INFO: 32-Bit Handles Required by Windows NT 4.0 and Windows 2000

ID: Q229072

This article discusses a Beta release of a Microsoft product. The information in this article is provided as-is and is subject to change without notice.

No formal product support is available from Microsoft for this Beta product. For information about obtaining support for a Beta release, please see the documentation included with the Beta product files, or check the Web location from which you downloaded the release.
The information in this article applies to:


SUMMARY

Windows NT 4.0 and Windows 2000 require full 32-bit handles to system resources. Applications that do not correctly access and return 32-bit handles fail on Windows NT 4.0 and Windows 2000.


MORE INFORMATION

Previous versions of Windows 9x and Windows NT used 32-bit handles, but accommodated 16-bit handles for backwards compatibility with legacy code. However, Windows NT 4.0 and Windows 2000 use the entire 32-bit values of each handle as a unique identifier. If an application tries to pass a 16-bit handle to Windows NT 4.0 or Windows 2000, the API call will fail.

For example, code that truncates a handle for a device context (hDC) from 32 bits to 16 bits and then tries to use that handle to open a print dialog box will fail to show the print dialog box. Also, if a message is sent to a window using a 16-bit handle, the specified window will not get the message.

When Windows 95 and Windows 98 receive 16-bit handles, the high 16 bits are automatically set to zero. True 32-bit handles almost always have at least one nonzero high bit. When code is tested on Windows NT 4.0 and Windows 2000, all handles should be validated as true 32-bit handles. You can validate 32-bit handles using a HIGH WORD bit mask (that is, 0xFFFF0000).

Additional query words: compatguidediff


Keywords          : kbWinOS2000 kbGrpKernBase 
Version           : winnt:
Platform          : winnt 
Issue type        : kbinfo 

Last Reviewed: June 23, 1999