Dear All,

I'm yet another masm newbie.

Please bear with me ...

I've downloaded Win32 Programmer's Reference (win32.hlp dated 14-March-1997).

(1) Is this the latest version? If not, where do I download the latest version?

(2) How do I translate it to masm?

e.g.

In the help file, it says

The RegOpenKeyEx function opens the specified key.

LONG RegOpenKeyEx(

HKEY hKey, // handle of open key
LPCTSTR lpSubKey, // address of name of subkey to open
DWORD ulOptions, // reserved
REGSAM samDesired, // security access mask
PHKEY phkResult // address of handle of open key
);

How is this translated to masm?

What is the rule of thumb? guideline? Any documentation I can read on how to translate the API to masm (with many examples)? Any real live examples of a program with masm source code I can refer to?


eager to learn,
newbie888
Posted on 2002-03-05 23:26:00 by newbie888
newbie888,

Its not as complicated as it looks, with only a few exceptions all of the parameters for windows API functions are 32 bit in size so its a matter of working out if they are values, addresses or a collection of data in a structure.

I don't know the API as I rarely use registry stuff but some of them are simple.

hKey is a 32 bit handle so you pass the value of the handle.

lpSubKey uses "lp" so its an address, in this case probably a zero terminated string.

ulOptions is reserved so its NULL

samDesired appears to be a 32 bit constant

phkResult is an address so it should be 32 bit like all addresses in 32 bit windows.

The general rule of thumb is the SIZE of the parameter, what you ned to work out is if its a value or an address. Both are passed as DWORD size in assembler.

Good Luck.

hutch@movsd.com
Posted on 2002-03-06 00:42:22 by hutch--
Hi hutch,

tq for the reply. I've found lots of examples from Betrayed website, which proves to be useful in understanding how to use the Win32 API in masm.

regards.
Posted on 2002-03-06 21:15:51 by newbie888