Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenumtypes.h
Go to the documentation of this file.
00001 /*++ NDK Version: 0095 00002 00003 Copyright (c) Alex Ionescu. All rights reserved. 00004 00005 Header Name: 00006 00007 umtypes.h 00008 00009 Abstract: 00010 00011 Type definitions for the basic native types. 00012 00013 Author: 00014 00015 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004 00016 00017 --*/ 00018 00019 #if !defined(_NTDEF_) && !defined(_NTDEF_H) 00020 #define _NTDEF_ 00021 #define _NTDEF_H 00022 00023 // 00024 // NDK Applications must use Unicode 00025 // 00026 #ifndef UNICODE 00027 #define UNICODE 00028 #endif 00029 00030 // 00031 // Don't use the SDK status values 00032 // 00033 #ifndef WIN32_NO_STATUS 00034 #define WIN32_NO_STATUS 00035 #endif 00036 00037 // 00038 // Let the NDK know we're in Application Mode 00039 // 00040 #define NTOS_MODE_USER 00041 00042 // 00043 // Dependencies 00044 // 00045 #include <windef.h> 00046 #undef WIN32_NO_STATUS 00047 #include <ntstatus.h> 00048 #include <winioctl.h> 00049 #include <ntnls.h> 00050 00051 // 00052 // Compiler Definitions 00053 // 00054 #ifndef _MANAGED 00055 #if defined(_M_IX86) 00056 #ifndef FASTCALL 00057 #define FASTCALL _fastcall 00058 #endif 00059 #else 00060 #define FASTCALL 00061 #endif 00062 #else 00063 #define FASTCALL NTAPI 00064 #endif 00065 00066 #if !defined(_M_CEE_PURE) 00067 #define NTAPI_INLINE NTAPI 00068 #else 00069 #define NTAPI_INLINE 00070 #endif 00071 00072 // 00073 // Alignment Macros 00074 // 00075 #define ALIGN_DOWN(s, t) \ 00076 ((ULONG)(s) & ~(sizeof(t) - 1)) 00077 00078 #define ALIGN_UP(s, t) \ 00079 (ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t)) 00080 00081 #define ALIGN_DOWN_POINTER(p, t) \ 00082 ((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1))) 00083 00084 #define ALIGN_UP_POINTER(p, t) \ 00085 (ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t)) 00086 00087 // 00088 // Native API Return Value Macros 00089 // 00090 #define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) 00091 #define NT_INFORMATION(Status) ((((ULONG)(Status)) >> 30) == 1) 00092 #define NT_WARNING(Status) ((((ULONG)(Status)) >> 30) == 2) 00093 #define NT_ERROR(Status) ((((ULONG)(Status)) >> 30) == 3) 00094 00095 // 00096 // Limits 00097 // 00098 #define MINCHAR 0x80 00099 #define MAXCHAR 0x7f 00100 #define MINSHORT 0x8000 00101 #define MAXSHORT 0x7fff 00102 #define MINLONG 0x80000000 00103 #define MAXLONG 0x7fffffff 00104 #define MAXUCHAR 0xff 00105 #define MAXUSHORT 0xffff 00106 #define MAXULONG 0xffffffff 00107 00108 // 00109 // CSR Macros 00110 // 00111 #define CSR_MAKE_OPCODE(s,m) ((s) << 16) | (m) 00112 #define CSR_API_ID_FROM_OPCODE(n) ((ULONG)((USHORT)(n))) 00113 #define CSR_SERVER_ID_FROM_OPCODE(n) (ULONG)((n) >> 16) 00114 00115 // 00116 // Basic Types that aren't defined in User-Mode Headers 00117 // 00118 typedef CONST int CINT; 00119 typedef CONST char *PCSZ; 00120 typedef ULONG CLONG; 00121 typedef short CSHORT; 00122 typedef CSHORT *PCSHORT; 00123 typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; 00124 typedef LONG KPRIORITY; 00125 00126 // 00127 // Basic NT Types 00128 // 00129 #if !defined(_NTSECAPI_H) && !defined(_SUBAUTH_H) && !defined(_NTSECAPI_) 00130 00131 typedef LONG NTSTATUS, *PNTSTATUS; 00132 00133 typedef struct _UNICODE_STRING 00134 { 00135 USHORT Length; 00136 USHORT MaximumLength; 00137 PWSTR Buffer; 00138 } UNICODE_STRING, *PUNICODE_STRING; 00139 00140 typedef struct _STRING 00141 { 00142 USHORT Length; 00143 USHORT MaximumLength; 00144 PCHAR Buffer; 00145 } STRING, *PSTRING; 00146 00147 typedef struct _CSTRING 00148 { 00149 USHORT Length; 00150 USHORT MaximumLength; 00151 CONST CHAR *Buffer; 00152 } CSTRING, *PCSTRING; 00153 00154 #endif 00155 00156 typedef struct _STRING32 { 00157 USHORT Length; 00158 USHORT MaximumLength; 00159 ULONG Buffer; 00160 } STRING32, *PSTRING32, 00161 UNICODE_STRING32, *PUNICODE_STRING32, 00162 ANSI_STRING32, *PANSI_STRING32; 00163 00164 typedef struct _STRING64 { 00165 USHORT Length; 00166 USHORT MaximumLength; 00167 ULONGLONG Buffer; 00168 } STRING64, *PSTRING64, 00169 UNICODE_STRING64, *PUNICODE_STRING64, 00170 ANSI_STRING64, *PANSI_STRING64; 00171 00172 00173 typedef struct _OBJECT_ATTRIBUTES 00174 { 00175 ULONG Length; 00176 HANDLE RootDirectory; 00177 PUNICODE_STRING ObjectName; 00178 ULONG Attributes; 00179 PVOID SecurityDescriptor; 00180 PVOID SecurityQualityOfService; 00181 } OBJECT_ATTRIBUTES, *POBJECT_ATTRIBUTES; 00182 00183 // 00184 // ClientID Structure 00185 // 00186 typedef struct _CLIENT_ID 00187 { 00188 HANDLE UniqueProcess; 00189 HANDLE UniqueThread; 00190 } CLIENT_ID, *PCLIENT_ID; 00191 00192 typedef const UNICODE_STRING* PCUNICODE_STRING; 00193 typedef STRING ANSI_STRING; 00194 typedef PSTRING PANSI_STRING; 00195 typedef STRING OEM_STRING; 00196 typedef PSTRING POEM_STRING; 00197 typedef CONST STRING* PCOEM_STRING; 00198 typedef STRING CANSI_STRING; 00199 typedef PSTRING PCANSI_STRING; 00200 00201 #endif Generated on Sun May 27 2012 04:31:05 for ReactOS by
1.7.6.1
|