1 | /* $Id: ntstuff.h 2861 2016-09-01 22:42:55Z bird $ */
|
---|
2 | /** @file
|
---|
3 | * Definitions, types, prototypes and globals for NT.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (c) 2005-2013 knut st. osmundsen <bird-kBuild-spamx@anduin.net>
|
---|
8 | *
|
---|
9 | * Permission is hereby granted, free of charge, to any person obtaining a
|
---|
10 | * copy of this software and associated documentation files (the "Software"),
|
---|
11 | * to deal in the Software without restriction, including without limitation
|
---|
12 | * the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
13 | * and/or sell copies of the Software, and to permit persons to whom the
|
---|
14 | * Software is furnished to do so, subject to the following conditions:
|
---|
15 | *
|
---|
16 | * The above copyright notice and this permission notice shall be included
|
---|
17 | * in all copies or substantial portions of the Software.
|
---|
18 | *
|
---|
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
---|
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
24 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
---|
25 | * IN THE SOFTWARE.
|
---|
26 | *
|
---|
27 | * Alternatively, the content of this file may be used under the terms of the
|
---|
28 | * GPL version 2 or later, or LGPL version 2.1 or later.
|
---|
29 | */
|
---|
30 |
|
---|
31 |
|
---|
32 | #ifndef ___nt_ntstuff_h
|
---|
33 | #define ___nt_ntstuff_h
|
---|
34 |
|
---|
35 | #define timeval timeval_Windows
|
---|
36 | #define WIN32_NO_STATUS
|
---|
37 | #include <Windows.h>
|
---|
38 | #include <winternl.h>
|
---|
39 | #undef WIN32_NO_STATUS
|
---|
40 | #include <ntstatus.h>
|
---|
41 | #undef timeval
|
---|
42 |
|
---|
43 |
|
---|
44 | /** @defgroup grp_nt_ntstuff NT Stuff
|
---|
45 | * @{ */
|
---|
46 |
|
---|
47 | typedef LONG MY_NTSTATUS;
|
---|
48 | typedef ULONG MY_ACCESS_MASK;
|
---|
49 |
|
---|
50 | typedef struct MY_IO_STATUS_BLOCK
|
---|
51 | {
|
---|
52 | union
|
---|
53 | {
|
---|
54 | MY_NTSTATUS Status;
|
---|
55 | PVOID Pointer;
|
---|
56 | } u;
|
---|
57 | ULONG_PTR Information;
|
---|
58 | } MY_IO_STATUS_BLOCK;
|
---|
59 |
|
---|
60 | typedef VOID WINAPI MY_IO_APC_ROUTINE(PVOID, MY_IO_STATUS_BLOCK *, ULONG);
|
---|
61 |
|
---|
62 | typedef struct MY_UNICODE_STRING
|
---|
63 | {
|
---|
64 | USHORT Length;
|
---|
65 | USHORT MaximumLength;
|
---|
66 | PWSTR Buffer;
|
---|
67 | } MY_UNICODE_STRING;
|
---|
68 |
|
---|
69 | typedef struct MY_STRING
|
---|
70 | {
|
---|
71 | USHORT Length;
|
---|
72 | USHORT MaximumLength;
|
---|
73 | PCHAR Buffer;
|
---|
74 | } MY_STRING;
|
---|
75 | typedef MY_STRING MY_ANSI_STRING;
|
---|
76 |
|
---|
77 | typedef struct MY_OBJECT_ATTRIBUTES
|
---|
78 | {
|
---|
79 | ULONG Length;
|
---|
80 | HANDLE RootDirectory;
|
---|
81 | MY_UNICODE_STRING *ObjectName;
|
---|
82 | ULONG Attributes;
|
---|
83 | PVOID SecurityDescriptor;
|
---|
84 | PVOID SecurityQualityOfService;
|
---|
85 | } MY_OBJECT_ATTRIBUTES;
|
---|
86 |
|
---|
87 | #define MyInitializeObjectAttributes(a_pAttr, a_pName, a_fAttribs, a_hRoot, a_pSecDesc) \
|
---|
88 | do { \
|
---|
89 | (a_pAttr)->Length = sizeof(MY_OBJECT_ATTRIBUTES); \
|
---|
90 | (a_pAttr)->RootDirectory = (a_hRoot); \
|
---|
91 | (a_pAttr)->Attributes = (a_fAttribs); \
|
---|
92 | (a_pAttr)->ObjectName = (a_pName); \
|
---|
93 | (a_pAttr)->SecurityDescriptor = (a_pSecDesc); \
|
---|
94 | (a_pAttr)->SecurityQualityOfService = NULL; \
|
---|
95 | } while (0)
|
---|
96 |
|
---|
97 |
|
---|
98 |
|
---|
99 | typedef struct MY_FILE_BASIC_INFORMATION
|
---|
100 | {
|
---|
101 | LARGE_INTEGER CreationTime;
|
---|
102 | LARGE_INTEGER LastAccessTime;
|
---|
103 | LARGE_INTEGER LastWriteTime;
|
---|
104 | LARGE_INTEGER ChangeTime;
|
---|
105 | ULONG FileAttributes;
|
---|
106 | } MY_FILE_BASIC_INFORMATION;
|
---|
107 |
|
---|
108 | typedef struct MY_FILE_STANDARD_INFORMATION
|
---|
109 | {
|
---|
110 | LARGE_INTEGER AllocationSize;
|
---|
111 | LARGE_INTEGER EndOfFile;
|
---|
112 | ULONG NumberOfLinks;
|
---|
113 | BOOLEAN DeletePending;
|
---|
114 | BOOLEAN Directory;
|
---|
115 | } MY_FILE_STANDARD_INFORMATION;
|
---|
116 |
|
---|
117 | typedef struct MY_FILE_INTERNAL_INFORMATION
|
---|
118 | {
|
---|
119 | LARGE_INTEGER IndexNumber;
|
---|
120 | } MY_FILE_INTERNAL_INFORMATION;
|
---|
121 |
|
---|
122 | typedef struct MY_FILE_EA_INFORMATION
|
---|
123 | {
|
---|
124 | ULONG EaSize;
|
---|
125 | } MY_FILE_EA_INFORMATION;
|
---|
126 |
|
---|
127 | typedef struct MY_FILE_ACCESS_INFORMATION
|
---|
128 | {
|
---|
129 | ACCESS_MASK AccessFlags;
|
---|
130 | } MY_FILE_ACCESS_INFORMATION;
|
---|
131 |
|
---|
132 | typedef struct MY_FILE_POSITION_INFORMATION
|
---|
133 | {
|
---|
134 | LARGE_INTEGER CurrentByteOffset;
|
---|
135 | } MY_FILE_POSITION_INFORMATION;
|
---|
136 |
|
---|
137 | typedef struct MY_FILE_MODE_INFORMATION
|
---|
138 | {
|
---|
139 | ULONG Mode;
|
---|
140 | } MY_FILE_MODE_INFORMATION;
|
---|
141 |
|
---|
142 | typedef struct MY_FILE_ALIGNMENT_INFORMATION
|
---|
143 | {
|
---|
144 | ULONG AlignmentRequirement;
|
---|
145 | } MY_FILE_ALIGNMENT_INFORMATION;
|
---|
146 |
|
---|
147 | typedef struct MY_FILE_NAME_INFORMATION
|
---|
148 | {
|
---|
149 | ULONG FileNameLength;
|
---|
150 | WCHAR FileName[1];
|
---|
151 | } MY_FILE_NAME_INFORMATION;
|
---|
152 |
|
---|
153 | typedef struct MY_FILE_ALL_INFORMATION
|
---|
154 | {
|
---|
155 | MY_FILE_BASIC_INFORMATION BasicInformation;
|
---|
156 | MY_FILE_STANDARD_INFORMATION StandardInformation;
|
---|
157 | MY_FILE_INTERNAL_INFORMATION InternalInformation;
|
---|
158 | MY_FILE_EA_INFORMATION EaInformation;
|
---|
159 | MY_FILE_ACCESS_INFORMATION AccessInformation;
|
---|
160 | MY_FILE_POSITION_INFORMATION PositionInformation;
|
---|
161 | MY_FILE_MODE_INFORMATION ModeInformation;
|
---|
162 | MY_FILE_ALIGNMENT_INFORMATION AlignmentInformation;
|
---|
163 | MY_FILE_NAME_INFORMATION NameInformation;
|
---|
164 | } MY_FILE_ALL_INFORMATION;
|
---|
165 |
|
---|
166 | typedef struct MY_FILE_ATTRIBUTE_TAG_INFORMATION
|
---|
167 | {
|
---|
168 | ULONG FileAttributes;
|
---|
169 | ULONG ReparseTag;
|
---|
170 | } MY_FILE_ATTRIBUTE_TAG_INFORMATION;
|
---|
171 |
|
---|
172 |
|
---|
173 | typedef struct MY_FILE_NAMES_INFORMATION
|
---|
174 | {
|
---|
175 | ULONG NextEntryOffset;
|
---|
176 | ULONG FileIndex;
|
---|
177 | ULONG FileNameLength;
|
---|
178 | WCHAR FileName[1];
|
---|
179 | } MY_FILE_NAMES_INFORMATION;
|
---|
180 | /** The sizeof(MY_FILE_NAMES_INFORMATION) without the FileName. */
|
---|
181 | #define MIN_SIZEOF_MY_FILE_NAMES_INFORMATION (4 + 4 + 4)
|
---|
182 |
|
---|
183 |
|
---|
184 | typedef struct MY_FILE_ID_FULL_DIR_INFORMATION
|
---|
185 | {
|
---|
186 | ULONG NextEntryOffset;
|
---|
187 | ULONG FileIndex;
|
---|
188 | LARGE_INTEGER CreationTime;
|
---|
189 | LARGE_INTEGER LastAccessTime;
|
---|
190 | LARGE_INTEGER LastWriteTime;
|
---|
191 | LARGE_INTEGER ChangeTime;
|
---|
192 | LARGE_INTEGER EndOfFile;
|
---|
193 | LARGE_INTEGER AllocationSize;
|
---|
194 | ULONG FileAttributes;
|
---|
195 | ULONG FileNameLength;
|
---|
196 | ULONG EaSize;
|
---|
197 | LARGE_INTEGER FileId;
|
---|
198 | WCHAR FileName[1];
|
---|
199 | } MY_FILE_ID_FULL_DIR_INFORMATION;
|
---|
200 | /** The sizeof(MY_FILE_NAMES_INFORMATION) without the FileName. */
|
---|
201 | #define MIN_SIZEOF_MY_FILE_ID_FULL_DIR_INFORMATION ( (size_t)&((MY_FILE_ID_FULL_DIR_INFORMATION *)0)->FileName )
|
---|
202 |
|
---|
203 | typedef struct MY_FILE_BOTH_DIR_INFORMATION
|
---|
204 | {
|
---|
205 | ULONG NextEntryOffset;
|
---|
206 | ULONG FileIndex;
|
---|
207 | LARGE_INTEGER CreationTime;
|
---|
208 | LARGE_INTEGER LastAccessTime;
|
---|
209 | LARGE_INTEGER LastWriteTime;
|
---|
210 | LARGE_INTEGER ChangeTime;
|
---|
211 | LARGE_INTEGER EndOfFile;
|
---|
212 | LARGE_INTEGER AllocationSize;
|
---|
213 | ULONG FileAttributes;
|
---|
214 | ULONG FileNameLength;
|
---|
215 | ULONG EaSize;
|
---|
216 | CCHAR ShortNameLength;
|
---|
217 | WCHAR ShortName[12];
|
---|
218 | WCHAR FileName[1];
|
---|
219 | } MY_FILE_BOTH_DIR_INFORMATION;
|
---|
220 | /** The sizeof(MY_FILE_BOTH_DIR_INFORMATION) without the FileName. */
|
---|
221 | #define MIN_SIZEOF_MY_FILE_BOTH_DIR_INFORMATION ( (size_t)&((MY_FILE_BOTH_DIR_INFORMATION *)0)->FileName )
|
---|
222 |
|
---|
223 |
|
---|
224 | typedef struct MY_FILE_ID_BOTH_DIR_INFORMATION
|
---|
225 | {
|
---|
226 | ULONG NextEntryOffset;
|
---|
227 | ULONG FileIndex;
|
---|
228 | LARGE_INTEGER CreationTime;
|
---|
229 | LARGE_INTEGER LastAccessTime;
|
---|
230 | LARGE_INTEGER LastWriteTime;
|
---|
231 | LARGE_INTEGER ChangeTime;
|
---|
232 | LARGE_INTEGER EndOfFile;
|
---|
233 | LARGE_INTEGER AllocationSize;
|
---|
234 | ULONG FileAttributes;
|
---|
235 | ULONG FileNameLength;
|
---|
236 | ULONG EaSize;
|
---|
237 | CCHAR ShortNameLength;
|
---|
238 | WCHAR ShortName[12];
|
---|
239 | LARGE_INTEGER FileId;
|
---|
240 | WCHAR FileName[1];
|
---|
241 | } MY_FILE_ID_BOTH_DIR_INFORMATION;
|
---|
242 | /** The sizeof(MY_FILE_NAMES_INFORMATION) without the FileName. */
|
---|
243 | #define MIN_SIZEOF_MY_FILE_ID_BOTH_DIR_INFORMATION ( (size_t)&((MY_FILE_ID_BOTH_DIR_INFORMATION *)0)->FileName )
|
---|
244 |
|
---|
245 |
|
---|
246 | typedef struct MY_FILE_DISPOSITION_INFORMATION
|
---|
247 | {
|
---|
248 | BOOLEAN DeleteFile;
|
---|
249 | } MY_FILE_DISPOSITION_INFORMATION;
|
---|
250 |
|
---|
251 |
|
---|
252 | typedef enum MY_FILE_INFORMATION_CLASS
|
---|
253 | {
|
---|
254 | MyFileDirectoryInformation = 1,
|
---|
255 | MyFileFullDirectoryInformation, /* = 2 */
|
---|
256 | MyFileBothDirectoryInformation, /* = 3 */
|
---|
257 | MyFileBasicInformation, /* = 4 */
|
---|
258 | MyFileStandardInformation, /* = 5 */
|
---|
259 | MyFileInternalInformation, /* = 6 */
|
---|
260 | MyFileEaInformation, /* = 7 */
|
---|
261 | MyFileAccessInformation, /* = 8 */
|
---|
262 | MyFileNameInformation, /* = 9 */
|
---|
263 | MyFileRenameInformation, /* = 10 */
|
---|
264 | MyFileLinkInformation, /* = 11 */
|
---|
265 | MyFileNamesInformation, /* = 12 */
|
---|
266 | MyFileDispositionInformation, /* = 13 */
|
---|
267 | MyFilePositionInformation, /* = 14 */
|
---|
268 | MyFileFullEaInformation, /* = 15 */
|
---|
269 | MyFileModeInformation, /* = 16 */
|
---|
270 | MyFileAlignmentInformation, /* = 17 */
|
---|
271 | MyFileAllInformation, /* = 18 */
|
---|
272 | MyFileAllocationInformation, /* = 19 */
|
---|
273 | MyFileEndOfFileInformation, /* = 20 */
|
---|
274 | MyFileAlternateNameInformation, /* = 21 */
|
---|
275 | MyFileStreamInformation, /* = 22 */
|
---|
276 | MyFilePipeInformation, /* = 23 */
|
---|
277 | MyFilePipeLocalInformation, /* = 24 */
|
---|
278 | MyFilePipeRemoteInformation, /* = 25 */
|
---|
279 | MyFileMailslotQueryInformation, /* = 26 */
|
---|
280 | MyFileMailslotSetInformation, /* = 27 */
|
---|
281 | MyFileCompressionInformation, /* = 28 */
|
---|
282 | MyFileObjectIdInformation, /* = 29 */
|
---|
283 | MyFileCompletionInformation, /* = 30 */
|
---|
284 | MyFileMoveClusterInformation, /* = 31 */
|
---|
285 | MyFileQuotaInformation, /* = 32 */
|
---|
286 | MyFileReparsePointInformation, /* = 33 */
|
---|
287 | MyFileNetworkOpenInformation, /* = 34 */
|
---|
288 | MyFileAttributeTagInformation, /* = 35 */
|
---|
289 | MyFileTrackingInformation, /* = 36 */
|
---|
290 | MyFileIdBothDirectoryInformation, /* = 37 */
|
---|
291 | MyFileIdFullDirectoryInformation, /* = 38 */
|
---|
292 | MyFileValidDataLengthInformation, /* = 39 */
|
---|
293 | MyFileShortNameInformation, /* = 40 */
|
---|
294 | MyFileIoCompletionNotificationInformation, /* = 41 */
|
---|
295 | MyFileIoStatusBlockRangeInformation, /* = 42 */
|
---|
296 | MyFileIoPriorityHintInformation, /* = 43 */
|
---|
297 | MyFileSfioReserveInformation, /* = 44 */
|
---|
298 | MyFileSfioVolumeInformation, /* = 45 */
|
---|
299 | MyFileHardLinkInformation, /* = 46 */
|
---|
300 | MyFileProcessIdsUsingFileInformation, /* = 47 */
|
---|
301 | MyFileNormalizedNameInformation, /* = 48 */
|
---|
302 | MyFileNetworkPhysicalNameInformation, /* = 49 */
|
---|
303 | MyFileIdGlobalTxDirectoryInformation, /* = 50 */
|
---|
304 | MyFileIsRemoteDeviceInformation, /* = 51 */
|
---|
305 | MyFileAttributeCacheInformation, /* = 52 */
|
---|
306 | MyFileNumaNodeInformation, /* = 53 */
|
---|
307 | MyFileStandardLinkInformation, /* = 54 */
|
---|
308 | MyFileRemoteProtocolInformation, /* = 55 */
|
---|
309 | MyFileMaximumInformation
|
---|
310 | } MY_FILE_INFORMATION_CLASS;
|
---|
311 |
|
---|
312 |
|
---|
313 | typedef struct MY_FILE_FS_VOLUME_INFORMATION
|
---|
314 | {
|
---|
315 | LARGE_INTEGER VolumeCreationTime;
|
---|
316 | ULONG VolumeSerialNumber;
|
---|
317 | ULONG VolumeLabelLength;
|
---|
318 | BOOLEAN SupportsObjects;
|
---|
319 | WCHAR VolumeLabel[1];
|
---|
320 | } MY_FILE_FS_VOLUME_INFORMATION;
|
---|
321 |
|
---|
322 | typedef struct _MY_FILE_FS_ATTRIBUTE_INFORMATION
|
---|
323 | {
|
---|
324 | ULONG FileSystemAttributes;
|
---|
325 | LONG MaximumComponentNameLength;
|
---|
326 | ULONG FileSystemNameLength;
|
---|
327 | WCHAR FileSystemName[1];
|
---|
328 | } MY_FILE_FS_ATTRIBUTE_INFORMATION;
|
---|
329 |
|
---|
330 | typedef enum MY_FSINFOCLASS
|
---|
331 | {
|
---|
332 | MyFileFsVolumeInformation = 1,
|
---|
333 | MyFileFsLabelInformation, /* = 2 */
|
---|
334 | MyFileFsSizeInformation, /* = 3 */
|
---|
335 | MyFileFsDeviceInformation, /* = 4 */
|
---|
336 | MyFileFsAttributeInformation, /* = 5 */
|
---|
337 | MyFileFsControlInformation, /* = 6 */
|
---|
338 | MyFileFsFullSizeInformation, /* = 7 */
|
---|
339 | MyFileFsObjectIdInformation, /* = 8 */
|
---|
340 | MyFileFsDriverPathInformation, /* = 9 */
|
---|
341 | MyFileFsVolumeFlagsInformation, /* = 10 */
|
---|
342 | MyFileFsMaximumInformation
|
---|
343 | } MY_FS_INFORMATION_CLASS;
|
---|
344 |
|
---|
345 |
|
---|
346 | typedef struct MY_RTLP_CURDIR_REF
|
---|
347 | {
|
---|
348 | LONG RefCount;
|
---|
349 | HANDLE Handle;
|
---|
350 | } MY_RTLP_CURDIR_REF;
|
---|
351 |
|
---|
352 | typedef struct MY_RTL_RELATIVE_NAME_U
|
---|
353 | {
|
---|
354 | MY_UNICODE_STRING RelativeName;
|
---|
355 | HANDLE ContainingDirectory;
|
---|
356 | MY_RTLP_CURDIR_REF CurDirRef;
|
---|
357 | } MY_RTL_RELATIVE_NAME_U;
|
---|
358 |
|
---|
359 |
|
---|
360 | #ifndef OBJ_INHERIT
|
---|
361 | # define OBJ_INHERIT 0x00000002U
|
---|
362 | # define OBJ_PERMANENT 0x00000010U
|
---|
363 | # define OBJ_EXCLUSIVE 0x00000020U
|
---|
364 | # define OBJ_CASE_INSENSITIVE 0x00000040U
|
---|
365 | # define OBJ_OPENIF 0x00000080U
|
---|
366 | # define OBJ_OPENLINK 0x00000100U
|
---|
367 | # define OBJ_KERNEL_HANDLE 0x00000200U
|
---|
368 | # define OBJ_FORCE_ACCESS_CHECK 0x00000400U
|
---|
369 | # define OBJ_VALID_ATTRIBUTES 0x000007f2U
|
---|
370 | #endif
|
---|
371 |
|
---|
372 | #ifndef FILE_OPEN
|
---|
373 | # define FILE_SUPERSEDE 0x00000000U
|
---|
374 | # define FILE_OPEN 0x00000001U
|
---|
375 | # define FILE_CREATE 0x00000002U
|
---|
376 | # define FILE_OPEN_IF 0x00000003U
|
---|
377 | # define FILE_OVERWRITE 0x00000004U
|
---|
378 | # define FILE_OVERWRITE_IF 0x00000005U
|
---|
379 | # define FILE_MAXIMUM_DISPOSITION 0x00000005U
|
---|
380 | #endif
|
---|
381 |
|
---|
382 | #ifndef FILE_DIRECTORY_FILE
|
---|
383 | # define FILE_DIRECTORY_FILE 0x00000001U
|
---|
384 | # define FILE_WRITE_THROUGH 0x00000002U
|
---|
385 | # define FILE_SEQUENTIAL_ONLY 0x00000004U
|
---|
386 | # define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008U
|
---|
387 | # define FILE_SYNCHRONOUS_IO_ALERT 0x00000010U
|
---|
388 | # define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020U
|
---|
389 | # define FILE_NON_DIRECTORY_FILE 0x00000040U
|
---|
390 | # define FILE_CREATE_TREE_CONNECTION 0x00000080U
|
---|
391 | # define FILE_COMPLETE_IF_OPLOCKED 0x00000100U
|
---|
392 | # define FILE_NO_EA_KNOWLEDGE 0x00000200U
|
---|
393 | # define FILE_OPEN_REMOTE_INSTANCE 0x00000400U
|
---|
394 | # define FILE_RANDOM_ACCESS 0x00000800U
|
---|
395 | # define FILE_DELETE_ON_CLOSE 0x00001000U
|
---|
396 | # define FILE_OPEN_BY_FILE_ID 0x00002000U
|
---|
397 | # define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000U
|
---|
398 | # define FILE_NO_COMPRESSION 0x00008000U
|
---|
399 | # define FILE_RESERVE_OPFILTER 0x00100000U
|
---|
400 | # define FILE_OPEN_REPARSE_POINT 0x00200000U
|
---|
401 | # define FILE_OPEN_NO_RECALL 0x00400000U
|
---|
402 | # define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000U
|
---|
403 | #endif
|
---|
404 |
|
---|
405 |
|
---|
406 | /** @name NT status codes and associated macros.
|
---|
407 | * @{ */
|
---|
408 | #define MY_NT_SUCCESS(a_ntRc) ((MY_NTSTATUS)(a_ntRc) >= 0)
|
---|
409 | #define MY_NT_FAILURE(a_ntRc) ((MY_NTSTATUS)(a_ntRc) < 0)
|
---|
410 | #define MY_STATUS_NO_MORE_FILES ((MY_NTSTATUS)0x80000006)
|
---|
411 | #define MY_STATUS_OBJECT_NAME_INVALID ((MY_NTSTATUS)0xc0000033)
|
---|
412 | #define MY_STATUS_OBJECT_NAME_NOT_FOUND ((MY_NTSTATUS)0xc0000034)
|
---|
413 | #define MY_STATUS_OBJECT_PATH_INVALID ((MY_NTSTATUS)0xc0000039)
|
---|
414 | #define MY_STATUS_OBJECT_PATH_NOT_FOUND ((MY_NTSTATUS)0xc000003a)
|
---|
415 | #define MY_STATUS_OBJECT_PATH_SYNTAX_BAD ((MY_NTSTATUS)0xc000003b)
|
---|
416 | /** @} */
|
---|
417 |
|
---|
418 |
|
---|
419 | /*******************************************************************************
|
---|
420 | * Global Variables *
|
---|
421 | *******************************************************************************/
|
---|
422 | extern MY_NTSTATUS (WINAPI * g_pfnNtClose)(HANDLE);
|
---|
423 | extern MY_NTSTATUS (WINAPI * g_pfnNtCreateFile)(PHANDLE, MY_ACCESS_MASK, MY_OBJECT_ATTRIBUTES *, MY_IO_STATUS_BLOCK *,
|
---|
424 | PLARGE_INTEGER, ULONG, ULONG, ULONG, ULONG, PVOID, ULONG);
|
---|
425 | extern MY_NTSTATUS (WINAPI * g_pfnNtDeleteFile)(MY_OBJECT_ATTRIBUTES *);
|
---|
426 | extern MY_NTSTATUS (WINAPI * g_pfnNtReadFile)(HANDLE hFile, HANDLE hEvent, MY_IO_APC_ROUTINE *pfnApc, PVOID pvApcCtx,
|
---|
427 | MY_IO_STATUS_BLOCK *, PVOID pvBuf, ULONG cbToRead, PLARGE_INTEGER poffFile,
|
---|
428 | PULONG puKey);
|
---|
429 | extern MY_NTSTATUS (WINAPI * g_pfnNtQueryInformationFile)(HANDLE, MY_IO_STATUS_BLOCK *,
|
---|
430 | PVOID, LONG, MY_FILE_INFORMATION_CLASS);
|
---|
431 | extern MY_NTSTATUS (WINAPI * g_pfnNtQueryVolumeInformationFile)(HANDLE, MY_IO_STATUS_BLOCK *,
|
---|
432 | PVOID, LONG, MY_FS_INFORMATION_CLASS);
|
---|
433 | extern MY_NTSTATUS (WINAPI * g_pfnNtQueryDirectoryFile)(HANDLE, HANDLE, MY_IO_APC_ROUTINE *, PVOID, MY_IO_STATUS_BLOCK *,
|
---|
434 | PVOID, ULONG, MY_FILE_INFORMATION_CLASS, BOOLEAN,
|
---|
435 | MY_UNICODE_STRING *, BOOLEAN);
|
---|
436 | extern MY_NTSTATUS (WINAPI * g_pfnNtQueryAttributesFile)(MY_OBJECT_ATTRIBUTES *, MY_FILE_BASIC_INFORMATION *);
|
---|
437 | extern MY_NTSTATUS (WINAPI * g_pfnNtSetInformationFile)(HANDLE, MY_IO_STATUS_BLOCK *, PVOID, LONG, MY_FILE_INFORMATION_CLASS);
|
---|
438 | extern BOOLEAN (WINAPI * g_pfnRtlDosPathNameToNtPathName_U)(PCWSTR, MY_UNICODE_STRING *, PCWSTR *, MY_RTL_RELATIVE_NAME_U *);
|
---|
439 | extern MY_NTSTATUS (WINAPI * g_pfnRtlAnsiStringToUnicodeString)(MY_UNICODE_STRING *, MY_ANSI_STRING const *, BOOLEAN);
|
---|
440 | extern BOOLEAN (WINAPI * g_pfnRtlEqualUnicodeString)(MY_UNICODE_STRING const *pUniStr1, MY_UNICODE_STRING const *pUniStr2,
|
---|
441 | BOOLEAN fCaseInsensitive);
|
---|
442 | extern BOOLEAN (WINAPI * g_pfnRtlEqualString)(MY_ANSI_STRING const *pAnsiStr1, MY_ANSI_STRING const *pAnsiStr2,
|
---|
443 | BOOLEAN fCaseInsensitive);
|
---|
444 | extern UCHAR (WINAPI * g_pfnRtlUpperChar)(UCHAR uch);
|
---|
445 |
|
---|
446 |
|
---|
447 | /** @} */
|
---|
448 |
|
---|
449 | #endif
|
---|
450 |
|
---|