Will there be a Win64 API? [closed]

2019-04-04 15:12发布

问题:

If I'm correct, Win32 is adapting or has been adapted to cope with 64 bit windows, for example, GetWindowLongPtr on 64 bit as opposed to GetWindowLong on 32 bit. Will there be a Win64 Api, and if so, is there any indication on when the transition will happen?

I'm not very knowledgeable on this subject so I apologize if I have anything obvious wrong. Thanks in advance, ell.

回答1:

This transition happened around the turn of the century. 64 bit versions of Windows using the 64 bit version of Win32 have been in use for a long time now.

However, the 64 bit version of Win32 is still known as Win32 since it is essentially an identical interface with the only major difference being different sized pointers.



回答2:

The new Windows API, just announced, is called WinRT. For more information, I recommend watching the keynotes from BUILD.



回答3:

The Windows API has suffered terribly from the habit of assuming a known value of sizeof(void *) and sticking it in a field of some integral type believed to be the same size. Even in the Windows MSG structure, wParam is so named because it was originally a WORD, or unsigned 16 bit value, and lParam a LONG, or signed 32 bit value. Perhaps this is another symptom of C Programmers' Disease.



回答4:

The win32 stuff ("Win32 API") in x64 is really 64-bit code through-and-through (* see comments).

The actual 32-bit code (in a 64-bit windows) runs under the WoW64 subsystem which encompasses both the file-system and registry. While this may seem "sloppy" it actually makes a good bit of sense because a program can be compiled for both x32 and x64 without needing to change names (so long as proper version-neutral code has been used) -- that is, the core interface and "how windows works" is a fairly stable target.

Happy coding.