Microsoft KB Archive/127991

{|
 * width="100%"|

INFO: GetLastError Differs Between Windows 95 and Windows NT

 * }

Q127991

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK), used with:
 * the operating system: Microsoft Windows NT, versions 3.51, 4.0
 * Microsoft Windows 95
 * the operating system: Microsoft Windows 2000

-

SUMMARY
The extended error codes returned by the GetLastError API are not guaranteed to be the same under Windows 95, Windows 2000, and Windows NT. This difference applies to extended error codes generated by calls to GDI, Window Management, and System Services APIs.

The set of potential error codes returned by any particular Win32 API depends on many underlying components, including system kernel-mode components and loaded drivers. The extended error codes are not a part of the Win32 specification. Therefore, they can change as operating system and driver code is changed.

It is impossible to get the error codes for each API in synch across operating system and platforms. Windows NT, Windows 95, and Windows 2000 have different code bases. Third-party drivers return error codes that are mapped to Win32 error codes. In addition, it would be difficult to accurately maintain error code information in the Win32 Programmer's Reference. Therefore, this information is not included in the documentation.

In general, you should not rely on GetLastError returning the same values under Windows 95 and Windows NT. Sometimes, an API will fail and GetLastError will return 0 (ERROR_SUCCESS) under Windows 95. This is because some of the APIs do not set error codes under Windows 95.

Additional query words:

Keywords : kbAPI kbGDI kbKernBase kbOSWinNT351 kbOSWinNT400 kbOSWin2000 kbSDKWin32 kbGrpDSUser kbOSWin95 kbDSupport kbGrpDSKernBase

Issue type : kbinfo

Technology : kbWin32SDKSearch kbAudDeveloper kbSDKSearch kbWin32sSearch