What is NTDEF.h? Why am I getting half a million errors on it? :(

One of my header files uses NTDEF.h...I located this header file in the system...

The code of the header is as follows:

#ifndef _NTDEF_H
#define _NTDEF_H
#if __GNUC__ >=3
#pragma GCC system_header
#endif

#define NTAPI __stdcall
#define OBJ_INHERIT 2L
#define OBJ_PERMANENT 16L
#define OBJ_EXCLUSIVE 32L
#define OBJ_CASE_INSENSITIVE 64L
#define OBJ_OPENIF 128L
#define OBJ_OPENLINK 256L
#define OBJ_VALID_ATTRIBUTES 498L
#define InitializeObjectAttributes(p,n,a,r,s) { \
(p)->Length = sizeof(OBJECT_ATTRIBUTES); \
(p)->RootDirectory = (r); \
(p)->Attributes = (a); \
(p)->ObjectName = (n); \
(p)->SecurityDescriptor = (s); \
(p)->SecurityQualityOfService = NULL; \
}
#ifndef NT_SUCCESS
#define NT_SUCCESS(x) ((x)>=0)
#define STATUS_SUCCESS ((NTSTATUS)0)
#endif
#if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H)
typedef LONG NTSTATUS, *PNTSTATUS;
typedef struct _UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} UNICODE_STRING, *PUNICODE_STRING;
typedef const UNICODE_STRING* PCUNICODE_STRING;
typedef struct _STRING {
USHORT Length;
USHORT MaximumLength;
PCHAR Buffer;
} STRING, *PSTRING;
#endif
typedef STRING ANSI_STRING;
typedef PSTRING PANSI_STRING;
typedef STRING OEM_STRING;
typedef PSTRING POEM_STRING;
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
typedef enum _SECTION_INHERIT {
ViewShare = 1,
ViewUnmap = 2
} SECTION_INHERIT;
#if !defined(_NTSECAPI_H)
typedef struct _OBJECT_ATTRIBUTES {
ULONG Length;
HANDLE RootDirectory;
PUNICODE_STRING ObjectName;
ULONG Attributes;
PVOID SecurityDescriptor;
PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES;
#endif
#endif /* _NTDEF_H */


I am getting all sorts of errors when this header is called. error codes C2146, C4430, resp. Could some please help me and tell me what to do?
This header comes with Windows Driver Kit, not with Windows SDK. What you really want to do, use some undocumented APIs from ntdll.dll ???
Let me say we don't remember the errors on sight, so just saying error C2146 and C4430 really won't get many answers. If you could be kind enough to, at least, slightly help us telling the error message, you could get answers faster.

@modoran: Was NTDEF.h in the DDK? Are you sure you're not talking about NTDDK.h? I remember NTDEF in my installation, going to check.

I unconfirm. NTDEF is in the DDK.
Last edited on
This is Microsoft documentation about these errors:

http://msdn.microsoft.com/en-us/library/9xbcaa9t(v=vs.80).aspx
http://msdn.microsoft.com/en-us/library/ms173696(v=vs.80).aspx

That NTDEF.H code posted seems to come from a MinGW instalation, it is not a Microsoft header (the original does come with DDK)
Topic archived. No new replies allowed.