Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > DoxygenCrossNt.h
Go to the documentation of this file.
00001 #ifndef __CROSS_VERSION_LIB_NT__H__ 00002 #define __CROSS_VERSION_LIB_NT__H__ 00003 00004 extern "C" { 00005 00006 #pragma pack(push, 8) 00007 00008 #if !defined(NT_INCLUDED) 00009 #include <ntddk.h> // various NT definitions 00010 #endif 00011 00012 #include <stddef.h> 00013 #include <string.h> 00014 #include <stdarg.h> 00015 #include <stdio.h> 00016 #include "ntddk_ex.h" 00017 #include "tools.h" 00018 00019 #include "rwlock.h" 00020 00021 #ifdef CROSS_NT_INTERNAL 00022 #include "ilock.h" 00023 #endif //CROSS_NT_INTERNAL 00024 00025 #include "misc.h" 00026 00027 #pragma pack(pop) 00028 00029 extern "C" 00030 NTSTATUS 00031 NTAPI 00032 CrNtInit( 00033 IN PDRIVER_OBJECT DriverObject, 00034 IN PUNICODE_STRING RegistryPath 00035 ); 00036 00037 extern "C" 00038 PVOID 00039 NTAPI 00040 CrNtGetModuleBase( 00041 IN PCHAR pModuleName 00042 ); 00043 00044 extern "C" 00045 PVOID 00046 NTAPI 00047 CrNtFindModuleBaseByPtr( 00048 IN PVOID ptrInSection, 00049 IN PCHAR ptrExportedName 00050 ); 00051 00052 extern "C" 00053 PVOID 00054 NTAPI 00055 CrNtGetProcAddress( 00056 PVOID ModuleBase, 00057 PCHAR pFunctionName 00058 ); 00059 00060 #ifdef __GNUC__ 00061 #define DECL_FUNC_PTR(_type, _cconv, _name) _type _cconv ( * _name) 00062 #else 00063 #define DECL_FUNC_PTR(_type, _cconv, _name) _type (_cconv * _name) 00064 #endif 00065 00066 typedef DECL_FUNC_PTR(BOOLEAN, __stdcall, ptrCrNtPsGetVersion)( 00067 PULONG MajorVersion OPTIONAL, 00068 PULONG MinorVersion OPTIONAL, 00069 PULONG BuildNumber OPTIONAL, 00070 PUNICODE_STRING CSDVersion OPTIONAL 00071 ); 00072 00073 extern "C" 00074 ptrCrNtPsGetVersion CrNtPsGetVersion; 00075 00076 typedef DECL_FUNC_PTR(NTSTATUS, __stdcall, ptrCrNtNtQuerySystemInformation)( 00077 IN SYSTEM_INFORMATION_CLASS SystemInfoClass, 00078 OUT PVOID SystemInfoBuffer, 00079 IN ULONG SystemInfoBufferSize, 00080 OUT PULONG BytesReturned OPTIONAL 00081 ); 00082 00083 extern "C" 00084 ptrCrNtNtQuerySystemInformation CrNtNtQuerySystemInformation; 00085 00086 00087 extern "C" { 00088 00089 extern ULONG MajorVersion; 00090 extern ULONG MinorVersion; 00091 extern ULONG BuildNumber; 00092 extern ULONG SPVersion; 00093 00094 extern HANDLE g_hNtosKrnl; 00095 extern HANDLE g_hHal; 00096 00097 }; 00098 00099 #define WinVer_Is351 (MajorVersion==0x03) 00100 #define WinVer_IsNT (MajorVersion==0x04) 00101 #define WinVer_Is2k (MajorVersion==0x05 && MinorVersion==0x00) 00102 #define WinVer_IsXP (MajorVersion==0x05 && MinorVersion==0x01) 00103 #define WinVer_IsXPp (MajorVersion==0x05 && MinorVersion>=0x01) 00104 #define WinVer_IsdNET (MajorVersion==0x05 && MinorVersion==0x02) 00105 #define WinVer_IsdNETp ((MajorVersion==0x05 && MinorVersion>=0x02) || (MajorVersion>0x05)) 00106 #define WinVer_IsVista (MajorVersion==0x06 && MinorVersion==0x00) 00107 00108 #define WinVer_Id() ((MajorVersion << 8) | MinorVersion) 00109 00110 #define WinVer_351 (0x0351) 00111 #define WinVer_NT (0x0400) 00112 #define WinVer_ROS (0x0401) 00113 #define WinVer_2k (0x0500) 00114 #define WinVer_XP (0x0501) 00115 #define WinVer_dNET (0x0502) 00116 #define WinVer_Vista (0x0600) 00117 00118 #ifdef _DEBUG 00119 00120 // NT3.51 doesn't export strlen() and strcmp() 00121 // The same time, Release build doesn't depend no these functions since they are inlined 00122 00123 #ifndef USE_REACTOS_DDK 00124 00125 size_t __cdecl CrNtstrlen ( 00126 const char * str 00127 ); 00128 00129 int __cdecl CrNtstrcmp ( 00130 const char * src, 00131 const char * dst 00132 ); 00133 00134 #define strlen CrNtstrlen 00135 #define strcmp CrNtstrcmp 00136 00137 #endif // !USE_REACTOS_DDK 00138 00139 #endif //_DEBUG 00140 00141 #define CROSSNT_DECL_API 00142 00143 #include "CrNtDecl.h" 00144 #include "CrNtStubs.h" 00145 00146 #undef CROSSNT_DECL_API 00147 00148 }; // end extern "C" 00149 00150 #endif //__CROSS_VERSION_LIB_NT__H__ Generated on Sat May 26 2012 04:26:58 for ReactOS by
1.7.6.1
|