Showing posts with label SDK. Show all posts
Showing posts with label SDK. Show all posts

Friday, 12 June 2009

NT_ERROR, NT_SUCCESS - identifier not found

After upgrading the Windows SDK I ran into the following compile error, in code which previous to the upgrade compiled without any problems:
error C3861: 'NT_ERROR': identifier not found'
error C3861: 'NT_SUCCESS': identifier not found
'
Turns out that the NT_SUCCESS macro definition has been moved from <stierr.h> to <subauth.h>. NT_ERROR seems to be completely removed from the headers in the new platform SDK.

To solve the problem I created this tiny header file which should work with both the new and old SDK:

#ifndef WINDOWS_NTSTATUS_H
#define WINDOWS_NTSTATUS_H

/**
* @author Roger Karlsson
* @since 2009-03-13
*/

#ifndef NT_SUCCESS
#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)
#endif

#ifndef NT_ERROR
#define NT_ERROR(Status) ((ULONG)(Status) >> 30 == 3)
#endif

#endif //WINDOWS_NTSTATUS_H

Wednesday, 11 March 2009

Windows SDK for Windows Server 2008 and .NET Framework 3.5

Upgrading to the latest Windows platform SDK. Hopefully mscat.h is available in this new SDK and I'll be able to use the catalog functions which are missing in the header files currently installed on my system.

Update: mscat.h is bundled with this version of the Windows SDK. Back to programming..