ReactOS 0.4.16-dev-250-g3ecd236
env_spec_nt.cpp
Go to the documentation of this file.
1
2// 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#ifdef NT_NATIVE_MODE
8
9#include "regtools.h"
10#include <stdarg.h>
11
12/*typedef BOOLEAN (*PPsGetVersion) (
13 PULONG MajorVersion OPTIONAL,
14 PULONG MinorVersion OPTIONAL,
15 PULONG BuildNumber OPTIONAL,
16 PUNICODE_STRING CSDVersion OPTIONAL
17 );
18
19//PPsGetVersion _PsGetVersion = PsGetVersion;
20
21/*NTSTATUS
22KernelGetProcAddress(
23 PWCHAR DllName,
24 PUCHAR ProcName,
25 PVOID* ProcAddr
26 )
27{
28 NTSTATUS RC;
29 HANDLE h;
30 UNICODE_STRING uname;
31 ANSI_STRING aname;
32
33 RtlInitUnicodeString(&uname, DllName);
34 *ProcAddr = NULL;
35
36 // RC = LdrGetDllHandle(NULL, NULL, &uname, &h);
37 if(!NT_SUCCESS(RC))
38 return RC;
39
40 RtlInitAnsiString(&aname, ProcName);
41
42// RC = LdrGetProcedureAddress(h, &aname, 0, ProcAddr);
43 return RC;
44} */
45
46
48GetOsVersion(
52 PUNICODE_STRING CSDVersion OPTIONAL
53 )
54{
55 WCHAR Str[32];
56 ULONG mn=0, mj=0, bld=0;
57
58// if(_PsGetVersion)
59// return _PsGetVersion(MajorVersion, MinorVersion, BuildNumber, CSDVersion);
60
61 RtlZeroMemory(Str, sizeof(Str));
62 if(RegTGetStringValue(NULL, L"\\Registry\\Machine\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
63 L"CurrentVersion",
64 &Str[0], sizeof(Str)-sizeof(WCHAR))) {
65 ULONG i=0;
66 WCHAR a;
67 while(a = Str[i]) {
68 if(a == '.')
69 break;
70 if(a < '0' || a > '9')
71 break;
72 mj = mj*16 + (a-'0');
73 i++;
74 }
75 i++;
76 while(a = Str[i]) {
77 if(a == '.')
78 break;
79 if(a < '0' || a > '9')
80 break;
81 mn = mn*16 + (a-'0');
82 i++;
83 }
84 }
85
86 if(RegTGetStringValue(NULL, L"\\Registry\\Machine\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion",
87 L"CurrentBuildNumber",
88 &Str[0], sizeof(Str)-sizeof(WCHAR))) {
89 ULONG i=0;
90 WCHAR a;
91 while(a = Str[i]) {
92 if(a < '0' || a > '9')
93 break;
94 bld = bld*10 + (a-'0');
95 i++;
96 }
97 }
98 if(MajorVersion)
99 *MajorVersion = mj;
100 if(MinorVersion)
101 *MinorVersion = mn;
102 if(BuildNumber)
103 *BuildNumber = bld;
104 return TRUE;
105}
106
108MyDeviceIoControl(
109 HANDLE h,
111 PVOID lpInBuffer,
112 DWORD nInBufferSize,
113 PVOID lpOutBuffer,
114 DWORD nOutBufferSize,
117 )
118{
119
120 NTSTATUS RC;
121 BOOLEAN DevIoCtl = TRUE;
123
125 DevIoCtl = FALSE;
126 } else {
127 DevIoCtl = TRUE;
128 }
129
130 if ( DevIoCtl ) {
132 h,
133 NULL,
134 NULL, // APC routine
135 NULL, // APC Context
136 &Iosb,
137 dwIoControlCode, // IoControlCode
138 lpInBuffer, // Buffer for data to the FS
139 nInBufferSize,
140 lpOutBuffer, // OutputBuffer for data from the FS
141 nOutBufferSize // OutputBuffer Length
142 );
143 } else {
144 RC = NtFsControlFile(
145 h,
146 NULL,
147 NULL, // APC routine
148 NULL, // APC Context
149 &Iosb,
150 dwIoControlCode, // IoControlCode
151 lpInBuffer, // Buffer for data to the FS
152 nInBufferSize,
153 lpOutBuffer, // OutputBuffer for data from the FS
154 nOutBufferSize // OutputBuffer Length
155 );
156 }
157
158 if ( RC == STATUS_PENDING) {
159 // Operation must complete before return & Iosb destroyed
161 if ( NT_SUCCESS(RC)) {
162 RC = Iosb.Status;
163 }
164 }
165
166 if ( NT_SUCCESS(RC) ) {
167 *lpBytesReturned = Iosb.Information;
168 return TRUE;
169 } else {
170 // handle warning value STATUS_BUFFER_OVERFLOW somewhat correctly
171 if ( !NT_ERROR(RC) ) {
172 *lpBytesReturned = Iosb.Information;
173 }
174 return FALSE;
175 }
176}
177
178VOID
179Sleep(
180 ULONG t
181 )
182{
183 LARGE_INTEGER delay = {0,0};
184 delay.QuadPart = -10I64*1000*t;
185 NtDelayExecution(FALSE, &delay);
186}
187
188HANDLE hGlobalHeap = NULL;
189
190extern "C"
191PVOID
192MyGlobalAlloc(
193 ULONG Size
194 )
195{
196 if(!hGlobalHeap) {
197 // Initialize some heap
198 hGlobalHeap = RtlCreateHeap( HEAP_GROWABLE, // Flags
199 NULL, // HeapBase
200 0, // ReserveSize
201 0, // CommitSize
202 NULL, // Lock
203 NULL ); // Parameters
204 if(!hGlobalHeap || hGlobalHeap == (HANDLE)(-1)) {
205 hGlobalHeap = NULL;
206 return NULL;
207 }
208 }
209 return RtlAllocateHeap( hGlobalHeap, 0, Size );
210}
211
212extern "C"
213VOID
214MyGlobalFree(
215 PVOID Addr
216 )
217{
218 if(!hGlobalHeap) {
219// BrutePoint();
220 return;
221 }
222 RtlFreeHeap( hGlobalHeap, 0, Addr );
223 return;
224}
225
226CHAR dbg_print_tmp_buff[2048];
227WCHAR dbg_stringBuffer[2048];
228
229BOOLEAN was_enter = TRUE;
230
231extern "C"
232VOID
234 PCHAR DebugMessage,
235 ...
236 )
237{
238 int len;
239 UNICODE_STRING msgBuff;
240 va_list ap;
241 va_start(ap, DebugMessage);
242
243 if(was_enter) {
244 strcpy(&dbg_print_tmp_buff[0], NT_DBG_PREFIX);
245 len = _vsnprintf(&dbg_print_tmp_buff[sizeof(NT_DBG_PREFIX)-1], 2047-sizeof(NT_DBG_PREFIX), DebugMessage, ap);
246 } else {
247 len = _vsnprintf(&dbg_print_tmp_buff[0], 2047, DebugMessage, ap);
248 }
249 dbg_print_tmp_buff[2047] = 0;
250 if(len > 0 &&
251 (dbg_print_tmp_buff[len-1] == '\n' ||
252 dbg_print_tmp_buff[len-1] == '\r') ) {
253 was_enter = TRUE;
254 } else {
255 was_enter = FALSE;
256 }
257
258 len = swprintf( dbg_stringBuffer, L"%S", dbg_print_tmp_buff );
259 msgBuff.Buffer = dbg_stringBuffer;
260 msgBuff.Length = len * sizeof(WCHAR);
261 msgBuff.MaximumLength = msgBuff.Length + sizeof(WCHAR);
262 NtDisplayString( &msgBuff );
263
264 va_end(ap);
265
266} // end PrintNtConsole()
267
268extern "C"
270EnvFileOpenW(
271 PWCHAR Name,
272 HANDLE* ph
273 )
274{
278 UNICODE_STRING fName;
279
280 RtlInitUnicodeString(&fName, Name);
281
283
284 Status = NtCreateFile(ph,
287 &IoStatus,
288 NULL,
291 FILE_OPEN,
293 NULL,
294 0);
295
296 return Status;
297} // end EnvFileOpenW()
298
299extern "C"
301EnvFileOpenA(
302 PCHAR Name,
303 HANDLE* ph
304 )
305{
306 ULONG len;
307 PWCHAR NameW;
309
310 len = strlen(Name);
311
312 NameW = (PWCHAR)MyAllocatePool__(NonPagedPool, (len+1)*sizeof(WCHAR));
313 if(!NameW)
315
316 swprintf(NameW, L"%S", Name);
317
318 Status = EnvFileOpenW(NameW, ph);
319
320 MyFreePool__(NameW);
321
322 return Status;
323} // end EnvFileOpenA()
324
325extern "C"
327EnvFileClose(
329 )
330{
331 return NtClose(hFile);
332} // end EnvFileClose()
333
334extern "C"
336EnvFileGetSizeByHandle(
338 PLONGLONG lpFileSize
339 )
340{
343 FILE_STANDARD_INFORMATION StandardInfo;
344
346 hFile,
348 &StandardInfo,
349 sizeof(StandardInfo),
351 );
352 if (NT_SUCCESS(Status)) {
353 *lpFileSize = StandardInfo.EndOfFile.QuadPart;
354 }
355 return Status;
356} // end EnvFileGetSizeByHandle()
357
358extern "C"
360EnvFileGetSizeA(
361 PCHAR Name,
362 PLONGLONG lpFileSize
363 )
364{
367
368 (*lpFileSize) = -1I64;
369
370 Status = EnvFileOpenA(Name, &hFile);
371
372 if(!NT_SUCCESS(Status))
373 return Status;
374
375 Status = EnvFileGetSizeByHandle(hFile, lpFileSize);
376
377 NtClose(hFile);
378
379 return Status;
380} // end EnvFileGetSizeA()
381
382extern "C"
384EnvFileGetSizeW(
385 PWCHAR Name,
386 PLONGLONG lpFileSize
387 )
388{
391
392 (*lpFileSize) = -1I64;
393
394 Status = EnvFileOpenW(Name, &hFile);
395
396 if(!NT_SUCCESS(Status))
397 return Status;
398
399 Status = EnvFileGetSizeByHandle(hFile, lpFileSize);
400
401 NtClose(hFile);
402
403 return Status;
404} // end EnvFileGetSizeW()
405
406extern "C"
408EnvFileExistsA(PCHAR Name) {
410 EnvFileGetSizeA(Name, &Size);
411 return Size != -1;
412}
413
414extern "C"
416EnvFileExistsW(PWCHAR Name) {
418 EnvFileGetSizeW(Name, &Size);
419 return Size != -1;
420}
421
422extern "C"
424EnvFileWrite(
425 HANDLE h,
426 PVOID ioBuffer,
429 )
430{
433
435 h,
436 NULL, // Event
437 NULL, // ApcRoutine
438 NULL, // ApcContext
439 &IoStatus,
440 ioBuffer,
441 Length,
442 NULL, // ByteOffset
443 NULL // Key
444 );
445 (*bytesWritten) = IoStatus.Information;
446
447 return Status;
448} // end EnvFileWrite()
449
450extern "C"
452EnvFileRead(
453 HANDLE h,
454 PVOID ioBuffer,
456 PULONG bytesRead
457 )
458{
461
463 h,
464 NULL, // Event
465 NULL, // ApcRoutine
466 NULL, // ApcContext
467 &IoStatus,
468 ioBuffer,
469 Length,
470 NULL, // ByteOffset
471 NULL // Key
472 );
473 (*bytesRead) = IoStatus.Information;
474
475 return Status;
476} // end EnvFileRead()
477
478extern "C"
480EnvFileSetPointer(
482 LONGLONG lDistanceToMove,
483 LONGLONG* lResultPointer,
484 DWORD dwMoveMethod
485 )
486{
491
492 switch (dwMoveMethod) {
493 case ENV_FILE_BEGIN :
494 CurrentPosition.CurrentByteOffset.QuadPart = lDistanceToMove;
495 break;
496
497 case ENV_FILE_CURRENT :
498
499 // Get the current position of the file pointer
501 hFile,
502 &IoStatus,
504 sizeof(CurrentPosition),
506 );
507 if(!NT_SUCCESS(Status)) {
508 return Status;
509 }
510 CurrentPosition.CurrentByteOffset.QuadPart += lDistanceToMove;
511 break;
512
513 case ENV_FILE_END :
515 hFile,
516 &IoStatus,
517 &FileInfo,
518 sizeof(FileInfo),
520 );
521 if (!NT_SUCCESS(Status)) {
522 return Status;
523 }
524 CurrentPosition.CurrentByteOffset.QuadPart =
525 FileInfo.EndOfFile.QuadPart + lDistanceToMove;
526 break;
527
528 default:
530 }
531
532 if ( CurrentPosition.CurrentByteOffset.QuadPart < 0 ) {
533 return Status;
534 }
535
537 hFile,
538 &IoStatus,
540 sizeof(CurrentPosition),
542 );
543
544 if(!NT_SUCCESS(Status)) {
545 return Status;
546 }
547 if(lResultPointer) {
548 *lResultPointer = CurrentPosition.CurrentByteOffset.QuadPart;
549 }
550 return STATUS_SUCCESS;
551} // end EnvFileSetPointer()
552
553NTSTATUS EnvFileDeleteW(PWCHAR Name) {
554
558 UNICODE_STRING fName;
561
562 RtlInitUnicodeString(&fName, Name);
563
565
567 &Handle,
570 &IoStatus,
575 );
576
577
578 if ( !NT_SUCCESS(Status) ) {
579 return Status;
580 }
581
582 Disposition.DeleteFile = TRUE;
583
585 Handle,
586 &IoStatus,
588 sizeof(Disposition),
590 );
591
593
594 return Status;
595}
596#endif //NT_NATIVE_MODE
unsigned char BOOLEAN
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
#define FILE_COMPLETE_IF_OPLOCKED
Definition: constants.h:493
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define I64(x)
Definition: byte_order.h:111
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define STATUS_PENDING
Definition: d3dkmdt.h:43
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define GENERIC_READ
Definition: compat.h:135
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define FILE_SHARE_READ
Definition: compat.h:136
#define swprintf
Definition: precomp.h:40
return Iosb
Definition: create.c:4402
#define NonPagedPool
Definition: env_spec_w32.h:307
ULONG BuildNumber
Definition: ros_glue.cpp:6
ULONG MajorVersion
Definition: ros_glue.cpp:4
ULONG MinorVersion
Definition: ros_glue.cpp:5
unsigned long DWORD
Definition: ntddk_ex.h:95
@ FilePositionInformation
Definition: from_kernel.h:75
@ FileDispositionInformation
Definition: from_kernel.h:74
#define FILE_OPEN
Definition: from_kernel.h:54
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
#define FILE_OPEN_FOR_BACKUP_INTENT
Definition: from_kernel.h:42
ULONG Handle
Definition: gdb_input.c:15
Status
Definition: gdiplustypes.h:25
GLdouble GLdouble t
Definition: gl.h:2047
GLenum GLsizei GLuint GLint * bytesWritten
Definition: glext.h:11123
GLenum GLsizei len
Definition: glext.h:6722
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
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
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
#define a
Definition: ke_i.h:78
#define MyAllocatePool__(type, size)
Definition: mem_tools.h:149
#define MyFreePool__(addr)
Definition: mem_tools.h:152
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_In_ HANDLE hFile
Definition: mswsock.h:90
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:93
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:56
NTSYSAPI NTSTATUS NTAPI NtOpenFile(OUT PHANDLE phFile, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG ShareMode, IN ULONG OpenMode)
Definition: file.c:3952
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSTATUS NTAPI NtDisplayString(PUNICODE_STRING String)
ULONG ACCESS_MASK
Definition: nt_native.h:40
NTSYSAPI NTSTATUS NTAPI NtWriteFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID WriteBuffer, IN ULONG WriteBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey OPTIONAL)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI PVOID NTAPI RtlCreateHeap(IN ULONG Flags, IN PVOID HeapBase OPTIONAL, IN ULONG ReserveSize OPTIONAL, IN ULONG CommitSize OPTIONAL, IN PVOID Lock OPTIONAL, IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL)
NTSYSAPI NTSTATUS NTAPI NtSetInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
Definition: iofunc.c:3096
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
NTSYSAPI NTSTATUS NTAPI NtDeviceIoControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define HEAP_GROWABLE
Definition: nt_native.h:1693
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
Definition: wait.c:876
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define DELETE
Definition: nt_native.h:57
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)
NTSTATUS NTAPI NtCreateFile(OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength)
#define GENERIC_WRITE
Definition: nt_native.h:90
NTSYSAPI NTSTATUS NTAPI NtFsControlFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, IN ULONG DeviceIoControlCode, IN PVOID InBuffer OPTIONAL, IN ULONG InBufferLength, OUT PVOID OutBuffer OPTIONAL, IN ULONG OutBufferLength)
__GNU_EXTENSION typedef __int64 * PLONGLONG
Definition: ntbasedef.h:390
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
ULONG CurrentPosition
Definition: patchapi.h:57
#define FileStandardInformation
Definition: propsheet.cpp:61
#define FILE_DEVICE_FILE_SYSTEM
Definition: winioctl.h:54
BOOLEAN RegTGetStringValue(IN HKEY hRootKey, IN PCWSTR RegistryPath, IN PCWSTR Name, IN PWCHAR pStr, IN ULONG MaxLen)
Definition: regtools.cpp:189
#define STATUS_SUCCESS
Definition: shellext.h:65
NTSTATUS NTAPI NtReadFile(HANDLE FileHandle, HANDLE Event, PIO_APC_ROUTINE ApcRoutine, PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, PVOID Buffer, ULONG Length, PLARGE_INTEGER ByteOffset, PULONG Key)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
USHORT MaximumLength
Definition: env_spec_w32.h:370
VOID WINAPI DECLSPEC_HOTPATCH Sleep(IN DWORD dwMilliseconds)
Definition: synch.c:790
uint32_t * PULONG
Definition: typedefs.h:59
int64_t LONGLONG
Definition: typedefs.h:68
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint16_t * PWCHAR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
char * PCHAR
Definition: typedefs.h:51
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define NT_ERROR(Status)
Definition: umtypes.h:106
#define PrintNtConsole(x)
Definition: atapi.h:1629
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_In_ DWORD _In_ DWORD _In_ DWORD _Out_ LPDWORD lpBytesReturned
Definition: winddi.h:1705
_In_ DWORD dwIoControlCode
Definition: winddi.h:1700
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36
#define _vsnprintf
Definition: xmlstorage.h:202
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175