2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: System call definitions
5 * FILE: include/ddk/zw.h
7 * ??/??/??: First few functions (David Welch)
8 * ??/??/??: Complete implementation by Boudewijn Dekker
9 * 13/07/98: Reorganised things a bit (David Welch)
18 * FUNCTION: Closes an object handle
20 * Handle = Handle to the object
23 NTSTATUS
ZwClose(HANDLE Handle
);
26 * FUNCTION: Creates or opens a directory object, which is a container for
29 * DirectoryHandle (OUT) = Points to a variable which stores the
30 * handle for the directory on success
31 * DesiredAccess = Type of access the caller requires to the directory
32 * ObjectAttributes = Structures specifing the object attributes,
33 * initialized with InitializeObjectAttributes
36 NTSTATUS
ZwCreateDirectoryObject(PHANDLE DirectoryHandle
,
37 ACCESS_MASK DesiredAccess
,
38 POBJECT_ATTRIBUTES ObjectAttributes
);
41 * FUNCTION: Creates or opens a registry key
43 * KeyHandle (OUT) = Points to a variable which stores the handle
44 * for the key on success
45 * DesiredAccess = Access desired by the caller to the key
46 * ObjectAttributes = Initialized object attributes for the key
47 * TitleIndex = Who knows?
48 * Class = Object class of the key?
49 * CreateOptions = Options for the key creation
50 * Disposition (OUT) = Points to a variable which a status value
51 * indicating whether a new key was created
54 NTSTATUS
ZwCreateKey(PHANDLE KeyHandle
, ACCESS_MASK DesiredAccess
,
55 POBJECT_ATTRIBUTES ObjectAttributes
,
56 ULONG TitleIndex
, PUNICODE_STRING Class
,
57 ULONG CreateOptions
, PULONG Disposition
);
60 * FUNCTION: Deletes a registry key
62 * KeyHandle = Handle of the key
65 NTSTATUS
ZwDeleteKey(HANDLE KeyHandle
);
68 * FUNCTION: Returns information about the subkeys of an open key
70 * KeyHandle = Handle of the key whose subkeys are to enumerated
71 * Index = zero based index of the subkey for which information is
73 * KeyInformationClass = Type of information returned
74 * KeyInformation (OUT) = Caller allocated buffer for the information
76 * Length = Length in bytes of the KeyInformation buffer
77 * ResultLength (OUT) = Caller allocated storage which holds
78 * the number of bytes of information retrieved
82 NTSTATUS
ZwEnumerateKey(HANDLE KeyHandle
, ULONG Index
,
83 KEY_INFORMATION_CLASS KeyInformationClass
,
84 PVOID KeyInformation
, ULONG Length
,
88 * FUNCTION: Returns information about the value entries of an open key
90 * KeyHandle = Handle of the key whose value entries are to enumerated
91 * Index = zero based index of the subkey for which information is
93 * KeyInformationClass = Type of information returned
94 * KeyInformation (OUT) = Caller allocated buffer for the information
96 * Length = Length in bytes of the KeyInformation buffer
97 * ResultLength (OUT) = Caller allocated storage which holds
98 * the number of bytes of information retrieved
102 NTSTATUS
ZwEnumerateValueKey(HANDLE KeyHandle
, ULONG Index
,
103 KEY_VALUE_INFORMATION_CLASS KeyInformationClass
,
104 PVOID KeyInformation
, ULONG Length
,
105 PULONG ResultLength
);
109 * FUNCTION: Forces a registry key to be committed to disk
111 * KeyHandle = Handle of the key to be written to disk
114 NTSTATUS
ZwFlushKey(HANDLE KeyHandle
);
117 * FUNCTION: Changes the attributes of an object to temporary
119 * Handle = Handle for the object
122 NTSTATUS
ZwMakeTemporaryObject(HANDLE Handle
);
125 * FUNCTION: Maps a view of a section into the virtual address space of a
128 * SectionHandle = Handle of the section
129 * ProcessHandle = Handle of the process
130 * BaseAddress = Desired base address (or NULL) on entry
131 * Actual base address of the view on exit
132 * ZeroBits = Number of high order address bits that must be zero
133 * CommitSize = Size in bytes of the initially committed section of
135 * SectionOffset = Offset in bytes from the beginning of the section
136 * to the beginning of the view
137 * ViewSize = Desired length of map (or zero to map all) on entry
138 * Actual length mapped on exit
139 * InheritDisposition = Specified how the view is to be shared with
141 * AllocateType = Type of allocation for the pages
142 * Protect = Protection for the committed region of the view
145 NTSTATUS
ZwMapViewOfSection(HANDLE SectionHandle
,
146 HANDLE ProcessHandle
,
150 PLARGE_INTEGER SectionOffset
,
152 SECTION_INHERIT InheritDisposition
,
153 ULONG AllocationType
,
157 * FUNCTION: Opens an existing key in the registry
159 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
160 * DesiredAccess = Requested access to the key
161 * ObjectAttribute = Initialized attributes for the object
164 NTSTATUS
ZwOpenKey(PHANDLE KeyHandle
, ACCESS_MASK DesiredAccess
,
165 POBJECT_ATTRIBUTES ObjectAttributes
);
168 * FUNCTION: Opens an existing section object
170 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
171 * DesiredAccess = Requested access to the key
172 * ObjectAttribute = Initialized attributes for the object
175 NTSTATUS
ZwOpenSection(PHANDLE KeyHandle
, ACCESS_MASK DesiredAccess
,
176 POBJECT_ATTRIBUTES ObjectAttributes
);
179 * FUNCTION: Returns information about an open file
181 * FileHandle = Handle of the file to be queried
182 * IoStatusBlock (OUT) = Caller supplied storage for the result
183 * FileInformation (OUT) = Caller supplied storage for the file
185 * Length = Length in bytes of the buffer for file information
186 * FileInformationClass = Type of information to be returned
189 NTSTATUS
ZwQueryInformationFile(HANDLE FileHandle
,
190 PIO_STATUS_BLOCK IoStatusBlock
,
191 PVOID FileInformation
,
193 FILE_INFORMATION_CLASS FileInformationClass
);
200 #endif /* __cplusplus */
202 #include <kernel32/heap.h>
204 #if KERNEL_SUPPORTS_OBJECT_ATTRIBUTES_CORRECTLY
205 typedef struct _OBJECT_ATTRIBUTES
{
207 HANDLE RootDirectory
;
208 PUNICODE_STRING ObjectName
;
210 SECURITY_DESCRIPTOR
*SecurityDescriptor
;
211 SECURITY_QUALITY_OF_SERVICE
*SecurityQualityOfService
;
212 } OBJECT_ATTRIBUTES
, *POBJECT_ATTRIBUTES
;
215 #if IOTYPES_DIDNT_DECLARE_THIS
216 typedef struct _IO_STATUS_BLOCK
{
219 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
223 //typedef LARGE_INTEGER *PLARGE_INTEGER;
227 #define NtCurrentProcess() ( (HANDLE) 0xFFFFFFFF )
228 #define NtCurrentThread() ( (HANDLE) 0xFFFFFFFE )
234 #define EVENT_READ_ACCESS 0x0001
235 #define EVENT_WRITE_ACCESS 0x0002
238 //process query / set information class
240 #define ProcessBasicInformation 0
241 #define ProcessQuotaLimits 1
242 #define ProcessIoCounters 2
243 #define ProcessVmCounters 3
244 #define ProcessTimes 4
245 #define ProcessBasePriority 5
246 #define ProcessRaisePriority 6
247 #define ProcessDebugPort 7
248 #define ProcessExceptionPort 8
249 #define ProcessAccessToken 9
250 #define ProcessLdtInformation 10
251 #define ProcessLdtSize 11
252 #define ProcessDefaultHardErrorMode 12
253 #define ProcessIoPortHandlers 13
254 #define ProcessPooledUsageAndLimits 14
255 #define ProcessWorkingSetWatch 15
256 #define ProcessUserModeIOPL 16
257 #define ProcessEnableAlignmentFaultFixup 17
258 #define ProcessPriorityClass 18
259 #define ProcessWx86Information 19
260 #define ProcessHandleCount 20
261 #define ProcessAffinityMask 21
262 #define MaxProcessInfoClass 22
264 // thread query / set information class
266 #define ThreadBasicInformation 0
267 #define ThreadTimes 1
268 #define ThreadPriority 2
269 #define ThreadBasePriority 3
270 #define ThreadAffinityMask 4
271 #define ThreadImpersonationToken 5
272 #define ThreadDescriptorTableEntry 6
273 #define ThreadEnableAlignmentFaultFixup 7
274 #define ThreadEventPair 8
275 #define ThreadQuerySetWin32StartAddress 9
276 #define ThreadZeroTlsCell 10
277 #define ThreadPerformanceCount 11
278 #define ThreadAmILastThread 12
279 #define ThreadIdealProcessor 13
280 #define ThreadPriorityBoost 14
281 #define MaxThreadInfoClass 15
284 // key query information class
286 #define KeyBasicInformation 0
287 #define KeyNodeInformation 1
288 #define KeyFullInformation 2
291 // key set information class
293 #define KeyWriteTimeInformation 0
295 // key value information class
297 #define KeyValueBasicInformation 0
298 #define KeyValueFullInformation 1
299 #define KeyValuePartialInformation 2
301 // object handle information
303 #define HandleBasicInformation 4
305 // system information
307 #define SystemTimeAdjustmentInformation 28
313 #define FileDirectoryInformation 1
314 #define FileFullDirectoryInformation 2
315 #define FileBothDirectoryInformation 3
316 #define FileBasicInformation 4
317 #define FileStandardInformation 5
318 #define FileInternalInformation 6
319 #define FileEaInformation 7
320 #define FileAccessInformation 8
321 #define FileNameInformation 9
322 #define FileRenameInformation 10
323 #define FileLinkInformation 11
324 #define FileNamesInformation 12
325 #define FileDispositionInformation 13
326 #define FilePositionInformation 14
327 #define FileFullEaInformation 15
328 #define FileModeInformation 16
329 #define FileAlignmentInformation 17
330 #define FileAllInformation 18
331 #define FileAllocationInformation 19
332 #define FileEndOfFileInformation 20
333 #define FileAlternateNameInformation 21
334 #define FileStreamInformation 22
335 #define FilePipeInformation 23
336 #define FilePipeLocalInformation 24
337 #define FilePipeRemoteInformation 25
338 #define FileMailslotQueryInformation 26
339 #define FileMailslotSetInformation 27
340 #define FileCompressionInformation 28
341 #define FileCopyOnWriteInformation 29
342 #define FileCompletionInformation 30
343 #define FileMoveClusterInformation 31
344 #define FileOleClassIdInformation 32
345 #define FileOleStateBitsInformation 33
346 #define FileNetworkOpenInformation 34
347 #define FileObjectIdInformation 35
348 #define FileOleAllInformation 36
349 #define FileOleDirectoryInformation 37
350 #define FileContentIndexInformation 38
351 #define FileInheritContentIndexInformation 39
352 #define FileOleInformation 40
353 #define FileMaximumInformation 41
357 //file system information class values
361 #define FileFsVolumeInformation 1
362 #define FileFsLabelInformation 2
363 #define FileFsSizeInformation 3
364 #define FileFsDeviceInformation 4
365 #define FileFsAttributeInformation 5
366 #define FileFsControlInformation 6
367 #define FileFsQuotaQueryInformation 7
368 #define FileFsQuotaSetInformation 8
369 #define FileFsMaximumInformation 9
379 #define REG_WHOLE_HIVE_VOLATILE (0x00000001L)
380 #define REG_REFRESH_HIVE (0x00000002L)
383 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
385 // object type access rights
387 #define OBJECT_TYPE_CREATE (0x0001)
388 #define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
391 // directory access rights
393 #define DIRECTORY_QUERY (0x0001)
394 #define DIRECTORY_TRAVERSE (0x0002)
395 #define DIRECTORY_CREATE_OBJECT (0x0004)
396 #define DIRECTORY_CREATE_SUBDIRECTORY (0x0008)
398 #define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF)
400 // symbolic link access rights
402 #define SYMBOLIC_LINK_QUERY (0x0001)
403 #define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1)
405 typedef struct _PROCESS_WS_WATCH_INFORMATION
{
408 } PROCESS_WS_WATCH_INFORMATION
, *PPROCESS_WS_WATCH_INFORMATION
;
410 typedef struct _PROCESS_BASIC_INFORMATION
{
413 KAFFINITY AffinityMask
;
414 KPRIORITY BasePriority
;
415 ULONG UniqueProcessId
;
416 ULONG InheritedFromUniqueProcessId
;
417 } PROCESS_BASIC_INFORMATION
, *PPROCESS_BASIC_INFORMATION
;
419 typedef struct _QUOTA_LIMITS
{
420 ULONG PagedPoolLimit
;
421 ULONG NonPagedPoolLimit
;
422 ULONG MinimumWorkingSetSize
;
423 ULONG MaximumWorkingSetSize
;
425 LARGE_INTEGER TimeLimit
;
426 } QUOTA_LIMITS
, *PQUOTA_LIMITS
;
428 typedef struct _IO_COUNTERS
{
429 ULONG ReadOperationCount
;
430 ULONG WriteOperationCount
;
431 ULONG OtherOperationCount
;
432 LARGE_INTEGER ReadTransferCount
;
433 LARGE_INTEGER WriteTransferCount
;
434 LARGE_INTEGER OtherTransferCount
;
435 } IO_COUNTERS
, *PIO_COUNTERS
;
438 typedef struct _VM_COUNTERS
{
439 ULONG PeakVirtualSize
;
441 ULONG PageFaultCount
;
442 ULONG PeakWorkingSetSize
;
443 ULONG WorkingSetSize
;
444 ULONG QuotaPeakPagedPoolUsage
;
445 ULONG QuotaPagedPoolUsage
;
446 ULONG QuotaPeakNonPagedPoolUsage
;
447 ULONG QuotaNonPagedPoolUsage
;
449 ULONG PeakPagefileUsage
;
450 } VM_COUNTERS
, *PVM_COUNTERS
;
453 typedef struct _POOLED_USAGE_AND_LIMITS
{
454 ULONG PeakPagedPoolUsage
;
455 ULONG PagedPoolUsage
;
456 ULONG PagedPoolLimit
;
457 ULONG PeakNonPagedPoolUsage
;
458 ULONG NonPagedPoolUsage
;
459 ULONG NonPagedPoolLimit
;
460 ULONG PeakPagefileUsage
;
463 } POOLED_USAGE_AND_LIMITS
, *PPOOLED_USAGE_AND_LIMITS
;
466 typedef struct _PROCESS_ACCESS_TOKEN
{
470 } PROCESS_ACCESS_TOKEN
, *PPROCESS_ACCESS_TOKEN
;
472 typedef struct _KERNEL_USER_TIMES
{
473 LARGE_INTEGER CreateTime
;
474 LARGE_INTEGER ExitTime
;
475 LARGE_INTEGER KernelTime
;
476 LARGE_INTEGER UserTime
;
478 typedef KERNEL_USER_TIMES
*PKERNEL_USER_TIMES
;
480 // exception structures
483 #define TEB_EXCEPTION_FRAME(pcontext) ((PEXCEPTION_FRAME)((TEB *)GET_SEL_BASE((pcontext)->SegFs))->except)
486 typedef struct _OBJECT_NAME_INFORMATION
{
488 } OBJECT_NAME_INFORMATION
, *POBJECT_NAME_INFORMATION
;
491 // section information
494 // handle information
496 //#define HANDLE_FLAG_INHERIT 0x00000001
497 //#define HANDLE_FLAG_PROTECT_FROM_CLOSE 0x00000002
500 typedef struct _HANDLE_INFO
503 BOOL bProtectFromClose
;
505 typedef HANDLE_INFO
*PHANDLE_INFO
;
509 typedef struct _SYSTEM_TIME_ADJUSTMENT
511 DWORD dwTimeAdjustment
;
512 BOOL bTimeAdjustmentDisabled
;
513 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
518 // asynchorneous procedure call
521 typedef struct _FILE_BASIC_INFORMATION
{
522 LARGE_INTEGER CreationTime
;
523 LARGE_INTEGER LastAccessTime
;
524 LARGE_INTEGER LastWriteTime
;
525 LARGE_INTEGER ChangeTime
;
526 ULONG FileAttributes
;
527 } FILE_BASIC_INFORMATION
, *PFILE_BASIC_INFORMATION
;
529 typedef struct _FILE_STANDARD_INFORMATION
{
530 LARGE_INTEGER AllocationSize
;
531 LARGE_INTEGER EndOfFile
;
533 BOOLEAN DeletePending
;
535 } FILE_STANDARD_INFORMATION
, *PFILE_STANDARD_INFORMATION
;
537 typedef struct _FILE_POSITION_INFORMATION
{
538 LARGE_INTEGER CurrentByteOffset
;
539 } FILE_POSITION_INFORMATION
, *PFILE_POSITION_INFORMATION
;
541 typedef struct _FILE_ALIGNMENT_INFORMATION
{
542 ULONG AlignmentRequirement
;
543 } FILE_ALIGNMENT_INFORMATION
, *PFILE_ALIGNMENT_INFORMATION
;
545 typedef struct _FILE_DISPOSITION_INFORMATION
{
547 } FILE_DISPOSITION_INFORMATION
, *PFILE_DISPOSITION_INFORMATION
;
549 typedef struct _FILE_END_OF_FILE_INFORMATION
{
550 LARGE_INTEGER EndOfFile
;
551 } FILE_END_OF_FILE_INFORMATION
, *PFILE_END_OF_FILE_INFORMATION
;
554 typedef struct _FILE_FULL_EA_INFORMATION
{
555 ULONG NextEntryOffset
;
558 USHORT EaValueLength
;
560 } FILE_FULL_EA_INFORMATION
;
561 typedef FILE_FULL_EA_INFORMATION
*PFILE_FULL_EA_INFORMATION
;
565 // file system information structures
567 typedef struct _FILE_FS_DEVICE_INFORMATION
{
568 DEVICE_TYPE DeviceType
;
569 ULONG Characteristics
;
570 } FILE_FS_DEVICE_INFORMATION
;
571 typedef FILE_FS_DEVICE_INFORMATION
*PFILE_FS_DEVICE_INFORMATION
;
574 // timer apc routine [ possible incompatible with ms winnt ]
578 (*PTIMERAPCROUTINE
) (
583 // shutdown action [ possible incompatible with ms winnt ]
584 // this might be parameter to specify how to shutdown
591 //NtAcceptConnectPort
593 //NtAccessCheckAndAuditAlarm
598 IN PUNICODE_STRING pString
601 //NtAdjustGroupsToken
602 //NtAdjustPrivilegesToken
603 //NtAlertResumeThread
605 //NtAllocateLocallyUniqueId
611 NtAllocateVirtualMemory(
613 OUT LPVOID lpAddress
,
614 IN ULONG uWillThingAbThis
,
616 IN DWORD flAllocationType
,
626 IN HANDLE TimerHandle
,
633 IN HANDLE EventHandle
643 // NtCloseObjectAuditAlarm
644 // NtCompleteConnectPort
658 NtCreateDirectoryObject(
659 OUT PHANDLE DirectoryHandle
,
660 IN ACCESS_MASK DesiredAccess
,
661 IN POBJECT_ATTRIBUTES ObjectAttributes
667 OUT PHANDLE FileHandle
,
668 IN ACCESS_MASK DesiredAccess
,
669 IN POBJECT_ATTRIBUTES ObjectAttributes
,
679 OUT PHANDLE FileHandle
,
680 IN ACCESS_MASK DesiredAccess
,
681 IN POBJECT_ATTRIBUTES ObjectAttributes
,
682 OUT PIO_STATUS_BLOCK IoStatusBlock
,
683 IN PLARGE_INTEGER AllocationSize OPTIONAL
,
684 IN ULONG FileAttributes
,
685 IN ULONG ShareAccess
,
686 IN ULONG CreateDisposition
,
687 IN ULONG CreateOptions
,
688 IN PVOID EaBuffer OPTIONAL
,
692 // NtCreateIoCompletion
697 OUT PHANDLE KeyHandle
,
698 IN ACCESS_MASK DesiredAccess
,
699 IN POBJECT_ATTRIBUTES ObjectAttributes
,
701 IN PUNICODE_STRING Class OPTIONAL
,
702 IN ULONG CreateOptions
,
703 IN PULONG Disposition OPTIONAL
705 // NtCreateMailslotFile
707 //-- NtCreateNamedPipeFile
708 //-- NtCreatePagingFile
714 OUT PHANDLE ProcessHandle
,
715 IN ACCESS_MASK DesiredAccess
,
716 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
717 IN HANDLE ParentProcess
,
718 IN BOOLEAN InheritObjectTable
,
719 IN HANDLE SectionHandle OPTIONAL
,
720 IN HANDLE DebugPort OPTIONAL
,
721 IN HANDLE ExceptionPort OPTIONAL
728 OUT PHANDLE SectionHandle
,
729 IN ACCESS_MASK DesiredAccess
,
730 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
731 IN PLARGE_INTEGER MaximumSize OPTIONAL
,
732 IN ULONG SectionPageProtection OPTIONAL
,
733 IN ULONG AllocationAttributes
,
734 IN HANDLE FileHandle OPTIONAL
740 OUT PHANDLE SemaphoreHandle
,
741 IN ACCESS_MASK DesiredAccess
,
742 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
743 IN ULONG InitialCount
,
744 IN ULONG MaximumCount
746 // NtCreateSymbolicLinkObject
751 OUT PHANDLE ThreadHandle
,
752 IN ACCESS_MASK DesiredAccess
,
753 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
754 IN HANDLE ProcessHandle
,
755 IN PCLIENT_ID ClientId
,
756 IN PCONTEXT ThreadContext
,
757 IN PINITIAL_TEB InitialTeb
,
758 IN BOOLEAN CreateSuspended
764 OUT PHANDLE TimerHandle
,
765 IN ACCESS_MASK DesiredAccess
,
766 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL
,
781 IN PLARGE_INTEGER Interval
804 // NtDeleteObjectAuditAlarm
806 // NtDeviceIoControlFile
811 IN PUNICODE_STRING DisplayString
817 IN HANDLE SourceProcessHandle
,
818 IN PHANDLE SourceHandle
,
819 IN HANDLE TargetProcessHandle
,
820 OUT PHANDLE TargetHandle
,
821 IN ULONG dwDesiredAccess
,
822 IN ULONG InheritHandle
831 IN CINT KeyInformationClass
,
832 OUT PVOID KeyInformation
,
834 OUT PULONG ResultLength
842 IN CINT KeyValueInformationClass
,
843 OUT PVOID KeyValueInformation
,
845 OUT PULONG ResultLength
852 IN PUNICODE_STRING AtomString
863 NtFlushInstructionCache(
864 IN HANDLE ProcessHandle
,
865 IN PVOID BaseAddress
,
876 * FIXME: Is the return type correct? (David Welch)
880 NtFlushVirtualMemory(
881 IN HANDLE ProcessHandle
,
882 IN VOID
*BaseAddress
,
883 IN ULONG NumberOfBytesToFlush
,
884 IN PULONG NumberOfBytesFlushed
897 IN LPVOID lpAddress
, // address of region of committed pages
898 IN DWORD dwSize
, // size of region
906 IN HANDLE ThreadHandle
,
909 // NtGetPlugPlayEvent
911 // NtImpersonateClientOfPort
912 // NtImpersonateThread
913 // NtInitializeRegistry
920 IN PUNICODE_STRING DriverServiceName
926 //NtLockVirtualMemory
930 NtMakeTemporaryObject(
937 IN HANDLE SectionHandle
,
938 IN HANDLE ProcessHandle
,
939 IN OUT PVOID
*BaseAddress
,
942 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL
,
943 IN OUT PULONG ViewSize
,
944 IN SECTION_INHERIT InheritDisposition
,
945 IN ULONG AllocationType
,
949 // NtNotifyChangeDirectoryFile
955 NtOpenDirectoryObject(
956 OUT PHANDLE DirectoryHandle
,
957 IN ACCESS_MASK DesiredAccess
,
958 IN POBJECT_ATTRIBUTES ObjectAttributes
964 OUT PHANDLE EventHandle
,
965 IN ACCESS_MASK DesiredAccess
,
966 IN POBJECT_ATTRIBUTES ObjectAttributes
973 OUT PHANDLE FileHandle
,
974 IN ACCESS_MASK DesiredAccess
,
975 IN POBJECT_ATTRIBUTES ObjectAttributes
,
976 OUT PIO_STATUS_BLOCK IoStatusBlock
,
977 IN ULONG ShareAccess
,
978 IN ULONG FileAttributes
980 // NtOpenIoCompletion
985 OUT PHANDLE KeyHandle
,
986 IN ACCESS_MASK DesiredAccess
,
987 IN POBJECT_ATTRIBUTES ObjectAttributes
990 // NtOpenObjectAuditAlarm
991 NTSTATUS
NtOpenProcess (
992 OUT PHANDLE ProcessHandle
,
993 IN ACCESS_MASK DesiredAccess
,
994 IN POBJECT_ATTRIBUTES ObjectAttributes
,
995 IN PCLIENT_ID ClientId
998 // NtOpenProcessToken
1003 OUT PHANDLE SectionHandle
,
1004 IN ACCESS_MASK DesiredAccess
,
1005 IN POBJECT_ATTRIBUTES ObjectAttributes
1010 NtOpenSymbolicLinkObject(
1011 OUT PHANDLE SymbolicLinkHandle
,
1012 IN ACCESS_MASK DesiredAccess
,
1013 IN POBJECT_ATTRIBUTES ObjectAttributes
1019 OUT PHANDLE ThreadHandle
,
1020 IN ACCESS_MASK DesiredAccess
,
1021 IN POBJECT_ATTRIBUTES ObjectAttributes
1028 OUT PHANDLE TimerHandle
,
1029 IN ACCESS_MASK DesiredAccess
,
1030 IN POBJECT_ATTRIBUTES ObjectAttributes
1032 // NtPlugPlayControl
1034 // NtPrivilegeObjectAuditAlarm
1035 // NtPrivilegedServiceAuditAlarm
1036 // NtProtectVirtualMemory
1041 IN HANDLE EventHandle
,
1042 IN BOOL Unknown OPTIONAL
1044 // NtQueryAttributesFile
1045 // NtQueryDefaultLocale
1046 // NtQueryDirectoryFile
1050 NtQueryDirectoryObject(
1051 IN HANDLE DirectoryHandle
,
1052 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1053 IN PLARGE_INTEGER AllocationSize OPTIONAL
,
1054 IN ULONG FileAttributes
,
1055 IN ULONG ShareAccess
,
1063 IN HANDLE FileHandle
,
1064 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1071 IN CINT FileInformationClass
1074 //-- NtQueryFullAttributesFile
1075 //-- NtQueryInformationAtom
1079 NtQueryInformationFile(
1080 IN HANDLE FileHandle
,
1081 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1082 OUT PVOID FileInformation
,
1084 IN CINT FileInformationClass
1086 //NtQueryInformationPort
1089 ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION
1090 ProcessBasicInfo PROCESS_BASIC_INFORMATION
1091 ProcessQuotaLimits QUOTA_LIMITS
1092 ProcessPooledQuotaLimits QUOTA_LIMITS
1093 ProcessIoCounters IO_COUNTERS
1094 ProcessVmCounters VM_COUNTERS
1095 ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS
1096 ProcessTimes KERNEL_USER_TIMES
1103 NtQueryInformationProcess(
1104 IN HANDLE ProcessHandle
,
1105 IN CINT ProcessInformationClass
,
1106 OUT PVOID ProcessInformation
,
1107 IN ULONG ProcessInformationLength
,
1108 OUT PULONG ReturnLength
1112 ThreadTimes KERNEL_USER_TIMES
1117 NtQueryInformationThread(
1118 IN HANDLE ThreadHandle
,
1119 IN CINT ThreadInformationClass
,
1120 OUT PVOID ThreadInformation
,
1121 IN ULONG ThreadInformationLength
,
1122 OUT PULONG ReturnLength
1124 // NtQueryInformationToken
1125 // NtQueryIntervalProfile
1126 // NtQueryIoCompletion
1131 IN HANDLE KeyHandle
,
1132 IN CINT KeyInformationClass
,
1133 OUT PVOID KeyInformation
,
1135 OUT PULONG ResultLength
1137 //-- NtQueryMultipleValueKey
1143 IN HANDLE ObjectHandle
,
1144 IN CINT HandleInformationClass
,
1145 OUT PHANDLE_INFO HandleInfo
,
1147 OUT PULONG ResultLength
);
1148 //NtQueryOleDirectoryFile
1152 NtQueryPerformanceCounter(
1158 //-- NtQuerySecurityObject
1159 //-- NtQuerySemaphore
1163 NtQuerySymbolicLinkObject(
1164 IN HANDLE SymbolicLinkHandle
,
1165 OUT PUNICODE_STRING TargetName
, /* target device name */
1168 //-- NtQuerySystemEnvironmentValue
1171 NtQuerySystemInformation(
1172 IN CINT SystemInformationClass
,
1173 OUT PVOID SystemInformation
,
1174 IN ULONG SystemInformationLength
1180 OUT PLARGE_INTEGER CurrentTime
1183 //-- NtQueryTimerResolution
1188 IN HANDLE KeyHandle
,
1189 IN PUNICODE_STRING ValueName
,
1190 IN CINT KeyValueInformationClass
,
1191 OUT PVOID KeyValueInformation
,
1193 OUT PULONG ResultLength
1195 //-- NtQueryVirtualMemory
1199 NtQueryVolumeInformationFile(
1200 IN HANDLE FileHandle
,
1201 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1202 OUT PVOID VolumeInformation
,
1204 IN CINT FSInformationClass
// dont know
1211 IN PEXCEPTION_RECORD ExceptionRecord
,
1212 IN PCONTEXT CONTEXT
,
1213 IN BOOL bUnknown OPTIONAL
1219 IN OUT ULONG Unknown1
,
1220 IN OUT ULONG Unknown2
,
1221 IN OUT PVOID Unknow3
,
1222 IN OUT ULONG Unknow4
,
1223 IN PEXCEPTION_RECORD ExceptionRecord
1230 IN HANDLE FileHandle
,
1231 IN HANDLE Event OPTIONAL
,
1232 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL
,
1233 IN PVOID ApcContext OPTIONAL
,
1234 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1237 IN PLARGE_INTEGER ByteOffset
,
1238 IN PULONG Key OPTIONAL
1242 IN HANDLE FileHandle
,
1243 IN HANDLE Event OPTIONAL
,
1244 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL
,
1245 IN PVOID UserApcContext OPTIONAL
,
1246 OUT PIO_STATUS_BLOCK UserIosb
,
1247 IN LARGE_INTEGER BufferDescription
[],
1248 IN ULONG BufferLength
,
1249 IN PLARGE_INTEGER ByteOffset
,
1250 IN PULONG Key OPTIONAL
1257 NtReadVirtualMemory(
1258 IN HANDLE ProcessHandle
,
1259 IN PVOID BaseAddress
,
1262 OUT PDWORD lpNumberOfBytesRead
1264 //--NtRegisterThreadTerminatePort
1270 IN HANDLE SemaphoreHandle
,
1271 IN ULONG ReleaseCount
,
1272 IN PULONG PreviousCount
1274 //NtRemoveIoCompletion
1277 //NtReplyWaitReceivePort
1278 //NtReplyWaitReplyPort
1279 //NtReplyWaitSendChannel
1281 //NtRequestWaitReplyPort
1288 IN HANDLE ThreadHandle
,
1292 //NtSendWaitReplyChannel
1293 //NtSetContextChannel
1298 IN HANDLE ThreadHandle
,
1301 //--NtSetDefaultHardErrorPort
1302 //--NtSetDefaultLocale
1305 //--NtSetHighEventPair
1306 //--NtSetHighWaitLowEventPair
1307 //--NtSetHighWaitLowThread
1312 NtSetInformationFile(
1313 IN HANDLE FileHandle
,
1314 IN PIO_STATUS_BLOCK IoStatusBlock
,
1315 IN PVOID FileInformation
,
1317 IN CINT FileInformationClass
1320 //KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION
1324 NtSetInformationKey(
1325 IN HANDLE KeyHandle
,
1326 IN CINT KeySetInformationClass
,
1327 IN PVOID KeyInformation
,
1328 IN ULONG KeyInformationLength
1332 NtSetInformationObject(
1333 IN HANDLE ObjectHandle
,
1334 IN CINT HandleInformationClass
,
1335 IN PVOID HandleInfo
,
1340 ProcessQuotaLimits QUOTA_LIMITS
1341 ProcessAccessToken PROCESS_ACCESS_TOKEN
1347 NtSetInformationProcess(
1348 IN HANDLE ProcessHandle
,
1349 IN CINT ProcessInformationClass
,
1350 IN PVOID ProcessInformation
,
1351 IN ULONG ProcessInformationLength
1356 NtSetInformationThread(
1357 IN HANDLE ThreadHandle
,
1358 IN CINT ThreadInformationClass
,
1359 IN PVOID ThreadInformation
,
1360 IN ULONG ThreadInformationLength
1362 // NtSetInformationToken
1363 // NtSetIntervalProfile
1364 // NtSetIoCompletion
1366 // NtSetLowEventPair
1367 // NtSetLowWaitHighEventPair
1368 // NtSetLowWaitHighThread
1369 // NtSetSecurityObject
1370 //NtSetSystemEnvironmentValue
1372 SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
1376 NtSetSystemInformation(
1377 IN CINT SystemInformationClass
,
1378 IN PVOID SystemInformation
,
1379 IN ULONG SystemInformationLength
1381 //NtSetSystemPowerState
1386 IN PLARGE_INTEGER SystemTime
,
1387 IN BOOL Unknown OPTIONAL
1393 IN HANDLE TimerHandle
,
1394 IN PLARGE_INTEGER DueTime
,
1395 IN PTIMERAPCROUTINE CompletionRoutine
,
1396 IN LPVOID ArgToCompletionRoutine
,
1400 // NtSetTimerResolution
1405 IN HANDLE KeyHandle
,
1406 IN PUNICODE_STRING ValueName
,
1407 IN ULONG TitleIndex
,
1413 //-- NtSetVolumeInformationFile
1418 IN SHUTDOWN_ACTION Action
1420 //-- NtSignalAndWaitForSingleObject
1427 IN HANDLE ThreadHandle
,
1428 IN PULONG PreviousSuspendCount
1430 //--NtSystemDebugControl
1435 IN HANDLE ProcessHandle
,
1436 IN NTSTATUS ExitStatus
1442 IN HANDLE ThreadHandle
,
1443 IN NTSTATUS ExitStatus
1451 IN PUNICODE_STRING DriverServiceName
1456 //--NtUnlockVirtualMemory
1460 NtUnmapViewOfSection(
1461 IN HANDLE ProcessHandle
,
1462 IN PVOID BaseAddress
1469 NtWaitForMultipleObjects (
1473 IN BOOLEAN Alertable
,
1474 IN PLARGE_INTEGER Time
1479 NtWaitForSingleObject (
1481 IN BOOLEAN Alertable
,
1482 IN PLARGE_INTEGER Time
1484 //--NtWaitHighEventPair
1485 //--NtWaitLowEventPair
1490 IN HANDLE FileHandle
,
1492 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL
,
1493 IN PVOID ApcContext OPTIONAL
,
1494 OUT PIO_STATUS_BLOCK IoStatusBlock
,
1497 IN PLARGE_INTEGER ByteOffset
,
1498 IN PULONG Key OPTIONAL
1502 STDCALL
NtWriteFileScatter(
1503 IN HANDLE FileHandle
,
1504 IN HANDLE Event OPTIONAL
,
1505 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL
,
1506 IN PVOID UserApcContext OPTIONAL
,
1507 OUT PIO_STATUS_BLOCK UserIosb
,
1508 IN LARGE_INTEGER BufferDescription
[],
1509 IN ULONG BufferLength
,
1510 IN PLARGE_INTEGER ByteOffset
,
1511 IN PULONG Key OPTIONAL
1514 //NtWriteRequestData
1518 NtWriteVirtualMemory(
1519 IN HANDLE ProcessHandle
,
1522 OUT PULONG NumberOfBytesWritten
1533 #endif /* __cplusplus */
1537 #endif /* __DDK_ZW_H */