ReactOS  0.4.14-dev-1233-gf5658fd
env_spec_nt.h
Go to the documentation of this file.
1 // Copyright (C) Alexander Telyatnikov, Ivan Keliukh, Yegor Anchishkin, SKIF Software, 1999-2013. Kiev, Ukraine
3 // All rights reserved
4 // This file was released under the GPLv2 on June 2015.
6 
7 #ifndef __ENV_SPEC_NT_NATIVE__H__
8 #define __ENV_SPEC_NT_NATIVE__H__
9 
10 #ifdef NT_NATIVE_MODE
11 
12 #include "zw_2_nt.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif //__cplusplus
17 
18 #ifndef MAX_PATH
19 #define MAX_PATH 260
20 #endif //MAX_PATH
21 
22 BOOLEAN
23 GetOsVersion(
27  PUNICODE_STRING CSDVersion OPTIONAL
28  );
29 
30 #define PsGetVersion(a,b,c,d) GetOsVersion(a,b,c,d)
31 
32 #define InterlockedIncrement(addr) \
33  ((*addr)++)
34 #define InterlockedDecrement(addr) \
35  ((*addr)--)
36 int
37 __inline
39  LONG Old = (*addr);
40  (*addr) += i;
41  return Old;
42 }
43 
44 #define DeviceIoControl(h, ctlc, ib, is, ob, os, r, ov) MyDeviceIoControl(h, ctlc, ib, is, ob, os, r, ov)
45 
46 BOOLEAN
47 MyDeviceIoControl(
48  HANDLE hDevice,
50  PVOID lpInBuffer,
51  DWORD nInBufferSize,
52  PVOID lpOutBuffer,
53  DWORD nOutBufferSize,
56  );
57 
58 #define OemToCharW(ansi_s, uni_s) (swprintf(uni_s, L"%S", ansi_s))
59 #define MultiByteToWideChar(cp, f, ansi_s, a_sz, uni_s, u_sz) (swprintf(uni_s, L"%S", ansi_s))
60 
61 VOID
62 Sleep(
63  ULONG t
64  );
65 
66 #define GlobalAlloc(foo, size) MyGlobalAlloc( size );
67 #define GlobalFree(ptr) MyGlobalFree( ptr );
68 
69 extern "C"
70 PVOID MyGlobalAlloc(ULONG Size);
71 
72 extern "C"
73 VOID MyGlobalFree(PVOID Addr);
74 
75 #define ExitProcess(Status) NtTerminateProcess( NtCurrentProcess(), Status );
76 
77 extern "C"
78 VOID
80  PCHAR DebugMessage,
81  ...
82  );
83 
84 extern "C"
86 EnvFileOpenW(
87  PWCHAR Name,
88  HANDLE* ph
89  );
90 
91 extern "C"
93 EnvFileOpenA(
94  PCHAR Name,
95  HANDLE* ph
96  );
97 
98 extern "C"
100 EnvFileClose(
101  HANDLE hFile
102  );
103 
104 extern "C"
105 NTSTATUS
106 EnvFileGetSizeByHandle(
107  HANDLE hFile,
108  PLONGLONG lpFileSize
109  );
110 
111 extern "C"
112 NTSTATUS
113 EnvFileGetSizeA(
114  PCHAR Name,
115  PLONGLONG lpFileSize
116  );
117 
118 extern "C"
119 NTSTATUS
120 EnvFileGetSizeW(
121  PWCHAR Name,
122  PLONGLONG lpFileSize
123  );
124 
125 extern "C"
126 BOOLEAN
127 EnvFileExistsA(PCHAR Name);
128 
129 extern "C"
130 BOOLEAN
131 EnvFileExistsW(PWCHAR Name);
132 
133 extern "C"
134 NTSTATUS
135 EnvFileWrite(
136  HANDLE h,
137  PVOID ioBuffer,
138  ULONG Length,
140  );
141 
142 extern "C"
143 NTSTATUS
144 EnvFileRead(
145  HANDLE h,
146  PVOID ioBuffer,
147  ULONG Length,
148  PULONG bytesRead
149  );
150 
151 #define ENV_FILE_CURRENT 1
152 #define ENV_FILE_END 2
153 #define ENV_FILE_BEGIN 3
154 
155 extern "C"
156 NTSTATUS
157 EnvFileSetPointer(
158  HANDLE hFile,
159  LONGLONG lDistanceToMove,
160  LONGLONG* lResultPointer,
161  DWORD dwMoveMethod
162  );
163 
164 extern "C"
165 NTSTATUS
166 EnvFileDeleteW(
167  PWCHAR fName
168  );
169 
170 #define PrintDbgConsole PrintNtConsole
171 
172 #ifdef __cplusplus
173 };
174 #endif //__cplusplus
175 
176 #endif //NT_NATIVE_MODE
177 
178 #endif //__ENV_SPEC_NT_NATIVE__H__
signed char * PCHAR
Definition: retypes.h:7
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
ULONG MinorVersion
Definition: ros_glue.cpp:5
ULONG MajorVersion
Definition: ros_glue.cpp:4
LONG NTSTATUS
Definition: precomp.h:26
GLdouble GLdouble t
Definition: gl.h:2047
uint16_t * PWCHAR
Definition: typedefs.h:55
#define PrintNtConsole(x)
Definition: atapi.h:1631
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:389
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
long LONG
Definition: pedump.c:60
unsigned char BOOLEAN
#define InterlockedExchangeAdd
Definition: interlocked.h:181
int64_t LONGLONG
Definition: typedefs.h:67
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
GLenum const GLvoid * addr
Definition: glext.h:9621
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
_In_ HANDLE hFile
Definition: mswsock.h:90
GLenum GLsizei GLuint GLint * bytesWritten
Definition: glext.h:11123
ULONG BuildNumber
Definition: ros_glue.cpp:6
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
unsigned int * PULONG
Definition: retypes.h:1
_In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpBytesReturned
Definition: winddi.h:1704
unsigned int ULONG
Definition: retypes.h:1
signed int * PLONG
Definition: retypes.h:5
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700