mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
99 lines
2.7 KiB
C
99 lines
2.7 KiB
C
#ifndef _NTDEF_H
|
|
#define _NTDEF_H
|
|
#if __GNUC__ >=3
|
|
#pragma GCC system_header
|
|
#endif
|
|
|
|
/* TODO: some compilers support this */
|
|
#define RESTRICTED_POINTER
|
|
|
|
#define NTAPI __stdcall
|
|
#if !defined(_M_CEE_PURE)
|
|
#define NTAPI_INLINE NTAPI
|
|
#else
|
|
#define NTAPI_INLINE
|
|
#endif
|
|
|
|
#ifndef DECLSPEC_NOINLINE
|
|
#define DECLSPEC_NOINLINE __declspec(noinline)
|
|
#endif
|
|
|
|
#define OBJ_INHERIT 0x00000002
|
|
#define OBJ_PERMANENT 0x00000010
|
|
#define OBJ_EXCLUSIVE 0x00000020
|
|
#define OBJ_CASE_INSENSITIVE 0x00000040
|
|
#define OBJ_OPENIF 0x00000080
|
|
#define OBJ_OPENLINK 0x00000100
|
|
#define OBJ_KERNEL_HANDLE 0x00000200
|
|
#define OBJ_VALID_ATTRIBUTES (OBJ_KERNEL_HANDLE | OBJ_OPENLINK | \
|
|
OBJ_OPENIF | OBJ_CASE_INSENSITIVE | OBJ_EXCLUSIVE | \
|
|
OBJ_PERMANENT | OBJ_INHERIT)
|
|
#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)
|
|
#endif
|
|
#define NT_WARNING(x) ((ULONG)(x)>>30==2)
|
|
#define NT_ERROR(x) ((ULONG)(x)>>30==3)
|
|
#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 CONST STRING* PCOEM_STRING;
|
|
typedef STRING CANSI_STRING;
|
|
typedef PSTRING PCANSI_STRING;
|
|
typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS;
|
|
typedef enum _SECTION_INHERIT {
|
|
ViewShare = 1,
|
|
ViewUnmap = 2
|
|
} SECTION_INHERIT;
|
|
typedef enum _NT_PRODUCT_TYPE {
|
|
NtProductWinNt = 1,
|
|
NtProductLanManNt,
|
|
NtProductServer
|
|
} NT_PRODUCT_TYPE, *PNT_PRODUCT_TYPE;
|
|
#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
|
|
#define NOTHING
|
|
#define RTL_CONSTANT_STRING(s) { sizeof(s)-sizeof((s)[0]), sizeof(s), s }
|
|
#define TYPE_ALIGNMENT( t ) FIELD_OFFSET( struct { char x; t test; }, test )
|
|
|
|
#define MINCHAR 0x80
|
|
#define MAXCHAR 0x7f
|
|
#define MINSHORT 0x8000
|
|
#define MAXSHORT 0x7fff
|
|
#define MINLONG 0x80000000
|
|
#define MAXLONG 0x7fffffff
|
|
#define MAXUCHAR 0xff
|
|
#define MAXUSHORT 0xffff
|
|
#define MAXULONG 0xffffffff
|
|
#endif /* _NTDEF_H */
|