Author Topic: Other simple simple program...but funny =)  (Read 778 times)

TWell

  • Member
  • ****
  • Posts: 748
Re: Other simple simple program...but funny =)
« Reply #15 on: May 12, 2017, 11:54:26 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.
Code: [Select]
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

  • Member
  • ***
  • Posts: 360
  • assemble the unassembled.
Re: Other simple simple program...but funny =)
« Reply #16 on: May 12, 2017, 11:57:03 PM »
Ok, so where do you recommend a good documentation (updated) for the api functions?
Felipe.

aw27

  • Member
  • ****
  • Posts: 852
  • Let's Make ASM Great Again!
Re: Other simple simple program...but funny =)
« Reply #17 on: May 13, 2017, 12:34:24 AM »
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

  • Member
  • ***
  • Posts: 360
  • assemble the unassembled.
Re: Other simple simple program...but funny =)
« Reply #18 on: May 13, 2017, 01:51:05 AM »
Ok, thanks a lot.  :icon14:
Felipe.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 4925
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Other simple simple program...but funny =)
« Reply #19 on: May 13, 2017, 02:40:15 AM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jj2007

  • Member
  • *****
  • Posts: 7738
  • Assembler is fun ;-)
    • MasmBasic
Re: Other simple simple program...but funny =)
« Reply #20 on: May 13, 2017, 04:12:16 AM »
an 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)