ReactOS  r73918
nt_native.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 //======================================================================
8 //
9 // NT_Native.h
10 //
11 //======================================================================
12 
13 #ifndef __NT_NATIVE_DEFS__H__
14 #define __NT_NATIVE_DEFS__H__
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif //__cplusplus
19 
20 #include <excpt.h>
21 #include <ntdef.h>
22 #include <ntstatus.h>
23 #include <string.h>
24 #include <DEVIOCTL.H>
25 #include <NTDDSTOR.H>
26 #include <NTDDDISK.H>
27 
28 typedef struct _KTHREAD *PKTHREAD;
29 typedef struct _ETHREAD *PETHREAD;
30 typedef struct _EPROCESS *PEPROCESS;
31 typedef struct _PEB *PPEB;
32 typedef struct _KINTERRUPT *PKINTERRUPT;
33 typedef struct _IO_TIMER *PIO_TIMER;
34 typedef struct _OBJECT_TYPE *POBJECT_TYPE;
36 typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT;
37 typedef struct _BUS_HANDLER *PBUS_HANDLER;
38 
39 
41 typedef ACCESS_MASK *PACCESS_MASK;
42 
43 #define BOOL BOOLEAN
44 #define DWORD ULONG
45 #define LPVOID PVOID
46 #define LPDWORD PULONG
47 
48 #define APIENTRY __stdcall
49 
50 #define FASTCALL _fastcall
51 
52 // end_winnt
53 //
54 // The following are masks for the predefined standard access types
55 //
56 
57 #define DELETE (0x00010000L)
58 #define READ_CONTROL (0x00020000L)
59 #define WRITE_DAC (0x00040000L)
60 #define WRITE_OWNER (0x00080000L)
61 #define SYNCHRONIZE (0x00100000L)
62 
63 #define STANDARD_RIGHTS_REQUIRED (0x000F0000L)
64 
65 #define STANDARD_RIGHTS_READ (READ_CONTROL)
66 #define STANDARD_RIGHTS_WRITE (READ_CONTROL)
67 #define STANDARD_RIGHTS_EXECUTE (READ_CONTROL)
68 
69 #define STANDARD_RIGHTS_ALL (0x001F0000L)
70 
71 #define SPECIFIC_RIGHTS_ALL (0x0000FFFFL)
72 
73 //
74 // AccessSystemAcl access type
75 //
76 
77 #define ACCESS_SYSTEM_SECURITY (0x01000000L)
78 
79 //
80 // MaximumAllowed access type
81 //
82 
83 #define MAXIMUM_ALLOWED (0x02000000L)
84 
85 //
86 // These are the generic rights.
87 //
88 
89 #define GENERIC_READ (0x80000000L)
90 #define GENERIC_WRITE (0x40000000L)
91 #define GENERIC_EXECUTE (0x20000000L)
92 #define GENERIC_ALL (0x10000000L)
93 
94 
95 //
96 // Subroutines for dealing with the Registry
97 //
98 
104  IN PVOID Context,
106  );
107 
116 
118 
119 
120 //
121 // The following flags specify how the Name field of a RTL_QUERY_REGISTRY_TABLE
122 // entry is interpreted. A NULL name indicates the end of the table.
123 //
124 
125 #define RTL_QUERY_REGISTRY_SUBKEY 0x00000001 // Name is a subkey and remainder of
126  // table or until next subkey are value
127  // names for that subkey to look at.
128 
129 #define RTL_QUERY_REGISTRY_TOPKEY 0x00000002 // Reset current key to original key for
130  // this and all following table entries.
131 
132 #define RTL_QUERY_REGISTRY_REQUIRED 0x00000004 // Fail if no match found for this table
133  // entry.
134 
135 #define RTL_QUERY_REGISTRY_NOVALUE 0x00000008 // Used to mark a table entry that has no
136  // value name, just wants a call out, not
137  // an enumeration of all values.
138 
139 #define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010 // Used to suppress the expansion of
140  // REG_MULTI_SZ into multiple callouts or
141  // to prevent the expansion of environment
142  // variable values in REG_EXPAND_SZ
143 
144 #define RTL_QUERY_REGISTRY_DIRECT 0x00000020 // QueryRoutine field ignored. EntryContext
145  // field points to location to store value.
146  // For null terminated strings, EntryContext
147  // points to UNICODE_STRING structure that
148  // that describes maximum size of buffer.
149  // If .Buffer field is NULL then a buffer is
150  // allocated.
151  //
152 
153 #define RTL_QUERY_REGISTRY_DELETE 0x00000040 // Used to delete value keys after they
154  // are queried.
155 
156 //
157 // The following values for the RelativeTo parameter determine what the
158 // Path parameter to RtlQueryRegistryValues is relative to.
159 //
160 
161 #define RTL_REGISTRY_ABSOLUTE 0 // Path is a full path
162 #define RTL_REGISTRY_SERVICES 1 // \Registry\Machine\System\CurrentControlSet\Services
163 #define RTL_REGISTRY_CONTROL 2 // \Registry\Machine\System\CurrentControlSet\Control
164 #define RTL_REGISTRY_WINDOWS_NT 3 // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion
165 #define RTL_REGISTRY_DEVICEMAP 4 // \Registry\Machine\Hardware\DeviceMap
166 #define RTL_REGISTRY_USER 5 // \Registry\User\CurrentUser
167 #define RTL_REGISTRY_MAXIMUM 6
168 #define RTL_REGISTRY_HANDLE 0x40000000 // Low order bits are registry handle
169 #define RTL_REGISTRY_OPTIONAL 0x80000000 // Indicates the key node is optional
170 
171 
172 
173 NTSYSAPI
174 NTSTATUS
175 NTAPI
177  PCSZ String,
178  ULONG Base,
179  PULONG Value
180  );
181 
182 NTSYSAPI
183 NTSTATUS
184 NTAPI
186  ULONG Value,
187  ULONG Base,
189  );
190 
191 NTSYSAPI
192 NTSTATUS
193 NTAPI
196  ULONG Base,
197  PULONG Value
198  );
199 
200 
201 //
202 // String manipulation routines
203 //
204 
205 #ifdef _NTSYSTEM_
206 
207 #define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag
208 #define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag
209 
210 #else
211 
212 #define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag)
213 #define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag)
214 
215 #endif // _NTSYSTEM_
216 
217 extern BOOLEAN NLS_MB_CODE_PAGE_TAG; // TRUE -> Multibyte CP, FALSE -> Singlebyte
218 extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; // TRUE -> Multibyte CP, FALSE -> Singlebyte
219 
220 NTSYSAPI
221 VOID
222 NTAPI
226  );
227 
228 NTSYSAPI
229 VOID
230 NTAPI
234  );
235 
236 NTSYSAPI
237 VOID
238 NTAPI
242  );
243 
244 
245 NTSYSAPI
246 VOID
247 NTAPI
251  );
252 
253 NTSYSAPI
254 CHAR
255 NTAPI
256 RtlUpperChar (
258  );
259 
260 NTSYSAPI
261 LONG
262 NTAPI
264  PSTRING String1,
267  );
268 
269 NTSYSAPI
270 BOOLEAN
271 NTAPI
273  PSTRING String1,
276  );
277 
278 
279 NTSYSAPI
280 VOID
281 NTAPI
285  );
286 
287 //
288 // NLS String functions
289 //
290 
291 NTSYSAPI
292 NTSTATUS
293 NTAPI
298  );
299 
300 
301 NTSYSAPI
302 NTSTATUS
303 NTAPI
308  );
309 
310 
311 NTSYSAPI
312 LONG
313 NTAPI
315  PUNICODE_STRING String1,
318  );
319 
320 NTSYSAPI
321 BOOLEAN
322 NTAPI
324  PUNICODE_STRING String1,
327  );
328 
329 NTSYSAPI
330 BOOLEAN
331 NTAPI
333  IN PUNICODE_STRING String1,
336  );
337 
338 NTSYSAPI
339 NTSTATUS
340 NTAPI
345  );
346 
347 
348 NTSYSAPI
349 VOID
350 NTAPI
354  );
355 
356 NTSYSAPI
357 NTSTATUS
358 NTAPI
362  );
363 
364 NTSYSAPI
365 NTSTATUS
366 NTAPI
369  PWSTR Source
370  );
371 
372 
373 NTSYSAPI
374 VOID
375 NTAPI
378  );
379 
380 NTSYSAPI
381 VOID
382 NTAPI
385  );
386 
387 
388 NTSYSAPI
389 ULONG
390 NTAPI
393  );
394 
395 //
396 // NTSYSAPI
397 // ULONG
398 // NTAPI
399 // RtlAnsiStringToUnicodeSize(
400 // PANSI_STRING AnsiString
401 // );
402 //
403 
404 #define RtlAnsiStringToUnicodeSize(STRING) ( \
405  NLS_MB_CODE_PAGE_TAG ? \
406  RtlxAnsiStringToUnicodeSize(STRING) : \
407  ((STRING)->Length + sizeof((UCHAR)NULL)) * sizeof(WCHAR) \
408 )
409 
410 #if DBG
411 NTSYSAPI
412 VOID
413 NTAPI
414 RtlAssert(
415  PVOID FailedAssertion,
416  PVOID FileName,
418  PCHAR Message
419  );
420 
421 #define ASSERT( exp ) \
422  if (!(exp)) \
423  RtlAssert( #exp, __FILE__, __LINE__, NULL )
424 
425 #define ASSERTMSG( msg, exp ) \
426  if (!(exp)) \
427  RtlAssert( #exp, __FILE__, __LINE__, msg )
428 
429 #else
430 #define ASSERT( exp )
431 #define ASSERTMSG( msg, exp )
432 #endif // DBG
433 
434 //
435 // Fast primitives to compare, move, and zero memory
436 //
437 
438 // begin_winnt begin_ntndis
439 #if defined(_M_IX86) || defined(_M_MRX000) || defined(_M_ALPHA)
440 
441 #if defined(_M_MRX000)
442 NTSYSAPI
443 ULONG
444 NTAPI
446  CONST VOID *Source1,
447  CONST VOID *Source2,
448  ULONG Length
449  );
450 
451 #else
452 #define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
453 #endif
454 
455 #define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length))
456 #define RtlCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length))
457 #define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length))
458 #define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length))
459 
460 #else // _M_PPC
461 
462 NTSYSAPI
463 ULONG
464 NTAPI
466  CONST VOID *Source1,
467  CONST VOID *Source2,
468  ULONG Length
469  );
470 
471 NTSYSAPI
472 VOID
473 NTAPI
477  ULONG Length
478  );
479 
480 NTSYSAPI
481 VOID
482 NTAPI
486  ULONG Length
487  );
488 
489 NTSYSAPI
490 VOID
491 NTAPI
495  ULONG Length
496  );
497 
498 NTSYSAPI
499 VOID
500 NTAPI
503  ULONG Length,
504  UCHAR Fill
505  );
506 
507 NTSYSAPI
508 VOID
509 NTAPI
512  ULONG Length
513  );
514 #endif
515 // end_winnt end_ntndis
516 
517 NTSYSAPI
518 ULONG
519 NTAPI
521  PVOID Source1,
522  PVOID Source2,
523  ULONG Length
524  );
525 
526 typedef struct _TIME_FIELDS {
527  CSHORT Year; // range [1601...]
528  CSHORT Month; // range [1..12]
529  CSHORT Day; // range [1..31]
530  CSHORT Hour; // range [0..23]
531  CSHORT Minute; // range [0..59]
532  CSHORT Second; // range [0..59]
533  CSHORT Milliseconds;// range [0..999]
534  CSHORT Weekday; // range [0..6] == [Sunday..Saturday]
535 } TIME_FIELDS;
537 
538 
539 NTSYSAPI
540 VOID
541 NTAPI
544  PTIME_FIELDS TimeFields
545  );
546 
547 //
548 // A time field record (Weekday ignored) -> 64 bit Time value
549 //
550 
551 NTSYSAPI
552 BOOLEAN
553 NTAPI
555  PTIME_FIELDS TimeFields,
557  );
558 
559 //
560 // Define the generic mapping array. This is used to denote the
561 // mapping of each generic access right to a specific access mask.
562 //
563 
564 typedef struct _GENERIC_MAPPING {
565  ACCESS_MASK GenericRead;
566  ACCESS_MASK GenericWrite;
567  ACCESS_MASK GenericExecute;
568  ACCESS_MASK GenericAll;
571 
572 //
573 // Define the various device type values. Note that values used by Microsoft
574 // Corporation are in the range 0-32767, and 32768-65535 are reserved for use
575 // by customers.
576 //
577 
578 #define DEVICE_TYPE ULONG
579 
580 //
581 // Macro definition for defining IOCTL and FSCTL function control codes. Note
582 // that function codes 0-2047 are reserved for Microsoft Corporation, and
583 // 2048-4095 are reserved for customers.
584 //
585 
586 #define CTL_CODE( DeviceType, Function, Method, Access ) ( \
587  ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \
588 )
589 
590 //
591 // Define the method codes for how buffers are passed for I/O and FS controls
592 //
593 
594 #define METHOD_BUFFERED 0
595 #define METHOD_IN_DIRECT 1
596 #define METHOD_OUT_DIRECT 2
597 #define METHOD_NEITHER 3
598 
599 //
600 // Define the access check value for any access
601 //
602 //
603 // The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in
604 // ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these
605 // constants *MUST* always be in sync.
606 //
607 
608 
609 #define FILE_ANY_ACCESS 0
610 #define FILE_READ_ACCESS ( 0x0001 ) // file & pipe
611 #define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe
612 
613 
614 // begin_winnt
615 
616 //
617 // Define access rights to files and directories
618 //
619 
620 //
621 // The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
622 // devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
623 // constants *MUST* always be in sync.
624 // The values are redefined in devioctl.h because they must be available to
625 // both DOS and NT.
626 //
627 
628 #define FILE_READ_DATA ( 0x0001 ) // file & pipe
629 #define FILE_LIST_DIRECTORY ( 0x0001 ) // directory
630 
631 #define FILE_WRITE_DATA ( 0x0002 ) // file & pipe
632 #define FILE_ADD_FILE ( 0x0002 ) // directory
633 
634 #define FILE_APPEND_DATA ( 0x0004 ) // file
635 #define FILE_ADD_SUBDIRECTORY ( 0x0004 ) // directory
636 #define FILE_CREATE_PIPE_INSTANCE ( 0x0004 ) // named pipe
637 
638 #define FILE_READ_EA ( 0x0008 ) // file & directory
639 
640 #define FILE_WRITE_EA ( 0x0010 ) // file & directory
641 
642 #define FILE_EXECUTE ( 0x0020 ) // file
643 #define FILE_TRAVERSE ( 0x0020 ) // directory
644 
645 #define FILE_DELETE_CHILD ( 0x0040 ) // directory
646 
647 #define FILE_READ_ATTRIBUTES ( 0x0080 ) // all
648 
649 #define FILE_WRITE_ATTRIBUTES ( 0x0100 ) // all
650 
651 #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF)
652 
653 #define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\
654  FILE_READ_DATA |\
655  FILE_READ_ATTRIBUTES |\
656  FILE_READ_EA |\
657  SYNCHRONIZE)
658 
659 
660 #define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\
661  FILE_WRITE_DATA |\
662  FILE_WRITE_ATTRIBUTES |\
663  FILE_WRITE_EA |\
664  FILE_APPEND_DATA |\
665  SYNCHRONIZE)
666 
667 
668 #define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\
669  FILE_READ_ATTRIBUTES |\
670  FILE_EXECUTE |\
671  SYNCHRONIZE)
672 
673 // end_winnt
674 
675 
676 //
677 // Define share access rights to files and directories
678 //
679 
680 #define FILE_SHARE_READ 0x00000001 // winnt
681 #define FILE_SHARE_WRITE 0x00000002 // winnt
682 #define FILE_SHARE_DELETE 0x00000004 // winnt
683 #define FILE_SHARE_VALID_FLAGS 0x00000007
684 
685 //
686 // Define the file attributes values
687 //
688 // Note: 0x00000008 is reserved for use for the old DOS VOLID (volume ID)
689 // and is therefore not considered valid in NT.
690 //
691 // Note: 0x00000010 is reserved for use for the old DOS SUBDIRECTORY flag
692 // and is therefore not considered valid in NT. This flag has
693 // been disassociated with file attributes since the other flags are
694 // protected with READ_ and WRITE_ATTRIBUTES access to the file.
695 //
696 // Note: Note also that the order of these flags is set to allow both the
697 // FAT and the Pinball File Systems to directly set the attributes
698 // flags in attributes words without having to pick each flag out
699 // individually. The order of these flags should not be changed!
700 //
701 
702 #define FILE_ATTRIBUTE_READONLY 0x00000001 // winnt
703 #define FILE_ATTRIBUTE_HIDDEN 0x00000002 // winnt
704 #define FILE_ATTRIBUTE_SYSTEM 0x00000004 // winnt
705 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010 // winnt
706 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020 // winnt
707 #define FILE_ATTRIBUTE_NORMAL 0x00000080 // winnt
708 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100 // winnt
709 #define FILE_ATTRIBUTE_RESERVED0 0x00000200
710 #define FILE_ATTRIBUTE_RESERVED1 0x00000400
711 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800 // winnt
712 #define FILE_ATTRIBUTE_OFFLINE 0x00001000 // winnt
713 #define FILE_ATTRIBUTE_PROPERTY_SET 0x00002000
714 #define FILE_ATTRIBUTE_VALID_FLAGS 0x00003fb7
715 #define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x00003fa7
716 
717 //
718 // Define the create disposition values
719 //
720 
721 #define FILE_SUPERSEDE 0x00000000
722 #define FILE_OPEN 0x00000001
723 #define FILE_CREATE 0x00000002
724 #define FILE_OPEN_IF 0x00000003
725 #define FILE_OVERWRITE 0x00000004
726 #define FILE_OVERWRITE_IF 0x00000005
727 #define FILE_MAXIMUM_DISPOSITION 0x00000005
728 
729 
730 //
731 // Define the create/open option flags
732 //
733 
734 #define FILE_DIRECTORY_FILE 0x00000001
735 #define FILE_WRITE_THROUGH 0x00000002
736 #define FILE_SEQUENTIAL_ONLY 0x00000004
737 #define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008
738 
739 #define FILE_SYNCHRONOUS_IO_ALERT 0x00000010
740 #define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020
741 #define FILE_NON_DIRECTORY_FILE 0x00000040
742 #define FILE_CREATE_TREE_CONNECTION 0x00000080
743 
744 #define FILE_COMPLETE_IF_OPLOCKED 0x00000100
745 #define FILE_NO_EA_KNOWLEDGE 0x00000200
746 //UNUSED 0x00000400
747 #define FILE_RANDOM_ACCESS 0x00000800
748 
749 #define FILE_DELETE_ON_CLOSE 0x00001000
750 #define FILE_OPEN_BY_FILE_ID 0x00002000
751 #define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000
752 #define FILE_NO_COMPRESSION 0x00008000
753 
754 
755 #define FILE_RESERVE_OPFILTER 0x00100000
756 #define FILE_TRANSACTED_MODE 0x00200000
757 #define FILE_OPEN_OFFLINE_FILE 0x00400000
758 
759 #define FILE_VALID_OPTION_FLAGS 0x007fffff
760 #define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032
761 #define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032
762 #define FILE_VALID_SET_FLAGS 0x00000036
763 
764 //
765 // Define the I/O status information return values for NtCreateFile/NtOpenFile
766 //
767 
768 #define FILE_SUPERSEDED 0x00000000
769 #define FILE_OPENED 0x00000001
770 #define FILE_CREATED 0x00000002
771 #define FILE_OVERWRITTEN 0x00000003
772 #define FILE_EXISTS 0x00000004
773 #define FILE_DOES_NOT_EXIST 0x00000005
774 
775 //
776 // Define special ByteOffset parameters for read and write operations
777 //
778 
779 #define FILE_WRITE_TO_END_OF_FILE 0xffffffff
780 #define FILE_USE_FILE_POINTER_POSITION 0xfffffffe
781 
782 //
783 // Define alignment requirement values
784 //
785 
786 #define FILE_BYTE_ALIGNMENT 0x00000000
787 #define FILE_WORD_ALIGNMENT 0x00000001
788 #define FILE_LONG_ALIGNMENT 0x00000003
789 #define FILE_QUAD_ALIGNMENT 0x00000007
790 #define FILE_OCTA_ALIGNMENT 0x0000000f
791 #define FILE_32_BYTE_ALIGNMENT 0x0000001f
792 #define FILE_64_BYTE_ALIGNMENT 0x0000003f
793 #define FILE_128_BYTE_ALIGNMENT 0x0000007f
794 #define FILE_256_BYTE_ALIGNMENT 0x000000ff
795 #define FILE_512_BYTE_ALIGNMENT 0x000001ff
796 
797 //
798 // Define the maximum length of a filename string
799 //
800 
801 #define MAXIMUM_FILENAME_LENGTH 256
802 
803 //
804 // Define the various device characteristics flags
805 //
806 
807 #define FILE_REMOVABLE_MEDIA 0x00000001
808 #define FILE_READ_ONLY_DEVICE 0x00000002
809 #define FILE_FLOPPY_DISKETTE 0x00000004
810 #define FILE_WRITE_ONCE_MEDIA 0x00000008
811 #define FILE_REMOTE_DEVICE 0x00000010
812 #define FILE_DEVICE_IS_MOUNTED 0x00000020
813 #define FILE_VIRTUAL_VOLUME 0x00000040
814 
815 #ifndef _FILESYSTEMFSCTL_
816 #define _FILESYSTEMFSCTL_
817 
818 #endif // _FILESYSTEMFSCTL_
819 
820 //
821 // The following is a list of the native file system fsctls followed by
822 // additional network file system fsctls. Some values have been
823 // decommissioned.
824 //
825 
826 #define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
827 #define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS)
828 #define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
829 #define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
830 #define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS)
831 #define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS)
832 #define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
833 #define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS)
834 #define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS)
835 // decommissioned fsctl value 9
836 #define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS)
837 #define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) // PATHNAME_BUFFER,
838 #define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
839 // decommissioned fsctl value 13
840 #define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS)
841 #define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
842 #define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
843 // decommissioned fsctl value 17
844 // decommissioned fsctl value 18
845 #define FSCTL_MARK_AS_SYSTEM_HIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS)
846 #define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS)
847 #define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS)
848 #define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_QUERY_FAT_BPB_BUFFER
849 #define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS)
850 #define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILESYSTEM_STATISTICS
851 #if(_WIN32_WINNT >= 0x0400)
852 #define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_VOLUME_DATA_BUFFER
853 #define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_FILE_RECORD_INPUT_BUFFER, NTFS_FILE_RECORD_OUTPUT_BUFFER
854 #define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_LCN_INPUT_BUFFER, VOLUME_BITMAP_BUFFER
855 #define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTERS_BUFFER
856 #define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // MOVE_FILE_DATA,
857 #define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS)
858 // decomissioned fsctl value 31
859 #define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS)
860 #endif /* _WIN32_WINNT >= 0x0400 */
861 
862 //
863 // Define the base asynchronous I/O argument types
864 //
865 
866 typedef struct _IO_STATUS_BLOCK {
870 
871 //
872 // Define an Asynchronous Procedure Call from I/O viewpoint
873 //
874 
875 typedef
876 VOID
879  IN PIO_STATUS_BLOCK IoStatusBlock,
881  );
882 
883 //
884 // Define the file information class values
885 //
886 // WARNING: The order of the following values are assumed by the I/O system.
887 // Any changes made here should be reflected there as well.
888 //
889 
933 
934 //
935 // Define the various structures which are returned on query operations
936 //
937 
938 typedef struct _FILE_BASIC_INFORMATION {
945 
946 typedef struct _FILE_STANDARD_INFORMATION {
953 
954 typedef struct _FILE_POSITION_INFORMATION {
957 
961 
971 
975 
979 
980 
988 
989 //
990 // Define the file system information class values
991 //
992 // WARNING: The order of the following values are assumed by the I/O system.
993 // Any changes made here should be reflected there as well.
994 
995 typedef enum _FSINFOCLASS {
1006 
1011 
1012 //
1013 // Registry Specific Access Rights.
1014 //
1015 
1016 #define KEY_QUERY_VALUE (0x0001)
1017 #define KEY_SET_VALUE (0x0002)
1018 #define KEY_CREATE_SUB_KEY (0x0004)
1019 #define KEY_ENUMERATE_SUB_KEYS (0x0008)
1020 #define KEY_NOTIFY (0x0010)
1021 #define KEY_CREATE_LINK (0x0020)
1022 
1023 #define KEY_READ ((STANDARD_RIGHTS_READ |\
1024  KEY_QUERY_VALUE |\
1025  KEY_ENUMERATE_SUB_KEYS |\
1026  KEY_NOTIFY) \
1027  & \
1028  (~SYNCHRONIZE))
1029 
1030 
1031 #define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\
1032  KEY_SET_VALUE |\
1033  KEY_CREATE_SUB_KEY) \
1034  & \
1035  (~SYNCHRONIZE))
1036 
1037 #define KEY_EXECUTE ((KEY_READ) \
1038  & \
1039  (~SYNCHRONIZE))
1040 
1041 #define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\
1042  KEY_QUERY_VALUE |\
1043  KEY_SET_VALUE |\
1044  KEY_CREATE_SUB_KEY |\
1045  KEY_ENUMERATE_SUB_KEYS |\
1046  KEY_NOTIFY |\
1047  KEY_CREATE_LINK) \
1048  & \
1049  (~SYNCHRONIZE))
1050 
1051 //
1052 // Open/Create Options
1053 //
1054 
1055 #define REG_OPTION_RESERVED (0x00000000L) // Parameter is reserved
1056 
1057 #define REG_OPTION_NON_VOLATILE (0x00000000L) // Key is preserved
1058  // when system is rebooted
1059 
1060 #define REG_OPTION_VOLATILE (0x00000001L) // Key is not preserved
1061  // when system is rebooted
1062 
1063 #define REG_OPTION_CREATE_LINK (0x00000002L) // Created key is a
1064  // symbolic link
1065 
1066 #define REG_OPTION_BACKUP_RESTORE (0x00000004L) // open for backup or restore
1067  // special access rules
1068  // privilege required
1069 
1070 #define REG_OPTION_OPEN_LINK (0x00000008L) // Open symbolic link
1071 
1072 #define REG_LEGAL_OPTION \
1073  (REG_OPTION_RESERVED |\
1074  REG_OPTION_NON_VOLATILE |\
1075  REG_OPTION_VOLATILE |\
1076  REG_OPTION_CREATE_LINK |\
1077  REG_OPTION_BACKUP_RESTORE |\
1078  REG_OPTION_OPEN_LINK)
1079 
1080 //
1081 // Key creation/open disposition
1082 //
1083 
1084 #define REG_CREATED_NEW_KEY (0x00000001L) // New Registry Key created
1085 #define REG_OPENED_EXISTING_KEY (0x00000002L) // Existing Key opened
1086 
1087 //
1088 // Key restore flags
1089 //
1090 
1091 #define REG_WHOLE_HIVE_VOLATILE (0x00000001L) // Restore whole hive volatile
1092 #define REG_REFRESH_HIVE (0x00000002L) // Unwind changes to last flush
1093 #define REG_NO_LAZY_FLUSH (0x00000004L) // Never lazy flush this hive
1094 
1095 //
1096 // Key query structures
1097 //
1098 
1099 typedef struct _KEY_BASIC_INFORMATION {
1103  WCHAR Name[1]; // Variable length string
1105 
1106 typedef struct _KEY_NODE_INFORMATION {
1112  WCHAR Name[1]; // Variable length string
1113 // Class[1]; // Variable length string not declared
1115 
1116 typedef struct _KEY_FULL_INFORMATION {
1127  WCHAR Class[1]; // Variable length
1129 
1135 
1139 
1143 
1144 //
1145 // Value entry query structures
1146 //
1147 
1152  WCHAR Name[1]; // Variable size
1154 
1161  WCHAR Name[1]; // Variable size
1162 // Data[1]; // Variable size data not declared
1164 
1169  UCHAR Data[1]; // Variable size
1171 
1172 typedef struct _KEY_VALUE_ENTRY {
1178 
1184 
1185 
1186 NTSYSAPI
1187 NTSTATUS
1188 NTAPI
1191  IN ULONG Index,
1193  IN PVOID KeyInformation,
1194  IN ULONG Length,
1196  );
1197 
1198 NTSYSAPI
1199 NTSTATUS
1200 NTAPI
1201 NtOpenKey(
1203  IN ACCESS_MASK DesiredAccess,
1205  );
1206 
1207 NTSYSAPI
1208 NTSTATUS
1209 NTAPI
1212  IN PUNICODE_STRING ValueName,
1214  IN PVOID KeyValueInformation,
1215  IN ULONG Length,
1217  );
1218 
1219 NTSYSAPI
1220 NTSTATUS
1221 NTAPI
1224  IN PUNICODE_STRING ValueName,
1226  IN ULONG Type,
1227  IN PVOID Data,
1228  IN ULONG DataSize
1229  );
1230 
1231 NTSYSAPI
1232 NTSTATUS
1233 NTAPI
1236  IN PUNICODE_STRING ValueName
1237  );
1238 
1239 
1240 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
1241 
1242 //
1243 // Object Manager Object Type Specific Access Rights.
1244 //
1245 
1246 #define OBJECT_TYPE_CREATE (0x0001)
1247 
1248 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1249 
1250 //
1251 // Object Manager Directory Specific Access Rights.
1252 //
1253 
1254 #define DIRECTORY_QUERY (0x0001)
1255 #define DIRECTORY_TRAVERSE (0x0002)
1256 #define DIRECTORY_CREATE_OBJECT (0x0004)
1257 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
1258 
1259 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
1260 
1261 //
1262 // Object Manager Symbolic Link Specific Access Rights.
1263 //
1264 
1265 #define SYMBOLIC_LINK_QUERY (0x0001)
1266 
1267 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
1268 
1269 typedef struct _OBJECT_NAME_INFORMATION {
1272 
1273 //
1274 // Section Information Structures.
1275 //
1276 
1277 typedef enum _SECTION_INHERIT {
1280 } SECTION_INHERIT;
1281 
1282 //
1283 // Section Access Rights.
1284 //
1285 
1286 // begin_winnt
1287 #define SECTION_QUERY 0x0001
1288 #define SECTION_MAP_WRITE 0x0002
1289 #define SECTION_MAP_READ 0x0004
1290 #define SECTION_MAP_EXECUTE 0x0008
1291 #define SECTION_EXTEND_SIZE 0x0010
1292 
1293 #define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY|\
1294  SECTION_MAP_WRITE | \
1295  SECTION_MAP_READ | \
1296  SECTION_MAP_EXECUTE | \
1297  SECTION_EXTEND_SIZE)
1298 // end_winnt
1299 
1300 #define SEGMENT_ALL_ACCESS SECTION_ALL_ACCESS
1301 
1302 #define PAGE_NOACCESS 0x01 // winnt
1303 #define PAGE_READONLY 0x02 // winnt
1304 #define PAGE_READWRITE 0x04 // winnt
1305 #define PAGE_WRITECOPY 0x08 // winnt
1306 #define PAGE_EXECUTE 0x10 // winnt
1307 #define PAGE_EXECUTE_READ 0x20 // winnt
1308 #define PAGE_EXECUTE_READWRITE 0x40 // winnt
1309 #define PAGE_EXECUTE_WRITECOPY 0x80 // winnt
1310 #define PAGE_GUARD 0x100 // winnt
1311 #define PAGE_NOCACHE 0x200 // winnt
1312 
1313 #define MEM_COMMIT 0x1000
1314 #define MEM_RESERVE 0x2000
1315 #define MEM_DECOMMIT 0x4000
1316 #define MEM_RELEASE 0x8000
1317 #define MEM_FREE 0x10000
1318 #define MEM_PRIVATE 0x20000
1319 #define MEM_MAPPED 0x40000
1320 #define MEM_RESET 0x80000
1321 #define MEM_TOP_DOWN 0x100000
1322 #define MEM_LARGE_PAGES 0x20000000
1323 #define SEC_RESERVE 0x4000000
1324 #define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
1325  0xFFF)
1326 
1327 
1328 #define MAXIMUM_PROCESSORS 32
1329 
1330 // end_winnt
1331 
1332 //
1333 // Thread Specific Access Rights
1334 //
1335 
1336 #define THREAD_TERMINATE (0x0001) // winnt
1337 #define THREAD_SET_INFORMATION (0x0020) // winnt
1338 
1339 #define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \
1340  0x3FF)
1341 
1342 //
1343 // ClientId
1344 //
1345 
1346 typedef struct _CLIENT_ID {
1349 } CLIENT_ID;
1351 
1352 //
1353 // Define the size of the 80387 save area, which is in the context frame.
1354 //
1355 
1356 #define SIZE_OF_80387_REGISTERS 80
1357 
1358 //
1359 // The following flags control the contents of the CONTEXT structure.
1360 //
1361 
1362 #if !defined(RC_INVOKED)
1363 
1364 #define CONTEXT_i386 0x00010000 // this assumes that i386 and
1365 #define CONTEXT_i486 0x00010000 // i486 have identical context records
1366 
1367 // end_wx86
1368 
1369 #define CONTEXT_CONTROL (CONTEXT_i386 | 0x00000001L) // SS:SP, CS:IP, FLAGS, BP
1370 #define CONTEXT_INTEGER (CONTEXT_i386 | 0x00000002L) // AX, BX, CX, DX, SI, DI
1371 #define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x00000004L) // DS, ES, FS, GS
1372 #define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x00000008L) // 387 state
1373 #define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x00000010L) // DB 0-3,6,7
1374 
1375 #define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |\
1376  CONTEXT_SEGMENTS)
1377 
1378 // begin_wx86
1379 
1380 #endif
1381 
1382 typedef struct _FLOATING_SAVE_AREA {
1393 
1395 
1396 //
1397 // Context Frame
1398 //
1399 // This frame has a several purposes: 1) it is used as an argument to
1400 // NtContinue, 2) is is used to constuct a call frame for APC delivery,
1401 // and 3) it is used in the user level thread creation routines.
1402 //
1403 // The layout of the record conforms to a standard call frame.
1404 //
1405 
1406 typedef struct _CONTEXT {
1407 
1408  //
1409  // The flags values within this flag control the contents of
1410  // a CONTEXT record.
1411  //
1412  // If the context record is used as an input parameter, then
1413  // for each portion of the context record controlled by a flag
1414  // whose value is set, it is assumed that that portion of the
1415  // context record contains valid context. If the context record
1416  // is being used to modify a threads context, then only that
1417  // portion of the threads context will be modified.
1418  //
1419  // If the context record is used as an IN OUT parameter to capture
1420  // the context of a thread, then only those portions of the thread's
1421  // context corresponding to set flags will be returned.
1422  //
1423  // The context record is never used as an OUT only parameter.
1424  //
1425 
1427 
1428  //
1429  // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is
1430  // set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT
1431  // included in CONTEXT_FULL.
1432  //
1433 
1440 
1441  //
1442  // This section is specified/returned if the
1443  // ContextFlags word contians the flag CONTEXT_FLOATING_POINT.
1444  //
1445 
1447 
1448  //
1449  // This section is specified/returned if the
1450  // ContextFlags word contians the flag CONTEXT_SEGMENTS.
1451  //
1452 
1457 
1458  //
1459  // This section is specified/returned if the
1460  // ContextFlags word contians the flag CONTEXT_INTEGER.
1461  //
1462 
1469 
1470  //
1471  // This section is specified/returned if the
1472  // ContextFlags word contians the flag CONTEXT_CONTROL.
1473  //
1474 
1477  ULONG SegCs; // MUST BE SANITIZED
1478  ULONG EFlags; // MUST BE SANITIZED
1481 
1482 } CONTEXT;
1483 
1484 
1485 
1487 
1488 //
1489 // Predefined Value Types.
1490 //
1491 
1492 #define REG_NONE ( 0 ) // No value type
1493 #define REG_SZ ( 1 ) // Unicode nul terminated string
1494 #define REG_EXPAND_SZ ( 2 ) // Unicode nul terminated string
1495  // (with environment variable references)
1496 #define REG_BINARY ( 3 ) // Free form binary
1497 #define REG_DWORD ( 4 ) // 32-bit number
1498 #define REG_DWORD_LITTLE_ENDIAN ( 4 ) // 32-bit number (same as REG_DWORD)
1499 #define REG_DWORD_BIG_ENDIAN ( 5 ) // 32-bit number
1500 #define REG_LINK ( 6 ) // Symbolic Link (unicode)
1501 #define REG_MULTI_SZ ( 7 ) // Multiple Unicode strings
1502 #define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map
1503 #define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description
1504 #define REG_RESOURCE_REQUIREMENTS_LIST ( 10 )
1505 
1506 /*
1507 LONG
1508 FASTCALL
1509 InterlockedIncrement(
1510  IN PLONG Addend
1511  );
1512 
1513 LONG
1514 FASTCALL
1515 InterlockedDecrement(
1516  IN PLONG Addend
1517  );
1518 
1519 LONG
1520 FASTCALL
1521 InterlockedExchange(
1522  IN OUT PLONG Target,
1523  IN LONG Value
1524  );
1525 
1526 LONG
1527 FASTCALL
1528 InterlockedExchangeAdd(
1529  IN OUT PLONG Addend,
1530  IN LONG Increment
1531  );
1532 
1533 PVOID
1534 FASTCALL
1535 InterlockedCompareExchange(
1536  IN OUT PVOID *Destination,
1537  IN PVOID ExChange,
1538  IN PVOID Comperand
1539  );
1540 */
1541 //
1542 // Environment information, which includes command line and
1543 // image file name
1544 //
1545 typedef struct {
1550 
1551 //
1552 // This structure is passed as NtProcessStartup's parameter
1553 //
1554 typedef struct {
1556  PENVIRONMENT_INFORMATION Environment;
1558 
1559 //
1560 // Data structure for heap definition. This includes various
1561 // sizing parameters and callback routines, which, if left NULL,
1562 // result in default behavior
1563 //
1564 typedef struct {
1568 
1569 //
1570 // Native NT api function to write something to the boot-time
1571 // blue screen
1572 //
1573 NTSTATUS
1574 NTAPI
1577  );
1578 
1579 //
1580 // Native applications must kill themselves when done - the job
1581 // of this native API
1582 //
1583 NTSTATUS
1584 NTAPI
1587  LONG ExitStatus
1588  );
1589 
1590 //
1591 // Thread start function
1592 //
1593 
1594 typedef
1595 VOID
1597  IN PVOID StartContext
1598  );
1599 
1600 typedef struct StackInfo_t {
1606 } STACKINFO, *PSTACKINFO;
1607 
1608 NTSYSAPI
1609 NTSTATUS
1610 NTAPI
1612  OUT PHANDLE phThread,
1613  IN ACCESS_MASK AccessMask,
1615  IN HANDLE hProcess,
1616  OUT PCLIENT_ID pClientId,
1617  IN PCONTEXT pContext,
1618  OUT PSTACKINFO pStackInfo,
1619  IN BOOLEAN bSuspended
1620 );
1621 
1622 /*NTSTATUS
1623 PsCreateSystemThread(
1624  OUT PHANDLE ThreadHandle,
1625  IN ACCESS_MASK DesiredAccess,
1626  IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1627  IN HANDLE ProcessHandle OPTIONAL,
1628  OUT PCLIENT_ID ClientId OPTIONAL,
1629  IN PKSTART_ROUTINE StartRoutine,
1630  IN PVOID StartContext
1631  );
1632 */
1633 NTSTATUS
1635  IN HANDLE ThreadHandle OPTIONAL,
1637  );
1638 
1639 /*
1640 BOOLEAN
1641 PsGetVersion(
1642  PULONG MajorVersion OPTIONAL,
1643  PULONG MinorVersion OPTIONAL,
1644  PULONG BuildNumber OPTIONAL,
1645  PUNICODE_STRING CSDVersion OPTIONAL
1646  );
1647 
1648 HANDLE
1649 PsGetCurrentProcessId( VOID );
1650 
1651 HANDLE
1652 PsGetCurrentThreadId( VOID );
1653 */
1654 //
1655 // Definition to represent current process
1656 //
1657 #define NtCurrentProcess() ( (HANDLE) -1 )
1658 
1659 typedef NTSTATUS
1661  IN PVOID Base,
1664  );
1665 
1666 typedef struct _RTL_HEAP_PARAMETERS {
1679 
1680 NTSYSAPI
1681 PVOID
1682 NTAPI
1684  IN ULONG Flags,
1686  IN ULONG ReserveSize OPTIONAL,
1687  IN ULONG CommitSize OPTIONAL,
1688  IN PVOID Lock OPTIONAL,
1689  IN PRTL_HEAP_PARAMETERS Parameters OPTIONAL
1690  );
1691 
1692 #define HEAP_NO_SERIALIZE 0x00000001 // winnt
1693 #define HEAP_GROWABLE 0x00000002 // winnt
1694 #define HEAP_GENERATE_EXCEPTIONS 0x00000004 // winnt
1695 #define HEAP_ZERO_MEMORY 0x00000008 // winnt
1696 #define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 // winnt
1697 #define HEAP_TAIL_CHECKING_ENABLED 0x00000020 // winnt
1698 #define HEAP_FREE_CHECKING_ENABLED 0x00000040 // winnt
1699 #define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 // winnt
1700 
1701 #define HEAP_CREATE_ALIGN_16 0x00010000 // winnt Create heap with 16 byte alignment
1702 #define HEAP_CREATE_ENABLE_TRACING 0x00020000 // winnt Create heap call tracing enabled
1703 
1704 #define HEAP_SETTABLE_USER_VALUE 0x00000100
1705 #define HEAP_SETTABLE_USER_FLAG1 0x00000200
1706 #define HEAP_SETTABLE_USER_FLAG2 0x00000400
1707 #define HEAP_SETTABLE_USER_FLAG3 0x00000800
1708 #define HEAP_SETTABLE_USER_FLAGS 0x00000E00
1709 
1710 #define HEAP_CLASS_0 0x00000000 // process heap
1711 #define HEAP_CLASS_1 0x00001000 // private heap
1712 #define HEAP_CLASS_2 0x00002000 // Kernel Heap
1713 #define HEAP_CLASS_3 0x00003000 // GDI heap
1714 #define HEAP_CLASS_4 0x00004000 // User heap
1715 #define HEAP_CLASS_5 0x00005000 // Console heap
1716 #define HEAP_CLASS_6 0x00006000 // User Desktop heap
1717 #define HEAP_CLASS_7 0x00007000 // Csrss Shared heap
1718 #define HEAP_CLASS_8 0x00008000 // Csr Port heap
1719 #define HEAP_CLASS_MASK 0x0000F000
1720 
1721 #define HEAP_MAXIMUM_TAG 0x0FFF // winnt
1722 #define HEAP_GLOBAL_TAG 0x0800
1723 #define HEAP_PSEUDO_TAG_FLAG 0x8000 // winnt
1724 #define HEAP_TAG_SHIFT 16 // winnt
1725 #define HEAP_MAKE_TAG_FLAGS( b, o ) ((ULONG)((b) + ((o) << 16))) // winnt
1726 #define HEAP_TAG_MASK (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT)
1727 
1728 #define HEAP_CREATE_VALID_MASK (HEAP_NO_SERIALIZE | \
1729  HEAP_GROWABLE | \
1730  HEAP_GENERATE_EXCEPTIONS | \
1731  HEAP_ZERO_MEMORY | \
1732  HEAP_REALLOC_IN_PLACE_ONLY | \
1733  HEAP_TAIL_CHECKING_ENABLED | \
1734  HEAP_FREE_CHECKING_ENABLED | \
1735  HEAP_DISABLE_COALESCE_ON_FREE | \
1736  HEAP_CLASS_MASK | \
1737  HEAP_CREATE_ALIGN_16 | \
1738  HEAP_CREATE_ENABLE_TRACING)
1739 
1740 NTSYSAPI
1741 PVOID
1742 NTAPI
1744  IN PVOID HeapHandle
1745  );
1746 
1747 //
1748 // Heap allocation function (ala "malloc")
1749 //
1750 PVOID
1751 NTAPI
1753  HANDLE Heap,
1754  ULONG Flags,
1755  ULONG Size
1756  );
1757 
1758 //
1759 // Heap free function (ala "free")
1760 //
1761 BOOLEAN
1762 NTAPI
1763 RtlFreeHeap(
1764  HANDLE Heap,
1765  ULONG Flags,
1766  PVOID Address
1767  );
1768 
1769 
1770 NTSTATUS
1771 NTAPI
1772 NtCreateFile(
1774  IN ACCESS_MASK DesiredAccess,
1776  OUT PIO_STATUS_BLOCK IoStatusBlock,
1782  IN PVOID EaBuffer OPTIONAL,
1783  IN ULONG EaLength
1784  );
1785 
1786 NTSYSAPI
1787 NTSTATUS
1788 NTAPI
1789 NtOpenFile(
1790  OUT PHANDLE phFile,
1791  IN ACCESS_MASK DesiredAccess,
1793  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1794  IN ULONG ShareMode,
1795  IN ULONG OpenMode
1796 );
1797 
1798 NTSYSAPI
1799 NTSTATUS
1800 NTAPI
1802  IN HANDLE hFile,
1804  IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL,
1805  IN PVOID IoApcContext OPTIONAL,
1806  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1807  IN ULONG DeviceIoControlCode,
1808  IN PVOID InBuffer OPTIONAL,
1809  IN ULONG InBufferLength,
1810  OUT PVOID OutBuffer OPTIONAL,
1811  IN ULONG OutBufferLength
1812 );
1813 
1814 NTSYSAPI
1815 NTSTATUS
1816 NTAPI
1818  IN HANDLE hFile,
1820  IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL,
1821  IN PVOID IoApcContext OPTIONAL,
1822  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1823  IN ULONG DeviceIoControlCode,
1824  IN PVOID InBuffer OPTIONAL,
1825  IN ULONG InBufferLength,
1826  OUT PVOID OutBuffer OPTIONAL,
1827  IN ULONG OutBufferLength
1828 );
1829 
1830 NTSYSAPI
1831 NTSTATUS
1832 NTAPI
1833 NtReadFile(
1834  IN HANDLE hFile,
1836  IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL,
1837  IN PVOID IoApcContext OPTIONAL,
1838  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1840  IN ULONG ReadBufferLength,
1841  IN PLARGE_INTEGER FileOffset OPTIONAL,
1842  IN PULONG LockOperationKey
1843 );
1844 
1845 NTSYSAPI
1846 NTSTATUS
1847 NTAPI
1848 NtWriteFile(
1849  IN HANDLE hFile,
1851  IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL,
1852  IN PVOID IoApcContext OPTIONAL,
1853  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1855  IN ULONG WriteBufferLength,
1856  IN PLARGE_INTEGER FileOffset OPTIONAL,
1857  IN PULONG LockOperationKey OPTIONAL
1858 );
1859 
1860 NTSYSAPI
1861 NTSTATUS
1862 NTAPI
1864  IN HANDLE hFile,
1865  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1866  OUT PVOID FileInformationBuffer,
1867  IN ULONG FileInformationBufferLength,
1868  IN FILE_INFORMATION_CLASS FileInfoClass
1869 );
1870 
1871 NTSYSAPI
1872 NTSTATUS
1873 NTAPI
1875  IN HANDLE hFile,
1876  OUT PIO_STATUS_BLOCK pIoStatusBlock,
1877  IN PVOID FileInformationBuffer,
1878  IN ULONG FileInformationBufferLength,
1879  IN FILE_INFORMATION_CLASS FileInfoClass
1880 );
1881 
1882 NTSTATUS
1883 NTAPI
1884 NtClose(
1885  IN HANDLE Handle
1886  );
1887 
1888 NTSYSAPI
1889 NTSTATUS
1890 NTAPI
1892  IN HANDLE hObject,
1893  IN BOOLEAN bAlertable,
1895 );
1896 
1897 NTSTATUS
1898 NTAPI
1901  IN PLARGE_INTEGER DelayInterval
1902  );
1903 
1904 #ifdef __cplusplus
1905 };
1906 #endif //__cplusplus
1907 
1908 #endif //__NT_NATIVE_DEFS__H__
DWORD *typedef PVOID
Definition: winlogon.h:52
IN CINT OUT PVOID IN ULONG OUT PULONG ResultLength
Definition: conport.c:47
CSHORT Weekday
Definition: nt_native.h:534
CONST char * PCSZ
Definition: umtypes.h:120
NTSYSAPI VOID NTAPI RtlUpperString(PSTRING DestinationString, PSTRING SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:35
struct _KEY_VALUE_BASIC_INFORMATION * PKEY_VALUE_BASIC_INFORMATION
struct _KEY_NODE_INFORMATION * PKEY_NODE_INFORMATION
struct _FILE_BASIC_INFORMATION * PFILE_BASIC_INFORMATION
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
struct STARTUP_ARGUMENT * PSTARTUP_ARGUMENT
NTSYSAPI NTSTATUS NTAPI RtlCharToInteger(PCSZ String, ULONG Base, PULONG Value)
Definition: unicode.c:261
const uint16_t * PCWSTR
Definition: typedefs.h:56
enum _FILE_INFORMATION_CLASS * PFILE_INFORMATION_CLASS
#define IN
Definition: typedefs.h:39
NTSTATUS(* PRTL_QUERY_REGISTRY_ROUTINE)(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
Definition: nt_native.h:99
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
Definition: iofuncs.h:719
NTSYSAPI VOID NTAPI RtlMoveMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
CLIENT_ID * PCLIENT_ID
Definition: nt_native.h:1350
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
NTSYSAPI BOOLEAN NTAPI RtlTimeFieldsToTime(PTIME_FIELDS TimeFields, PLARGE_INTEGER Time)
PVOID ULONG Address
Definition: oprghdlr.h:14
struct _KEY_VALUE_BASIC_INFORMATION KEY_VALUE_BASIC_INFORMATION
VOID(* PIO_APC_ROUTINE)(IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
Definition: nt_native.h:877
static ACCESS_MASK const OBJECT_ATTRIBUTES ULONG TitleIndex
Definition: reg.c:130
ULONG Esp
Definition: nt_native.h:1479
#define DEVICE_TYPE
Definition: nt_native.h:578
PENVIRONMENT_INFORMATION Environment
Definition: nt_native.h:1556
void Fill(HDC hdc, LONG x, LONG y, COLORREF color)
Definition: drawing.cpp:109
NTSYSAPI LONG NTAPI RtlCompareString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
Type
Definition: Type.h:6
ULONG Eip
Definition: nt_native.h:1476
NTSYSAPI NTSTATUS NTAPI NtCreateThread(OUT PHANDLE phThread, IN ACCESS_MASK AccessMask, IN POBJECT_ATTRIBUTES ObjectAttributes, IN HANDLE hProcess, OUT PCLIENT_ID pClientId, IN PCONTEXT pContext, OUT PSTACKINFO pStackInfo, IN BOOLEAN bSuspended)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4692
struct _IO_TIMER * PIO_TIMER
Definition: nt_native.h:33
_In_ ULONG _In_ KEY_INFORMATION_CLASS KeyInformationClass
Definition: zwfuncs.h:166
enum _KEY_INFORMATION_CLASS KEY_INFORMATION_CLASS
struct _KEY_VALUE_ENTRY * PKEY_VALUE_ENTRY
FLOATING_SAVE_AREA FloatSave
Definition: nt_native.h:1446
struct _KEY_VALUE_ENTRY KEY_VALUE_ENTRY
struct _KEY_VALUE_FULL_INFORMATION KEY_VALUE_FULL_INFORMATION
ACCESS_MASK GenericRead
Definition: nt_native.h:565
struct _FILE_DISPOSITION_INFORMATION * PFILE_DISPOSITION_INFORMATION
LARGE_INTEGER LastAccessTime
Definition: nt_native.h:940
CONTEXT * PCONTEXT
Definition: nt_native.h:1486
__wchar_t WCHAR
Definition: xmlstorage.h:180
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeToString(PUNICODE_STRING Destination, PWSTR Source)
UNICODE_STRING CommandLine
Definition: nt_native.h:1547
PRTL_HEAP_COMMIT_ROUTINE CommitRoutine
Definition: nt_native.h:1676
char CHAR
Definition: xmlstorage.h:175
_In_ PCWSTR _In_z_ PCWSTR _In_ ULONG ValueType
Definition: rtlfuncs.h:3857
ULONG Ecx
Definition: nt_native.h:1467
struct _KEY_WRITE_TIME_INFORMATION * PKEY_WRITE_TIME_INFORMATION
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer
Definition: iofuncs.h:835
NTSYSAPI NTSTATUS NTAPI NtQueryInformationFile(IN HANDLE hFile, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID FileInformationBuffer, IN ULONG FileInformationBufferLength, IN FILE_INFORMATION_CLASS FileInfoClass)
#define ReadBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:339
struct _KEY_BASIC_INFORMATION KEY_BASIC_INFORMATION
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2303
struct _EPROCESS * PEPROCESS
Definition: nt_native.h:30
ULONG DataLength
Definition: nt_native.h:1174
struct _GENERIC_MAPPING GENERIC_MAPPING
PVOID *typedef PWSTR
Definition: winlogon.h:57
FLOATING_SAVE_AREA * PFLOATING_SAVE_AREA
Definition: nt_native.h:1394
_FSINFOCLASS
Definition: nt_native.h:995
struct _IO_STATUS_BLOCK IO_STATUS_BLOCK
_In_ BOOL _In_ HANDLE hProcess
Definition: mapping.h:70
_KEY_INFORMATION_CLASS
Definition: nt_native.h:1130
struct _CALLBACK_OBJECT * PCALLBACK_OBJECT
Definition: nt_native.h:35
ULONG SegGs
Definition: nt_native.h:1453
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)
ULONG SegFs
Definition: nt_native.h:1454
struct RTL_HEAP_DEFINITION * PRTL_HEAP_DEFINITION
ULONG SegDs
Definition: nt_native.h:1456
UNICODE_STRING Name
Definition: nt_native.h:1270
IN POBJECT_ATTRIBUTES PortAttributes IN ACCESS_MASK DesiredAccess
Definition: creport.c:28
ULONG DeCommitFreeBlockThreshold
Definition: nt_native.h:1670
_Must_inspect_result_ _In_ ULONG Index
Definition: fltkernel.h:1824
struct _FILE_POSITION_INFORMATION FILE_POSITION_INFORMATION
struct _ACPI_EFI_FILE_HANDLE CHAR16 UINT64 OpenMode
Definition: acefiex.h:335
HANDLE UniqueProcess
Definition: compat.h:474
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: file.c:104
NTSYSAPI BOOLEAN NTAPI RtlEqualString(PSTRING String1, PSTRING String2, BOOLEAN CaseInSensitive)
#define NTSYSAPI
Definition: ntoskrnl.h:14
PVOID pContext
Definition: ddkmapi.h:96
struct _CONTEXT CONTEXT
struct _FILE_NETWORK_OPEN_INFORMATION FILE_NETWORK_OPEN_INFORMATION
ULONG Dr7
Definition: nt_native.h:1439
ULONG Dr3
Definition: nt_native.h:1437
_SECTION_INHERIT
Definition: nt_native.h:1277
HANDLE hObject
Definition: wglext.h:924
NTSYSAPI NTSTATUS NTAPI NtEnumerateKey(IN HANDLE KeyHandle, IN ULONG Index, IN KEY_INFORMATION_CLASS KeyInformationClass, IN PVOID KeyInformation, IN ULONG Length, IN PULONG ResultLength)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
static HANDLE hEvent
Definition: comm.c:54
ULONG TopOfStack
Definition: nt_native.h:1603
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG CreateDisposition
Definition: fltkernel.h:1230
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
TIME_FIELDS * PTIME_FIELDS
Definition: nt_native.h:536
struct _KEY_WRITE_TIME_INFORMATION KEY_WRITE_TIME_INFORMATION
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
struct _KTHREAD * PKTHREAD
Definition: nt_native.h:28
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
CHAR16 * String
Definition: acefiex.h:201
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
Definition: nt_native.h:109
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PUNICODE_STRING ValueName
Definition: nt_native.h:1173
VOID NTAPI RtlAssert(IN PVOID FailedAssertion, IN PVOID FileName, IN ULONG LineNumber, IN PCHAR Message OPTIONAL)
Definition: rtlcompat.c:64
KSTART_ROUTINE * PKSTART_ROUTINE
Definition: ketypes.h:472
long LONG
Definition: pedump.c:60
_In_ const STRING _In_ BOOLEAN CaseInSensitive
Definition: rtlfuncs.h:2252
struct _RTL_HEAP_DEFINITION RTL_HEAP_DEFINITION
ACCESS_MASK GenericExecute
Definition: nt_native.h:567
ULONG SegEs
Definition: nt_native.h:1455
struct _IO_STATUS_BLOCK * PIO_STATUS_BLOCK
ULONG Esi
Definition: nt_native.h:1464
CSHORT Second
Definition: nt_native.h:532
enum _KEY_SET_INFORMATION_CLASS KEY_SET_INFORMATION_CLASS
ACCESS_MASK GenericWrite
Definition: nt_native.h:566
struct _KEY_BASIC_INFORMATION * PKEY_BASIC_INFORMATION
struct _RTL_QUERY_REGISTRY_TABLE * PRTL_QUERY_REGISTRY_TABLE
Definition: reg.c:122
ULONG Dr1
Definition: nt_native.h:1435
ULONG SegCs
Definition: nt_native.h:1477
struct _OBJECT_NAME_INFORMATION OBJECT_NAME_INFORMATION
struct _TIME_FIELDS TIME_FIELDS
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
Definition: rtlfuncs.h:3845
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1845
ULONG Edx
Definition: nt_native.h:1466
struct _FILE_DISPOSITION_INFORMATION FILE_DISPOSITION_INFORMATION
struct StackInfo_t STACKINFO
_FILE_INFORMATION_CLASS
Definition: nt_native.h:890
NTSYSAPI VOID NTAPI RtlCopyString(PSTRING DestinationString, PSTRING SourceString)
LARGE_INTEGER EndOfFile
Definition: nt_native.h:948
CSHORT Day
Definition: nt_native.h:529
NTSYSAPI PVOID NTAPI RtlDestroyHeap(IN PVOID HeapHandle)
LARGE_INTEGER CurrentByteOffset
Definition: nt_native.h:955
UNICODE_STRING ImageFile
Definition: nt_native.h:1548
ULONG EFlags
Definition: nt_native.h:1478
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG ShareAccess
Definition: fltkernel.h:1230
struct _KINTERRUPT * PKINTERRUPT
Definition: nt_native.h:32
ULONG Dr2
Definition: nt_native.h:1436
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
ULONG Ebx
Definition: nt_native.h:1465
CSHORT Milliseconds
Definition: nt_native.h:533
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
Definition: fltkernel.h:1230
struct _KEY_NODE_INFORMATION KEY_NODE_INFORMATION
#define CONST
Definition: compiler.h:170
NTSTATUS Status
Definition: nt_native.h:867
NTSTATUS NTAPI NtDelayExecution(IN BOOLEAN Alertable, IN PLARGE_INTEGER DelayInterval)
Definition: wait.c:879
ULONG ContextFlags
Definition: compat.h:331
struct _FILE_END_OF_FILE_INFORMATION * PFILE_END_OF_FILE_INFORMATION
UINTN Size
Definition: acefiex.h:550
CSHORT Hour
Definition: nt_native.h:530
NTSYSAPI NTSTATUS NTAPI NtDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName)
Definition: ntapi.c:744
UCHAR RegisterArea[SIZE_OF_80387_REGISTERS]
Definition: nt_native.h:1390
#define UNALIGNED
Definition: crtdefs.h:132
_In_ HANDLE Handle
Definition: extypes.h:390
CSHORT Month
Definition: nt_native.h:528
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:3508
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
NTSYSAPI NTSTATUS NTAPI RtlUpcaseUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
Definition: string_lib.cpp:46
unsigned char BOOLEAN
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
CSHORT Minute
Definition: nt_native.h:531
NTSTATUS NtTerminateThread(IN HANDLE ThreadHandle OPTIONAL, IN NTSTATUS ExitStatus)
Definition: kill.c:1278
ULONG VirtualMemoryThreshold
Definition: nt_native.h:1673
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:941
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)
enum _FSINFOCLASS FS_INFORMATION_CLASS
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)
NTSYSAPI ULONG NTAPI RtlEqualMemory(CONST VOID *Source1, CONST VOID *Source2, ULONG Length)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG EaLength
Definition: fltkernel.h:1241
NTSYSAPI NTSTATUS NTAPI NtReadFile(IN HANDLE hFile, IN HANDLE hEvent OPTIONAL, IN PIO_APC_ROUTINE IoApcRoutine OPTIONAL, IN PVOID IoApcContext OPTIONAL, OUT PIO_STATUS_BLOCK pIoStatusBlock, OUT PVOID ReadBuffer, IN ULONG ReadBufferLength, IN PLARGE_INTEGER FileOffset OPTIONAL, IN PULONG LockOperationKey)
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
_Inout_ PVOID * CommitAddress
Definition: rtltypes.h:574
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID _In_ ULONG_PTR _In_ SIZE_T CommitSize
Definition: mmfuncs.h:404
struct _FILE_ALIGNMENT_INFORMATION FILE_ALIGNMENT_INFORMATION
ULONG Type
Definition: nt_native.h:1176
struct _KEY_FULL_INFORMATION KEY_FULL_INFORMATION
_In_ ACCESS_MASK AccessMask
Definition: exfuncs.h:186
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:1117
_In_ GUID _In_ PVOID ValueData
Definition: hubbusif.h:311
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2781
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG CreateOptions
Definition: fltkernel.h:1230
struct ENVIRONMENT_INFORMATION * PENVIRONMENT_INFORMATION
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:1107
struct _FILE_STANDARD_INFORMATION FILE_STANDARD_INFORMATION
LARGE_INTEGER AllocationSize
Definition: nt_native.h:947
struct _RTL_QUERY_REGISTRY_TABLE RTL_QUERY_REGISTRY_TABLE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3392
NTSYSAPI CHAR NTAPI RtlUpperChar(CHAR Character)
HANDLE UniqueThread
Definition: compat.h:475
CHAR Message[80]
Definition: alive.c:5
struct _FILE_STANDARD_INFORMATION * PFILE_STANDARD_INFORMATION
NTSYSAPI VOID NTAPI RtlFillMemory(VOID UNALIGNED *Destination, ULONG Length, UCHAR Fill)
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _OBJECT_TYPE * POBJECT_TYPE
Definition: nt_native.h:34
enum _FSINFOCLASS * PFS_INFORMATION_CLASS
LARGE_INTEGER CreationTime
Definition: nt_native.h:939
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1845
VOID UINTN Length
Definition: acefiex.h:718
_In_ GUID _In_ PVOID _In_ ULONG ValueLength
Definition: hubbusif.h:311
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:411
#define VOID
Definition: acefi.h:69
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)
struct _FILE_FS_DEVICE_INFORMATION FILE_FS_DEVICE_INFORMATION
NTSYSAPI ULONG NTAPI RtlCompareMemory(PVOID Source1, PVOID Source2, ULONG Length)
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)
ULONG OnePageBelowTopOfStack
Definition: nt_native.h:1604
PBYTE Character
Definition: device.h:83
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock
Definition: CrNtStubs.h:75
GENERIC_MAPPING * PGENERIC_MAPPING
Definition: nt_native.h:570
ULONG Eax
Definition: nt_native.h:1468
_In_ HANDLE hFile
Definition: mswsock.h:90
struct _CLIENT_ID CLIENT_ID
struct _FILE_ALIGNMENT_INFORMATION * PFILE_ALIGNMENT_INFORMATION
NTSYSAPI VOID NTAPI RtlCopyMemory32(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
_In_opt_ PVOID HeapBase
Definition: rtlfuncs.h:2169
ULONG PVOID Reserved
Definition: ntimage.h:533
struct _RTL_HEAP_PARAMETERS * PRTL_HEAP_PARAMETERS
UINT64 UINTN DataSize
Definition: acefiex.h:494
UINTN UINT8 Value
Definition: acefiex.h:725
LARGE_INTEGER ChangeTime
Definition: nt_native.h:942
NTSYSAPI VOID NTAPI RtlInitString(PSTRING DestinationString, PCSZ SourceString)
struct _FILE_BASIC_INFORMATION FILE_BASIC_INFORMATION
#define NLS_MB_CODE_PAGE_TAG
Definition: nt_native.h:212
CSHORT Year
Definition: nt_native.h:527
struct _FILE_FULL_EA_INFORMATION * PFILE_FULL_EA_INFORMATION
ACPI_EFI_STATUS ExitStatus
Definition: acefiex.h:480
NTSTATUS NTAPI NtDisplayString(PUNICODE_STRING String)
NTSYSAPI ULONG NTAPI RtlxAnsiStringToUnicodeSize(PANSI_STRING AnsiString)
static HANDLE FileHandle
Definition: cabinet.c:47
ULONG DataOffset
Definition: nt_native.h:1175
ULONG Unknown2
Definition: nt_native.h:1602
DWORD *typedef HANDLE
Definition: winlogon.h:52
LONG NTSTATUS
Definition: DriverTester.h:11
static ULONG Timeout
Definition: ping.c:61
ULONG SegSs
Definition: nt_native.h:1480
Definition: ntddk_ex.h:242
struct _KEY_FULL_INFORMATION * PKEY_FULL_INFORMATION
unsigned short USHORT
Definition: pedump.c:61
PVOID NTAPI RtlAllocateHeap(HANDLE Heap, ULONG Flags, ULONG Size)
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER AllocationSize
Definition: fltkernel.h:1230
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
ULONG Dr6
Definition: nt_native.h:1438
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
_KEY_VALUE_INFORMATION_CLASS
Definition: nt_native.h:1179
unsigned int * PULONG
Definition: retypes.h:1
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
Definition: ntapi.c:617
_In_opt_ PVOID _In_opt_ SIZE_T ReserveSize
Definition: rtlfuncs.h:2169
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
struct _RTL_HEAP_PARAMETERS RTL_HEAP_PARAMETERS
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1195
struct _FLOATING_SAVE_AREA FLOATING_SAVE_AREA
struct StackInfo_t * PSTACKINFO
struct _FILE_END_OF_FILE_INFORMATION FILE_END_OF_FILE_INFORMATION
struct _FILE_NETWORK_OPEN_INFORMATION * PFILE_NETWORK_OPEN_INFORMATION
_KEY_SET_INFORMATION_CLASS
Definition: nt_native.h:1140
_In_ PLARGE_INTEGER FileOffset
Definition: cctypes.h:53
struct _FILE_FS_DEVICE_INFORMATION * PFILE_FS_DEVICE_INFORMATION
_In_ const STRING * String2
Definition: rtlfuncs.h:2221
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: ntapi.c:120
ULONG Dr0
Definition: nt_native.h:1434
signed char * PCHAR
Definition: retypes.h:7
struct _FILE_POSITION_INFORMATION * PFILE_POSITION_INFORMATION
#define NLS_MB_OEM_CODE_PAGE_TAG
Definition: nt_native.h:213
#define OUT
Definition: typedefs.h:40
BOOLEAN NTAPI RtlFreeHeap(HANDLE Heap, ULONG Flags, PVOID Address)
Definition: heap.c:2158
Definition: nt_native.h:1172
ULONG BottomOfStack
Definition: nt_native.h:1605
struct tagContext Context
Definition: acpixf.h:1013
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToInteger(PUNICODE_STRING String, ULONG Base, PULONG Value)
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI LONG NTAPI RtlCompareUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
Definition: string_lib.cpp:31
NTSYSAPI VOID NTAPI RtlTimeToTimeFields(PLARGE_INTEGER Time, PTIME_FIELDS TimeFields)
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtTerminateProcess(HANDLE ProcessHandle, LONG ExitStatus)
struct _DEVICE_HANDLER_OBJECT * PDEVICE_HANDLER_OBJECT
Definition: nt_native.h:36
struct _BUS_HANDLER * PBUS_HANDLER
Definition: nt_native.h:37
struct _FILE_FULL_EA_INFORMATION FILE_FULL_EA_INFORMATION
#define NTSTATUS
Definition: env_spec_w32.h:77
struct _ETHREAD * PETHREAD
Definition: nt_native.h:29
ACCESS_MASK GenericAll
Definition: nt_native.h:568
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:1100
_In_ ULONG _In_ KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass
Definition: cmfuncs.h:93
_In_ PSID _In_ BOOLEAN AllocateDestinationString
Definition: rtlfuncs.h:1297
#define SIZE_OF_80387_REGISTERS
Definition: nt_native.h:1356
_In_ HANDLE ProcessHandle
Definition: mmfuncs.h:403
static PTIME_FIELDS TimeFields
Definition: time.c:27
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:1137
ULONG Unknown1
Definition: nt_native.h:1601
short CSHORT
Definition: umtypes.h:122
NTSYSAPI VOID NTAPI RtlZeroMemory(VOID UNALIGNED *Destination, ULONG Length)
enum _SECTION_INHERIT SECTION_INHERIT
NTSTATUS(* PRTL_HEAP_COMMIT_ROUTINE)(IN PVOID Base, IN OUT PVOID *CommitAddress, IN OUT PULONG CommitSize)
Definition: nt_native.h:1660
ULONG DeCommitTotalFreeThreshold
Definition: nt_native.h:1671
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
IN HDEVINFO IN PSP_DEVINFO_DATA DeviceInfoData OPTIONAL
Definition: devinst.c:44
ULONG ACCESS_MASK
Definition: nt_native.h:40
static PLARGE_INTEGER Time
Definition: time.c:28
ULONG Ebp
Definition: nt_native.h:1475
#define WriteBuffer(BaseIoAddress, Buffer, Count)
Definition: atapi.h:344
struct _KEY_VALUE_FULL_INFORMATION * PKEY_VALUE_FULL_INFORMATION
struct _PEB * PPEB
Definition: nt_native.h:31
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:2797
IN SCSI_ADAPTER_CONTROL_TYPE IN PVOID Parameters
Definition: srb.h:488
enum _KEY_VALUE_INFORMATION_CLASS KEY_VALUE_INFORMATION_CLASS
Definition: reg.c:135
ULONG Edi
Definition: nt_native.h:1463
struct _OBJECT_NAME_INFORMATION * POBJECT_NAME_INFORMATION
NTSYSAPI NTSTATUS NTAPI NtWaitForSingleObject(IN HANDLE hObject, IN BOOLEAN bAlertable, IN PLARGE_INTEGER Timeout)