News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Other simple simple program...but funny =)

Started by felipe, May 11, 2017, 01:32:35 PM

Previous topic - Next topic

TWell

Quote from: felipe on May 12, 2017, 11:16:50 PM
so this: "dwReserved
Reserved; this parameter is ignored. "

It's just for high level languages?
Just an incomplete documentation, normally reserved should be zero.
In Windows 2000 it was ignored, but after that, in WindowsXP it was documented and used.
BOOL ExitWindows(
  DWORD dwReserved,  // reserved; must be zero
  UINT uReserved     // reserved; must be zero
);

EDIT: https://msdn.microsoft.com/en-us/library/windows/desktop/aa376868(v=vs.85).aspx

felipe

Ok, so where do you recommend a good documentation (updated) for the api functions?

aw27

Quote from: felipe on May 12, 2017, 11:57:03 PM
Ok, so where do you recommend a good documentation (updated) for the api functions?

The latest is online, simply search for the function name.
For offline, the latest is the MSDN Library for Visual Studio 2008 SP1


felipe


hutch--

felipe,

Windows API functions are a bit "all over the place" and not necessarily consistent but one thing you must do to write reliable code is get the argument count right. When you get a function that has a "Reserved" status, you set it to zero. You can in fact write your own functions the same way, an empty argument can be used like a LOCAL variable in the called function, not my own style but it works OK and it seems Windows has done this on enough occasions.

jj2007

Quote from: hutch-- on May 13, 2017, 02:40:15 AMan empty argument can be used like a LOCAL variable in the called function

Interesting idea. 5 bytes shorter in the proc, 2 bytes more for every invoke though 8)