ReactOS  0.4.14-dev-614-gbfd8a84
CrossNt.h
Go to the documentation of this file.
1 #ifndef __CROSS_VERSION_LIB_NT__H__
2 #define __CROSS_VERSION_LIB_NT__H__
3 
4 extern "C" {
5 
6 #pragma pack(push, 8)
7 
8 #if !defined(NT_INCLUDED)
9 #include <ntddk.h> // various NT definitions
10 #endif
11 
12 #include <stddef.h>
13 #include <string.h>
14 #include <stdarg.h>
15 #include <stdio.h>
16 #include "ntddk_ex.h"
17 #include "tools.h"
18 
19 #include "rwlock.h"
20 
21 #ifdef CROSS_NT_INTERNAL
22 #include "ilock.h"
23 #endif //CROSS_NT_INTERNAL
24 
25 #include "misc.h"
26 
27 #pragma pack(pop)
28 
29 extern "C"
31 NTAPI
32 CrNtInit(
35  );
36 
37 extern "C"
38 PVOID
39 NTAPI
41  IN PCHAR pModuleName
42  );
43 
44 extern "C"
45 PVOID
46 NTAPI
48  IN PVOID ptrInSection,
49  IN PCHAR ptrExportedName
50  );
51 
52 extern "C"
53 PVOID
54 NTAPI
56  PVOID ModuleBase,
57  PCHAR pFunctionName
58  );
59 
60 #ifdef __GNUC__
61  #define DECL_FUNC_PTR(_type, _cconv, _name) _type _cconv ( * _name)
62 #else
63  #define DECL_FUNC_PTR(_type, _cconv, _name) _type (_cconv * _name)
64 #endif
65 
70  PUNICODE_STRING CSDVersion OPTIONAL
71  );
72 
73 extern "C"
75 
77  IN SYSTEM_INFORMATION_CLASS SystemInfoClass,
81  );
82 
83 extern "C"
85 
86 
87 extern "C" {
88 
89 extern ULONG MajorVersion;
90 extern ULONG MinorVersion;
91 extern ULONG BuildNumber;
92 extern ULONG SPVersion;
93 
94 extern HANDLE g_hNtosKrnl;
95 extern HANDLE g_hHal;
96 
97 };
98 
99 #define WinVer_Is351 (MajorVersion==0x03)
100 #define WinVer_IsNT (MajorVersion==0x04)
101 #define WinVer_Is2k (MajorVersion==0x05 && MinorVersion==0x00)
102 #define WinVer_IsXP (MajorVersion==0x05 && MinorVersion==0x01)
103 #define WinVer_IsXPp (MajorVersion==0x05 && MinorVersion>=0x01)
104 #define WinVer_IsdNET (MajorVersion==0x05 && MinorVersion==0x02)
105 #define WinVer_IsdNETp ((MajorVersion==0x05 && MinorVersion>=0x02) || (MajorVersion>0x05))
106 #define WinVer_IsVista (MajorVersion==0x06 && MinorVersion==0x00)
107 
108 #define WinVer_Id() ((MajorVersion << 8) | MinorVersion)
109 
110 #define WinVer_351 (0x0351)
111 #define WinVer_NT (0x0400)
112 #define WinVer_ROS (0x0401)
113 #define WinVer_2k (0x0500)
114 #define WinVer_XP (0x0501)
115 #define WinVer_dNET (0x0502)
116 #define WinVer_Vista (0x0600)
117 
118 #ifdef _DEBUG
119 
120 // NT3.51 doesn't export strlen() and strcmp()
121 // The same time, Release build doesn't depend no these functions since they are inlined
122 
123 #ifndef USE_REACTOS_DDK
124 
125 size_t __cdecl CrNtstrlen (
126  const char * str
127  );
128 
129 int __cdecl CrNtstrcmp (
130  const char * src,
131  const char * dst
132  );
133 
134 #define strlen CrNtstrlen
135 #define strcmp CrNtstrcmp
136 
137 #endif // !USE_REACTOS_DDK
138 
139 #endif //_DEBUG
140 
141 #define CROSSNT_DECL_API
142 
143 #include "CrNtDecl.h"
144 #include "CrNtStubs.h"
145 
146 #undef CROSSNT_DECL_API
147 
148 }; // end extern "C"
149 
150 #endif //__CROSS_VERSION_LIB_NT__H__
enum _SYSTEM_INFORMATION_CLASS SYSTEM_INFORMATION_CLASS
signed char * PCHAR
Definition: retypes.h:7
#define IN
Definition: typedefs.h:38
ULONG MinorVersion
Definition: ros_glue.cpp:5
ULONG MajorVersion
Definition: ros_glue.cpp:4
#define __cdecl
Definition: accygwin.h:79
LONG NTSTATUS
Definition: precomp.h:26
ptrCrNtPsGetVersion CrNtPsGetVersion
Definition: CrossNt.h:68
PVOID CrNtFindModuleBaseByPtr(IN PVOID ptrInSection, IN PCHAR ptrExportedName)
NTSTATUS(__stdcall * ptrCrNtNtQuerySystemInformation)(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
Definition: CrossNt.h:70
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
HANDLE g_hHal
BOOLEAN(__stdcall * ptrCrNtPsGetVersion)(PULONG MajorVersion OPTIONAL, PULONG MinorVersion OPTIONAL, PULONG BuildNumber OPTIONAL, PUNICODE_STRING CSDVersion OPTIONAL)
Definition: CrossNt.h:60
const WCHAR * str
unsigned char BOOLEAN
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
ULONG SPVersion
ptrCrNtNtQuerySystemInformation CrNtNtQuerySystemInformation
Definition: CrossNt.h:78
NTSTATUS CrNtInit(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
#define __stdcall
Definition: typedefs.h:25
OUT PVOID SystemInfoBuffer
Definition: CrossNt.h:78
GLenum src
Definition: glext.h:6340
OUT PVOID IN ULONG SystemInfoBufferSize
Definition: CrossNt.h:78
ULONG BuildNumber
Definition: ros_glue.cpp:6
PVOID CrNtGetModuleBase(IN PCHAR pModuleName)
#define DECL_FUNC_PTR(_type, _cconv, _name)
Definition: CrossNt.h:63
GLenum GLenum dst
Definition: glext.h:6340
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
PVOID CrNtGetProcAddress(PVOID ModuleBase, PCHAR pFunctionName)
unsigned int * PULONG
Definition: retypes.h:1
#define OUT
Definition: typedefs.h:39
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
HANDLE g_hNtosKrnl
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68