ReactOS 0.4.16-dev-320-g3bd9ddc
CrossNt.h
Go to the documentation of this file.
1#ifndef __CROSS_VERSION_LIB_NT__H__
2#define __CROSS_VERSION_LIB_NT__H__
3
4extern "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
18#include "rwlock.h"
19
20#ifdef CROSS_NT_INTERNAL
21#include "ilock.h"
22#endif //CROSS_NT_INTERNAL
23
24#include "misc.h"
25#include "tools.h"
26
27#pragma pack(pop)
28
29extern "C"
34 );
35
36extern "C"
39
40extern "C"
43 IN PCHAR pModuleName
44 );
45
46extern "C"
49 IN PVOID ptrInSection,
50 IN PCHAR ptrExportedName
51 );
52
53extern "C"
56 PVOID ModuleBase,
57 PCHAR pFunctionName
58 );
59
64 PUNICODE_STRING CSDVersion OPTIONAL
65 );
66
67extern "C"
69
71 IN SYSTEM_INFORMATION_CLASS SystemInfoClass,
75 );
76
77extern "C"
79
80extern "C"
83 PVOID p
84 );
85
86extern "C" {
87
88extern ULONG MajorVersion;
89extern ULONG MinorVersion;
90extern ULONG BuildNumber;
91extern ULONG SPVersion;
92
93extern HANDLE g_hNtosKrnl;
94extern HANDLE g_hHal;
95
97
98};
99
100#define WinVer_Is351 (MajorVersion==0x03)
101#define WinVer_IsNT (MajorVersion==0x04)
102#define WinVer_Is2k (MajorVersion==0x05 && MinorVersion==0x00)
103#define WinVer_IsXP (MajorVersion==0x05 && MinorVersion==0x01)
104#define WinVer_IsXPp (MajorVersion==0x05 && MinorVersion>=0x01)
105#define WinVer_IsdNET (MajorVersion==0x05 && MinorVersion==0x02)
106#define WinVer_IsdNETp ((MajorVersion==0x05 && MinorVersion>=0x02) || (MajorVersion>0x05))
107#define WinVer_IsVista (MajorVersion==0x06 && MinorVersion==0x00)
108
109#define WinVer_Id() ((MajorVersion << 8) | MinorVersion)
110
111#define WinVer_351 (0x0351)
112#define WinVer_NT (0x0400)
113#define WinVer_ROS (0x0401)
114#define WinVer_2k (0x0500)
115#define WinVer_XP (0x0501)
116#define WinVer_dNET (0x0502)
117#define WinVer_Vista (0x0600)
118
119#ifdef _DEBUG
120
121// NT3.51 doesn't export strlen() and strcmp()
122// The same time, Release build doesn't depend no these functions since they are inlined
123
124size_t __cdecl CrNtstrlen (
125 const char * str
126 );
127
128int __cdecl CrNtstrcmp (
129 const char * src,
130 const char * dst
131 );
132
133#define strlen CrNtstrlen
134#define strcmp CrNtstrcmp
135
136#endif //_DEBUG
137
138#define CROSSNT_DECL_API
139
140#include "CrNtDecl.h"
141#include "CrNtStubs.h"
142
143#undef CROSSNT_DECL_API
144
145}; // end extern "C"
146
147#endif //__CROSS_VERSION_LIB_NT__H__
#define __cdecl
Definition: accygwin.h:79
LONG NTSTATUS
Definition: precomp.h:26
#define NTSTATUS
Definition: precomp.h:21
PVOID CrNtGetProcAddress(PVOID ModuleBase, PCHAR pFunctionName)
NTSTATUS CrNtInit(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
PVOID CrNtFindModuleBaseByPtr(IN PVOID ptrInSection, IN PCHAR ptrExportedName)
PVOID CrNtGetModuleBase(IN PCHAR pModuleName)
ptrCrNtNtQuerySystemInformation CrNtNtQuerySystemInformation
Definition: CrossNt.h:78
ULONG BuildNumber
Definition: ros_glue.cpp:6
ULONG CrNtGetCPUGen()
NTSTATUS(__stdcall * ptrCrNtNtQuerySystemInformation)(IN SYSTEM_INFORMATION_CLASS SystemInfoClass, OUT PVOID SystemInfoBuffer, IN ULONG SystemInfoBufferSize, OUT PULONG BytesReturned OPTIONAL)
Definition: CrossNt.h:70
PVOID CrNtSkipImportStub(PVOID p)
HANDLE g_hNtosKrnl
PCHAR g_KeNumberProcessors
ptrCrNtPsGetVersion CrNtPsGetVersion
Definition: CrossNt.h:68
ULONG SPVersion
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
HANDLE g_hHal
BOOLEAN(__stdcall * ptrCrNtPsGetVersion)(PULONG MajorVersion OPTIONAL, PULONG MinorVersion OPTIONAL, PULONG BuildNumber OPTIONAL, PUNICODE_STRING CSDVersion OPTIONAL)
Definition: CrossNt.h:60
enum _SYSTEM_INFORMATION_CLASS SYSTEM_INFORMATION_CLASS
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
GLfloat GLfloat p
Definition: glext.h:8902
#define BOOLEAN
Definition: pedump.c:73
const WCHAR * str
OUT PVOID IN ULONG SystemInfoBufferSize
Definition: CrossNt.h:79
OUT PVOID SystemInfoBuffer
Definition: CrossNt.h:78
#define OPTIONAL
Definition: typedefs.h:41
uint32_t * PULONG
Definition: typedefs.h:59
#define __stdcall
Definition: typedefs.h:25
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesReturned
Definition: wdfiotarget.h:1052