Groups | Search | Server Info | Login | Register


Groups > comp.lang.c.moderated > #494

Help with conversion

From Mint <chocolatemint77581@yahoo.com>
Newsgroups comp.lang.c.moderated
Subject Help with conversion
Date 2011-02-01 16:28 -0600
Organization http://groups.google.com
Message-ID <clcm-20110201-0007@plethora.net> (permalink)

Show all headers | View raw


I am trying to convert this C code to an assembly procedure.

I am using ml.exe and link.exe.

Is there someone who could help me?

Thanks


;  ; HANDLE GetMessageResources()
;  ; {
;  ;     HANDLE hResources = NULL;
;  ;
;  ;     hResources = LoadLibraryEx(RESOURCE_DLL, NULL,
LOAD_LIBRARY_AS_IMAGE_RESOURCE | LOAD_LIBRARY_AS_DATAFILE);
;  ;     if (NULL == hResources)
;  ;     {
;  ;         wprintf(L"LoadLibrary failed with %lu.\n",
GetLastError());
;  ;     }
;  ;
;  ;     return hResources;
;  ; }

This is what I have so far.
Plenty of mistakes, but I will work to fix them all.

Andy


; Local prototypes

GetMessageResources   PROTO

.DATA

LL_Failed      db  "LoadLibrary failed with",0
RESOURCE_DLL   db  "c:\masm32\source\Provider.dll",0
FormatString db "%s", 0
OutputBuffer db 50 dup (0)

.DATA?

hwnd    HWND  ?

.CODE

start:

invoke GetMessageResources

invoke ExitProcess,0

GetMessageResources proc

invoke LoadLibraryEx,RESOURCE_DLL, NULL,
LOAD_LIBRARY_AS_IMAGE_RESOURCE OR LOAD_LIBRARY_AS_DATAFILE

.if EAX == 0

invoke wsprintf, ADDR OutputBuffer, ADDR FormatString, ADDR LL_Failed

.ELSE

.endif

ret

GetMessageResources endp
-- 
comp.lang.c.moderated - moderation address: clcm@plethora.net -- you must
have an appropriate newsgroups line in your header for your mail to be seen,
or the newsgroup name in square brackets in the subject line.  Sorry.

Back to comp.lang.c.moderated | Previous | NextNext in thread | Find similar


Thread

Help with conversion Mint <chocolatemint77581@yahoo.com> - 2011-02-01 16:28 -0600
  Re: Help with conversion Kenneth Brody <kenbrody@spamcop.net> - 2011-02-04 12:45 -0600
  Re: Help with conversion Jasen Betts <jasen@xnet.co.nz> - 2011-02-04 12:45 -0600

csiph-web