removed double definition of Nt/ZwSecureConnectPort
[reactos.git] / reactos / include / ntos / zw.h
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: System call definitions
6 * FILE: include/ddk/zw.h
7 * REVISION HISTORY:
8 * ??/??/??: First few functions (David Welch)
9 * ??/??/??: Complete implementation by Ariadne
10 * 13/07/98: Reorganised things a bit (David Welch)
11 * 04/08/98: Added some documentation (Ariadne)
12 * 14/08/98: Added type TIME and change variable type from [1] to [0]
13 * 14/09/98: Added for each Nt call a corresponding Zw Call
14 * 09/08/03: Added ThreadEventPair routines
15 */
16
17 #ifndef __DDK_ZW_H
18 #define __DDK_ZW_H
19
20 #include <ntos/security.h>
21 #include <ntos/zwtypes.h>
22 #include <napi/npipe.h>
23
24 #ifndef _RTLGETPROCESSHEAP_DEFINED_
25 #define _RTLGETPROCESSHEAP_DEFINED_
26 #define RtlGetProcessHeap() (NtCurrentPeb()->ProcessHeap)
27 #endif
28
29 // semaphore information
30
31 typedef enum _SEMAPHORE_INFORMATION_CLASS
32 {
33 SemaphoreBasicInformation = 0
34 } SEMAPHORE_INFORMATION_CLASS;
35
36 typedef struct _SEMAPHORE_BASIC_INFORMATION
37 {
38 LONG CurrentCount;
39 LONG MaximumCount;
40 } SEMAPHORE_BASIC_INFORMATION, *PSEMAPHORE_BASIC_INFORMATION;
41
42 // event information
43
44 typedef enum _EVENT_INFORMATION_CLASS
45 {
46 EventBasicInformation = 0
47 } EVENT_INFORMATION_CLASS;
48
49 typedef struct _EVENT_BASIC_INFORMATION
50 {
51 EVENT_TYPE EventType;
52 LONG EventState;
53 } EVENT_BASIC_INFORMATION, *PEVENT_BASIC_INFORMATION;
54
55 // wmi trace event data
56 typedef struct _EVENT_TRACE_HEADER {
57 USHORT Size;
58 union {
59 USHORT FieldTypeFlags;
60 struct {
61 UCHAR HeaderType;
62 UCHAR MarkerFlags;
63 };
64 };
65 union {
66 ULONG Version;
67 struct {
68 UCHAR Type;
69 UCHAR Level;
70 USHORT Version;
71 } Class;
72 };
73 ULONG ThreadId;
74 ULONG ProcessId;
75 LARGE_INTEGER TimeStamp;
76 union {
77 GUID Guid;
78 ULONGLONG GuidPtr;
79 };
80 union {
81 struct {
82 ULONG ClientContext;
83 ULONG Flags;
84 };
85 struct {
86 ULONG KernelTime;
87 ULONG UserTime;
88 };
89 ULONG64 ProcessorTime;
90 };
91 } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
92
93
94 typedef struct _FILE_USER_QUOTA_INFORMATION {
95 ULONG NextEntryOffset;
96 ULONG SidLength;
97 LARGE_INTEGER ChangeTime;
98 LARGE_INTEGER QuotaUsed;
99 LARGE_INTEGER QuotaThreshold;
100 LARGE_INTEGER QuotaLimit;
101 SID Sid[1];
102 } FILE_USER_QUOTA_INFORMATION, *PFILE_USER_QUOTA_INFORMATION;
103
104
105 //#define LCID ULONG
106 //#define SECURITY_INFORMATION ULONG
107 //typedef ULONG SECURITY_INFORMATION;
108
109 #ifndef __USE_NT_LPC__
110 NTSTATUS STDCALL
111 NtAcceptConnectPort (PHANDLE PortHandle,
112 HANDLE NamedPortHandle,
113 PLPC_MESSAGE ServerReply,
114 BOOLEAN AcceptIt,
115 PLPC_SECTION_WRITE WriteMap,
116 PLPC_SECTION_READ ReadMap);
117 #else
118 NTSTATUS STDCALL
119 NtAcceptConnectPort (PHANDLE PortHandle,
120 ULONG PortIdentifier,
121 PLPC_MESSAGE ServerReply,
122 BOOLEAN AcceptIt,
123 PLPC_SECTION_WRITE WriteMap,
124 PLPC_SECTION_READ ReadMap);
125 #endif /* ndef __USE_NT_LPC__ */
126
127 NTSTATUS
128 STDCALL
129 NtAddBootEntry(
130 IN PUNICODE_STRING EntryName,
131 IN PUNICODE_STRING EntryValue
132 );
133
134 NTSTATUS
135 STDCALL
136 ZwAddBootEntry(
137 IN PUNICODE_STRING EntryName,
138 IN PUNICODE_STRING EntryValue
139 );
140
141 /*
142 * FUNCTION: Adjusts the groups in an access token
143 * ARGUMENTS:
144 * TokenHandle = Specifies the access token
145 * ResetToDefault = If true the NewState parameter is ignored and the groups are set to
146 * their default state, if false the groups specified in
147 * NewState are set.
148 * NewState =
149 * BufferLength = Specifies the size of the buffer for the PreviousState.
150 * PreviousState =
151 * ReturnLength = Bytes written in PreviousState buffer.
152 * REMARKS: The arguments map to the win32 AdjustTokenGroups
153 * RETURNS: Status
154 */
155
156 NTSTATUS
157 STDCALL
158 NtAdjustGroupsToken(
159 IN HANDLE TokenHandle,
160 IN BOOLEAN ResetToDefault,
161 IN PTOKEN_GROUPS NewState,
162 IN ULONG BufferLength,
163 OUT PTOKEN_GROUPS PreviousState OPTIONAL,
164 OUT PULONG ReturnLength
165 );
166
167 NTSTATUS
168 STDCALL
169 ZwAdjustGroupsToken(
170 IN HANDLE TokenHandle,
171 IN BOOLEAN ResetToDefault,
172 IN PTOKEN_GROUPS NewState,
173 IN ULONG BufferLength,
174 OUT PTOKEN_GROUPS PreviousState,
175 OUT PULONG ReturnLength
176 );
177
178
179 /*
180 * FUNCTION:
181 *
182 * ARGUMENTS:
183 * TokenHandle = Handle to the access token
184 * DisableAllPrivileges = The resulting suspend count.
185 NewState =
186 BufferLength =
187 PreviousState =
188 ReturnLength =
189 * REMARK:
190 * The arguments map to the win32 AdjustTokenPrivileges
191 * RETURNS: Status
192 */
193
194 NTSTATUS
195 STDCALL
196 NtAdjustPrivilegesToken(
197 IN HANDLE TokenHandle,
198 IN BOOLEAN DisableAllPrivileges,
199 IN PTOKEN_PRIVILEGES NewState,
200 IN ULONG BufferLength,
201 OUT PTOKEN_PRIVILEGES PreviousState,
202 OUT PULONG ReturnLength
203 );
204
205 NTSTATUS
206 STDCALL
207 ZwAdjustPrivilegesToken(
208 IN HANDLE TokenHandle,
209 IN BOOLEAN DisableAllPrivileges,
210 IN PTOKEN_PRIVILEGES NewState,
211 IN ULONG BufferLength,
212 OUT PTOKEN_PRIVILEGES PreviousState,
213 OUT PULONG ReturnLength
214 );
215
216
217 /*
218 * FUNCTION: Decrements a thread's suspend count and places it in an alerted
219 * state.
220 * ARGUMENTS:
221 * ThreadHandle = Handle to the thread that should be resumed
222 * SuspendCount = The resulting suspend count.
223 * REMARK:
224 * A thread is resumed if its suspend count is 0
225 * RETURNS: Status
226 */
227 NTSTATUS
228 STDCALL
229 NtAlertResumeThread(
230 IN HANDLE ThreadHandle,
231 OUT PULONG SuspendCount
232 );
233
234 NTSTATUS
235 STDCALL
236 ZwAlertResumeThread(
237 IN HANDLE ThreadHandle,
238 OUT PULONG SuspendCount
239 );
240
241 /*
242 * FUNCTION: Puts the thread in a alerted state
243 * ARGUMENTS:
244 * ThreadHandle = Handle to the thread that should be alerted
245 * RETURNS: Status
246 */
247 NTSTATUS
248 STDCALL
249 NtAlertThread(
250 IN HANDLE ThreadHandle
251 );
252
253 NTSTATUS
254 STDCALL
255 ZwAlertThread(
256 IN HANDLE ThreadHandle
257 );
258
259
260 /*
261 * FUNCTION: Allocates a locally unique id
262 * ARGUMENTS:
263 * LocallyUniqueId = Locally unique number
264 * RETURNS: Status
265 */
266 NTSTATUS
267 STDCALL
268 NtAllocateLocallyUniqueId(
269 OUT LUID *LocallyUniqueId
270 );
271
272 NTSTATUS
273 STDCALL
274 ZwAllocateLocallyUniqueId(
275 OUT PLUID Luid
276 );
277
278 /*
279 * FUNCTION: Allocates a block of virtual memory in the process address space
280 * ARGUMENTS:
281 * ProcessHandle = The handle of the process which owns the virtual memory
282 * BaseAddress = A pointer to the virtual memory allocated. If you supply a non zero
283 * value the system will try to allocate the memory at the address supplied. It rounds
284 * it down to a multiple if the page size.
285 * ZeroBits = (OPTIONAL) You can specify the number of high order bits that must be zero, ensuring that
286 * the memory will be allocated at a address below a certain value.
287 * RegionSize = The number of bytes to allocate
288 * AllocationType = Indicates the type of virtual memory you like to allocated,
289 * can be one of the values : MEM_COMMIT, MEM_RESERVE, MEM_RESET, MEM_TOP_DOWN
290 * Protect = Indicates the protection type of the pages allocated, can be a combination of
291 * PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READ,
292 * PAGE_EXECUTE_READWRITE, PAGE_GUARD, PAGE_NOACCESS, PAGE_NOACCESS
293 * REMARKS:
294 * This function maps to the win32 VirtualAllocEx. Virtual memory is process based so the
295 * protocol starts with a ProcessHandle. I splitted the functionality of obtaining the actual address and specifying
296 * the start address in two parameters ( BaseAddress and StartAddress ) The NumberOfBytesAllocated specify the range
297 * and the AllocationType and ProctectionType map to the other two parameters.
298 * RETURNS: Status
299 */
300 NTSTATUS
301 STDCALL
302 NtAllocateVirtualMemory (
303 IN HANDLE ProcessHandle,
304 IN OUT PVOID *BaseAddress,
305 IN ULONG ZeroBits,
306 IN OUT PULONG RegionSize,
307 IN ULONG AllocationType,
308 IN ULONG Protect
309 );
310
311 NTSTATUS
312 STDCALL
313 ZwAllocateVirtualMemory (
314 IN HANDLE ProcessHandle,
315 IN OUT PVOID *BaseAddress,
316 IN ULONG ZeroBits,
317 IN OUT PULONG RegionSize,
318 IN ULONG AllocationType,
319 IN ULONG Protect);
320
321
322
323 NTSTATUS
324 STDCALL
325 NtAssignProcessToJobObject(
326 HANDLE JobHandle,
327 HANDLE ProcessHandle);
328
329 NTSTATUS
330 STDCALL
331 ZwAssignProcessToJobObject(
332 HANDLE JobHandle,
333 HANDLE ProcessHandle);
334
335 /*
336 * FUNCTION: Returns from a callback into user mode
337 * ARGUMENTS:
338 * RETURN Status
339 */
340 //FIXME: this function might need 3 parameters
341 NTSTATUS STDCALL NtCallbackReturn(PVOID Result,
342 ULONG ResultLength,
343 NTSTATUS Status);
344
345 NTSTATUS STDCALL ZwCallbackReturn(PVOID Result,
346 ULONG ResultLength,
347 NTSTATUS Status);
348
349 /*
350 * FUNCTION: Cancels a IO request
351 * ARGUMENTS:
352 * FileHandle = Handle to the file
353 * IoStatusBlock =
354 *
355 * REMARKS:
356 * This function maps to the win32 CancelIo.
357 * RETURNS: Status
358 */
359 NTSTATUS
360 STDCALL
361 NtCancelIoFile(
362 IN HANDLE FileHandle,
363 OUT PIO_STATUS_BLOCK IoStatusBlock
364 );
365
366 NTSTATUS
367 STDCALL
368 ZwCancelIoFile(
369 IN HANDLE FileHandle,
370 OUT PIO_STATUS_BLOCK IoStatusBlock
371 );
372
373 /*
374 * FUNCTION: Sets the status of the event back to non-signaled
375 * ARGUMENTS:
376 * EventHandle = Handle to the event
377 * REMARKS:
378 * This function maps to win32 function ResetEvent.
379 * RETURcNS: Status
380 */
381
382 NTSTATUS
383 STDCALL
384 NtClearEvent(
385 IN HANDLE EventHandle
386 );
387
388 NTSTATUS
389 STDCALL
390 ZwClearEvent(
391 IN HANDLE EventHandle
392 );
393
394 NTSTATUS
395 STDCALL
396 NtCreateJobObject(
397 PHANDLE JobHandle,
398 ACCESS_MASK DesiredAccess,
399 POBJECT_ATTRIBUTES ObjectAttributes
400 );
401
402 NTSTATUS
403 STDCALL
404 ZwCreateJobObject(
405 PHANDLE JobHandle,
406 ACCESS_MASK DesiredAccess,
407 POBJECT_ATTRIBUTES ObjectAttributes
408 );
409
410
411 /*
412 * FUNCTION: Closes an object handle
413 * ARGUMENTS:
414 * Handle = Handle to the object
415 * REMARKS:
416 * This function maps to the win32 function CloseHandle.
417 * RETURNS: Status
418 */
419
420 NTSTATUS
421 STDCALL
422 NtClose(
423 IN HANDLE Handle
424 );
425
426 NTSTATUS
427 STDCALL
428 ZwClose(
429 IN HANDLE Handle
430 );
431
432 /*
433 * FUNCTION: Generates an audit message when a handle to an object is dereferenced
434 * ARGUMENTS:
435 * SubsystemName =
436 HandleId = Handle to the object
437 GenerateOnClose =
438 * REMARKS:
439 * This function maps to the win32 function ObjectCloseAuditAlarm.
440 * RETURNS: Status
441 */
442
443 NTSTATUS
444 STDCALL
445 NtCloseObjectAuditAlarm(
446 IN PUNICODE_STRING SubsystemName,
447 IN PVOID HandleId,
448 IN BOOLEAN GenerateOnClose
449 );
450
451 NTSTATUS
452 STDCALL
453 ZwCloseObjectAuditAlarm(
454 IN PUNICODE_STRING SubsystemName,
455 IN PVOID HandleId,
456 IN BOOLEAN GenerateOnClose
457 );
458
459
460 NTSTATUS STDCALL
461 NtCompleteConnectPort (HANDLE PortHandle);
462
463 NTSTATUS STDCALL
464 ZwCompleteConnectPort (HANDLE PortHandle);
465
466
467 NTSTATUS STDCALL
468 NtConnectPort(OUT PHANDLE PortHandle,
469 IN PUNICODE_STRING PortName,
470 IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
471 IN OUT PLPC_SECTION_WRITE ClientSharedMemory OPTIONAL,
472 OUT PLPC_SECTION_READ ServerSharedMemory OPTIONAL,
473 OUT PULONG MaxMessageSize OPTIONAL,
474 IN PVOID ConnectInfo OPTIONAL,
475 IN PULONG ConnectInfoLength OPTIONAL);
476
477 NTSTATUS STDCALL
478 ZwConnectPort(OUT PHANDLE PortHandle,
479 IN PUNICODE_STRING PortName,
480 IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
481 IN OUT PLPC_SECTION_WRITE ClientSharedMemory OPTIONAL,
482 OUT PLPC_SECTION_READ ServerSharedMemory OPTIONAL,
483 OUT PULONG MaxMessageSize OPTIONAL,
484 IN PVOID ConnectInfo OPTIONAL,
485 IN PULONG ConnectInfoLength OPTIONAL);
486
487 NTSTATUS STDCALL
488 NtSecureConnectPort(OUT PHANDLE PortHandle,
489 IN PUNICODE_STRING PortName,
490 IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
491 IN OUT PLPC_SECTION_WRITE ClientSharedMemory OPTIONAL,
492 IN PSID ServerSid OPTIONAL,
493 OUT PLPC_SECTION_READ ServerSharedMemory OPTIONAL,
494 OUT PULONG MaxMessageSize OPTIONAL,
495 IN PVOID ConnectInfo OPTIONAL,
496 IN PULONG ConnectInfoLength OPTIONAL);
497
498 NTSTATUS STDCALL
499 ZwSecureConnectPort(OUT PHANDLE PortHandle,
500 IN PUNICODE_STRING PortName,
501 IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
502 IN OUT PLPC_SECTION_WRITE ClientSharedMemory OPTIONAL,
503 IN PSID ServerSid OPTIONAL,
504 OUT PLPC_SECTION_READ ServerSharedMemory OPTIONAL,
505 OUT PULONG MaxMessageSize OPTIONAL,
506 IN PVOID ConnectInfo OPTIONAL,
507 IN PULONG ConnectInfoLength OPTIONAL);
508
509 /*
510 * FUNCTION: Creates a directory object
511 * ARGUMENTS:
512 * DirectoryHandle (OUT) = Caller supplied storage for the resulting handle
513 * DesiredAccess = Specifies access to the directory
514 * ObjectAttribute = Initialized attributes for the object
515 * REMARKS: This function maps to the win32 CreateDirectory. A directory is like a file so it needs a
516 * handle, a access mask and a OBJECT_ATTRIBUTES structure to map the path name and the SECURITY_ATTRIBUTES.
517 * RETURNS: Status
518 */
519
520 NTSTATUS
521 STDCALL
522 NtCreateDirectoryObject(
523 OUT PHANDLE DirectoryHandle,
524 IN ACCESS_MASK DesiredAccess,
525 IN POBJECT_ATTRIBUTES ObjectAttributes
526 );
527
528 NTSTATUS
529 STDCALL
530 ZwCreateDirectoryObject(
531 OUT PHANDLE DirectoryHandle,
532 IN ACCESS_MASK DesiredAccess,
533 IN POBJECT_ATTRIBUTES ObjectAttributes
534 );
535
536 /*
537 * FUNCTION: Creates an event object
538 * ARGUMENTS:
539 * EventHandle (OUT) = Caller supplied storage for the resulting handle
540 * DesiredAccess = Specifies access to the event
541 * ObjectAttribute = Initialized attributes for the object
542 * ManualReset = manual-reset or auto-reset if true you have to reset the state of the event manually
543 * using NtResetEvent/NtClearEvent. if false the system will reset the event to a non-signalled state
544 * automatically after the system has rescheduled a thread waiting on the event.
545 * InitialState = specifies the initial state of the event to be signaled ( TRUE ) or non-signalled (FALSE).
546 * REMARKS: This function maps to the win32 CreateEvent. Demanding a out variable of type HANDLE,
547 * a access mask and a OBJECT_ATTRIBUTES structure mapping to the SECURITY_ATTRIBUTES. ManualReset and InitialState are
548 * both parameters aswell ( possibly the order is reversed ).
549 * RETURNS: Status
550 */
551
552 NTSTATUS
553 STDCALL
554 NtCreateEvent(
555 OUT PHANDLE EventHandle,
556 IN ACCESS_MASK DesiredAccess,
557 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
558 IN EVENT_TYPE EventType,
559 IN BOOLEAN InitialState
560 );
561
562 NTSTATUS
563 STDCALL
564 ZwCreateEvent(
565 OUT PHANDLE EventHandle,
566 IN ACCESS_MASK DesiredAccess,
567 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
568 IN EVENT_TYPE EventType,
569 IN BOOLEAN InitialState
570 );
571
572 /*
573 * FUNCTION: Creates an eventpair object
574 * ARGUMENTS:
575 * EventPairHandle (OUT) = Caller supplied storage for the resulting handle
576 * DesiredAccess = Specifies access to the event
577 * ObjectAttribute = Initialized attributes for the object
578 */
579
580 NTSTATUS
581 STDCALL
582 NtCreateEventPair(
583 OUT PHANDLE EventPairHandle,
584 IN ACCESS_MASK DesiredAccess,
585 IN POBJECT_ATTRIBUTES ObjectAttributes
586 );
587
588 NTSTATUS
589 STDCALL
590 ZwCreateEventPair(
591 OUT PHANDLE EventPairHandle,
592 IN ACCESS_MASK DesiredAccess,
593 IN POBJECT_ATTRIBUTES ObjectAttributes
594 );
595
596
597 /*
598 * FUNCTION: Creates or opens a file, directory or device object.
599 * ARGUMENTS:
600 * FileHandle (OUT) = Caller supplied storage for the resulting handle
601 * DesiredAccess = Specifies the allowed or desired access to the file can
602 * be a combination of DELETE | FILE_READ_DATA ..
603 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
604 * IoStatusBlock (OUT) = Caller supplied storage for the resulting status information, indicating if the
605 * the file is created and opened or allready existed and is just opened.
606 * FileAttributes = file attributes can be a combination of FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN ...
607 * ShareAccess = can be a combination of the following: FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
608 * CreateDisposition = specifies what the behavior of the system if the file allready exists.
609 * CreateOptions = specifies the behavior of the system on file creation.
610 * EaBuffer (OPTIONAL) = Extended Attributes buffer, applies only to files and directories.
611 * EaLength = Extended Attributes buffer size, applies only to files and directories.
612 * REMARKS: This function maps to the win32 CreateFile.
613 * RETURNS: Status
614 */
615
616 NTSTATUS
617 STDCALL
618 NtCreateFile(
619 OUT PHANDLE FileHandle,
620 IN ACCESS_MASK DesiredAccess,
621 IN POBJECT_ATTRIBUTES ObjectAttributes,
622 OUT PIO_STATUS_BLOCK IoStatusBlock,
623 IN PLARGE_INTEGER AllocationSize OPTIONAL,
624 IN ULONG FileAttributes,
625 IN ULONG ShareAccess,
626 IN ULONG CreateDisposition,
627 IN ULONG CreateOptions,
628 IN PVOID EaBuffer OPTIONAL,
629 IN ULONG EaLength
630 );
631
632 NTSTATUS
633 STDCALL
634 ZwCreateFile(
635 OUT PHANDLE FileHandle,
636 IN ACCESS_MASK DesiredAccess,
637 IN POBJECT_ATTRIBUTES ObjectAttributes,
638 OUT PIO_STATUS_BLOCK IoStatusBlock,
639 IN PLARGE_INTEGER AllocationSize OPTIONAL,
640 IN ULONG FileAttributes,
641 IN ULONG ShareAccess,
642 IN ULONG CreateDisposition,
643 IN ULONG CreateOptions,
644 IN PVOID EaBuffer OPTIONAL,
645 IN ULONG EaLength
646 );
647
648 /*
649 * FUNCTION: Creates or opens a file, directory or device object.
650 * ARGUMENTS:
651 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
652 * DesiredAccess = Specifies the allowed or desired access to the port
653 * IoStatusBlock =
654 * NumberOfConcurrentThreads =
655 * REMARKS: This function maps to the win32 CreateIoCompletionPort
656 * RETURNS:
657 * Status
658 */
659
660 NTSTATUS
661 STDCALL
662 NtCreateIoCompletion(
663 OUT PHANDLE IoCompletionHandle,
664 IN ACCESS_MASK DesiredAccess,
665 IN POBJECT_ATTRIBUTES ObjectAttributes,
666 IN ULONG NumberOfConcurrentThreads
667 );
668
669 NTSTATUS
670 STDCALL
671 ZwCreateIoCompletion(
672 OUT PHANDLE IoCompletionHandle,
673 IN ACCESS_MASK DesiredAccess,
674 IN POBJECT_ATTRIBUTES ObjectAttributes,
675 IN ULONG NumberOfConcurrentThreads
676 );
677
678 /*
679 * FUNCTION: Creates a registry key
680 * ARGUMENTS:
681 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
682 * DesiredAccess = Specifies the allowed or desired access to the key
683 * It can have a combination of the following values:
684 * KEY_READ | KEY_WRITE | KEY_EXECUTE | KEY_ALL_ACCESS
685 * or
686 * KEY_QUERY_VALUE The values of the key can be queried.
687 * KEY_SET_VALUE The values of the key can be modified.
688 * KEY_CREATE_SUB_KEYS The key may contain subkeys.
689 * KEY_ENUMERATE_SUB_KEYS Subkeys can be queried.
690 * KEY_NOTIFY
691 * KEY_CREATE_LINK A symbolic link to the key can be created.
692 * ObjectAttributes = The name of the key may be specified directly in the name field
693 * of object attributes or relative to a key in rootdirectory.
694 * TitleIndex = Might specify the position in the sequential order of subkeys.
695 * Class = Specifies the kind of data, for example REG_SZ for string data. [ ??? ]
696 * CreateOptions = Specifies additional options with which the key is created
697 * REG_OPTION_VOLATILE The key is not preserved across boots.
698 * REG_OPTION_NON_VOLATILE The key is preserved accross boots.
699 * REG_OPTION_CREATE_LINK The key is a symbolic link to another key.
700 * REG_OPTION_BACKUP_RESTORE Key is being opened or created for backup/restore operations.
701 * Disposition = Indicates if the call to NtCreateKey resulted in the creation of a key it
702 * can have the following values: REG_CREATED_NEW_KEY | REG_OPENED_EXISTING_KEY
703 * RETURNS:
704 * Status
705 */
706
707 NTSTATUS STDCALL
708 NtCreateKey(OUT PHANDLE KeyHandle,
709 IN ACCESS_MASK DesiredAccess,
710 IN POBJECT_ATTRIBUTES ObjectAttributes,
711 IN ULONG TitleIndex,
712 IN PUNICODE_STRING Class OPTIONAL,
713 IN ULONG CreateOptions,
714 IN PULONG Disposition OPTIONAL);
715
716 NTSTATUS STDCALL
717 ZwCreateKey(OUT PHANDLE KeyHandle,
718 IN ACCESS_MASK DesiredAccess,
719 IN POBJECT_ATTRIBUTES ObjectAttributes,
720 IN ULONG TitleIndex,
721 IN PUNICODE_STRING Class OPTIONAL,
722 IN ULONG CreateOptions,
723 IN PULONG Disposition OPTIONAL);
724
725 /*
726 * FUNCTION: Creates a mail slot file
727 * ARGUMENTS:
728 * MailSlotFileHandle (OUT) = Caller supplied storage for the resulting handle
729 * DesiredAccess = Specifies the allowed or desired access to the file
730 * ObjectAttributes = Contains the name of the mailslotfile.
731 * IoStatusBlock =
732 * FileAttributes =
733 * ShareAccess =
734 * MaxMessageSize =
735 * TimeOut =
736 *
737 * REMARKS: This funciton maps to the win32 function CreateMailSlot
738 * RETURNS:
739 * Status
740 */
741
742 NTSTATUS
743 STDCALL
744 NtCreateMailslotFile(
745 OUT PHANDLE MailSlotFileHandle,
746 IN ACCESS_MASK DesiredAccess,
747 IN POBJECT_ATTRIBUTES ObjectAttributes,
748 OUT PIO_STATUS_BLOCK IoStatusBlock,
749 IN ULONG FileAttributes,
750 IN ULONG ShareAccess,
751 IN ULONG MaxMessageSize,
752 IN PLARGE_INTEGER TimeOut
753 );
754
755 NTSTATUS
756 STDCALL
757 ZwCreateMailslotFile(
758 OUT PHANDLE MailSlotFileHandle,
759 IN ACCESS_MASK DesiredAccess,
760 IN POBJECT_ATTRIBUTES ObjectAttributes,
761 OUT PIO_STATUS_BLOCK IoStatusBlock,
762 IN ULONG FileAttributes,
763 IN ULONG ShareAccess,
764 IN ULONG MaxMessageSize,
765 IN PLARGE_INTEGER TimeOut
766 );
767
768 /*
769 * FUNCTION: Creates or opens a mutex
770 * ARGUMENTS:
771 * MutantHandle (OUT) = Caller supplied storage for the resulting handle
772 * DesiredAccess = Specifies the allowed or desired access to the port
773 * ObjectAttributes = Contains the name of the mutex.
774 * InitialOwner = If true the calling thread acquires ownership
775 * of the mutex.
776 * REMARKS: This funciton maps to the win32 function CreateMutex
777 * RETURNS:
778 * Status
779 */
780 NTSTATUS
781 STDCALL
782 NtCreateMutant(
783 OUT PHANDLE MutantHandle,
784 IN ACCESS_MASK DesiredAccess,
785 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
786 IN BOOLEAN InitialOwner
787 );
788
789 NTSTATUS
790 STDCALL
791 ZwCreateMutant(
792 OUT PHANDLE MutantHandle,
793 IN ACCESS_MASK DesiredAccess,
794 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
795 IN BOOLEAN InitialOwner
796 );
797
798 /*
799 * FUNCTION: Creates a named pipe
800 * ARGUMENTS:
801 * NamedPipeFileHandle (OUT) = Caller supplied storage for the
802 * resulting handle
803 * DesiredAccess = Specifies the type of access that the caller
804 * requires to the file boject
805 * ObjectAttributes = Points to a structure that specifies the
806 * object attributes.
807 * IoStatusBlock = Points to a variable that receives the final
808 * completion status and information
809 * ShareAccess = Specifies the limitations on sharing of the file.
810 * This parameter can be zero or any compatible
811 * combination of the following flags
812 * FILE_SHARE_READ
813 * FILE_SHARE_WRITE
814 * CreateDisposition = Specifies what to do depending on whether
815 * the file already exists. This must be one of
816 * the following values
817 * FILE_OPEN
818 * FILE_CREATE
819 * FILE_OPEN_IF
820 * CreateOptions = Specifies the options to be applied when
821 * creating or opening the file, as a compatible
822 * combination of the following flags
823 * FILE_WRITE_THROUGH
824 * FILE_SYNCHRONOUS_IO_ALERT
825 * FILE_SYNCHRONOUS_IO_NONALERT
826 * TypeMessage = Specifies whether the data written to the pipe is
827 * interpreted as a sequence of messages or as a
828 * stream of bytes
829 * ReadModeMessage = Specifies whether the data read from the pipe
830 * is interpreted as a sequence of messages or as
831 * a stream of bytes
832 * NonBlocking = Specifies whether non-blocking mode is enabled
833 * MaxInstances = Specifies the maximum number of instancs that can
834 * be created for this pipe
835 * InBufferSize = Specifies the number of bytes to reserve for the
836 * input buffer
837 * OutBufferSize = Specifies the number of bytes to reserve for the
838 * output buffer
839 * DefaultTimeout = Optionally points to a variable that specifies
840 * the default timeout value in units of
841 * 100-nanoseconds.
842 * REMARKS: This funciton maps to the win32 function CreateNamedPipe
843 * RETURNS:
844 * Status
845 */
846 NTSTATUS STDCALL
847 NtCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle,
848 IN ACCESS_MASK DesiredAccess,
849 IN POBJECT_ATTRIBUTES ObjectAttributes,
850 OUT PIO_STATUS_BLOCK IoStatusBlock,
851 IN ULONG ShareAccess,
852 IN ULONG CreateDisposition,
853 IN ULONG CreateOptions,
854 IN ULONG NamedPipeType,
855 IN ULONG ReadMode,
856 IN ULONG CompletionMode,
857 IN ULONG MaxInstances,
858 IN ULONG InBufferSize,
859 IN ULONG OutBufferSize,
860 IN PLARGE_INTEGER DefaultTimeOut);
861
862 NTSTATUS STDCALL
863 ZwCreateNamedPipeFile (OUT PHANDLE NamedPipeFileHandle,
864 IN ACCESS_MASK DesiredAccess,
865 IN POBJECT_ATTRIBUTES ObjectAttributes,
866 OUT PIO_STATUS_BLOCK IoStatusBlock,
867 IN ULONG ShareAccess,
868 IN ULONG CreateDisposition,
869 IN ULONG CreateOptions,
870 IN ULONG NamedPipeType,
871 IN ULONG ReadMode,
872 IN ULONG CompletionMode,
873 IN ULONG MaxInstances,
874 IN ULONG InBufferSize,
875 IN ULONG OutBufferSize,
876 IN PLARGE_INTEGER DefaultTimeOut);
877
878
879 NTSTATUS STDCALL
880 NtCreatePort (PHANDLE PortHandle,
881 POBJECT_ATTRIBUTES ObjectAttributes,
882 ULONG MaxConnectInfoLength,
883 ULONG MaxDataLength,
884 ULONG NPMessageQueueSize OPTIONAL);
885
886 NTSTATUS STDCALL
887 NtCreatePort (PHANDLE PortHandle,
888 POBJECT_ATTRIBUTES ObjectAttributes,
889 ULONG MaxConnectInfoLength,
890 ULONG MaxDataLength,
891 ULONG NPMessageQueueSize OPTIONAL);
892
893
894 /*
895 * FUNCTION: Creates a process.
896 * ARGUMENTS:
897 * ProcessHandle (OUT) = Caller supplied storage for the resulting handle
898 * DesiredAccess = Specifies the allowed or desired access to the process can
899 * be a combinate of STANDARD_RIGHTS_REQUIRED| ..
900 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
901 * ParentProcess = Handle to the parent process.
902 * InheritObjectTable = Specifies to inherit the objects of the parent process if true.
903 * SectionHandle = Handle to a section object to back the image file
904 * DebugPort = Handle to a DebugPort if NULL the system default debug port will be used.
905 * ExceptionPort = Handle to a exception port.
906 * REMARKS:
907 * This function maps to the win32 CreateProcess.
908 * RETURNS: Status
909 */
910 NTSTATUS
911 STDCALL
912 NtCreateProcess(
913 OUT PHANDLE ProcessHandle,
914 IN ACCESS_MASK DesiredAccess,
915 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
916 IN HANDLE ParentProcess,
917 IN BOOLEAN InheritObjectTable,
918 IN HANDLE SectionHandle OPTIONAL,
919 IN HANDLE DebugPort OPTIONAL,
920 IN HANDLE ExceptionPort OPTIONAL
921 );
922
923 NTSTATUS
924 STDCALL
925 ZwCreateProcess(
926 OUT PHANDLE ProcessHandle,
927 IN ACCESS_MASK DesiredAccess,
928 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
929 IN HANDLE ParentProcess,
930 IN BOOLEAN InheritObjectTable,
931 IN HANDLE SectionHandle OPTIONAL,
932 IN HANDLE DebugPort OPTIONAL,
933 IN HANDLE ExceptionPort OPTIONAL
934 );
935
936 /*
937 * FUNCTION: Creates a section object.
938 * ARGUMENTS:
939 * SectionHandle (OUT) = Caller supplied storage for the resulting handle
940 * DesiredAccess = Specifies the desired access to the section can be a combination of STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE |
941 * SECTION_MAP_READ | SECTION_MAP_EXECUTE.
942 * ObjectAttribute = Initialized attributes for the object can be used to create a named section
943 * MaxiumSize = Maximizes the size of the memory section. Must be non-NULL for a page-file backed section.
944 * If value specified for a mapped file and the file is not large enough, file will be extended.
945 * SectionPageProtection = Can be a combination of PAGE_READONLY | PAGE_READWRITE | PAGE_WRITEONLY | PAGE_WRITECOPY.
946 * AllocationAttributes = can be a combination of SEC_IMAGE | SEC_RESERVE
947 * FileHanlde = Handle to a file to create a section mapped to a file instead of a memory backed section.
948 * RETURNS: Status
949 */
950
951 NTSTATUS
952 STDCALL
953 NtCreateSection(
954 OUT PHANDLE SectionHandle,
955 IN ACCESS_MASK DesiredAccess,
956 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
957 IN PLARGE_INTEGER MaximumSize OPTIONAL,
958 IN ULONG SectionPageProtection OPTIONAL,
959 IN ULONG AllocationAttributes,
960 IN HANDLE FileHandle OPTIONAL
961 );
962
963 NTSTATUS
964 STDCALL
965 ZwCreateSection(
966 OUT PHANDLE SectionHandle,
967 IN ACCESS_MASK DesiredAccess,
968 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
969 IN PLARGE_INTEGER MaximumSize OPTIONAL,
970 IN ULONG SectionPageProtection OPTIONAL,
971 IN ULONG AllocationAttributes,
972 IN HANDLE FileHandle OPTIONAL
973 );
974
975 /*
976 * FUNCTION: Creates a semaphore object for interprocess synchronization.
977 * ARGUMENTS:
978 * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle
979 * DesiredAccess = Specifies the allowed or desired access to the semaphore.
980 * ObjectAttribute = Initialized attributes for the object.
981 * InitialCount = Not necessary zero, might be smaller than zero.
982 * MaximumCount = Maxiumum count the semaphore can reach.
983 * RETURNS: Status
984 * REMARKS:
985 * The semaphore is set to signaled when its count is greater than zero, and non-signaled when its count is zero.
986 */
987
988 //FIXME: should a semaphore's initial count allowed to be smaller than zero ??
989 NTSTATUS
990 STDCALL
991 NtCreateSemaphore(
992 OUT PHANDLE SemaphoreHandle,
993 IN ACCESS_MASK DesiredAccess,
994 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
995 IN LONG InitialCount,
996 IN LONG MaximumCount
997 );
998
999 NTSTATUS
1000 STDCALL
1001 ZwCreateSemaphore(
1002 OUT PHANDLE SemaphoreHandle,
1003 IN ACCESS_MASK DesiredAccess,
1004 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1005 IN LONG InitialCount,
1006 IN LONG MaximumCount
1007 );
1008
1009 /*
1010 * FUNCTION: Creates a symbolic link object
1011 * ARGUMENTS:
1012 * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle
1013 * DesiredAccess = Specifies the allowed or desired access to the thread.
1014 * ObjectAttributes = Initialized attributes for the object.
1015 * Name = Target name of the symbolic link
1016 * RETURNS: Status
1017 */
1018 NTSTATUS
1019 STDCALL
1020 NtCreateSymbolicLinkObject(
1021 OUT PHANDLE LinkHandle,
1022 IN ACCESS_MASK DesiredAccess,
1023 IN POBJECT_ATTRIBUTES ObjectAttributes,
1024 IN PUNICODE_STRING LinkTarget
1025 );
1026
1027 NTSTATUS
1028 STDCALL
1029 ZwCreateSymbolicLinkObject(
1030 OUT PHANDLE LinkHandle,
1031 IN ACCESS_MASK DesiredAccess,
1032 IN POBJECT_ATTRIBUTES ObjectAttributes,
1033 IN PUNICODE_STRING LinkTarget
1034 );
1035
1036 /*
1037 * FUNCTION: Creates a waitable timer.
1038 * ARGUMENTS:
1039 * TimerHandle (OUT) = Caller supplied storage for the resulting handle
1040 * DesiredAccess = Specifies the allowed or desired access to the timer.
1041 * ObjectAttributes = Initialized attributes for the object.
1042 * TimerType = Specifies if the timer should be reset manually.
1043 * REMARKS:
1044 * This function maps to the win32 CreateWaitableTimer. lpTimerAttributes and lpTimerName map to
1045 * corresponding fields in OBJECT_ATTRIBUTES structure.
1046 * RETURNS: Status
1047 */
1048 NTSTATUS
1049 STDCALL
1050 NtCreateTimer(
1051 OUT PHANDLE TimerHandle,
1052 IN ACCESS_MASK DesiredAccess,
1053 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1054 IN TIMER_TYPE TimerType
1055 );
1056
1057 NTSTATUS
1058 STDCALL
1059 ZwCreateTimer(
1060 OUT PHANDLE TimerHandle,
1061 IN ACCESS_MASK DesiredAccess,
1062 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1063 IN TIMER_TYPE TimerType
1064 );
1065
1066 /*
1067 * FUNCTION: Creates a token.
1068 * ARGUMENTS:
1069 * TokenHandle (OUT) = Caller supplied storage for the resulting handle
1070 * DesiredAccess = Specifies the allowed or desired access to the process can
1071 * be a combinate of STANDARD_RIGHTS_REQUIRED| ..
1072 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
1073 * TokenType =
1074 * AuthenticationId =
1075 * ExpirationTime =
1076 * TokenUser =
1077 * TokenGroups =
1078 * TokenPrivileges =
1079 * TokenOwner =
1080 * TokenPrimaryGroup =
1081 * TokenDefaultDacl =
1082 * TokenSource =
1083 * REMARKS:
1084 * This function does not map to a win32 function
1085 * RETURNS: Status
1086 */
1087
1088 NTSTATUS
1089 STDCALL
1090 NtCreateToken(
1091 OUT PHANDLE TokenHandle,
1092 IN ACCESS_MASK DesiredAccess,
1093 IN POBJECT_ATTRIBUTES ObjectAttributes,
1094 IN TOKEN_TYPE TokenType,
1095 IN PLUID AuthenticationId,
1096 IN PLARGE_INTEGER ExpirationTime,
1097 IN PTOKEN_USER TokenUser,
1098 IN PTOKEN_GROUPS TokenGroups,
1099 IN PTOKEN_PRIVILEGES TokenPrivileges,
1100 IN PTOKEN_OWNER TokenOwner,
1101 IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
1102 IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
1103 IN PTOKEN_SOURCE TokenSource
1104 );
1105
1106 NTSTATUS
1107 STDCALL
1108 ZwCreateToken(
1109 OUT PHANDLE TokenHandle,
1110 IN ACCESS_MASK DesiredAccess,
1111 IN POBJECT_ATTRIBUTES ObjectAttributes,
1112 IN TOKEN_TYPE TokenType,
1113 IN PLUID AuthenticationId,
1114 IN PLARGE_INTEGER ExpirationTime,
1115 IN PTOKEN_USER TokenUser,
1116 IN PTOKEN_GROUPS TokenGroups,
1117 IN PTOKEN_PRIVILEGES TokenPrivileges,
1118 IN PTOKEN_OWNER TokenOwner,
1119 IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
1120 IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
1121 IN PTOKEN_SOURCE TokenSource
1122 );
1123
1124 /*
1125 * FUNCTION: Returns the callers thread TEB.
1126 * RETURNS: The resulting teb.
1127 */
1128 #if 0
1129 NT_TEB *
1130 STDCALL
1131 NtCurrentTeb(VOID
1132 );
1133 #endif
1134
1135
1136 NTSTATUS STDCALL
1137 NtCreateWaitablePort (PHANDLE PortHandle,
1138 POBJECT_ATTRIBUTES ObjectAttributes,
1139 ULONG MaxConnectInfoLength,
1140 ULONG MaxDataLength,
1141 ULONG NPMessageQueueSize OPTIONAL);
1142
1143 NTSTATUS STDCALL
1144 ZwCreateWaitablePort (PHANDLE PortHandle,
1145 POBJECT_ATTRIBUTES ObjectAttributes,
1146 ULONG MaxConnectInfoLength,
1147 ULONG MaxDataLength,
1148 ULONG NPMessageQueueSize OPTIONAL);
1149
1150
1151 /*
1152 * FUNCTION: Deletes an atom from the global atom table
1153 * ARGUMENTS:
1154 * Atom = Identifies the atom to delete
1155 * REMARKS:
1156 * The function maps to the win32 GlobalDeleteAtom
1157 * RETURNS: Status
1158 */
1159 NTSTATUS
1160 STDCALL
1161 NtDeleteAtom(
1162 IN RTL_ATOM Atom
1163 );
1164
1165 NTSTATUS
1166 STDCALL
1167 ZwDeleteAtom(
1168 IN RTL_ATOM Atom
1169 );
1170
1171 NTSTATUS
1172 STDCALL
1173 NtDeleteBootEntry(
1174 IN PUNICODE_STRING EntryName,
1175 IN PUNICODE_STRING EntryValue
1176 );
1177
1178 NTSTATUS
1179 STDCALL
1180 ZwDeleteBootEntry(
1181 IN PUNICODE_STRING EntryName,
1182 IN PUNICODE_STRING EntryValue
1183 );
1184
1185 /*
1186 * FUNCTION: Deletes a file or a directory
1187 * ARGUMENTS:
1188 * ObjectAttributes = Name of the file which should be deleted
1189 * REMARKS:
1190 * This system call is functionally equivalent to NtSetInformationFile
1191 * setting the disposition information.
1192 * The function maps to the win32 DeleteFile.
1193 * RETURNS: Status
1194 */
1195 NTSTATUS
1196 STDCALL
1197 NtDeleteFile(
1198 IN POBJECT_ATTRIBUTES ObjectAttributes
1199 );
1200
1201 NTSTATUS
1202 STDCALL
1203 ZwDeleteFile(
1204 IN POBJECT_ATTRIBUTES ObjectAttributes
1205 );
1206
1207 /*
1208 * FUNCTION: Deletes a registry key
1209 * ARGUMENTS:
1210 * KeyHandle = Handle of the key
1211 * RETURNS: Status
1212 */
1213 NTSTATUS
1214 STDCALL
1215 NtDeleteKey(
1216 IN HANDLE KeyHandle
1217 );
1218 NTSTATUS
1219 STDCALL
1220 ZwDeleteKey(
1221 IN HANDLE KeyHandle
1222 );
1223
1224 /*
1225 * FUNCTION: Generates a audit message when an object is deleted
1226 * ARGUMENTS:
1227 * SubsystemName = Spefies the name of the subsystem can be 'WIN32' or 'DEBUG'
1228 * HandleId= Handle to an audit object
1229 * GenerateOnClose = Value returned by NtAccessCheckAndAuditAlarm
1230 * REMARKS: This function maps to the win32 ObjectCloseAuditAlarm
1231 * RETURNS: Status
1232 */
1233
1234 NTSTATUS
1235 STDCALL
1236 NtDeleteObjectAuditAlarm (
1237 IN PUNICODE_STRING SubsystemName,
1238 IN PVOID HandleId,
1239 IN BOOLEAN GenerateOnClose
1240 );
1241
1242 NTSTATUS
1243 STDCALL
1244 ZwDeleteObjectAuditAlarm (
1245 IN PUNICODE_STRING SubsystemName,
1246 IN PVOID HandleId,
1247 IN BOOLEAN GenerateOnClose
1248 );
1249
1250
1251 /*
1252 * FUNCTION: Deletes a value from a registry key
1253 * ARGUMENTS:
1254 * KeyHandle = Handle of the key
1255 * ValueName = Name of the value to delete
1256 * RETURNS: Status
1257 */
1258
1259 NTSTATUS
1260 STDCALL
1261 NtDeleteValueKey(
1262 IN HANDLE KeyHandle,
1263 IN PUNICODE_STRING ValueName
1264 );
1265
1266 NTSTATUS
1267 STDCALL
1268 ZwDeleteValueKey(
1269 IN HANDLE KeyHandle,
1270 IN PUNICODE_STRING ValueName
1271 );
1272 /*
1273 * FUNCTION: Sends IOCTL to the io sub system
1274 * ARGUMENTS:
1275 * DeviceHandle = Points to the handle that is created by NtCreateFile
1276 * Event = Event to synchronize on STATUS_PENDING
1277 * ApcRoutine = Asynchroneous procedure callback
1278 * ApcContext = Callback context.
1279 * IoStatusBlock = Caller should supply storage for extra information..
1280 * IoControlCode = Contains the IO Control command. This is an
1281 * index to the structures in InputBuffer and OutputBuffer.
1282 * InputBuffer = Caller should supply storage for input buffer if IOTL expects one.
1283 * InputBufferSize = Size of the input bufffer
1284 * OutputBuffer = Caller should supply storage for output buffer if IOTL expects one.
1285 * OutputBufferSize = Size of the input bufffer
1286 * RETURNS: Status
1287 */
1288
1289 NTSTATUS
1290 STDCALL
1291 NtDeviceIoControlFile(
1292 IN HANDLE DeviceHandle,
1293 IN HANDLE Event OPTIONAL,
1294 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
1295 IN PVOID UserApcContext OPTIONAL,
1296 OUT PIO_STATUS_BLOCK IoStatusBlock,
1297 IN ULONG IoControlCode,
1298 IN PVOID InputBuffer,
1299 IN ULONG InputBufferSize,
1300 OUT PVOID OutputBuffer,
1301 IN ULONG OutputBufferSize
1302 );
1303
1304 NTSTATUS
1305 STDCALL
1306 ZwDeviceIoControlFile(
1307 IN HANDLE DeviceHandle,
1308 IN HANDLE Event OPTIONAL,
1309 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
1310 IN PVOID UserApcContext OPTIONAL,
1311 OUT PIO_STATUS_BLOCK IoStatusBlock,
1312 IN ULONG IoControlCode,
1313 IN PVOID InputBuffer,
1314 IN ULONG InputBufferSize,
1315 OUT PVOID OutputBuffer,
1316 IN ULONG OutputBufferSize
1317 );
1318 /*
1319 * FUNCTION: Displays a string on the blue screen
1320 * ARGUMENTS:
1321 * DisplayString = The string to display
1322 * RETURNS: Status
1323 */
1324
1325 NTSTATUS
1326 STDCALL
1327 NtDisplayString(
1328 IN PUNICODE_STRING DisplayString
1329 );
1330
1331 NTSTATUS
1332 STDCALL
1333 ZwDisplayString(
1334 IN PUNICODE_STRING DisplayString
1335 );
1336
1337
1338 NTSTATUS
1339 STDCALL
1340 NtEnumerateBootEntries(
1341 IN ULONG Unknown1,
1342 IN ULONG Unknown2
1343 );
1344
1345 NTSTATUS
1346 STDCALL
1347 ZwEnumerateBootEntries(
1348 IN ULONG Unknown1,
1349 IN ULONG Unknown2
1350 );
1351
1352
1353 /*
1354 * FUNCTION: Returns information about the subkeys of an open key
1355 * ARGUMENTS:
1356 * KeyHandle = Handle of the key whose subkeys are to enumerated
1357 * Index = zero based index of the subkey for which information is
1358 * request
1359 * KeyInformationClass = Type of information returned
1360 * KeyInformation (OUT) = Caller allocated buffer for the information
1361 * about the key
1362 * Length = Length in bytes of the KeyInformation buffer
1363 * ResultLength (OUT) = Caller allocated storage which holds
1364 * the number of bytes of information retrieved
1365 * on return
1366 * RETURNS: Status
1367 */
1368 NTSTATUS
1369 STDCALL
1370 NtEnumerateKey(
1371 IN HANDLE KeyHandle,
1372 IN ULONG Index,
1373 IN KEY_INFORMATION_CLASS KeyInformationClass,
1374 OUT PVOID KeyInformation,
1375 IN ULONG Length,
1376 OUT PULONG ResultLength
1377 );
1378
1379 NTSTATUS
1380 STDCALL
1381 ZwEnumerateKey(
1382 IN HANDLE KeyHandle,
1383 IN ULONG Index,
1384 IN KEY_INFORMATION_CLASS KeyInformationClass,
1385 OUT PVOID KeyInformation,
1386 IN ULONG Length,
1387 OUT PULONG ResultLength
1388 );
1389 /*
1390 * FUNCTION: Returns information about the value entries of an open key
1391 * ARGUMENTS:
1392 * KeyHandle = Handle of the key whose value entries are to enumerated
1393 * Index = zero based index of the subkey for which information is
1394 * request
1395 * KeyInformationClass = Type of information returned
1396 * KeyInformation (OUT) = Caller allocated buffer for the information
1397 * about the key
1398 * Length = Length in bytes of the KeyInformation buffer
1399 * ResultLength (OUT) = Caller allocated storage which holds
1400 * the number of bytes of information retrieved
1401 * on return
1402 * RETURNS: Status
1403 */
1404 NTSTATUS
1405 STDCALL
1406 NtEnumerateValueKey(
1407 IN HANDLE KeyHandle,
1408 IN ULONG Index,
1409 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1410 OUT PVOID KeyValueInformation,
1411 IN ULONG Length,
1412 OUT PULONG ResultLength
1413 );
1414
1415 NTSTATUS
1416 STDCALL
1417 ZwEnumerateValueKey(
1418 IN HANDLE KeyHandle,
1419 IN ULONG Index,
1420 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1421 OUT PVOID KeyValueInformation,
1422 IN ULONG Length,
1423 OUT PULONG ResultLength
1424 );
1425
1426 /*
1427 * FUNCTION: Flushes chached file data to disk
1428 * ARGUMENTS:
1429 * FileHandle = Points to the file
1430 * IoStatusBlock = Caller must supply storage to receive the result of the flush
1431 * buffers operation. The information field is set to number of bytes
1432 * flushed to disk.
1433 * RETURNS: Status
1434 * REMARKS:
1435 * This funciton maps to the win32 FlushFileBuffers
1436 */
1437 NTSTATUS
1438 STDCALL
1439 NtFlushBuffersFile(
1440 IN HANDLE FileHandle,
1441 OUT PIO_STATUS_BLOCK IoStatusBlock
1442 );
1443
1444 NTSTATUS
1445 STDCALL
1446 ZwFlushBuffersFile(
1447 IN HANDLE FileHandle,
1448 OUT PIO_STATUS_BLOCK IoStatusBlock
1449 );
1450
1451 /*
1452 * FUNCTION: Flushes a registry key to disk
1453 * ARGUMENTS:
1454 * KeyHandle = Points to the registry key handle
1455 * RETURNS: Status
1456 * REMARKS:
1457 * This funciton maps to the win32 RegFlushKey.
1458 */
1459 NTSTATUS
1460 STDCALL
1461 NtFlushKey(
1462 IN HANDLE KeyHandle
1463 );
1464
1465 NTSTATUS
1466 STDCALL
1467 ZwFlushKey(
1468 IN HANDLE KeyHandle
1469 );
1470
1471 /*
1472 * FUNCTION: Flushes the dirty pages to file
1473 * RETURNS: Status
1474 * FIXME: Not sure this does (how is the file specified)
1475 */
1476 NTSTATUS STDCALL NtFlushWriteBuffer(VOID);
1477 NTSTATUS STDCALL ZwFlushWriteBuffer(VOID);
1478
1479 /*
1480 * FUNCTION: Frees a range of virtual memory
1481 * ARGUMENTS:
1482 * ProcessHandle = Points to the process that allocated the virtual
1483 * memory
1484 * BaseAddress = Points to the memory address, rounded down to a
1485 * multiple of the pagesize
1486 * RegionSize = Limits the range to free, rounded up to a multiple of
1487 * the paging size
1488 * FreeType = Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE
1489 * RETURNS: Status
1490 */
1491 NTSTATUS STDCALL NtFreeVirtualMemory(IN HANDLE ProcessHandle,
1492 IN PVOID *BaseAddress,
1493 IN PULONG RegionSize,
1494 IN ULONG FreeType);
1495 NTSTATUS STDCALL ZwFreeVirtualMemory(IN HANDLE ProcessHandle,
1496 IN PVOID *BaseAddress,
1497 IN PULONG RegionSize,
1498 IN ULONG FreeType);
1499
1500 /*
1501 * FUNCTION: Sends FSCTL to the filesystem
1502 * ARGUMENTS:
1503 * DeviceHandle = Points to the handle that is created by NtCreateFile
1504 * Event = Event to synchronize on STATUS_PENDING
1505 * ApcRoutine =
1506 * ApcContext =
1507 * IoStatusBlock = Caller should supply storage for
1508 * IoControlCode = Contains the File System Control command. This is an
1509 * index to the structures in InputBuffer and OutputBuffer.
1510 * FSCTL_GET_RETRIEVAL_POINTERS [Input/Output] RETRIEVAL_POINTERS_BUFFER
1511 * FSCTL_GET_VOLUME_BITMAP [Input] STARTING_LCN_INPUT_BUFFER
1512 * FSCTL_GET_VOLUME_BITMAP [Output] VOLUME_BITMAP_BUFFER
1513 * FSCTL_MOVE_FILE [Input] MOVE_FILE_DATA
1514 *
1515 * InputBuffer = Caller should supply storage for input buffer if FSCTL expects one.
1516 * InputBufferSize = Size of the input bufffer
1517 * OutputBuffer = Caller should supply storage for output buffer if FSCTL expects one.
1518 * OutputBufferSize = Size of the input bufffer
1519 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
1520 * STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ]
1521 */
1522 NTSTATUS
1523 STDCALL
1524 NtFsControlFile(
1525 IN HANDLE DeviceHandle,
1526 IN HANDLE Event OPTIONAL,
1527 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1528 IN PVOID ApcContext OPTIONAL,
1529 OUT PIO_STATUS_BLOCK IoStatusBlock,
1530 IN ULONG IoControlCode,
1531 IN PVOID InputBuffer,
1532 IN ULONG InputBufferSize,
1533 OUT PVOID OutputBuffer,
1534 IN ULONG OutputBufferSize
1535 );
1536
1537 NTSTATUS
1538 STDCALL
1539 ZwFsControlFile(
1540 IN HANDLE DeviceHandle,
1541 IN HANDLE Event OPTIONAL,
1542 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1543 IN PVOID ApcContext OPTIONAL,
1544 OUT PIO_STATUS_BLOCK IoStatusBlock,
1545 IN ULONG IoControlCode,
1546 IN PVOID InputBuffer,
1547 IN ULONG InputBufferSize,
1548 OUT PVOID OutputBuffer,
1549 IN ULONG OutputBufferSize
1550 );
1551
1552 /*
1553 * FUNCTION: Retrieves the processor context of a thread
1554 * ARGUMENTS:
1555 * ThreadHandle = Handle to a thread
1556 * ThreadContext (OUT) = Caller allocated storage for the processor context
1557 * RETURNS: Status
1558 */
1559
1560 NTSTATUS
1561 STDCALL
1562 NtGetContextThread(
1563 IN HANDLE ThreadHandle,
1564 OUT PCONTEXT ThreadContext
1565 );
1566
1567 NTSTATUS
1568 STDCALL
1569 ZwGetContextThread(
1570 IN HANDLE ThreadHandle,
1571 OUT PCONTEXT ThreadContext
1572 );
1573
1574
1575 NTSTATUS STDCALL
1576 NtImpersonateClientOfPort (HANDLE PortHandle,
1577 PLPC_MESSAGE ClientMessage);
1578
1579 NTSTATUS STDCALL
1580 ZwImpersonateClientOfPort (HANDLE PortHandle,
1581 PLPC_MESSAGE ClientMessage);
1582
1583 /*
1584 * FUNCTION: Sets a thread to impersonate another
1585 * ARGUMENTS:
1586 * ThreadHandle = Server thread that will impersonate a client.
1587 ThreadToImpersonate = Client thread that will be impersonated
1588 SecurityQualityOfService = Specifies the impersonation level.
1589 * RETURNS: Status
1590 */
1591
1592 NTSTATUS
1593 STDCALL
1594 NtImpersonateThread(
1595 IN HANDLE ThreadHandle,
1596 IN HANDLE ThreadToImpersonate,
1597 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
1598 );
1599
1600 NTSTATUS
1601 STDCALL
1602 ZwImpersonateThread(
1603 IN HANDLE ThreadHandle,
1604 IN HANDLE ThreadToImpersonate,
1605 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
1606 );
1607
1608 NTSTATUS
1609 STDCALL
1610 NtInitiatePowerAction (
1611 IN POWER_ACTION SystemAction,
1612 IN SYSTEM_POWER_STATE MinSystemState,
1613 IN ULONG Flags,
1614 IN BOOLEAN Asynchronous
1615 );
1616
1617 NTSTATUS
1618 STDCALL
1619 ZwInitiatePowerAction (
1620 IN POWER_ACTION SystemAction,
1621 IN SYSTEM_POWER_STATE MinSystemState,
1622 IN ULONG Flags,
1623 IN BOOLEAN Asynchronous
1624 );
1625 /*
1626 * FUNCTION: Initializes the registry.
1627 * ARGUMENTS:
1628 * SetUpBoot = This parameter is true for a setup boot.
1629 * RETURNS: Status
1630 */
1631 NTSTATUS
1632 STDCALL
1633 NtInitializeRegistry(
1634 BOOLEAN SetUpBoot
1635 );
1636 NTSTATUS
1637 STDCALL
1638 ZwInitializeRegistry(
1639 BOOLEAN SetUpBoot
1640 );
1641
1642 NTSTATUS
1643 STDCALL
1644 NtIsProcessInJob(
1645 IN HANDLE ProcessHandle, // ProcessHandle must grant PROCESS_QUERY_INFORMATION access.
1646 IN HANDLE JobHandle OPTIONAL // JobHandle must JOB_OBJECT_QUERY grant access. Defaults to the current process's job object.
1647 );
1648
1649 NTSTATUS
1650 STDCALL
1651 ZwIsProcessInJob(
1652 IN HANDLE ProcessHandle, // ProcessHandle must grant PROCESS_QUERY_INFORMATION access.
1653 IN HANDLE JobHandle OPTIONAL // JobHandle must JOB_OBJECT_QUERY grant access. Defaults to the current process's job object.
1654 );
1655
1656 NTSTATUS STDCALL
1657 NtListenPort (HANDLE PortHandle,
1658 PLPC_MESSAGE LpcMessage);
1659
1660 NTSTATUS STDCALL
1661 ZwListenPort (HANDLE PortHandle,
1662 PLPC_MESSAGE LpcMessage);
1663
1664
1665 /*
1666 * FUNCTION: Loads a driver.
1667 * ARGUMENTS:
1668 * DriverServiceName = Name of the driver to load
1669 * RETURNS: Status
1670 */
1671 NTSTATUS
1672 STDCALL
1673 NtLoadDriver(
1674 IN PUNICODE_STRING DriverServiceName
1675 );
1676
1677 NTSTATUS
1678 STDCALL
1679 ZwLoadDriver(
1680 IN PUNICODE_STRING DriverServiceName
1681 );
1682
1683 /*
1684 * FUNCTION: Locks a range of bytes in a file.
1685 * ARGUMENTS:
1686 * FileHandle = Handle to the file
1687 * Event = Should be null if apc is specified.
1688 * ApcRoutine = Asynchroneous Procedure Callback
1689 * ApcContext = Argument to the callback
1690 * IoStatusBlock (OUT) = Caller should supply storage for a structure containing
1691 * the completion status and information about the requested lock operation.
1692 * ByteOffset = Offset
1693 * Length = Number of bytes to lock.
1694 * Key = Special value to give other threads the possibility to unlock the file
1695 by supplying the key in a call to NtUnlockFile.
1696 * FailImmediatedly = If false the request will block untill the lock is obtained.
1697 * ExclusiveLock = Specifies whether a exclusive or a shared lock is obtained.
1698 * REMARK:
1699 This procedure maps to the win32 procedure LockFileEx. STATUS_PENDING is returned if the lock could
1700 not be obtained immediately, the device queue is busy and the IRP is queued.
1701 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
1702 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_LOCK_NOT_GRANTED ]
1703
1704 */
1705 NTSTATUS
1706 STDCALL
1707 NtLockFile(
1708 IN HANDLE FileHandle,
1709 IN HANDLE Event OPTIONAL,
1710 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1711 IN PVOID ApcContext OPTIONAL,
1712 OUT PIO_STATUS_BLOCK IoStatusBlock,
1713 IN PLARGE_INTEGER ByteOffset,
1714 IN PLARGE_INTEGER Length,
1715 IN PULONG Key,
1716 IN BOOLEAN FailImmediatedly,
1717 IN BOOLEAN ExclusiveLock
1718 );
1719
1720 NTSTATUS
1721 STDCALL
1722 ZwLockFile(
1723 IN HANDLE FileHandle,
1724 IN HANDLE Event OPTIONAL,
1725 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1726 IN PVOID ApcContext OPTIONAL,
1727 OUT PIO_STATUS_BLOCK IoStatusBlock,
1728 IN PLARGE_INTEGER ByteOffset,
1729 IN PLARGE_INTEGER Length,
1730 IN PULONG Key,
1731 IN BOOLEAN FailImmediatedly,
1732 IN BOOLEAN ExclusiveLock
1733 );
1734
1735 /*
1736 * FUNCTION: Makes temporary object that will be removed at next boot.
1737 * ARGUMENTS:
1738 * Handle = Handle to object
1739 * RETURNS: Status
1740 */
1741
1742
1743 NTSTATUS
1744 STDCALL
1745 NtMakePermanentObject(
1746 IN HANDLE ObjectHandle
1747 );
1748
1749 NTSTATUS
1750 STDCALL
1751 ZwMakePermanentObject(
1752 IN HANDLE ObjectHandle
1753 );
1754
1755 NTSTATUS
1756 STDCALL
1757 NtMakeTemporaryObject(
1758 IN HANDLE ObjectHandle
1759 );
1760
1761 NTSTATUS
1762 STDCALL
1763 ZwMakeTemporaryObject(
1764 IN HANDLE ObjectHandle
1765 );
1766 /*
1767 * FUNCTION: Maps a view of a section into the virtual address space of a
1768 * process
1769 * ARGUMENTS:
1770 * SectionHandle = Handle of the section
1771 * ProcessHandle = Handle of the process
1772 * BaseAddress = Desired base address (or NULL) on entry
1773 * Actual base address of the view on exit
1774 * ZeroBits = Number of high order address bits that must be zero
1775 * CommitSize = Size in bytes of the initially committed section of
1776 * the view
1777 * SectionOffset = Offset in bytes from the beginning of the section
1778 * to the beginning of the view
1779 * ViewSize = Desired length of map (or zero to map all) on entry
1780 * Actual length mapped on exit
1781 * InheritDisposition = Specified how the view is to be shared with
1782 * child processes
1783 * AllocateType = Type of allocation for the pages
1784 * Protect = Protection for the committed region of the view
1785 * RETURNS: Status
1786 */
1787 NTSTATUS
1788 STDCALL
1789 NtMapViewOfSection(
1790 IN HANDLE SectionHandle,
1791 IN HANDLE ProcessHandle,
1792 IN OUT PVOID *BaseAddress,
1793 IN ULONG ZeroBits,
1794 IN ULONG CommitSize,
1795 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
1796 IN OUT PULONG ViewSize,
1797 IN SECTION_INHERIT InheritDisposition,
1798 IN ULONG AllocationType,
1799 IN ULONG AccessProtection
1800 );
1801
1802 NTSTATUS
1803 STDCALL
1804 ZwMapViewOfSection(
1805 IN HANDLE SectionHandle,
1806 IN HANDLE ProcessHandle,
1807 IN OUT PVOID *BaseAddress,
1808 IN ULONG ZeroBits,
1809 IN ULONG CommitSize,
1810 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
1811 IN OUT PULONG ViewSize,
1812 IN SECTION_INHERIT InheritDisposition,
1813 IN ULONG AllocationType,
1814 IN ULONG AccessProtection
1815 );
1816
1817 /*
1818 * FUNCTION: Installs a notify for the change of a directory's contents
1819 * ARGUMENTS:
1820 * FileHandle = Handle to the directory
1821 Event =
1822 * ApcRoutine = Start address
1823 * ApcContext = Delimits the range of virtual memory
1824 * for which the new access protection holds
1825 * IoStatusBlock = The new access proctection for the pages
1826 * Buffer = Caller supplies storage for resulting information --> FILE_NOTIFY_INFORMATION
1827 * BufferSize = Size of the buffer
1828 CompletionFilter = Can be one of the following values:
1829 FILE_NOTIFY_CHANGE_FILE_NAME
1830 FILE_NOTIFY_CHANGE_DIR_NAME
1831 FILE_NOTIFY_CHANGE_NAME ( FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME )
1832 FILE_NOTIFY_CHANGE_ATTRIBUTES
1833 FILE_NOTIFY_CHANGE_SIZE
1834 FILE_NOTIFY_CHANGE_LAST_WRITE
1835 FILE_NOTIFY_CHANGE_LAST_ACCESS
1836 FILE_NOTIFY_CHANGE_CREATION ( change of creation timestamp )
1837 FILE_NOTIFY_CHANGE_EA
1838 FILE_NOTIFY_CHANGE_SECURITY
1839 FILE_NOTIFY_CHANGE_STREAM_NAME
1840 FILE_NOTIFY_CHANGE_STREAM_SIZE
1841 FILE_NOTIFY_CHANGE_STREAM_WRITE
1842 WatchTree = If true the notify will be installed recursively on the targetdirectory and all subdirectories.
1843 *
1844 * REMARKS:
1845 * The function maps to the win32 FindFirstChangeNotification, FindNextChangeNotification
1846 * RETURNS: Status
1847 */
1848 NTSTATUS
1849 STDCALL
1850 NtNotifyChangeDirectoryFile(
1851 IN HANDLE FileHandle,
1852 IN HANDLE Event OPTIONAL,
1853 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1854 IN PVOID ApcContext OPTIONAL,
1855 OUT PIO_STATUS_BLOCK IoStatusBlock,
1856 OUT PVOID Buffer,
1857 IN ULONG BufferSize,
1858 IN ULONG CompletionFilter,
1859 IN BOOLEAN WatchTree
1860 );
1861
1862 NTSTATUS
1863 STDCALL
1864 ZwNotifyChangeDirectoryFile(
1865 IN HANDLE FileHandle,
1866 IN HANDLE Event OPTIONAL,
1867 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1868 IN PVOID ApcContext OPTIONAL,
1869 OUT PIO_STATUS_BLOCK IoStatusBlock,
1870 OUT PVOID Buffer,
1871 IN ULONG BufferSize,
1872 IN ULONG CompletionFilter,
1873 IN BOOLEAN WatchTree
1874 );
1875
1876 /*
1877 * FUNCTION: Installs a notfication callback on registry changes
1878 * ARGUMENTS:
1879 KeyHandle = Handle to the registry key
1880 Event = Event that should be signalled on modification of the key
1881 ApcRoutine = Routine that should be called on modification of the key
1882 ApcContext = Argument to the ApcRoutine
1883 IoStatusBlock = ???
1884 CompletionFilter = Specifies the kind of notification the caller likes to receive.
1885 Can be a combination of the following values:
1886
1887 REG_NOTIFY_CHANGE_NAME
1888 REG_NOTIFY_CHANGE_ATTRIBUTES
1889 REG_NOTIFY_CHANGE_LAST_SET
1890 REG_NOTIFY_CHANGE_SECURITY
1891
1892
1893 Asynchroneous = If TRUE the changes are reported by signalling an event if false
1894 the function will not return before a change occurs.
1895 ChangeBuffer = Will return the old value
1896 Length = Size of the change buffer
1897 WatchSubtree = Indicates if the caller likes to receive a notification of changes in
1898 sub keys or not.
1899 * REMARKS: If the key is closed the event is signalled aswell.
1900 * RETURNS: Status
1901 */
1902
1903 NTSTATUS
1904 STDCALL
1905 NtNotifyChangeKey(
1906 IN HANDLE KeyHandle,
1907 IN HANDLE Event,
1908 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1909 IN PVOID ApcContext OPTIONAL,
1910 OUT PIO_STATUS_BLOCK IoStatusBlock,
1911 IN ULONG CompletionFilter,
1912 IN BOOLEAN WatchSubtree,
1913 OUT PVOID Buffer,
1914 IN ULONG Length,
1915 IN BOOLEAN Asynchronous
1916 );
1917
1918 NTSTATUS
1919 STDCALL
1920 ZwNotifyChangeKey(
1921 IN HANDLE KeyHandle,
1922 IN HANDLE Event,
1923 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1924 IN PVOID ApcContext OPTIONAL,
1925 OUT PIO_STATUS_BLOCK IoStatusBlock,
1926 IN ULONG CompletionFilter,
1927 IN BOOLEAN WatchSubtree,
1928 OUT PVOID Buffer,
1929 IN ULONG Length,
1930 IN BOOLEAN Asynchronous
1931 );
1932
1933 /*
1934 * FUNCTION: Opens an existing directory object
1935 * ARGUMENTS:
1936 * FileHandle (OUT) = Caller supplied storage for the resulting handle
1937 * DesiredAccess = Requested access to the directory
1938 * ObjectAttributes = Initialized attributes for the object
1939 * RETURNS: Status
1940 */
1941
1942 NTSTATUS
1943 STDCALL
1944 NtOpenDirectoryObject(
1945 OUT PHANDLE FileHandle,
1946 IN ACCESS_MASK DesiredAccess,
1947 IN POBJECT_ATTRIBUTES ObjectAttributes
1948 );
1949 NTSTATUS
1950 STDCALL
1951 ZwOpenDirectoryObject(
1952 OUT PHANDLE FileHandle,
1953 IN ACCESS_MASK DesiredAccess,
1954 IN POBJECT_ATTRIBUTES ObjectAttributes
1955 );
1956
1957 /*
1958 * FUNCTION: Opens an existing event
1959 * ARGUMENTS:
1960 * EventHandle (OUT) = Caller supplied storage for the resulting handle
1961 * DesiredAccess = Requested access to the event
1962 * ObjectAttributes = Initialized attributes for the object
1963 * RETURNS: Status
1964 */
1965 NTSTATUS
1966 STDCALL
1967 NtOpenEvent(
1968 OUT PHANDLE EventHandle,
1969 IN ACCESS_MASK DesiredAccess,
1970 IN POBJECT_ATTRIBUTES ObjectAttributes
1971 );
1972
1973 NTSTATUS
1974 STDCALL
1975 ZwOpenEvent(
1976 OUT PHANDLE EventHandle,
1977 IN ACCESS_MASK DesiredAccess,
1978 IN POBJECT_ATTRIBUTES ObjectAttributes
1979 );
1980
1981 /*
1982 * FUNCTION: Opens an existing event pair
1983 * ARGUMENTS:
1984 * EventHandle (OUT) = Caller supplied storage for the resulting handle
1985 * DesiredAccess = Requested access to the event
1986 * ObjectAttributes = Initialized attributes for the object
1987 * RETURNS: Status
1988 */
1989
1990 NTSTATUS
1991 STDCALL
1992 NtOpenEventPair(
1993 OUT PHANDLE EventPairHandle,
1994 IN ACCESS_MASK DesiredAccess,
1995 IN POBJECT_ATTRIBUTES ObjectAttributes
1996 );
1997
1998 NTSTATUS
1999 STDCALL
2000 ZwOpenEventPair(
2001 OUT PHANDLE EventPairHandle,
2002 IN ACCESS_MASK DesiredAccess,
2003 IN POBJECT_ATTRIBUTES ObjectAttributes
2004 );
2005 /*
2006 * FUNCTION: Opens an existing file
2007 * ARGUMENTS:
2008 * FileHandle (OUT) = Caller supplied storage for the resulting handle
2009 * DesiredAccess = Requested access to the file
2010 * ObjectAttributes = Initialized attributes for the object
2011 * IoStatusBlock =
2012 * ShareAccess =
2013 * OpenOptions =
2014 * RETURNS: Status
2015 */
2016 NTSTATUS
2017 STDCALL
2018 NtOpenFile(
2019 OUT PHANDLE FileHandle,
2020 IN ACCESS_MASK DesiredAccess,
2021 IN POBJECT_ATTRIBUTES ObjectAttributes,
2022 OUT PIO_STATUS_BLOCK IoStatusBlock,
2023 IN ULONG ShareAccess,
2024 IN ULONG OpenOptions
2025 );
2026
2027 NTSTATUS
2028 STDCALL
2029 ZwOpenFile(
2030 OUT PHANDLE FileHandle,
2031 IN ACCESS_MASK DesiredAccess,
2032 IN POBJECT_ATTRIBUTES ObjectAttributes,
2033 OUT PIO_STATUS_BLOCK IoStatusBlock,
2034 IN ULONG ShareAccess,
2035 IN ULONG OpenOptions
2036 );
2037
2038 /*
2039 * FUNCTION: Opens an existing io completion object
2040 * ARGUMENTS:
2041 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
2042 * DesiredAccess = Requested access to the io completion object
2043 * ObjectAttributes = Initialized attributes for the object
2044 * RETURNS: Status
2045 */
2046
2047 NTSTATUS
2048 STDCALL
2049 NtOpenIoCompletion(
2050 OUT PHANDLE CompetionPort,
2051 IN ACCESS_MASK DesiredAccess,
2052 IN POBJECT_ATTRIBUTES ObjectAttributes
2053 );
2054
2055 NTSTATUS
2056 STDCALL
2057 ZwOpenIoCompletion(
2058 OUT PHANDLE CompetionPort,
2059 IN ACCESS_MASK DesiredAccess,
2060 IN POBJECT_ATTRIBUTES ObjectAttributes
2061 );
2062
2063
2064 NTSTATUS
2065 STDCALL
2066 NtOpenJobObject(
2067 PHANDLE JobHandle,
2068 ACCESS_MASK DesiredAccess,
2069 POBJECT_ATTRIBUTES ObjectAttributes
2070 );
2071
2072 NTSTATUS
2073 STDCALL
2074 ZwOpenJobObject(
2075 PHANDLE JobHandle,
2076 ACCESS_MASK DesiredAccess,
2077 POBJECT_ATTRIBUTES ObjectAttributes
2078 );
2079 /*
2080 * FUNCTION: Opens an existing key in the registry
2081 * ARGUMENTS:
2082 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
2083 * DesiredAccess = Requested access to the key
2084 * ObjectAttributes = Initialized attributes for the object
2085 * RETURNS: Status
2086 */
2087 NTSTATUS
2088 STDCALL
2089 NtOpenKey(
2090 OUT PHANDLE KeyHandle,
2091 IN ACCESS_MASK DesiredAccess,
2092 IN POBJECT_ATTRIBUTES ObjectAttributes
2093 );
2094
2095 NTSTATUS
2096 STDCALL
2097 ZwOpenKey(
2098 OUT PHANDLE KeyHandle,
2099 IN ACCESS_MASK DesiredAccess,
2100 IN POBJECT_ATTRIBUTES ObjectAttributes
2101 );
2102 /*
2103 * FUNCTION: Opens an existing key in the registry
2104 * ARGUMENTS:
2105 * MutantHandle (OUT) = Caller supplied storage for the resulting handle
2106 * DesiredAccess = Requested access to the mutant
2107 * ObjectAttribute = Initialized attributes for the object
2108 * RETURNS: Status
2109 */
2110 NTSTATUS
2111 STDCALL
2112 NtOpenMutant(
2113 OUT PHANDLE MutantHandle,
2114 IN ACCESS_MASK DesiredAccess,
2115 IN POBJECT_ATTRIBUTES ObjectAttributes
2116 );
2117 NTSTATUS
2118 STDCALL
2119 ZwOpenMutant(
2120 OUT PHANDLE MutantHandle,
2121 IN ACCESS_MASK DesiredAccess,
2122 IN POBJECT_ATTRIBUTES ObjectAttributes
2123 );
2124
2125 /*
2126 * FUNCTION: Opens an existing process
2127 * ARGUMENTS:
2128 * ProcessHandle (OUT) = Caller supplied storage for the resulting handle
2129 * DesiredAccess = Requested access to the process
2130 * ObjectAttribute = Initialized attributes for the object
2131 * ClientId = Identifies the process id to open
2132 * RETURNS: Status
2133 */
2134 NTSTATUS
2135 STDCALL
2136 NtOpenProcess (
2137 OUT PHANDLE ProcessHandle,
2138 IN ACCESS_MASK DesiredAccess,
2139 IN POBJECT_ATTRIBUTES ObjectAttributes,
2140 IN PCLIENT_ID ClientId
2141 );
2142 NTSTATUS
2143 STDCALL
2144 ZwOpenProcess (
2145 OUT PHANDLE ProcessHandle,
2146 IN ACCESS_MASK DesiredAccess,
2147 IN POBJECT_ATTRIBUTES ObjectAttributes,
2148 IN PCLIENT_ID ClientId
2149 );
2150 /*
2151 * FUNCTION: Opens an existing process
2152 * ARGUMENTS:
2153 * ProcessHandle = Handle of the process of which owns the token
2154 * DesiredAccess = Requested access to the token
2155 * TokenHandle (OUT) = Caller supplies storage for the resulting token.
2156 * REMARKS:
2157 This function maps to the win32
2158 * RETURNS: Status
2159 */
2160
2161 NTSTATUS
2162 STDCALL
2163 NtOpenProcessToken(
2164 IN HANDLE ProcessHandle,
2165 IN ACCESS_MASK DesiredAccess,
2166 OUT PHANDLE TokenHandle
2167 );
2168
2169 NTSTATUS
2170 STDCALL
2171 ZwOpenProcessToken(
2172 IN HANDLE ProcessHandle,
2173 IN ACCESS_MASK DesiredAccess,
2174 OUT PHANDLE TokenHandle
2175 );
2176
2177
2178 NTSTATUS
2179 STDCALL
2180 NtOpenProcessTokenEx(
2181 IN HANDLE ProcessHandle,
2182 IN ACCESS_MASK DesiredAccess,
2183 IN ULONG HandleAttributes,
2184 OUT PHANDLE TokenHandle
2185 );
2186
2187
2188 NTSTATUS
2189 STDCALL
2190 ZwOpenProcessTokenEx(
2191 IN HANDLE ProcessHandle,
2192 IN ACCESS_MASK DesiredAccess,
2193 IN ULONG HandleAttributes,
2194 OUT PHANDLE TokenHandle
2195 );
2196 /*
2197 * FUNCTION: Opens an existing section object
2198 * ARGUMENTS:
2199 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
2200 * DesiredAccess = Requested access to the key
2201 * ObjectAttribute = Initialized attributes for the object
2202 * RETURNS: Status
2203 */
2204
2205 NTSTATUS
2206 STDCALL
2207 NtOpenSection(
2208 OUT PHANDLE SectionHandle,
2209 IN ACCESS_MASK DesiredAccess,
2210 IN POBJECT_ATTRIBUTES ObjectAttributes
2211 );
2212 NTSTATUS
2213 STDCALL
2214 ZwOpenSection(
2215 OUT PHANDLE SectionHandle,
2216 IN ACCESS_MASK DesiredAccess,
2217 IN POBJECT_ATTRIBUTES ObjectAttributes
2218 );
2219 /*
2220 * FUNCTION: Opens an existing semaphore
2221 * ARGUMENTS:
2222 * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle
2223 * DesiredAccess = Requested access to the semaphore
2224 * ObjectAttribute = Initialized attributes for the object
2225 * RETURNS: Status
2226 */
2227 NTSTATUS
2228 STDCALL
2229 NtOpenSemaphore(
2230 OUT PHANDLE SemaphoreHandle,
2231 IN ACCESS_MASK DesiredAcces,
2232 IN POBJECT_ATTRIBUTES ObjectAttributes
2233 );
2234 NTSTATUS
2235 STDCALL
2236 ZwOpenSemaphore(
2237 OUT PHANDLE SemaphoreHandle,
2238 IN ACCESS_MASK DesiredAcces,
2239 IN POBJECT_ATTRIBUTES ObjectAttributes
2240 );
2241 /*
2242 * FUNCTION: Opens an existing symbolic link
2243 * ARGUMENTS:
2244 * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle
2245 * DesiredAccess = Requested access to the symbolic link
2246 * ObjectAttribute = Initialized attributes for the object
2247 * RETURNS: Status
2248 */
2249 NTSTATUS
2250 STDCALL
2251 NtOpenSymbolicLinkObject(
2252 OUT PHANDLE LinkHandle,
2253 IN ACCESS_MASK DesiredAccess,
2254 IN POBJECT_ATTRIBUTES ObjectAttributes
2255 );
2256 NTSTATUS
2257 STDCALL
2258 ZwOpenSymbolicLinkObject(
2259 OUT PHANDLE LinkHandle,
2260 IN ACCESS_MASK DesiredAccess,
2261 IN POBJECT_ATTRIBUTES ObjectAttributes
2262 );
2263 /*
2264 * FUNCTION: Opens an existing thread
2265 * ARGUMENTS:
2266 * ThreadHandle (OUT) = Caller supplied storage for the resulting handle
2267 * DesiredAccess = Requested access to the thread
2268 * ObjectAttribute = Initialized attributes for the object
2269 * ClientId = Identifies the thread to open.
2270 * RETURNS: Status
2271 */
2272 NTSTATUS
2273 STDCALL
2274 NtOpenThread(
2275 OUT PHANDLE ThreadHandle,
2276 IN ACCESS_MASK DesiredAccess,
2277 IN POBJECT_ATTRIBUTES ObjectAttributes,
2278 IN PCLIENT_ID ClientId
2279 );
2280 NTSTATUS
2281 STDCALL
2282 ZwOpenThread(
2283 OUT PHANDLE ThreadHandle,
2284 IN ACCESS_MASK DesiredAccess,
2285 IN POBJECT_ATTRIBUTES ObjectAttributes,
2286 IN PCLIENT_ID ClientId
2287 );
2288
2289 NTSTATUS
2290 STDCALL
2291 NtOpenThreadToken(
2292 IN HANDLE ThreadHandle,
2293 IN ACCESS_MASK DesiredAccess,
2294 IN BOOLEAN OpenAsSelf,
2295 OUT PHANDLE TokenHandle
2296 );
2297
2298 NTSTATUS
2299 STDCALL
2300 ZwOpenThreadToken(
2301 IN HANDLE ThreadHandle,
2302 IN ACCESS_MASK DesiredAccess,
2303 IN BOOLEAN OpenAsSelf,
2304 OUT PHANDLE TokenHandle
2305 );
2306
2307 NTSTATUS
2308 STDCALL
2309 NtOpenThreadTokenEx(
2310 IN HANDLE ThreadHandle,
2311 IN ACCESS_MASK DesiredAccess,
2312 IN BOOLEAN OpenAsSelf,
2313 IN ULONG HandleAttributes,
2314 OUT PHANDLE TokenHandle
2315 );
2316
2317
2318 NTSTATUS
2319 STDCALL
2320 ZwOpenThreadTokenEx(
2321 IN HANDLE ThreadHandle,
2322 IN ACCESS_MASK DesiredAccess,
2323 IN BOOLEAN OpenAsSelf,
2324 IN ULONG HandleAttributes,
2325 OUT PHANDLE TokenHandle
2326 );
2327
2328 /*
2329 * FUNCTION: Opens an existing timer
2330 * ARGUMENTS:
2331 * TimerHandle (OUT) = Caller supplied storage for the resulting handle
2332 * DesiredAccess = Requested access to the timer
2333 * ObjectAttribute = Initialized attributes for the object
2334 * RETURNS: Status
2335 */
2336 NTSTATUS
2337 STDCALL
2338 NtOpenTimer(
2339 OUT PHANDLE TimerHandle,
2340 IN ACCESS_MASK DesiredAccess,
2341 IN POBJECT_ATTRIBUTES ObjectAttributes
2342 );
2343 NTSTATUS
2344 STDCALL
2345 ZwOpenTimer(
2346 OUT PHANDLE TimerHandle,
2347 IN ACCESS_MASK DesiredAccess,
2348 IN POBJECT_ATTRIBUTES ObjectAttributes
2349 );
2350
2351 /*
2352 * FUNCTION: Checks an access token for specific privileges
2353 * ARGUMENTS:
2354 * ClientToken = Handle to a access token structure
2355 * RequiredPrivileges = Specifies the requested privileges.
2356 * Result = Caller supplies storage for the result. If PRIVILEGE_SET_ALL_NECESSARY is
2357 set in the Control member of PRIVILEGES_SET Result
2358 will only be TRUE if all privileges are present in the access token.
2359 * RETURNS: Status
2360 */
2361
2362
2363 NTSTATUS
2364 STDCALL
2365 NtPowerInformation(
2366 IN POWER_INFORMATION_LEVEL PowerInformationLevel,
2367 IN PVOID InputBuffer OPTIONAL,
2368 IN ULONG InputBufferLength,
2369 OUT PVOID OutputBuffer OPTIONAL,
2370 IN ULONG OutputBufferLength
2371 );
2372
2373 NTSTATUS
2374 STDCALL
2375 ZwPowerInformation(
2376 IN POWER_INFORMATION_LEVEL PowerInformationLevel,
2377 IN PVOID InputBuffer OPTIONAL,
2378 IN ULONG InputBufferLength,
2379 OUT PVOID OutputBuffer OPTIONAL,
2380 IN ULONG OutputBufferLength
2381 );
2382
2383 NTSTATUS
2384 STDCALL
2385 NtPrivilegeCheck(
2386 IN HANDLE ClientToken,
2387 IN PPRIVILEGE_SET RequiredPrivileges,
2388 IN PBOOLEAN Result
2389 );
2390
2391 NTSTATUS
2392 STDCALL
2393 ZwPrivilegeCheck(
2394 IN HANDLE ClientToken,
2395 IN PPRIVILEGE_SET RequiredPrivileges,
2396 IN PBOOLEAN Result
2397 );
2398
2399 NTSTATUS
2400 STDCALL
2401 NtPrivilegedServiceAuditAlarm(
2402 IN PUNICODE_STRING SubsystemName,
2403 IN PUNICODE_STRING ServiceName,
2404 IN HANDLE ClientToken,
2405 IN PPRIVILEGE_SET Privileges,
2406 IN BOOLEAN AccessGranted
2407 );
2408
2409 NTSTATUS
2410 STDCALL
2411 ZwPrivilegedServiceAuditAlarm(
2412 IN PUNICODE_STRING SubsystemName,
2413 IN PUNICODE_STRING ServiceName,
2414 IN HANDLE ClientToken,
2415 IN PPRIVILEGE_SET Privileges,
2416 IN BOOLEAN AccessGranted
2417 );
2418
2419 NTSTATUS
2420 STDCALL
2421 NtPrivilegeObjectAuditAlarm(
2422 IN PUNICODE_STRING SubsystemName,
2423 IN PVOID HandleId,
2424 IN HANDLE ClientToken,
2425 IN ULONG DesiredAccess,
2426 IN PPRIVILEGE_SET Privileges,
2427 IN BOOLEAN AccessGranted
2428 );
2429
2430 NTSTATUS
2431 STDCALL
2432 ZwPrivilegeObjectAuditAlarm(
2433 IN PUNICODE_STRING SubsystemName,
2434 IN PVOID HandleId,
2435 IN HANDLE ClientToken,
2436 IN ULONG DesiredAccess,
2437 IN PPRIVILEGE_SET Privileges,
2438 IN BOOLEAN AccessGranted
2439 );
2440
2441 /*
2442 * FUNCTION: Entry point for native applications
2443 * ARGUMENTS:
2444 * Peb = Pointes to the Process Environment Block (PEB)
2445 * REMARKS:
2446 * Native applications should use this function instead of a main.
2447 * Calling proces should terminate itself.
2448 * RETURNS: Status
2449 */
2450 VOID STDCALL
2451 NtProcessStartup(
2452 IN PPEB Peb
2453 );
2454
2455
2456 /*
2457 * FUNCTION: Signals an event and resets it afterwards.
2458 * ARGUMENTS:
2459 * EventHandle = Handle to the event
2460 * PulseCount = Number of times the action is repeated
2461 * RETURNS: Status
2462 */
2463 NTSTATUS
2464 STDCALL
2465 NtPulseEvent(
2466 IN HANDLE EventHandle,
2467 OUT PLONG PreviousState OPTIONAL
2468 );
2469
2470 NTSTATUS
2471 STDCALL
2472 ZwPulseEvent(
2473 IN HANDLE EventHandle,
2474 OUT PLONG PreviousState OPTIONAL
2475 );
2476
2477 /*
2478 * FUNCTION: Queries the attributes of a file
2479 * ARGUMENTS:
2480 * ObjectAttributes = Initialized attributes for the object
2481 * Buffer = Caller supplies storage for the attributes
2482 * RETURNS: Status
2483 */
2484
2485 NTSTATUS
2486 STDCALL
2487 NtQueryAttributesFile(
2488 IN POBJECT_ATTRIBUTES ObjectAttributes,
2489 OUT PFILE_BASIC_INFORMATION FileInformation
2490 );
2491
2492 NTSTATUS
2493 STDCALL
2494 ZwQueryAttributesFile(
2495 IN POBJECT_ATTRIBUTES ObjectAttributes,
2496 OUT PFILE_BASIC_INFORMATION FileInformation
2497 );
2498
2499
2500 NTSTATUS
2501 STDCALL
2502 NtQueryBootEntryOrder(
2503 IN ULONG Unknown1,
2504 IN ULONG Unknown2
2505 );
2506
2507 NTSTATUS
2508 STDCALL
2509 ZwQueryBootEntryOrder(
2510 IN ULONG Unknown1,
2511 IN ULONG Unknown2
2512 );
2513
2514 NTSTATUS
2515 STDCALL
2516 NtQueryBootOptions(
2517 IN ULONG Unknown1,
2518 IN ULONG Unknown2
2519 );
2520
2521 NTSTATUS
2522 STDCALL
2523 ZwQueryBootOptions(
2524 IN ULONG Unknown1,
2525 IN ULONG Unknown2
2526 );
2527 /*
2528 * FUNCTION: Queries the default locale id
2529 * ARGUMENTS:
2530 * UserProfile = Type of locale id
2531 * TRUE: thread locale id
2532 * FALSE: system locale id
2533 * DefaultLocaleId = Caller supplies storage for the locale id
2534 * RETURNS: Status
2535 */
2536
2537 NTSTATUS
2538 STDCALL
2539 NtQueryDefaultLocale(
2540 IN BOOLEAN UserProfile,
2541 OUT PLCID DefaultLocaleId
2542 );
2543
2544 NTSTATUS
2545 STDCALL
2546 ZwQueryDefaultLocale(
2547 IN BOOLEAN UserProfile,
2548 OUT PLCID DefaultLocaleId
2549 );
2550
2551 NTSTATUS
2552 STDCALL
2553 NtQueryDefaultUILanguage(
2554 PLANGID LanguageId
2555 );
2556
2557 NTSTATUS
2558 STDCALL
2559 ZwQueryDefaultUILanguage(
2560 PLANGID LanguageId
2561 );
2562
2563 /*
2564 * FUNCTION: Queries a directory file.
2565 * ARGUMENTS:
2566 * FileHandle = Handle to a directory file
2567 * EventHandle = Handle to the event signaled on completion
2568 * ApcRoutine = Asynchroneous procedure callback, called on completion
2569 * ApcContext = Argument to the apc.
2570 * IoStatusBlock = Caller supplies storage for extended status information.
2571 * FileInformation = Caller supplies storage for the resulting information.
2572 *
2573 * FileNameInformation FILE_NAMES_INFORMATION
2574 * FileDirectoryInformation FILE_DIRECTORY_INFORMATION
2575 * FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION
2576 * FileBothDirectoryInformation FILE_BOTH_DIR_INFORMATION
2577 *
2578 * Length = Size of the storage supplied
2579 * FileInformationClass = Indicates the type of information requested.
2580 * ReturnSingleEntry = Specify true if caller only requests the first directory found.
2581 * FileName = Initial directory name to query, that may contain wild cards.
2582 * RestartScan = Number of times the action should be repeated
2583 * RETURNS: Status [ STATUS_SUCCESS, STATUS_ACCESS_DENIED, STATUS_INSUFFICIENT_RESOURCES,
2584 * STATUS_INVALID_PARAMETER, STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_OVERFLOW,
2585 * STATUS_INVALID_INFO_CLASS, STATUS_NO_SUCH_FILE, STATUS_NO_MORE_FILES ]
2586 */
2587
2588 NTSTATUS
2589 STDCALL
2590 NtQueryDirectoryFile(
2591 IN HANDLE FileHandle,
2592 IN HANDLE Event OPTIONAL,
2593 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2594 IN PVOID ApcContext OPTIONAL,
2595 OUT PIO_STATUS_BLOCK IoStatusBlock,
2596 OUT PVOID FileInformation,
2597 IN ULONG Length,
2598 IN FILE_INFORMATION_CLASS FileInformationClass,
2599 IN BOOLEAN ReturnSingleEntry,
2600 IN PUNICODE_STRING FileName OPTIONAL,
2601 IN BOOLEAN RestartScan
2602 );
2603
2604 NTSTATUS
2605 STDCALL
2606 ZwQueryDirectoryFile(
2607 IN HANDLE FileHandle,
2608 IN HANDLE Event OPTIONAL,
2609 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2610 IN PVOID ApcContext OPTIONAL,
2611 OUT PIO_STATUS_BLOCK IoStatusBlock,
2612 OUT PVOID FileInformation,
2613 IN ULONG Length,
2614 IN FILE_INFORMATION_CLASS FileInformationClass,
2615 IN BOOLEAN ReturnSingleEntry,
2616 IN PUNICODE_STRING FileName OPTIONAL,
2617 IN BOOLEAN RestartScan
2618 );
2619
2620 /*
2621 * FUNCTION: Queries the extended attributes of a file
2622 * ARGUMENTS:
2623 * FileHandle = Handle to the event
2624 * IoStatusBlock = Number of times the action is repeated
2625 * Buffer
2626 * Length
2627 * ReturnSingleEntry
2628 * EaList
2629 * EaListLength
2630 * EaIndex
2631 * RestartScan
2632 * RETURNS: Status
2633 */
2634
2635 NTSTATUS
2636 STDCALL
2637 NtQueryEaFile(
2638 IN HANDLE FileHandle,
2639 OUT PIO_STATUS_BLOCK IoStatusBlock,
2640 OUT PVOID Buffer,
2641 IN ULONG Length,
2642 IN BOOLEAN ReturnSingleEntry,
2643 IN PVOID EaList OPTIONAL,
2644 IN ULONG EaListLength,
2645 IN PULONG EaIndex OPTIONAL,
2646 IN BOOLEAN RestartScan
2647 );
2648
2649 NTSTATUS
2650 STDCALL
2651 ZwQueryEaFile(
2652 IN HANDLE FileHandle,
2653 OUT PIO_STATUS_BLOCK IoStatusBlock,
2654 OUT PVOID Buffer,
2655 IN ULONG Length,
2656 IN BOOLEAN ReturnSingleEntry,
2657 IN PVOID EaList OPTIONAL,
2658 IN ULONG EaListLength,
2659 IN PULONG EaIndex OPTIONAL,
2660 IN BOOLEAN RestartScan
2661 );
2662
2663 /*
2664 * FUNCTION: Queries an event
2665 * ARGUMENTS:
2666 * EventHandle = Handle to the event
2667 * EventInformationClass = Index of the information structure
2668
2669 EventBasicInformation EVENT_BASIC_INFORMATION
2670
2671 * EventInformation = Caller supplies storage for the information structure
2672 * EventInformationLength = Size of the information structure
2673 * ReturnLength = Data written
2674 * RETURNS: Status
2675 */
2676 NTSTATUS
2677 STDCALL
2678 NtQueryEvent(
2679 IN HANDLE EventHandle,
2680 IN EVENT_INFORMATION_CLASS EventInformationClass,
2681 OUT PVOID EventInformation,
2682 IN ULONG EventInformationLength,
2683 OUT PULONG ReturnLength OPTIONAL
2684 );
2685 NTSTATUS
2686 STDCALL
2687 ZwQueryEvent(
2688 IN HANDLE EventHandle,
2689 IN EVENT_INFORMATION_CLASS EventInformationClass,
2690 OUT PVOID EventInformation,
2691 IN ULONG EventInformationLength,
2692 OUT PULONG ReturnLength OPTIONAL
2693 );
2694
2695 NTSTATUS STDCALL
2696 NtQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2697 OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation);
2698
2699 NTSTATUS STDCALL
2700 ZwQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2701 OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation);
2702
2703 /*
2704 * FUNCTION: Queries the information of a file object.
2705 * ARGUMENTS:
2706 * FileHandle = Handle to the file object
2707 * IoStatusBlock = Caller supplies storage for extended information
2708 * on the current operation.
2709 * FileInformation = Storage for the new file information
2710 * Lenght = Size of the storage for the file information.
2711 * FileInformationClass = Indicates which file information is queried
2712
2713 FileDirectoryInformation FILE_DIRECTORY_INFORMATION
2714 FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION
2715 FileBothDirectoryInformation FILE_BOTH_DIRECTORY_INFORMATION
2716 FileBasicInformation FILE_BASIC_INFORMATION
2717 FileStandardInformation FILE_STANDARD_INFORMATION
2718 FileInternalInformation FILE_INTERNAL_INFORMATION
2719 FileEaInformation FILE_EA_INFORMATION
2720 FileAccessInformation FILE_ACCESS_INFORMATION
2721 FileNameInformation FILE_NAME_INFORMATION
2722 FileRenameInformation FILE_RENAME_INFORMATION
2723 FileLinkInformation
2724 FileNamesInformation FILE_NAMES_INFORMATION
2725 FileDispositionInformation FILE_DISPOSITION_INFORMATION
2726 FilePositionInformation FILE_POSITION_INFORMATION
2727 FileFullEaInformation FILE_FULL_EA_INFORMATION
2728 FileModeInformation FILE_MODE_INFORMATION
2729 FileAlignmentInformation FILE_ALIGNMENT_INFORMATION
2730 FileAllInformation FILE_ALL_INFORMATION
2731
2732 FileEndOfFileInformation FILE_END_OF_FILE_INFORMATION
2733 FileAlternateNameInformation
2734 FileStreamInformation FILE_STREAM_INFORMATION
2735 FilePipeInformation
2736 FilePipeLocalInformation
2737 FilePipeRemoteInformation
2738 FileMailslotQueryInformation
2739 FileMailslotSetInformation
2740 FileCompressionInformation FILE_COMPRESSION_INFORMATION
2741 FileCopyOnWriteInformation
2742 FileCompletionInformation IO_COMPLETION_CONTEXT
2743 FileMoveClusterInformation
2744 FileOleClassIdInformation
2745 FileOleStateBitsInformation
2746 FileNetworkOpenInformation FILE_NETWORK_OPEN_INFORMATION
2747 FileObjectIdInformation
2748 FileOleAllInformation
2749 FileOleDirectoryInformation
2750 FileContentIndexInformation
2751 FileInheritContentIndexInformation
2752 FileOleInformation
2753 FileMaximumInformation
2754
2755 * REMARK:
2756 * This procedure maps to the win32 GetShortPathName, GetLongPathName,
2757 GetFullPathName, GetFileType, GetFileSize, GetFileTime functions.
2758 * RETURNS: Status
2759 */
2760 NTSTATUS
2761 STDCALL
2762 NtQueryInformationFile(
2763 IN HANDLE FileHandle,
2764 OUT PIO_STATUS_BLOCK IoStatusBlock,
2765 OUT PVOID FileInformation,
2766 IN ULONG Length,
2767 IN FILE_INFORMATION_CLASS FileInformationClass
2768 );
2769
2770 NTSTATUS
2771 STDCALL
2772 ZwQueryInformationFile(
2773 HANDLE FileHandle,
2774 PIO_STATUS_BLOCK IoStatusBlock,
2775 PVOID FileInformation,
2776 ULONG Length,
2777 FILE_INFORMATION_CLASS FileInformationClass
2778 );
2779
2780 NTSTATUS
2781 STDCALL
2782 NtQueryInformationJobObject(
2783 HANDLE JobHandle,
2784 JOBOBJECTINFOCLASS JobInformationClass,
2785 PVOID JobInformation,
2786 ULONG JobInformationLength,
2787 PULONG ReturnLength
2788 );
2789
2790 NTSTATUS
2791 STDCALL
2792 ZwQueryInformationJobObject(
2793 HANDLE JobHandle,
2794 JOBOBJECTINFOCLASS JobInformationClass,
2795 PVOID JobInformation,
2796 ULONG JobInformationLength,
2797 PULONG ReturnLength
2798 );
2799
2800 NTSTATUS STDCALL
2801 NtQueryInformationPort (HANDLE PortHandle,
2802 CINT PortInformationClass,
2803 PVOID PortInformation,
2804 ULONG PortInformationLength,
2805 PULONG ReturnLength);
2806
2807 #ifndef __USE_W32API
2808 NTSTATUS STDCALL
2809 ZwQueryInformationPort (HANDLE PortHandle,
2810 CINT PortInformationClass,
2811 PVOID PortInformation,
2812 ULONG PortInformationLength,
2813 PULONG ReturnLength);
2814 #endif
2815
2816 /*
2817 * FUNCTION: Queries the information of a thread object.
2818 * ARGUMENTS:
2819 * ThreadHandle = Handle to the thread object
2820 * ThreadInformationClass = Index to a certain information structure
2821
2822 ThreadBasicInformation THREAD_BASIC_INFORMATION
2823 ThreadTimes KERNEL_USER_TIMES
2824 ThreadPriority KPRIORITY
2825 ThreadBasePriority KPRIORITY
2826 ThreadAffinityMask KAFFINITY
2827 ThreadImpersonationToken
2828 ThreadDescriptorTableEntry
2829 ThreadEnableAlignmentFaultFixup
2830 ThreadEventPair
2831 ThreadQuerySetWin32StartAddress
2832 ThreadZeroTlsCell
2833 ThreadPerformanceCount
2834 ThreadAmILastThread BOOLEAN
2835 ThreadIdealProcessor ULONG
2836 ThreadPriorityBoost ULONG
2837 MaxThreadInfoClass
2838
2839
2840 * ThreadInformation = Caller supplies torage for the thread information
2841 * ThreadInformationLength = Size of the thread information structure
2842 * ReturnLength = Actual number of bytes written
2843
2844 * REMARK:
2845 * This procedure maps to the win32 GetThreadTimes, GetThreadPriority,
2846 GetThreadPriorityBoost functions.
2847 * RETURNS: Status
2848 */
2849
2850
2851 NTSTATUS
2852 STDCALL
2853 NtQueryInformationThread(
2854 IN HANDLE ThreadHandle,
2855 IN THREADINFOCLASS ThreadInformationClass,
2856 OUT PVOID ThreadInformation,
2857 IN ULONG ThreadInformationLength,
2858 OUT PULONG ReturnLength OPTIONAL
2859 );
2860
2861 NTSTATUS
2862 STDCALL
2863 ZwQueryInformationThread(
2864 IN HANDLE ThreadHandle,
2865 IN THREADINFOCLASS ThreadInformationClass,
2866 OUT PVOID ThreadInformation,
2867 IN ULONG ThreadInformationLength,
2868 OUT PULONG ReturnLength OPTIONAL
2869 );
2870
2871
2872 NTSTATUS
2873 STDCALL
2874 NtQueryInformationToken(
2875 IN HANDLE TokenHandle,
2876 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
2877 OUT PVOID TokenInformation,
2878 IN ULONG TokenInformationLength,
2879 OUT PULONG ReturnLength
2880 );
2881
2882 NTSTATUS
2883 STDCALL
2884 ZwQueryInformationToken(
2885 IN HANDLE TokenHandle,
2886 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
2887 OUT PVOID TokenInformation,
2888 IN ULONG TokenInformationLength,
2889 OUT PULONG ReturnLength
2890 );
2891
2892 NTSTATUS
2893 STDCALL
2894 NtQueryInstallUILanguage(
2895 PLANGID LanguageId
2896 );
2897
2898 NTSTATUS
2899 STDCALL
2900 ZwQueryInstallUILanguage(
2901 PLANGID LanguageId
2902 );
2903
2904 NTSTATUS
2905 STDCALL
2906 NtQueryIoCompletion(
2907 IN HANDLE IoCompletionHandle,
2908 IN IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass,
2909 OUT PVOID IoCompletionInformation,
2910 IN ULONG IoCompletionInformationLength,
2911 OUT PULONG ResultLength OPTIONAL
2912 );
2913
2914 NTSTATUS
2915 STDCALL
2916 ZwQueryIoCompletion(
2917 IN HANDLE IoCompletionHandle,
2918 IN IO_COMPLETION_INFORMATION_CLASS IoCompletionInformationClass,
2919 OUT PVOID IoCompletionInformation,
2920 IN ULONG IoCompletionInformationLength,
2921 OUT PULONG ResultLength OPTIONAL
2922 );
2923
2924 /*
2925 * FUNCTION: Queries the information of a registry key object.
2926 * ARGUMENTS:
2927 KeyHandle = Handle to a registry key
2928 KeyInformationClass = Index to a certain information structure
2929 KeyInformation = Caller supplies storage for resulting information
2930 Length = Size of the supplied storage
2931 ResultLength = Bytes written
2932 */
2933 NTSTATUS
2934 STDCALL
2935 NtQueryKey(
2936 IN HANDLE KeyHandle,
2937 IN KEY_INFORMATION_CLASS KeyInformationClass,
2938 OUT PVOID KeyInformation,
2939 IN ULONG Length,
2940 OUT PULONG ResultLength
2941 );
2942
2943 NTSTATUS
2944 STDCALL
2945 ZwQueryKey(
2946 IN HANDLE KeyHandle,
2947 IN KEY_INFORMATION_CLASS KeyInformationClass,
2948 OUT PVOID KeyInformation,
2949 IN ULONG Length,
2950 OUT PULONG ResultLength
2951 );
2952
2953
2954
2955 NTSTATUS
2956 STDCALL
2957 NtQueryQuotaInformationFile(
2958 IN HANDLE FileHandle,
2959 OUT PIO_STATUS_BLOCK IoStatusBlock,
2960 OUT PVOID Buffer,
2961 IN ULONG Length,
2962 IN BOOLEAN ReturnSingleEntry,
2963 IN PVOID SidList OPTIONAL,
2964 IN ULONG SidListLength,
2965 IN PSID StartSid OPTIONAL,
2966 IN BOOLEAN RestartScan
2967 );
2968
2969
2970 NTSTATUS
2971 STDCALL
2972 ZwQueryQuotaInformationFile(
2973 IN HANDLE FileHandle,
2974 OUT PIO_STATUS_BLOCK IoStatusBlock,
2975 OUT PVOID Buffer,
2976 IN ULONG Length,
2977 IN BOOLEAN ReturnSingleEntry,
2978 IN PVOID SidList OPTIONAL,
2979 IN ULONG SidListLength,
2980 IN PSID StartSid OPTIONAL,
2981 IN BOOLEAN RestartScan
2982 );
2983 // draft
2984
2985 NTSTATUS
2986 STDCALL
2987 NtQueryMultipleValueKey(
2988 IN HANDLE KeyHandle,
2989 IN OUT PKEY_VALUE_ENTRY ValueList,
2990 IN ULONG NumberOfValues,
2991 OUT PVOID Buffer,
2992 IN OUT PULONG Length,
2993 OUT PULONG ReturnLength
2994 );
2995
2996 NTSTATUS
2997 STDCALL
2998 ZwQueryMultipleValueKey(
2999 IN HANDLE KeyHandle,
3000 IN OUT PKEY_VALUE_ENTRY ValueList,
3001 IN ULONG NumberOfValues,
3002 OUT PVOID Buffer,
3003 IN OUT PULONG Length,
3004 OUT PULONG ReturnLength
3005 );
3006
3007 /*
3008 * FUNCTION: Queries the information of a mutant object.
3009 * ARGUMENTS:
3010 MutantHandle = Handle to a mutant
3011 MutantInformationClass = Index to a certain information structure
3012 MutantInformation = Caller supplies storage for resulting information
3013 Length = Size of the supplied storage
3014 ResultLength = Bytes written
3015 */
3016 NTSTATUS
3017 STDCALL
3018 NtQueryMutant(
3019 IN HANDLE MutantHandle,
3020 IN MUTANT_INFORMATION_CLASS MutantInformationClass,
3021 OUT PVOID MutantInformation,
3022 IN ULONG MutantInformationLength,
3023 OUT PULONG ResultLength OPTIONAL
3024 );
3025
3026 NTSTATUS
3027 STDCALL
3028 ZwQueryMutant(
3029 IN HANDLE MutantHandle,
3030 IN MUTANT_INFORMATION_CLASS MutantInformationClass,
3031 OUT PVOID MutantInformation,
3032 IN ULONG MutantInformationLength,
3033 OUT PULONG ResultLength OPTIONAL
3034 );
3035
3036 /*
3037 * FUNCTION: Queries the system ( high-resolution ) performance counter.
3038 * ARGUMENTS:
3039 * PerformanceCounter = Performance counter
3040 * PerformanceFrequency = Performance frequency
3041 * REMARKS:
3042 This procedure queries a tick count faster than 10ms ( The resolution for Intel®-based CPUs is about 0.8 microseconds.)
3043 This procedure maps to the win32 QueryPerformanceCounter, QueryPerformanceFrequency
3044 * RETURNS: Status
3045 *
3046 */
3047 NTSTATUS
3048 STDCALL
3049 NtQueryPerformanceCounter(
3050 OUT PLARGE_INTEGER PerformanceCounter,
3051 OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL
3052 );
3053
3054 NTSTATUS
3055 STDCALL
3056 ZwQueryPerformanceCounter(
3057 OUT PLARGE_INTEGER PerformanceCounter,
3058 OUT PLARGE_INTEGER PerformanceFrequency OPTIONAL
3059 );
3060
3061 /*
3062 * FUNCTION: Queries the information of a semaphore.
3063 * ARGUMENTS:
3064 * SemaphoreHandle = Handle to the semaphore object
3065 * SemaphoreInformationClass = Index to a certain information structure
3066
3067 SemaphoreBasicInformation SEMAPHORE_BASIC_INFORMATION
3068
3069 * SemaphoreInformation = Caller supplies storage for the semaphore information structure
3070 * Length = Size of the infomation structure
3071 */
3072 NTSTATUS
3073 STDCALL
3074 NtQuerySemaphore(
3075 IN HANDLE SemaphoreHandle,
3076 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
3077 OUT PVOID SemaphoreInformation,
3078 IN ULONG Length,
3079 OUT PULONG ReturnLength OPTIONAL
3080 );
3081
3082 NTSTATUS
3083 STDCALL
3084 ZwQuerySemaphore(
3085 IN HANDLE SemaphoreHandle,
3086 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
3087 OUT PVOID SemaphoreInformation,
3088 IN ULONG Length,
3089 OUT PULONG ReturnLength OPTIONAL
3090 );
3091
3092
3093 /*
3094 * FUNCTION: Queries the information of a symbolic link object.
3095 * ARGUMENTS:
3096 * SymbolicLinkHandle = Handle to the symbolic link object
3097 * LinkTarget = resolved name of link
3098 * DataWritten = size of the LinkName.
3099 * RETURNS: Status
3100 *
3101 */
3102 NTSTATUS
3103 STDCALL
3104 NtQuerySymbolicLinkObject(
3105 IN HANDLE LinkHandle,
3106 OUT PUNICODE_STRING LinkTarget,
3107 OUT PULONG ResultLength OPTIONAL
3108 );
3109
3110 NTSTATUS
3111 STDCALL
3112 ZwQuerySymbolicLinkObject(
3113 IN HANDLE LinkHandle,
3114 OUT PUNICODE_STRING LinkTarget,
3115 OUT PULONG ResultLength OPTIONAL
3116 );
3117
3118
3119 /*
3120 * FUNCTION: Queries a system environment variable.
3121 * ARGUMENTS:
3122 * Name = Name of the variable
3123 * Value (OUT) = value of the variable
3124 * Length = size of the buffer
3125 * ReturnLength = data written
3126 * RETURNS: Status
3127 *
3128 */
3129 NTSTATUS
3130 STDCALL
3131 NtQuerySystemEnvironmentValue(
3132 IN PUNICODE_STRING VariableName,
3133 OUT PWCHAR ValueBuffer,
3134 IN ULONG ValueBufferLength,
3135 OUT PULONG ReturnLength OPTIONAL
3136 );
3137
3138 NTSTATUS
3139 STDCALL
3140 ZwQuerySystemEnvironmentValue(
3141 IN PUNICODE_STRING VariableName,
3142 OUT PWCHAR ValueBuffer,
3143 IN ULONG ValueBufferLength,
3144 OUT PULONG ReturnLength OPTIONAL
3145 );
3146
3147
3148 /*
3149 * FUNCTION: Queries the system information.
3150 * ARGUMENTS:
3151 * SystemInformationClass = Index to a certain information structure
3152
3153 SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
3154 SystemCacheInformation SYSTEM_CACHE_INFORMATION
3155 SystemConfigurationInformation CONFIGURATION_INFORMATION
3156
3157 * SystemInformation = caller supplies storage for the information structure
3158 * Length = size of the structure
3159 ResultLength = Data written
3160 * RETURNS: Status
3161 *
3162 */
3163 NTSTATUS
3164 STDCALL
3165 NtQuerySystemInformation(
3166 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
3167 OUT PVOID SystemInformation,
3168 IN ULONG Length,
3169 OUT PULONG ResultLength
3170 );
3171
3172 NTSTATUS
3173 STDCALL
3174 ZwQuerySystemInformation(
3175 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
3176 OUT PVOID SystemInformation,
3177 IN ULONG Length,
3178 OUT PULONG ResultLength
3179 );
3180
3181 /*
3182 * FUNCTION: Queries information about a timer
3183 * ARGUMENTS:
3184 * TimerHandle = Handle to the timer
3185 TimerValueInformationClass = Index to a certain information structure
3186 TimerValueInformation = Caller supplies storage for the information structure
3187 Length = Size of the information structure
3188 ResultLength = Data written
3189 * RETURNS: Status
3190 *
3191 */
3192 NTSTATUS
3193 STDCALL
3194 NtQueryTimer(
3195 IN HANDLE TimerHandle,
3196 IN TIMER_INFORMATION_CLASS TimerInformationClass,
3197 OUT PVOID TimerInformation,
3198 IN ULONG TimerInformationLength,
3199 OUT PULONG ReturnLength OPTIONAL
3200 );
3201 NTSTATUS
3202 STDCALL
3203 ZwQueryTimer(
3204 IN HANDLE TimerHandle,
3205 IN TIMER_INFORMATION_CLASS TimerInformationClass,
3206 OUT PVOID TimerInformation,
3207 IN ULONG TimerInformationLength,
3208 OUT PULONG ReturnLength OPTIONAL
3209 );
3210
3211 /*
3212 * FUNCTION: Queries the timer resolution
3213 * ARGUMENTS:
3214 * MinimumResolution (OUT) = Caller should supply storage for the resulting time.
3215 Maximum Resolution (OUT) = Caller should supply storage for the resulting time.
3216 ActualResolution (OUT) = Caller should supply storage for the resulting time.
3217 * RETURNS: Status
3218 *
3219 */
3220
3221
3222 NTSTATUS
3223 STDCALL
3224 NtQueryTimerResolution (
3225 OUT PULONG MinimumResolution,
3226 OUT PULONG MaximumResolution,
3227 OUT PULONG ActualResolution
3228 );
3229
3230 NTSTATUS
3231 STDCALL
3232 ZwQueryTimerResolution (
3233 OUT PULONG MinimumResolution,
3234 OUT PULONG MaximumResolution,
3235 OUT PULONG ActualResolution
3236 );
3237
3238 /*
3239 * FUNCTION: Queries a registry key value
3240 * ARGUMENTS:
3241 * KeyHandle = Handle to the registry key
3242 ValueName = Name of the value in the registry key
3243 KeyValueInformationClass = Index to a certain information structure
3244
3245 KeyValueBasicInformation = KEY_VALUE_BASIC_INFORMATION
3246 KeyValueFullInformation = KEY_FULL_INFORMATION
3247 KeyValuePartialInformation = KEY_VALUE_PARTIAL_INFORMATION
3248
3249 KeyValueInformation = Caller supplies storage for the information structure
3250 Length = Size of the information structure
3251 ResultLength = Data written
3252 * RETURNS: Status
3253 *
3254 */
3255 NTSTATUS
3256 STDCALL
3257 NtQueryValueKey(
3258 IN HANDLE KeyHandle,
3259 IN PUNICODE_STRING ValueName,
3260 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
3261 OUT PVOID KeyValueInformation,
3262 IN ULONG Length,
3263 OUT PULONG ResultLength
3264 );
3265
3266 NTSTATUS
3267 STDCALL
3268 ZwQueryValueKey(
3269 IN HANDLE KeyHandle,
3270 IN PUNICODE_STRING ValueName,
3271 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
3272 OUT PVOID KeyValueInformation,
3273 IN ULONG Length,
3274 OUT PULONG ResultLength
3275 );
3276
3277 /*
3278 * FUNCTION: Queries the volume information
3279 * ARGUMENTS:
3280 * FileHandle = Handle to a file object on the target volume
3281 * IoStatusBlock = Caller should supply storage for additional status information
3282 * ReturnLength = DataWritten
3283 * FsInformation = Caller should supply storage for the information structure.
3284 * Length = Size of the information structure
3285 * FsInformationClass = Index to a information structure
3286
3287 FileFsVolumeInformation FILE_FS_VOLUME_INFORMATION
3288 FileFsLabelInformation FILE_FS_LABEL_INFORMATION
3289 FileFsSizeInformation FILE_FS_SIZE_INFORMATION
3290 FileFsDeviceInformation FILE_FS_DEVICE_INFORMATION
3291 FileFsAttributeInformation FILE_FS_ATTRIBUTE_INFORMATION
3292 FileFsControlInformation
3293 FileFsQuotaQueryInformation --
3294 FileFsQuotaSetInformation --
3295 FileFsMaximumInformation
3296
3297 * RETURNS: Status [ STATUS_SUCCESS | STATUS_INSUFFICIENT_RESOURCES | STATUS_INVALID_PARAMETER |
3298 STATUS_INVALID_DEVICE_REQUEST | STATUS_BUFFER_OVERFLOW ]
3299 *
3300 */
3301 NTSTATUS
3302 STDCALL
3303 NtQueryVolumeInformationFile(
3304 IN HANDLE FileHandle,
3305 OUT PIO_STATUS_BLOCK IoStatusBlock,
3306 OUT PVOID FsInformation,
3307 IN ULONG Length,
3308 IN FS_INFORMATION_CLASS FsInformationClass
3309 );
3310
3311 NTSTATUS
3312 STDCALL
3313 ZwQueryVolumeInformationFile(
3314 IN HANDLE FileHandle,
3315 OUT PIO_STATUS_BLOCK IoStatusBlock,
3316 OUT PVOID FsInformation,
3317 IN ULONG Length,
3318 IN FS_INFORMATION_CLASS FsInformationClass
3319 );
3320 // draft
3321 // FIXME: Should I specify if the apc is user or kernel mode somewhere ??
3322 /*
3323 * FUNCTION: Queues a (user) apc to a thread.
3324 * ARGUMENTS:
3325 ThreadHandle = Thread to which the apc is queued.
3326 ApcRoutine = Points to the apc routine
3327 NormalContext = Argument to Apc Routine
3328 * SystemArgument1 = Argument of the Apc Routine
3329 SystemArgument2 = Argument of the Apc Routine
3330 * REMARK: If the apc is queued against a thread of a different process than the calling thread
3331 the apc routine should be specified in the address space of the queued thread's process.
3332 * RETURNS: Status
3333 */
3334
3335 NTSTATUS
3336 STDCALL
3337 NtQueueApcThread(
3338 HANDLE ThreadHandle,
3339 PKNORMAL_ROUTINE ApcRoutine,
3340 PVOID NormalContext,
3341 PVOID SystemArgument1,
3342 PVOID SystemArgument2);
3343
3344 NTSTATUS
3345 STDCALL
3346 ZwQueueApcThread(
3347 HANDLE ThreadHandle,
3348 PKNORMAL_ROUTINE ApcRoutine,
3349 PVOID NormalContext,
3350 PVOID SystemArgument1,
3351 PVOID SystemArgument2);
3352
3353
3354 /*
3355 * FUNCTION: Raises an exception
3356 * ARGUMENTS:
3357 * ExceptionRecord = Structure specifying the exception
3358 * Context = Context in which the excpetion is raised
3359 * IsDebugger =
3360 * RETURNS: Status
3361 *
3362 */
3363
3364 NTSTATUS
3365 STDCALL
3366 NtRaiseException(
3367 IN PEXCEPTION_RECORD ExceptionRecord,
3368 IN PCONTEXT Context,
3369 IN BOOLEAN SearchFrames
3370 );
3371
3372 NTSTATUS
3373 STDCALL
3374 ZwRaiseException(
3375 IN PEXCEPTION_RECORD ExceptionRecord,
3376 IN PCONTEXT Context,
3377 IN BOOLEAN SearchFrames
3378 );
3379
3380 /*
3381 * FUNCTION: Read a file
3382 * ARGUMENTS:
3383 * FileHandle = Handle of a file to read
3384 * Event = This event is signalled when the read operation completes
3385 * UserApcRoutine = Call back , if supplied Event should be NULL
3386 * UserApcContext = Argument to the callback
3387 * IoStatusBlock = Caller should supply storage for additional status information
3388 * Buffer = Caller should supply storage to receive the information
3389 * BufferLength = Size of the buffer
3390 * ByteOffset = Offset to start reading the file
3391 * Key = If a range is lock a matching key will allow the read to continue.
3392 * RETURNS: Status
3393 *
3394 */
3395
3396 NTSTATUS
3397 STDCALL
3398 NtReadFile(
3399 IN HANDLE FileHandle,
3400 IN HANDLE Event OPTIONAL,
3401 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3402 IN PVOID UserApcContext OPTIONAL,
3403 OUT PIO_STATUS_BLOCK IoStatusBlock,
3404 OUT PVOID Buffer,
3405 IN ULONG BufferLength,
3406 IN PLARGE_INTEGER ByteOffset OPTIONAL,
3407 IN PULONG Key OPTIONAL
3408 );
3409
3410 NTSTATUS
3411 STDCALL
3412 ZwReadFile(
3413 IN HANDLE FileHandle,
3414 IN HANDLE Event OPTIONAL,
3415 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3416 IN PVOID UserApcContext OPTIONAL,
3417 OUT PIO_STATUS_BLOCK IoStatusBlock,
3418 OUT PVOID Buffer,
3419 IN ULONG BufferLength,
3420 IN PLARGE_INTEGER ByteOffset OPTIONAL,
3421 IN PULONG Key OPTIONAL
3422 );
3423 /*
3424 * FUNCTION: Read a file using scattered io
3425 * ARGUMENTS:
3426 FileHandle = Handle of a file to read
3427 Event = This event is signalled when the read operation completes
3428 * UserApcRoutine = Call back , if supplied Event should be NULL
3429 UserApcContext = Argument to the callback
3430 IoStatusBlock = Caller should supply storage for additional status information
3431 BufferDescription = Caller should supply storage to receive the information
3432 BufferLength = Size of the buffer
3433 ByteOffset = Offset to start reading the file
3434 Key = Key = If a range is lock a matching key will allow the read to continue.
3435 * RETURNS: Status
3436 *
3437 */
3438 NTSTATUS
3439 STDCALL
3440 NtReadFileScatter(
3441 IN HANDLE FileHandle,
3442 IN HANDLE Event OPTIONAL,
3443 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3444 IN PVOID UserApcContext OPTIONAL,
3445 OUT PIO_STATUS_BLOCK UserIoStatusBlock,
3446 IN FILE_SEGMENT_ELEMENT BufferDescription[],
3447 IN ULONG BufferLength,
3448 IN PLARGE_INTEGER ByteOffset,
3449 IN PULONG Key OPTIONAL
3450 );
3451
3452 NTSTATUS
3453 STDCALL
3454 ZwReadFileScatter(
3455 IN HANDLE FileHandle,
3456 IN HANDLE Event OPTIONAL,
3457 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3458 IN PVOID UserApcContext OPTIONAL,
3459 OUT PIO_STATUS_BLOCK UserIoStatusBlock,
3460 IN FILE_SEGMENT_ELEMENT BufferDescription[],
3461 IN ULONG BufferLength,
3462 IN PLARGE_INTEGER ByteOffset,
3463 IN PULONG Key OPTIONAL
3464 );
3465
3466
3467 NTSTATUS STDCALL
3468 NtReadRequestData (HANDLE PortHandle,
3469 PLPC_MESSAGE Message,
3470 ULONG Index,
3471 PVOID Buffer,
3472 ULONG BufferLength,
3473 PULONG ReturnLength);
3474
3475 NTSTATUS STDCALL
3476 ZwReadRequestData (HANDLE PortHandle,
3477 PLPC_MESSAGE Message,
3478 ULONG Index,
3479 PVOID Buffer,
3480 ULONG BufferLength,
3481 PULONG ReturnLength);
3482
3483
3484 /*
3485 * FUNCTION: Copies a range of virtual memory to a buffer
3486 * ARGUMENTS:
3487 * ProcessHandle = Specifies the process owning the virtual address space
3488 * BaseAddress = Points to the address of virtual memory to start the read
3489 * Buffer = Caller supplies storage to copy the virtual memory to.
3490 * NumberOfBytesToRead = Limits the range to read
3491 * NumberOfBytesRead = The actual number of bytes read.
3492 * RETURNS: Status
3493 */
3494
3495 NTSTATUS
3496 STDCALL
3497 NtReadVirtualMemory(
3498 IN HANDLE ProcessHandle,
3499 IN PVOID BaseAddress,
3500 OUT PVOID Buffer,
3501 IN ULONG NumberOfBytesToRead,
3502 OUT PULONG NumberOfBytesRead
3503 );
3504 NTSTATUS
3505 STDCALL
3506 ZwReadVirtualMemory(
3507 IN HANDLE ProcessHandle,
3508 IN PVOID BaseAddress,
3509 OUT PVOID Buffer,
3510 IN ULONG NumberOfBytesToRead,
3511 OUT PULONG NumberOfBytesRead
3512 );
3513
3514
3515 /*
3516 * FUNCTION: Debugger can register for thread termination
3517 * ARGUMENTS:
3518 * TerminationPort = Port on which the debugger likes to be notified.
3519 * RETURNS: Status
3520 */
3521 NTSTATUS
3522 STDCALL
3523 NtRegisterThreadTerminatePort(
3524 HANDLE PortHandle
3525 );
3526 NTSTATUS
3527 STDCALL
3528 ZwRegisterThreadTerminatePort(
3529 HANDLE PortHandle
3530 );
3531
3532 /*
3533 * FUNCTION: Releases a mutant
3534 * ARGUMENTS:
3535 * MutantHandle = Handle to the mutant
3536 * ReleaseCount =
3537 * RETURNS: Status
3538 */
3539 NTSTATUS
3540 STDCALL
3541 NtReleaseMutant(
3542 IN HANDLE MutantHandle,
3543 IN PLONG PreviousCount OPTIONAL
3544 );
3545
3546 NTSTATUS
3547 STDCALL
3548 ZwReleaseMutant(
3549 IN HANDLE MutantHandle,
3550 IN PLONG PreviousCount OPTIONAL
3551 );
3552
3553 /*
3554 * FUNCTION: Releases a semaphore
3555 * ARGUMENTS:
3556 * SemaphoreHandle = Handle to the semaphore object
3557 * ReleaseCount = Number to decrease the semaphore count
3558 * PreviousCount = Previous semaphore count
3559 * RETURNS: Status
3560 */
3561 NTSTATUS
3562 STDCALL
3563 NtReleaseSemaphore(
3564 IN HANDLE SemaphoreHandle,
3565 IN LONG ReleaseCount,
3566 OUT PLONG PreviousCount OPTIONAL
3567 );
3568
3569 NTSTATUS
3570 STDCALL
3571 ZwReleaseSemaphore(
3572 IN HANDLE SemaphoreHandle,
3573 IN LONG ReleaseCount,
3574 OUT PLONG PreviousCount OPTIONAL
3575 );
3576
3577 /*
3578 * FUNCTION: Removes an io completion
3579 * ARGUMENTS:
3580 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
3581 * CompletionKey = Requested access to the key
3582 * IoStatusBlock = Caller provides storage for extended status information
3583 * CompletionStatus = Current status of the io operation.
3584 * WaitTime = Time to wait if ..
3585 * RETURNS: Status
3586 */
3587 NTSTATUS
3588 STDCALL
3589 NtRemoveIoCompletion(
3590 IN HANDLE IoCompletionHandle,
3591 OUT PVOID *CompletionKey,
3592 OUT PVOID *CompletionContext,
3593 OUT PIO_STATUS_BLOCK IoStatusBlock,
3594 IN PLARGE_INTEGER Timeout OPTIONAL
3595 );
3596
3597 NTSTATUS
3598 STDCALL
3599 ZwRemoveIoCompletion(
3600 IN HANDLE IoCompletionHandle,
3601 OUT PVOID *CompletionKey,
3602 OUT PVOID *CompletionValue,
3603 OUT PIO_STATUS_BLOCK IoStatusBlock,
3604 IN PLARGE_INTEGER Timeout OPTIONAL
3605 );
3606
3607 /*
3608 * FUNCTION: Replaces one registry key with another
3609 * ARGUMENTS:
3610 * ObjectAttributes = Specifies the attributes of the key
3611 * Key = Handle to the key
3612 * ReplacedObjectAttributes = The function returns the old object attributes
3613 * RETURNS: Status
3614 */
3615 NTSTATUS
3616 STDCALL
3617 NtReplaceKey(
3618 IN POBJECT_ATTRIBUTES ObjectAttributes,
3619 IN HANDLE Key,
3620 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes
3621 );
3622 NTSTATUS
3623 STDCALL
3624 ZwReplaceKey(
3625 IN POBJECT_ATTRIBUTES ObjectAttributes,
3626 IN HANDLE Key,
3627 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes
3628 );
3629
3630
3631 NTSTATUS STDCALL
3632 NtReplyPort (HANDLE PortHandle,
3633 PLPC_MESSAGE LpcReply);
3634
3635 NTSTATUS STDCALL
3636 ZwReplyPort (HANDLE PortHandle,
3637 PLPC_MESSAGE LpcReply);
3638
3639
3640 NTSTATUS STDCALL
3641 NtReplyWaitReceivePort (HANDLE PortHandle,
3642 PULONG PortId,
3643 PLPC_MESSAGE MessageReply,
3644 PLPC_MESSAGE MessageRequest);
3645
3646 NTSTATUS STDCALL
3647 ZwReplyWaitReceivePort (HANDLE PortHandle,
3648 PULONG PortId,
3649 PLPC_MESSAGE MessageReply,
3650 PLPC_MESSAGE MessageRequest);
3651
3652
3653 NTSTATUS STDCALL
3654 NtReplyWaitReplyPort (HANDLE PortHandle,
3655 PLPC_MESSAGE ReplyMessage);
3656
3657 NTSTATUS STDCALL
3658 ZwReplyWaitReplyPort (HANDLE PortHandle,
3659 PLPC_MESSAGE ReplyMessage);
3660
3661
3662 NTSTATUS STDCALL
3663 NtRequestPort (HANDLE PortHandle,
3664 PLPC_MESSAGE LpcMessage);
3665
3666 NTSTATUS STDCALL
3667 ZwRequestPort (HANDLE PortHandle,
3668 PLPC_MESSAGE LpcMessage);
3669
3670
3671 NTSTATUS STDCALL
3672 NtRequestWaitReplyPort (HANDLE PortHandle,
3673 PLPC_MESSAGE LpcReply,
3674 PLPC_MESSAGE LpcRequest);
3675
3676 NTSTATUS STDCALL
3677 ZwRequestWaitReplyPort (HANDLE PortHandle,
3678 PLPC_MESSAGE LpcReply,
3679 PLPC_MESSAGE LpcRequest);
3680
3681 /*
3682 * FUNCTION: Resets a event to a non signaled state
3683 * ARGUMENTS:
3684 * EventHandle = Handle to the event that should be reset
3685 * NumberOfWaitingThreads = The number of threads released.
3686 * RETURNS: Status
3687 */
3688 NTSTATUS
3689 STDCALL
3690 NtResetEvent(
3691 HANDLE EventHandle,
3692 OUT PLONG PreviousState OPTIONAL
3693 );
3694 NTSTATUS
3695 STDCALL
3696 ZwResetEvent(
3697 HANDLE EventHandle,
3698 OUT PLONG PreviousState OPTIONAL
3699 );
3700 //draft
3701 NTSTATUS
3702 STDCALL
3703 NtRestoreKey(
3704 HANDLE KeyHandle,
3705 HANDLE FileHandle,
3706 ULONG RestoreFlags
3707 );
3708
3709 NTSTATUS
3710 STDCALL
3711 ZwRestoreKey(
3712 HANDLE KeyHandle,
3713 HANDLE FileHandle,
3714 ULONG RestoreFlags
3715 );
3716 /*
3717 * FUNCTION: Decrements a thread's resume count
3718 * ARGUMENTS:
3719 * ThreadHandle = Handle to the thread that should be resumed
3720 * ResumeCount = The resulting resume count.
3721 * REMARK:
3722 * A thread is resumed if its suspend count is 0. This procedure maps to
3723 * the win32 ResumeThread function. ( documentation about the the suspend count can be found here aswell )
3724 * RETURNS: Status
3725 */
3726 NTSTATUS
3727 STDCALL
3728 NtResumeThread(
3729 IN HANDLE ThreadHandle,
3730 OUT PULONG SuspendCount OPTIONAL
3731 );
3732 NTSTATUS
3733 STDCALL
3734 ZwResumeThread(
3735 IN HANDLE ThreadHandle,
3736 OUT PULONG SuspendCount OPTIONAL
3737 );
3738 /*
3739 * FUNCTION: Writes the content of a registry key to ascii file
3740 * ARGUMENTS:
3741 * KeyHandle = Handle to the key
3742 * FileHandle = Handle of the file
3743 * REMARKS:
3744 This function maps to the Win32 RegSaveKey.
3745 * RETURNS: Status
3746 */
3747
3748 NTSTATUS
3749 STDCALL
3750 NtSaveKey(
3751 IN HANDLE KeyHandle,
3752 IN HANDLE FileHandle
3753 );
3754 NTSTATUS
3755 STDCALL
3756 ZwSaveKey(
3757 IN HANDLE KeyHandle,
3758 IN HANDLE FileHandle
3759 );
3760
3761 NTSTATUS
3762 STDCALL
3763 NtSaveKeyEx(
3764 IN HANDLE KeyHandle,
3765 IN HANDLE FileHandle,
3766 IN ULONG Flags // REG_STANDARD_FORMAT, etc..
3767 );
3768
3769 NTSTATUS
3770 STDCALL
3771 ZwSaveKeyEx(
3772 IN HANDLE KeyHandle,
3773 IN HANDLE FileHandle,
3774 IN ULONG Flags // REG_STANDARD_FORMAT, etc..
3775 );
3776
3777 NTSTATUS
3778 STDCALL
3779 NtSetBootEntryOrder(
3780 IN ULONG Unknown1,
3781 IN ULONG Unknown2
3782 );
3783
3784 NTSTATUS
3785 STDCALL
3786 ZwSetBootEntryOrder(
3787 IN ULONG Unknown1,
3788 IN ULONG Unknown2
3789 );
3790
3791 NTSTATUS
3792 STDCALL
3793 NtSetBootOptions(
3794 ULONG Unknown1,
3795 ULONG Unknown2
3796 );
3797
3798 NTSTATUS
3799 STDCALL
3800 ZwSetBootOptions(
3801 ULONG Unknown1,
3802 ULONG Unknown2
3803 );
3804
3805
3806 /*
3807 * FUNCTION: Sets the context of a specified thread.
3808 * ARGUMENTS:
3809 * ThreadHandle = Handle to the thread
3810 * ThreadContext = The processor context.
3811 * RETURNS: Status
3812 */
3813
3814 NTSTATUS
3815 STDCALL
3816 NtSetContextThread(
3817 IN HANDLE ThreadHandle,
3818 IN PCONTEXT ThreadContext
3819 );
3820 NTSTATUS
3821 STDCALL
3822 ZwSetContextThread(
3823 IN HANDLE ThreadHandle,
3824 IN PCONTEXT ThreadContext
3825 );
3826
3827 /*
3828 * FUNCTION: Sets the default locale id
3829 * ARGUMENTS:
3830 * UserProfile = Type of locale id
3831 * TRUE: thread locale id
3832 * FALSE: system locale id
3833 * DefaultLocaleId = Locale id
3834 * RETURNS: Status
3835 */
3836
3837 NTSTATUS
3838 STDCALL
3839 NtSetDefaultLocale(
3840 IN BOOLEAN UserProfile,
3841 IN LCID DefaultLocaleId
3842 );
3843
3844 NTSTATUS
3845 STDCALL
3846 ZwSetDefaultLocale(
3847 IN BOOLEAN UserProfile,
3848 IN LCID DefaultLocaleId
3849 );
3850
3851 NTSTATUS
3852 STDCALL
3853 NtSetDefaultUILanguage(
3854 LANGID LanguageId
3855 );
3856
3857 NTSTATUS
3858 STDCALL
3859 ZwSetDefaultUILanguage(
3860 LANGID LanguageId
3861 );
3862 /*
3863 * FUNCTION: Sets the default hard error port
3864 * ARGUMENTS:
3865 * PortHandle = Handle to the port
3866 * NOTE: The hard error port is used for first change exception handling
3867 * RETURNS: Status
3868 */
3869 NTSTATUS
3870 STDCALL
3871 NtSetDefaultHardErrorPort(
3872 IN HANDLE PortHandle
3873 );
3874 NTSTATUS
3875 STDCALL
3876 ZwSetDefaultHardErrorPort(
3877 IN HANDLE PortHandle
3878 );
3879
3880 /*
3881 * FUNCTION: Sets the extended attributes of a file.
3882 * ARGUMENTS:
3883 * FileHandle = Handle to the file
3884 * IoStatusBlock = Storage for a resulting status and information
3885 * on the current operation.
3886 * EaBuffer = Extended Attributes buffer.
3887 * EaBufferSize = Size of the extended attributes buffer
3888 * RETURNS: Status
3889 */
3890 NTSTATUS
3891 STDCALL
3892 NtSetEaFile(
3893 IN HANDLE FileHandle,
3894 IN PIO_STATUS_BLOCK IoStatusBlock,
3895 PVOID EaBuffer,
3896 ULONG EaBufferSize
3897 );
3898 NTSTATUS
3899 STDCALL
3900 ZwSetEaFile(
3901 IN HANDLE FileHandle,
3902 IN PIO_STATUS_BLOCK IoStatusBlock,
3903 PVOID EaBuffer,
3904 ULONG EaBufferSize
3905 );
3906
3907 //FIXME: should I return the event state ?
3908
3909 /*
3910 * FUNCTION: Sets the event to a signalled state.
3911 * ARGUMENTS:
3912 * EventHandle = Handle to the event
3913 * NumberOfThreadsReleased = The number of threads released
3914 * REMARK:
3915 * This procedure maps to the win32 SetEvent function.
3916 * RETURNS: Status
3917 */
3918
3919 NTSTATUS
3920 STDCALL
3921 NtSetEvent(
3922 IN HANDLE EventHandle,
3923 OUT PLONG PreviousState OPTIONAL
3924 );
3925
3926 NTSTATUS
3927 STDCALL
3928 ZwSetEvent(
3929 IN HANDLE EventHandle,
3930 OUT PLONG PreviousState OPTIONAL
3931 );
3932
3933 /*
3934 * FUNCTION: Sets the high part of an event pair
3935 * ARGUMENTS:
3936 EventPair = Handle to the event pair
3937 * RETURNS: Status
3938 */
3939
3940 NTSTATUS
3941 STDCALL
3942 NtSetHighEventPair(
3943 IN HANDLE EventPairHandle
3944 );
3945
3946 NTSTATUS
3947 STDCALL
3948 ZwSetHighEventPair(
3949 IN HANDLE EventPairHandle
3950 );
3951 /*
3952 * FUNCTION: Sets the high part of an event pair and wait for the low part
3953 * ARGUMENTS:
3954 EventPair = Handle to the event pair
3955 * RETURNS: Status
3956 */
3957 NTSTATUS
3958 STDCALL
3959 NtSetHighWaitLowEventPair(
3960 IN HANDLE EventPairHandle
3961 );
3962 NTSTATUS
3963 STDCALL
3964 ZwSetHighWaitLowEventPair(
3965 IN HANDLE EventPairHandle
3966 );
3967
3968 /*
3969 * FUNCTION: Sets the information of a file object.
3970 * ARGUMENTS:
3971 * FileHandle = Handle to the file object
3972 * IoStatusBlock = Caller supplies storage for extended information
3973 * on the current operation.
3974 * FileInformation = Storage for the new file information
3975 * Lenght = Size of the new file information.
3976 * FileInformationClass = Indicates to a certain information structure
3977
3978 FileNameInformation FILE_NAME_INFORMATION
3979 FileRenameInformation FILE_RENAME_INFORMATION
3980 FileStreamInformation FILE_STREAM_INFORMATION
3981 * FileCompletionInformation IO_COMPLETION_CONTEXT
3982
3983 * REMARK:
3984 * This procedure maps to the win32 SetEndOfFile, SetFileAttributes,
3985 * SetNamedPipeHandleState, SetMailslotInfo functions.
3986 * RETURNS: Status
3987 */
3988
3989
3990 NTSTATUS
3991 STDCALL
3992 NtSetInformationFile(
3993 IN HANDLE FileHandle,
3994 IN PIO_STATUS_BLOCK IoStatusBlock,
3995 IN PVOID FileInformation,
3996 IN ULONG Length,
3997 IN FILE_INFORMATION_CLASS FileInformationClass
3998 );
3999 NTSTATUS
4000 STDCALL
4001 ZwSetInformationFile(
4002 IN HANDLE FileHandle,
4003 IN PIO_STATUS_BLOCK IoStatusBlock,
4004 IN PVOID FileInformation,
4005 IN ULONG Length,
4006 IN FILE_INFORMATION_CLASS FileInformationClass
4007 );
4008
4009 NTSTATUS
4010 STDCALL
4011 NtSetInformationJobObject(
4012 HANDLE JobHandle,
4013 JOBOBJECTINFOCLASS JobInformationClass,
4014 PVOID JobInformation,
4015 ULONG JobInformationLength
4016 );
4017
4018 NTSTATUS
4019 STDCALL
4020 ZwSetInformationJobObject(
4021 HANDLE JobHandle,
4022 JOBOBJECTINFOCLASS JobInformationClass,
4023 PVOID JobInformation,
4024 ULONG JobInformationLength
4025 );
4026 /*
4027 * FUNCTION: Changes a set of thread specific parameters
4028 * ARGUMENTS:
4029 * ThreadHandle = Handle to the thread
4030 * ThreadInformationClass = Index to the set of parameters to change.
4031 * Can be one of the following values:
4032 *
4033 * ThreadBasicInformation THREAD_BASIC_INFORMATION
4034 * ThreadPriority KPRIORITY //???
4035 * ThreadBasePriority KPRIORITY
4036 * ThreadAffinityMask KAFFINITY //??
4037 * ThreadImpersonationToken ACCESS_TOKEN
4038 * ThreadIdealProcessor ULONG
4039 * ThreadPriorityBoost ULONG
4040 *
4041 * ThreadInformation = Caller supplies storage for parameters to set.
4042 * ThreadInformationLength = Size of the storage supplied
4043 * RETURNS: Status
4044 */
4045 NTSTATUS
4046 STDCALL
4047 NtSetInformationThread(
4048 IN HANDLE ThreadHandle,
4049 IN THREADINFOCLASS ThreadInformationClass,
4050 IN PVOID ThreadInformation,
4051 IN ULONG ThreadInformationLength
4052 );
4053 NTSTATUS
4054 STDCALL
4055 ZwSetInformationThread(
4056 IN HANDLE ThreadHandle,
4057 IN THREADINFOCLASS ThreadInformationClass,
4058 IN PVOID ThreadInformation,
4059 IN ULONG ThreadInformationLength
4060 );
4061
4062 /*
4063 * FUNCTION: Changes a set of token specific parameters
4064 * ARGUMENTS:
4065 * TokenHandle = Handle to the token
4066 * TokenInformationClass = Index to a certain information structure.
4067 * Can be one of the following values:
4068 *
4069 TokenUser TOKEN_USER
4070 TokenGroups TOKEN_GROUPS
4071 TokenPrivileges TOKEN_PRIVILEGES
4072 TokenOwner TOKEN_OWNER
4073 TokenPrimaryGroup TOKEN_PRIMARY_GROUP
4074 TokenDefaultDacl TOKEN_DEFAULT_DACL
4075 TokenSource TOKEN_SOURCE
4076 TokenType TOKEN_TYPE
4077 TokenImpersonationLevel TOKEN_IMPERSONATION_LEVEL
4078 TokenStatistics TOKEN_STATISTICS
4079 *
4080 * TokenInformation = Caller supplies storage for information structure.
4081 * TokenInformationLength = Size of the information structure
4082 * RETURNS: Status
4083 */
4084
4085 NTSTATUS
4086 STDCALL
4087 NtSetInformationToken(
4088 IN HANDLE TokenHandle,
4089 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
4090 OUT PVOID TokenInformation,
4091 IN ULONG TokenInformationLength
4092 );
4093
4094 NTSTATUS
4095 STDCALL
4096 ZwSetInformationToken(
4097 IN HANDLE TokenHandle,
4098 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
4099 OUT PVOID TokenInformation,
4100 IN ULONG TokenInformationLength
4101 );
4102
4103
4104 /*
4105 * FUNCTION: Sets an io completion
4106 * ARGUMENTS:
4107 * CompletionPort =
4108 * CompletionKey =
4109 * IoStatusBlock =
4110 * NumberOfBytesToTransfer =
4111 * NumberOfBytesTransferred =
4112 * RETURNS: Status
4113 */
4114 NTSTATUS
4115 STDCALL
4116 NtSetIoCompletion(
4117 IN HANDLE IoCompletionPortHandle,
4118 IN PVOID CompletionKey,
4119 IN PVOID CompletionContext,
4120 IN NTSTATUS CompletionStatus,
4121 IN ULONG CompletionInformation
4122 );
4123
4124 NTSTATUS
4125 STDCALL
4126 ZwSetIoCompletion(
4127 IN HANDLE IoCompletionPortHandle,
4128 IN PVOID CompletionKey,
4129 IN PVOID CompletionContext,
4130 IN NTSTATUS CompletionStatus,
4131 IN ULONG CompletionInformation
4132 );
4133
4134 /*
4135 * FUNCTION: Set properties for profiling
4136 * ARGUMENTS:
4137 * Interval =
4138 * ClockSource =
4139 * RETURNS: Status
4140 *
4141 */
4142
4143 NTSTATUS
4144 STDCALL
4145 NtSetIntervalProfile(
4146 ULONG Interval,
4147 KPROFILE_SOURCE ClockSource
4148 );
4149
4150 NTSTATUS
4151 STDCALL
4152 ZwSetIntervalProfile(
4153 ULONG Interval,
4154 KPROFILE_SOURCE ClockSource
4155 );
4156
4157
4158 /*
4159 * FUNCTION: Sets the low part of an event pair
4160 * ARGUMENTS:
4161 EventPair = Handle to the event pair
4162 * RETURNS: Status
4163 */
4164
4165 NTSTATUS
4166 STDCALL
4167 NtSetLowEventPair(
4168 HANDLE EventPair
4169 );
4170 NTSTATUS
4171 STDCALL
4172 ZwSetLowEventPair(
4173 HANDLE EventPair
4174 );
4175 /*
4176 * FUNCTION: Sets the low part of an event pair and wait for the high part
4177 * ARGUMENTS:
4178 EventPair = Handle to the event pair
4179 * RETURNS: Status
4180 */
4181 NTSTATUS
4182 STDCALL
4183 NtSetLowWaitHighEventPair(
4184 HANDLE EventPair
4185 );
4186 NTSTATUS
4187 STDCALL
4188 ZwSetLowWaitHighEventPair(
4189 HANDLE EventPair
4190 );
4191
4192 /* NtSetLowWaitHighThread effectively invokes NtSetLowWaitHighEventPair on the
4193 * event pair of the thread.
4194 */
4195 NTSTATUS
4196 STDCALL
4197 NtSetLowWaitHighThread(
4198 VOID
4199 );
4200 /* ZwSetLowWaitHighThread effectively invokes ZwSetLowWaitHighEventPair on the
4201 * event pair of the thread.
4202 */
4203 NTSTATUS
4204 STDCALL
4205 ZwSetLowWaitHighThread(
4206 VOID
4207 );
4208
4209 /* NtSetHighWaitLowThread effectively invokes NtSetHighWaitLowEventPair on the
4210 * event pair of the thread.
4211 */
4212 NTSTATUS
4213 STDCALL
4214 NtSetHighWaitLowThread(
4215 VOID
4216 );
4217
4218 /* ZwSetHighWaitLowThread effectively invokes ZwSetHighWaitLowEventPair on the
4219 * event pair of the thread.
4220 */
4221 NTSTATUS
4222 STDCALL
4223 ZwSetHighWaitLowThread(
4224 VOID
4225 );
4226
4227 NTSTATUS
4228 STDCALL
4229 NtSetQuotaInformationFile(
4230 HANDLE FileHandle,
4231 PIO_STATUS_BLOCK IoStatusBlock,
4232 PFILE_USER_QUOTA_INFORMATION Buffer,
4233 ULONG BufferLength
4234 );
4235
4236 NTSTATUS
4237 STDCALL
4238 ZwSetQuotaInformationFile(
4239 HANDLE FileHandle,
4240 PIO_STATUS_BLOCK IoStatusBlock,
4241 PFILE_USER_QUOTA_INFORMATION Buffer,
4242 ULONG BufferLength
4243 );
4244
4245 NTSTATUS
4246 STDCALL
4247 NtSetSecurityObject(
4248 IN HANDLE Handle,
4249 IN SECURITY_INFORMATION SecurityInformation,
4250 IN PSECURITY_DESCRIPTOR SecurityDescriptor
4251 );
4252
4253 NTSTATUS
4254 STDCALL
4255 ZwSetSecurityObject(
4256 IN HANDLE Handle,
4257 IN SECURITY_INFORMATION SecurityInformation,
4258 IN PSECURITY_DESCRIPTOR SecurityDescriptor
4259 );
4260
4261
4262 /*
4263 * FUNCTION: Sets a system environment variable
4264 * ARGUMENTS:
4265 * ValueName = Name of the environment variable
4266 * Value = Value of the environment variable
4267 * RETURNS: Status
4268 */
4269 NTSTATUS
4270 STDCALL
4271 NtSetSystemEnvironmentValue(
4272 IN PUNICODE_STRING VariableName,
4273 IN PUNICODE_STRING Value
4274 );
4275 NTSTATUS
4276 STDCALL
4277 ZwSetSystemEnvironmentValue(
4278 IN PUNICODE_STRING VariableName,
4279 IN PUNICODE_STRING Value
4280 );
4281 /*
4282 * FUNCTION: Sets system parameters
4283 * ARGUMENTS:
4284 * SystemInformationClass = Index to a particular set of system parameters
4285 * Can be one of the following values:
4286 *
4287 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
4288 *
4289 * SystemInformation = Structure containing the parameters.
4290 * SystemInformationLength = Size of the structure.
4291 * RETURNS: Status
4292 */
4293 NTSTATUS
4294 STDCALL
4295 NtSetSystemInformation(
4296 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
4297 IN PVOID SystemInformation,
4298 IN ULONG SystemInformationLength
4299 );
4300
4301 NTSTATUS
4302 STDCALL
4303 ZwSetSystemInformation(
4304 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
4305 IN PVOID SystemInformation,
4306 IN ULONG SystemInformationLength
4307 );
4308
4309 /*
4310 * FUNCTION: Sets the system time
4311 * ARGUMENTS:
4312 * SystemTime = Old System time
4313 * NewSystemTime = New System time
4314 * RETURNS: Status
4315 */
4316 NTSTATUS
4317 STDCALL
4318 NtSetSystemTime(
4319 IN PLARGE_INTEGER SystemTime,
4320 IN PLARGE_INTEGER NewSystemTime OPTIONAL
4321 );
4322 NTSTATUS
4323 STDCALL
4324 ZwSetSystemTime(
4325 IN PLARGE_INTEGER SystemTime,
4326 IN PLARGE_INTEGER NewSystemTime OPTIONAL
4327 );
4328
4329 /*
4330 * FUNCTION: Sets the frequency of the system timer
4331 * ARGUMENTS:
4332 * RequestedResolution =
4333 * SetOrUnset =
4334 * ActualResolution =
4335 * RETURNS: Status
4336 */
4337 NTSTATUS
4338 STDCALL
4339 NtSetTimerResolution(
4340 IN ULONG DesiredResolution,
4341 IN BOOLEAN SetResolution,
4342 OUT PULONG CurrentResolution
4343 );
4344 NTSTATUS
4345 STDCALL
4346 ZwSetTimerResolution(
4347 IN ULONG DesiredResolution,
4348 IN BOOLEAN SetResolution,
4349 OUT PULONG CurrentResolution
4350 );
4351
4352 /*
4353 * FUNCTION: Sets the value of a registry key
4354 * ARGUMENTS:
4355 * KeyHandle = Handle to a registry key
4356 * ValueName = Name of the value entry to change
4357 * TitleIndex = pointer to a structure containing the new volume information
4358 * Type = Type of the registry key. Can be one of the values:
4359 * REG_BINARY Unspecified binary data
4360 * REG_DWORD A 32 bit value
4361 * REG_DWORD_LITTLE_ENDIAN Same as REG_DWORD
4362 * REG_DWORD_BIG_ENDIAN A 32 bit value whose least significant byte is at the highest address
4363 * REG_EXPAND_SZ A zero terminated wide character string with unexpanded environment variables ( "%PATH%" )
4364 * REG_LINK A zero terminated wide character string referring to a symbolic link.
4365 * REG_MULTI_SZ A series of zero-terminated strings including a additional trailing zero
4366 * REG_NONE Unspecified type
4367 * REG_SZ A wide character string ( zero terminated )
4368 * REG_RESOURCE_LIST ??
4369 * REG_RESOURCE_REQUIREMENTS_LIST ??
4370 * REG_FULL_RESOURCE_DESCRIPTOR ??
4371 * Data = Contains the data for the registry key.
4372 * DataSize = size of the data.
4373 * RETURNS: Status
4374 */
4375 NTSTATUS
4376 STDCALL
4377 NtSetValueKey(
4378 IN HANDLE KeyHandle,
4379 IN PUNICODE_STRING ValueName,
4380 IN ULONG TitleIndex OPTIONAL,
4381 IN ULONG Type,
4382 IN PVOID Data,
4383 IN ULONG DataSize
4384 );
4385 NTSTATUS
4386 STDCALL
4387 ZwSetValueKey(
4388 IN HANDLE KeyHandle,
4389 IN PUNICODE_STRING ValueName,
4390 IN ULONG TitleIndex OPTIONAL,
4391 IN ULONG Type,
4392 IN PVOID Data,
4393 IN ULONG DataSize
4394 );
4395
4396 /*
4397 * FUNCTION: Sets the volume information.
4398 * ARGUMENTS:
4399 * FileHandle = Handle to the file
4400 * IoStatusBlock = Caller should supply storage for additional status information
4401 * VolumeInformation = pointer to a structure containing the new volume information
4402 * Length = size of the structure.
4403 * VolumeInformationClass = specifies the particular volume information to set
4404 * RETURNS: Status
4405 */
4406 NTSTATUS
4407 STDCALL
4408 NtSetVolumeInformationFile(
4409 IN HANDLE FileHandle,
4410 OUT PIO_STATUS_BLOCK IoStatusBlock,
4411 IN PVOID FsInformation,
4412 IN ULONG Length,
4413 IN FS_INFORMATION_CLASS FsInformationClass
4414 );
4415
4416 NTSTATUS
4417 STDCALL
4418 ZwSetVolumeInformationFile(
4419 IN HANDLE FileHandle,
4420 OUT PIO_STATUS_BLOCK IoStatusBlock,
4421 IN PVOID FsInformation,
4422 IN ULONG Length,
4423 IN FS_INFORMATION_CLASS FsInformationClass
4424 );
4425
4426 /*
4427 * FUNCTION: Shuts the system down
4428 * ARGUMENTS:
4429 * Action = Specifies the type of shutdown, it can be one of the following values:
4430 * ShutdownNoReboot, ShutdownReboot, ShutdownPowerOff
4431 * RETURNS: Status
4432 */
4433 NTSTATUS
4434 STDCALL
4435 NtShutdownSystem(
4436 IN SHUTDOWN_ACTION Action
4437 );
4438
4439 NTSTATUS
4440 STDCALL
4441 ZwShutdownSystem(
4442 IN SHUTDOWN_ACTION Action
4443 );
4444
4445 /*
4446 * FUNCTION: Signals an object and wait for an other one.
4447 * ARGUMENTS:
4448 * SignalObject = Handle to the object that should be signaled
4449 * WaitObject = Handle to the object that should be waited for
4450 * Alertable = True if the wait is alertable
4451 * Time = The time to wait
4452 * RETURNS: Status
4453 */
4454 NTSTATUS
4455 STDCALL
4456 NtSignalAndWaitForSingleObject(
4457 IN HANDLE SignalObject,
4458 IN HANDLE WaitObject,
4459 IN BOOLEAN Alertable,
4460 IN PLARGE_INTEGER Time
4461 );
4462
4463 NTSTATUS
4464 STDCALL
4465 NtSignalAndWaitForSingleObject(
4466 IN HANDLE SignalObject,
4467 IN HANDLE WaitObject,
4468 IN BOOLEAN Alertable,
4469 IN PLARGE_INTEGER Time
4470 );
4471
4472 /*
4473 * FUNCTION: Starts profiling
4474 * ARGUMENTS:
4475 * ProfileHandle = Handle to the profile
4476 * RETURNS: Status
4477 */
4478
4479 NTSTATUS
4480 STDCALL
4481 NtStartProfile(
4482 HANDLE ProfileHandle
4483 );
4484
4485 NTSTATUS
4486 STDCALL
4487 ZwStartProfile(
4488 HANDLE ProfileHandle
4489 );
4490
4491 /*
4492 * FUNCTION: Stops profiling
4493 * ARGUMENTS:
4494 * ProfileHandle = Handle to the profile
4495 * RETURNS: Status
4496 */
4497
4498 NTSTATUS
4499 STDCALL
4500 NtStopProfile(
4501 HANDLE ProfileHandle
4502 );
4503
4504 NTSTATUS
4505 STDCALL
4506 ZwStopProfile(
4507 HANDLE ProfileHandle
4508 );
4509
4510 /* --- PROCESS MANAGEMENT --- */
4511
4512 //--NtSystemDebugControl
4513 /*
4514 * FUNCTION: Terminates the execution of a process.
4515 * ARGUMENTS:
4516 * ThreadHandle = Handle to the process
4517 * ExitStatus = The exit status of the process to terminate with.
4518 * REMARKS
4519 * Native applications should kill themselves using this function.
4520 * RETURNS: Status
4521 */
4522 NTSTATUS
4523 STDCALL
4524 NtTerminateProcess(
4525 IN HANDLE ProcessHandle OPTIONAL,
4526 IN NTSTATUS ExitStatus
4527 );
4528 NTSTATUS
4529 STDCALL
4530 ZwTerminateProcess(
4531 IN HANDLE ProcessHandle OPTIONAL,
4532 IN NTSTATUS ExitStatus
4533 );
4534
4535 NTSTATUS
4536 STDCALL
4537 NtTerminateJobObject(
4538 HANDLE JobHandle,
4539 NTSTATUS ExitStatus
4540 );
4541
4542 NTSTATUS
4543 STDCALL
4544 ZwTerminateJobObject(
4545 HANDLE JobHandle,
4546 NTSTATUS ExitStatus
4547 );
4548
4549 NTSTATUS
4550 STDCALL
4551 NtTraceEvent(
4552 IN ULONG TraceHandle,
4553 IN ULONG Flags,
4554 IN ULONG TraceHeaderLength,
4555 IN struct _EVENT_TRACE_HEADER* TraceHeader
4556 );
4557
4558 NTSTATUS
4559 STDCALL
4560 ZwTraceEvent(
4561 IN ULONG TraceHandle,
4562 IN ULONG Flags,
4563 IN ULONG TraceHeaderLength,
4564 IN struct _EVENT_TRACE_HEADER* TraceHeader
4565 );
4566
4567 NTSTATUS
4568 STDCALL
4569 NtTranslateFilePath(
4570 ULONG Unknown1,
4571 ULONG Unknown2,
4572 ULONG Unknown3
4573 );
4574
4575
4576 NTSTATUS
4577 STDCALL
4578 ZwTranslateFilePath(
4579 ULONG Unknown1,
4580 ULONG Unknown2,
4581 ULONG Unknown3
4582 );
4583 /*
4584 * FUNCTION: Unloads a driver.
4585 * ARGUMENTS:
4586 * DriverServiceName = Name of the driver to unload
4587 * RETURNS: Status
4588 */
4589 NTSTATUS
4590 STDCALL
4591 NtUnloadDriver(
4592 IN PUNICODE_STRING DriverServiceName
4593 );
4594 NTSTATUS
4595 STDCALL
4596 ZwUnloadDriver(
4597 IN PUNICODE_STRING DriverServiceName
4598 );
4599
4600 /*
4601 * FUNCTION: Unmaps a piece of virtual memory backed by a file.
4602 * ARGUMENTS:
4603 * ProcessHandle = Handle to the process
4604 * BaseAddress = The address where the mapping begins
4605 * REMARK:
4606 This procedure maps to the win32 UnMapViewOfFile
4607 * RETURNS: Status
4608 */
4609 NTSTATUS
4610 STDCALL
4611 NtUnmapViewOfSection(
4612 IN HANDLE ProcessHandle,
4613 IN PVOID BaseAddress
4614 );
4615 NTSTATUS
4616 STDCALL
4617 ZwUnmapViewOfSection(
4618 IN HANDLE ProcessHandle,
4619 IN PVOID BaseAddress
4620 );
4621
4622
4623 NTSTATUS STDCALL
4624 NtWriteRequestData (HANDLE PortHandle,
4625 PLPC_MESSAGE Message,
4626 ULONG Index,
4627 PVOID Buffer,
4628 ULONG BufferLength,
4629 PULONG ReturnLength);
4630
4631 NTSTATUS STDCALL
4632 ZwWriteRequestData (HANDLE PortHandle,
4633 PLPC_MESSAGE Message,
4634 ULONG Index,
4635 PVOID Buffer,
4636 ULONG BufferLength,
4637 PULONG ReturnLength);
4638
4639
4640 /*
4641 * FUNCTION: Writes a range of virtual memory
4642 * ARGUMENTS:
4643 * ProcessHandle = The handle to the process owning the address space.
4644 * BaseAddress = The points to the address to write to
4645 * Buffer = Pointer to the buffer to write
4646 * NumberOfBytesToWrite = Offset to the upper boundary to write
4647 * NumberOfBytesWritten = Total bytes written
4648 * REMARKS:
4649 * This function maps to the win32 WriteProcessMemory
4650 * RETURNS: Status
4651 */
4652 NTSTATUS
4653 STDCALL
4654 NtWriteVirtualMemory(
4655 IN HANDLE ProcessHandle,
4656 IN PVOID BaseAddress,
4657 IN PVOID Buffer,
4658 IN ULONG NumberOfBytesToWrite,
4659 OUT PULONG NumberOfBytesWritten
4660 );
4661
4662 NTSTATUS
4663 STDCALL
4664 ZwWriteVirtualMemory(
4665 IN HANDLE ProcessHandle,
4666 IN PVOID BaseAddress,
4667 IN PVOID Buffer,
4668 IN ULONG NumberOfBytesToWrite,
4669 OUT PULONG NumberOfBytesWritten
4670 );
4671
4672
4673 /*
4674 * FUNCTION: Waits for an object to become signalled.
4675 * ARGUMENTS:
4676 * Object = The object handle
4677 * Alertable = If true the wait is alertable.
4678 * Time = The maximum wait time.
4679 * REMARKS:
4680 * This function maps to the win32 WaitForSingleObjectEx.
4681 * RETURNS: Status
4682 */
4683 NTSTATUS
4684 STDCALL
4685 NtWaitForSingleObject (
4686 IN HANDLE Object,
4687 IN BOOLEAN Alertable,
4688 IN PLARGE_INTEGER Time
4689 );
4690
4691 NTSTATUS
4692 STDCALL
4693 ZwWaitForSingleObject (
4694 IN HANDLE Object,
4695 IN BOOLEAN Alertable,
4696 IN PLARGE_INTEGER Time
4697 );
4698
4699 /* --- EVENT PAIR OBJECT --- */
4700
4701 /*
4702 * FUNCTION: Waits for the high part of an eventpair to become signalled
4703 * ARGUMENTS:
4704 * EventPairHandle = Handle to the event pair.
4705 * RETURNS: Status
4706 */
4707
4708 NTSTATUS
4709 STDCALL
4710 NtWaitHighEventPair(
4711 IN HANDLE EventPairHandle
4712 );
4713
4714 NTSTATUS
4715 STDCALL
4716 ZwWaitHighEventPair(
4717 IN HANDLE EventPairHandle
4718 );
4719
4720 /*
4721 * FUNCTION: Waits for the low part of an eventpair to become signalled
4722 * ARGUMENTS:
4723 * EventPairHandle = Handle to the event pair.
4724 * RETURNS: Status
4725 */
4726 NTSTATUS
4727 STDCALL
4728 NtWaitLowEventPair(
4729 IN HANDLE EventPairHandle
4730 );
4731
4732 NTSTATUS
4733 STDCALL
4734 ZwWaitLowEventPair(
4735 IN HANDLE EventPairHandle
4736 );
4737
4738 /* --- FILE MANAGEMENT --- */
4739
4740 /*
4741 * FUNCTION: Unlocks a range of bytes in a file.
4742 * ARGUMENTS:
4743 * FileHandle = Handle to the file
4744 * IoStatusBlock = Caller should supply storage for a structure containing
4745 * the completion status and information about the requested unlock operation.
4746 The information field is set to the number of bytes unlocked.
4747 * ByteOffset = Offset to start the range of bytes to unlock
4748 * Length = Number of bytes to unlock.
4749 * Key = Special value to enable other threads to unlock a file than the
4750 thread that locked the file. The key supplied must match with the one obtained
4751 in a previous call to NtLockFile.
4752 * REMARK:
4753 This procedure maps to the win32 procedure UnlockFileEx. STATUS_PENDING is returned if the lock could
4754 not be obtained immediately, the device queue is busy and the IRP is queued.
4755 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
4756 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_RANGE_NOT_LOCKED ]
4757 */
4758 NTSTATUS
4759 STDCALL
4760 NtUnlockFile(
4761 IN HANDLE FileHandle,
4762 OUT PIO_STATUS_BLOCK IoStatusBlock,
4763 IN PLARGE_INTEGER ByteOffset,
4764 IN PLARGE_INTEGER Lenght,
4765 OUT PULONG Key OPTIONAL
4766 );
4767 NTSTATUS
4768 STDCALL
4769 ZwUnlockFile(
4770 IN HANDLE FileHandle,
4771 OUT PIO_STATUS_BLOCK IoStatusBlock,
4772 IN PLARGE_INTEGER ByteOffset,
4773 IN PLARGE_INTEGER Lenght,
4774 OUT PULONG Key OPTIONAL
4775 );
4776
4777 /*
4778 * FUNCTION: Writes data to a file
4779 * ARGUMENTS:
4780 * FileHandle = The handle a file ( from NtCreateFile )
4781 * Event = Specifies a event that will become signalled when the write operation completes.
4782 * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ]
4783 * ApcContext = Argument to the Apc Routine
4784 * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation.
4785 * Buffer = Caller should supply storage for a buffer that will contain the information to be written to file.
4786 * Length = Size in bytest of the buffer
4787 * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged.
4788 * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if
4789 * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset
4790 * should be created by specifying FILE_USE_FILE_POINTER_POSITION.
4791 * Key = Unused
4792 * REMARKS:
4793 * This function maps to the win32 WriteFile.
4794 * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL.
4795 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES
4796 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ]
4797 */
4798 NTSTATUS
4799 STDCALL
4800 NtWriteFile(
4801 IN HANDLE FileHandle,
4802 IN HANDLE Event OPTIONAL,
4803 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
4804 IN PVOID ApcContext OPTIONAL,
4805 OUT PIO_STATUS_BLOCK IoStatusBlock,
4806 IN PVOID Buffer,
4807 IN ULONG Length,
4808 IN PLARGE_INTEGER ByteOffset,
4809 IN PULONG Key OPTIONAL
4810 );
4811
4812 NTSTATUS
4813 STDCALL
4814 ZwWriteFile(
4815 IN HANDLE FileHandle,
4816 IN HANDLE Event OPTIONAL,
4817 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
4818 IN PVOID ApcContext OPTIONAL,
4819 OUT PIO_STATUS_BLOCK IoStatusBlock,
4820 IN PVOID Buffer,
4821 IN ULONG Length,
4822 IN PLARGE_INTEGER ByteOffset ,
4823 IN PULONG Key OPTIONAL
4824 );
4825
4826 /*
4827 * FUNCTION: Writes a file
4828 * ARGUMENTS:
4829 * FileHandle = The handle of the file
4830 * Event =
4831 * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ]
4832 * ApcContext = Argument to the Apc Routine
4833 * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation.
4834 * BufferDescription = Caller should supply storage for a buffer that will contain the information to be written to file.
4835 * BufferLength = Size in bytest of the buffer
4836 * ByteOffset = Points to a file offset. If a combination of Length and BytesOfSet is past the end-of-file mark the file will be enlarged.
4837 * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if
4838 * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset
4839 * should be created by specifying FILE_USE_FILE_POINTER_POSITION. Use FILE_WRITE_TO_END_OF_FILE to write to the EOF.
4840 * Key = If a matching key [ a key provided at NtLockFile ] is provided the write operation will continue even if a byte range is locked.
4841 * REMARKS:
4842 * This function maps to the win32 WriteFile.
4843 * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL.
4844 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES
4845 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ]
4846 */
4847
4848 NTSTATUS
4849 STDCALL
4850 NtWriteFileGather(
4851 IN HANDLE FileHandle,
4852 IN HANDLE Event OPTIONAL,
4853 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
4854 IN PVOID ApcContext OPTIONAL,
4855 OUT PIO_STATUS_BLOCK IoStatusBlock,
4856 IN FILE_SEGMENT_ELEMENT BufferDescription[],
4857 IN ULONG BufferLength,
4858 IN PLARGE_INTEGER ByteOffset,
4859 IN PULONG Key OPTIONAL
4860 );
4861
4862 NTSTATUS
4863 STDCALL
4864 ZwWriteFileGather(
4865 IN HANDLE FileHandle,
4866 IN HANDLE Event OPTIONAL,
4867 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
4868 IN PVOID ApcContext OPTIONAL,
4869 OUT PIO_STATUS_BLOCK IoStatusBlock,
4870 IN FILE_SEGMENT_ELEMENT BufferDescription[],
4871 IN ULONG BufferLength,
4872 IN PLARGE_INTEGER ByteOffset,
4873 IN PULONG Key OPTIONAL
4874 );
4875
4876
4877 /* --- THREAD MANAGEMENT --- */
4878
4879 /*
4880 * FUNCTION: Increments a thread's resume count
4881 * ARGUMENTS:
4882 * ThreadHandle = Handle to the thread that should be resumed
4883 * PreviousSuspendCount = The resulting/previous suspend count.
4884 * REMARK:
4885 * A thread will be suspended if its suspend count is greater than 0. This procedure maps to
4886 * the win32 SuspendThread function. ( documentation about the the suspend count can be found here aswell )
4887 * The suspend count is not increased if it is greater than MAXIMUM_SUSPEND_COUNT.
4888 * RETURNS: Status
4889 */
4890 NTSTATUS
4891 STDCALL
4892 NtSuspendThread(
4893 IN HANDLE ThreadHandle,
4894 OUT PULONG PreviousSuspendCount OPTIONAL
4895 );
4896
4897 NTSTATUS
4898 STDCALL
4899 ZwSuspendThread(
4900 IN HANDLE ThreadHandle,
4901 OUT PULONG PreviousSuspendCount OPTIONAL
4902 );
4903
4904 /*
4905 * FUNCTION: Terminates the execution of a thread.
4906 * ARGUMENTS:
4907 * ThreadHandle = Handle to the thread
4908 * ExitStatus = The exit status of the thread to terminate with.
4909 * RETURNS: Status
4910 */
4911 NTSTATUS
4912 STDCALL
4913 NtTerminateThread(
4914 IN HANDLE ThreadHandle ,
4915 IN NTSTATUS ExitStatus
4916 );
4917 NTSTATUS
4918 STDCALL
4919 ZwTerminateThread(
4920 IN HANDLE ThreadHandle ,
4921 IN NTSTATUS ExitStatus
4922 );
4923 /*
4924 * FUNCTION: Tests to see if there are any pending alerts for the calling thread
4925 * RETURNS: Status
4926 */
4927 NTSTATUS
4928 STDCALL
4929 NtTestAlert(
4930 VOID
4931 );
4932 NTSTATUS
4933 STDCALL
4934 ZwTestAlert(
4935 VOID
4936 );
4937
4938 /*
4939 * FUNCTION: Yields the callers thread.
4940 * RETURNS: Status
4941 */
4942 NTSTATUS
4943 STDCALL
4944 NtYieldExecution(
4945 VOID
4946 );
4947
4948 NTSTATUS
4949 STDCALL
4950 ZwYieldExecution(
4951 VOID
4952 );
4953
4954 /* --- PLUG AND PLAY --- */
4955
4956 NTSTATUS
4957 STDCALL
4958 NtPlugPlayControl (DWORD Unknown1,
4959 DWORD Unknown2,
4960 DWORD Unknown3);
4961
4962 NTSTATUS
4963 STDCALL
4964 NtGetPlugPlayEvent (ULONG Reserved1,
4965 ULONG Reserved2,
4966 PVOID Buffer,
4967 ULONG BufferLength);
4968
4969 /* --- POWER MANAGEMENT --- */
4970
4971 #ifndef __USE_W32API
4972 NTSTATUS STDCALL
4973 NtSetSystemPowerState(IN POWER_ACTION SystemAction,
4974 IN SYSTEM_POWER_STATE MinSystemState,
4975 IN ULONG Flags);
4976 #endif
4977
4978 /* --- DEBUG SUBSYSTEM --- */
4979
4980 NTSTATUS STDCALL
4981 NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode,
4982 PVOID InputBuffer,
4983 ULONG InputBufferLength,
4984 PVOID OutputBuffer,
4985 ULONG OutputBufferLength,
4986 PULONG ReturnLength);
4987
4988 /* --- VIRTUAL DOS MACHINE (VDM) --- */
4989
4990 NTSTATUS
4991 STDCALL
4992 NtVdmControl (ULONG ControlCode, PVOID ControlData);
4993
4994
4995 /* --- WIN32 --- */
4996
4997 NTSTATUS STDCALL
4998 NtW32Call(IN ULONG RoutineIndex,
4999 IN PVOID Argument,
5000 IN ULONG ArgumentLength,
5001 OUT PVOID* Result OPTIONAL,
5002 OUT PULONG ResultLength OPTIONAL);
5003
5004 /* --- CHANNELS --- */
5005
5006 NTSTATUS
5007 STDCALL
5008 NtCreateChannel (
5009 VOID
5010 );
5011
5012 NTSTATUS
5013 STDCALL
5014 NtListenChannel (
5015 VOID
5016 );
5017
5018 NTSTATUS
5019 STDCALL
5020 NtOpenChannel (
5021 VOID
5022 );
5023
5024 NTSTATUS
5025 STDCALL
5026 NtReplyWaitSendChannel (
5027 VOID
5028 );
5029
5030 NTSTATUS
5031 STDCALL
5032 NtSendWaitReplyChannel (
5033 VOID
5034 );
5035
5036 NTSTATUS
5037 STDCALL
5038 NtSetContextChannel (
5039 VOID
5040 );
5041
5042 /* --- MISCELLANEA --- */
5043
5044 //NTSTATUS STDCALL NtSetLdtEntries(VOID);
5045 NTSTATUS
5046 STDCALL
5047 NtSetLdtEntries (ULONG Selector1,
5048 LDT_ENTRY LdtEntry1,
5049 ULONG Selector2,
5050 LDT_ENTRY LdtEntry2);
5051
5052 NTSTATUS
5053 STDCALL
5054 NtQueryOleDirectoryFile (
5055 VOID
5056 );
5057
5058 /*
5059 * FUNCTION: Checks a clients access rights to a object
5060 * ARGUMENTS:
5061 * SecurityDescriptor = Security information against which the access is checked
5062 * ClientToken = Represents a client
5063 * DesiredAcces =
5064 * GenericMapping =
5065 * PrivilegeSet =
5066 * ReturnLength = Bytes written
5067 * GrantedAccess =
5068 * AccessStatus = Indicates if the ClientToken allows the requested access
5069 * REMARKS: The arguments map to the win32 AccessCheck
5070 * Gary Nebbett is wrong:
5071 * The 7th argument is a PACCESS_MASK, not a PULONG.
5072 * The 8th argument is a PNTSTATUS, not a PBOOLEAN.
5073 * RETURNS: Status
5074 */
5075
5076 NTSTATUS
5077 STDCALL
5078 NtAccessCheck(
5079 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5080 IN HANDLE ClientToken,
5081 IN ACCESS_MASK DesiredAcces,
5082 IN PGENERIC_MAPPING GenericMapping,
5083 OUT PPRIVILEGE_SET PrivilegeSet,
5084 OUT PULONG ReturnLength,
5085 OUT PACCESS_MASK GrantedAccess,
5086 OUT PNTSTATUS AccessStatus
5087 );
5088
5089 NTSTATUS
5090 STDCALL
5091 ZwAccessCheck(
5092 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5093 IN HANDLE ClientToken,
5094 IN ACCESS_MASK DesiredAcces,
5095 IN PGENERIC_MAPPING GenericMapping,
5096 OUT PPRIVILEGE_SET PrivilegeSet,
5097 OUT PULONG ReturnLength,
5098 OUT PACCESS_MASK GrantedAccess,
5099 OUT PNTSTATUS AccessStatus
5100 );
5101
5102 NTSTATUS
5103 STDCALL
5104 RtlOpenCurrentUser(
5105 IN ACCESS_MASK DesiredAccess,
5106 OUT PHANDLE KeyHandle);
5107
5108 /*
5109 * FUNCTION: Checks a clients access rights to a object and issues a audit a alarm. ( it logs the access )
5110 * ARGUMENTS:
5111 * SubsystemName = Specifies the name of the subsystem, can be "WIN32" or "DEBUG"
5112 * ObjectHandle =
5113 * ObjectTypeName =
5114 * ObjectName =
5115 * SecurityDescriptor =
5116 * DesiredAcces =
5117 * GenericMapping =
5118 * ObjectCreation =
5119 * GrantedAccess =
5120 * AccessStatus =
5121 * GenerateOnClose =
5122 * REMARKS: The arguments map to the win32 AccessCheck
5123 * RETURNS: Status
5124 */
5125
5126 NTSTATUS
5127 STDCALL
5128 NtAccessCheckAndAuditAlarm(
5129 IN PUNICODE_STRING SubsystemName,
5130 IN PHANDLE ObjectHandle,
5131 IN PUNICODE_STRING ObjectTypeName,
5132 IN PUNICODE_STRING ObjectName,
5133 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5134 IN ACCESS_MASK DesiredAccess,
5135 IN PGENERIC_MAPPING GenericMapping,
5136 IN BOOLEAN ObjectCreation,
5137 OUT PACCESS_MASK GrantedAccess,
5138 OUT PNTSTATUS AccessStatus,
5139 OUT PBOOLEAN GenerateOnClose
5140 );
5141
5142 /*
5143 * FUNCTION: Cancels a timer
5144 * ARGUMENTS:
5145 * TimerHandle = Handle to the timer
5146 * CurrentState = Specifies the state of the timer when cancelled.
5147 * REMARKS:
5148 * The arguments to this function map to the function CancelWaitableTimer.
5149 * RETURNS: Status
5150 */
5151 NTSTATUS
5152 STDCALL
5153 NtCancelTimer(
5154 IN HANDLE TimerHandle,
5155 OUT PBOOLEAN CurrentState OPTIONAL
5156 );
5157
5158 /*
5159 * FUNCTION: Continues a thread with the specified context
5160 * ARGUMENTS:
5161 * Context = Specifies the processor context
5162 * IrqLevel = Specifies the Interupt Request Level to continue with. Can
5163 * be PASSIVE_LEVEL or APC_LEVEL
5164 * REMARKS
5165 * NtContinue can be used to continue after an exception or apc.
5166 * RETURNS: Status
5167 */
5168 //FIXME This function might need another parameter
5169
5170 NTSTATUS
5171 STDCALL
5172 NtContinue(
5173 IN PCONTEXT Context,
5174 IN BOOLEAN TestAlert
5175 );
5176
5177 /*
5178 * FUNCTION: Creates a paging file.
5179 * ARGUMENTS:
5180 * FileName = Name of the pagefile
5181 * InitialSize = Specifies the initial size in bytes
5182 * MaximumSize = Specifies the maximum size in bytes
5183 * Reserved = Reserved for future use
5184 * RETURNS: Status
5185 */
5186 NTSTATUS
5187 STDCALL
5188 NtCreatePagingFile(
5189 IN PUNICODE_STRING FileName,
5190 IN PLARGE_INTEGER InitialSize,
5191 IN PLARGE_INTEGER MaxiumSize,
5192 IN ULONG Reserved
5193 );
5194
5195
5196 /*
5197 * FUNCTION: Creates a profile
5198 * ARGUMENTS:
5199 * ProfileHandle (OUT) = Caller supplied storage for the resulting handle
5200 * ObjectAttribute = Initialized attributes for the object
5201 * ImageBase = Start address of executable image
5202 * ImageSize = Size of the image
5203 * Granularity = Bucket size
5204 * Buffer = Caller supplies buffer for profiling info
5205 * ProfilingSize = Buffer size
5206 * ClockSource = Specify 0 / FALSE ??
5207 * ProcessorMask = A value of -1 indicates disables per processor profiling,
5208 otherwise bit set for the processor to profile.
5209 * REMARKS:
5210 * This function maps to the win32 CreateProcess.
5211 * RETURNS: Status
5212 */
5213
5214 NTSTATUS
5215 STDCALL
5216 NtCreateProfile(OUT PHANDLE ProfileHandle,
5217 IN HANDLE Process OPTIONAL,
5218 IN PVOID ImageBase,
5219 IN ULONG ImageSize,
5220 IN ULONG BucketSize,
5221 IN PVOID Buffer,
5222 IN ULONG BufferSize,
5223 IN KPROFILE_SOURCE ProfileSource,
5224 IN KAFFINITY Affinity);
5225
5226 /*
5227 * FUNCTION: Creates a user mode thread
5228 * ARGUMENTS:
5229 * ThreadHandle (OUT) = Caller supplied storage for the resulting handle
5230 * DesiredAccess = Specifies the allowed or desired access to the thread.
5231 * ObjectAttributes = Initialized attributes for the object.
5232 * ProcessHandle = Handle to the threads parent process.
5233 * ClientId (OUT) = Caller supplies storage for returned process id and thread id.
5234 * ThreadContext = Initial processor context for the thread.
5235 * InitialTeb = Initial user mode stack context for the thread.
5236 * CreateSuspended = Specifies if the thread is ready for scheduling
5237 * REMARKS:
5238 * This function maps to the win32 function CreateThread.
5239 * RETURNS: Status
5240 */
5241 NTSTATUS
5242 STDCALL
5243 NtCreateThread(
5244 OUT PHANDLE ThreadHandle,
5245 IN ACCESS_MASK DesiredAccess,
5246 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
5247 IN HANDLE ProcessHandle,
5248 OUT PCLIENT_ID ClientId,
5249 IN PCONTEXT ThreadContext,
5250 IN PINITIAL_TEB InitialTeb,
5251 IN BOOLEAN CreateSuspended
5252 );
5253
5254 /*
5255 * FUNCTION: Delays the execution of the calling thread.
5256 * ARGUMENTS:
5257 * Alertable = If TRUE the thread is alertable during is wait period
5258 * Interval = Specifies the interval to wait.
5259 * RETURNS: Status
5260 */
5261
5262 NTSTATUS
5263 STDCALL
5264 NtDelayExecution(
5265 IN BOOLEAN Alertable,
5266 IN PLARGE_INTEGER DelayInterval
5267 );
5268
5269 /*
5270 * FUNCTION: Extends a section
5271 * ARGUMENTS:
5272 * SectionHandle = Handle to the section
5273 * NewMaximumSize = Adjusted size
5274 * RETURNS: Status
5275 */
5276 NTSTATUS
5277 STDCALL
5278 NtExtendSection(
5279 IN HANDLE SectionHandle,
5280 IN PLARGE_INTEGER NewMaximumSize
5281 );
5282
5283 /*
5284 * FUNCTION: Flushes a the processors instruction cache
5285 * ARGUMENTS:
5286 * ProcessHandle = Points to the process owning the cache
5287 * BaseAddress = // might this be a image address ????
5288 * NumberOfBytesToFlush =
5289 * RETURNS: Status
5290 * REMARKS:
5291 * This funciton is used by debuggers
5292 */
5293 NTSTATUS
5294 STDCALL
5295 NtFlushInstructionCache(
5296 IN HANDLE ProcessHandle,
5297 IN PVOID BaseAddress,
5298 IN UINT NumberOfBytesToFlush
5299 );
5300
5301 /*
5302 * FUNCTION: Flushes virtual memory to file
5303 * ARGUMENTS:
5304 * ProcessHandle = Points to the process that allocated the virtual memory
5305 * BaseAddress = Points to the memory address
5306 * NumberOfBytesToFlush = Limits the range to flush,
5307 * NumberOfBytesFlushed = Actual number of bytes flushed
5308 * RETURNS: Status
5309 * REMARKS:
5310 * Check return status on STATUS_NOT_MAPPED_DATA
5311 */
5312 NTSTATUS
5313 STDCALL
5314 NtFlushVirtualMemory(
5315 IN HANDLE ProcessHandle,
5316 IN PVOID BaseAddress,
5317 IN ULONG NumberOfBytesToFlush,
5318 OUT PULONG NumberOfBytesFlushed OPTIONAL
5319 );
5320
5321 /*
5322 * FUNCTION: Retrieves the uptime of the system
5323 * ARGUMENTS:
5324 * UpTime = Number of clock ticks since boot.
5325 * RETURNS: Status
5326 */
5327 ULONG
5328 STDCALL
5329 NtGetTickCount(
5330 VOID
5331 );
5332
5333 /*
5334 * FUNCTION: Loads a registry key.
5335 * ARGUMENTS:
5336 * KeyObjectAttributes = Key to be loaded
5337 * FileObjectAttributes = File to load the key from
5338 * REMARK:
5339 * This procedure maps to the win32 procedure RegLoadKey
5340 * RETURNS: Status
5341 */
5342 NTSTATUS
5343 STDCALL
5344 NtLoadKey(
5345 IN POBJECT_ATTRIBUTES KeyObjectAttributes,
5346 IN POBJECT_ATTRIBUTES FileObjectAttributes
5347 );
5348
5349
5350 /*
5351 * FUNCTION: Locks a range of virtual memory.
5352 * ARGUMENTS:
5353 * ProcessHandle = Handle to the process
5354 * BaseAddress = Lower boundary of the range of bytes to lock.
5355 * NumberOfBytesLock = Offset to the upper boundary.
5356 * NumberOfBytesLocked (OUT) = Number of bytes actually locked.
5357 * REMARK:
5358 This procedure maps to the win32 procedure VirtualLock.
5359 * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ]
5360 */
5361 NTSTATUS
5362 STDCALL
5363 NtLockVirtualMemory(
5364 HANDLE ProcessHandle,
5365 PVOID BaseAddress,
5366 ULONG NumberOfBytesToLock,
5367 PULONG NumberOfBytesLocked
5368 );
5369
5370 NTSTATUS
5371 STDCALL
5372 NtOpenObjectAuditAlarm(
5373 IN PUNICODE_STRING SubsystemName,
5374 IN PVOID HandleId,
5375 IN PUNICODE_STRING ObjectTypeName,
5376 IN PUNICODE_STRING ObjectName,
5377 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5378 IN HANDLE ClientToken,
5379 IN ULONG DesiredAccess,
5380 IN ULONG GrantedAccess,
5381 IN PPRIVILEGE_SET Privileges,
5382 IN BOOLEAN ObjectCreation,
5383 IN BOOLEAN AccessGranted,
5384 OUT PBOOLEAN GenerateOnClose
5385 );
5386
5387 /*
5388 * FUNCTION: Set the access protection of a range of virtual memory
5389 * ARGUMENTS:
5390 * ProcessHandle = Handle to process owning the virtual address space
5391 * BaseAddress = Start address
5392 * NumberOfBytesToProtect = Delimits the range of virtual memory
5393 * for which the new access protection holds
5394 * NewAccessProtection = The new access proctection for the pages
5395 * OldAccessProtection = Caller should supply storage for the old
5396 * access protection
5397 *
5398 * REMARKS:
5399 * The function maps to the win32 VirtualProtectEx
5400 * RETURNS: Status
5401 */
5402 NTSTATUS
5403 STDCALL
5404 NtProtectVirtualMemory(
5405 IN HANDLE ProcessHandle,
5406 IN PVOID *BaseAddress,
5407 IN ULONG *NumberOfBytesToProtect,
5408 IN ULONG NewAccessProtection,
5409 OUT PULONG OldAccessProtection
5410 );
5411
5412 /*
5413 * FUNCTION: Query information about the content of a directory object
5414 * ARGUMENTS:
5415 DirectoryHandle =
5416 Buffer = Buffer must be large enough to hold the name strings too
5417 ReturnSingleEntry = If TRUE :return the index of the next object in this directory in ObjectIndex
5418 If FALSE: return the number of objects in this directory in ObjectIndex
5419 RestartScan = If TRUE: ignore input value of ObjectIndex always start at index 0
5420 If FALSE use input value of ObjectIndex
5421 Context = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
5422 ReturnLength = Actual size of the ObjectIndex ???
5423 * RETURNS: Status
5424 */
5425 NTSTATUS
5426 STDCALL
5427 NtQueryDirectoryObject(
5428 IN HANDLE DirectoryHandle,
5429 OUT PVOID Buffer,
5430 IN ULONG BufferLength,
5431 IN BOOLEAN ReturnSingleEntry,
5432 IN BOOLEAN RestartScan,
5433 IN OUT PULONG Context,
5434 OUT PULONG ReturnLength OPTIONAL
5435 );
5436
5437 /*
5438 * FUNCTION: Query the interval and the clocksource for profiling
5439 * ARGUMENTS:
5440 Interval =
5441 ClockSource =
5442 * RETURNS: Status
5443 */
5444 NTSTATUS
5445 STDCALL
5446 NtQueryIntervalProfile(
5447 IN KPROFILE_SOURCE ProfileSource,
5448 OUT PULONG Interval
5449 );
5450
5451 /*
5452 * FUNCTION: Queries the information of a section object.
5453 * ARGUMENTS:
5454 * SectionHandle = Handle to the section link object
5455 * SectionInformationClass = Index to a certain information structure
5456 * SectionInformation (OUT)= Caller supplies storage for resulting information
5457 * Length = Size of the supplied storage
5458 * ResultLength = Data written
5459 * RETURNS: Status
5460 *
5461 */
5462 NTSTATUS
5463 STDCALL
5464 NtQuerySection(
5465 IN HANDLE SectionHandle,
5466 IN CINT SectionInformationClass,
5467 OUT PVOID SectionInformation,
5468 IN ULONG Length,
5469 OUT PULONG ResultLength
5470 );
5471
5472 /*
5473 * FUNCTION: Queries the virtual memory information.
5474 * ARGUMENTS:
5475 ProcessHandle = Process owning the virtual address space
5476 BaseAddress = Points to the page where the information is queried for.
5477 * VirtualMemoryInformationClass = Index to a certain information structure
5478
5479 MemoryBasicInformation MEMORY_BASIC_INFORMATION
5480
5481 * VirtualMemoryInformation = caller supplies storage for the information structure
5482 * Length = size of the structure
5483 ResultLength = Data written
5484 * RETURNS: Status
5485 *
5486 */
5487
5488 NTSTATUS
5489 STDCALL
5490 NtQueryVirtualMemory(
5491 IN HANDLE ProcessHandle,
5492 IN PVOID Address,
5493 IN IN CINT VirtualMemoryInformationClass,
5494 OUT PVOID VirtualMemoryInformation,
5495 IN ULONG Length,
5496 OUT PULONG ResultLength
5497 );
5498
5499 /*
5500 * FUNCTION: Raises a hard error (stops the system)
5501 * ARGUMENTS:
5502 * Status = Status code of the hard error
5503 * Unknown2 = ??
5504 * Unknown3 = ??
5505 * Unknown4 = ??
5506 * Unknown5 = ??
5507 * Unknown6 = ??
5508 * RETURNS: Status
5509 *
5510 */
5511
5512 NTSTATUS
5513 STDCALL
5514 NtRaiseHardError(
5515 IN NTSTATUS Status,
5516 ULONG Unknown2,
5517 ULONG Unknown3,
5518 ULONG Unknown4,
5519 ULONG Unknown5,
5520 ULONG Unknown6
5521 );
5522
5523 /*
5524 * FUNCTION: Sets the information of a registry key.
5525 * ARGUMENTS:
5526 * KeyHandle = Handle to the registry key
5527 * KeyInformationClass = Index to the a certain information structure.
5528 * Can be one of the following values:
5529 *
5530 * KeyLastWriteTimeInformation KEY_LAST_WRITE_TIME_INFORMATION
5531 *
5532 * KeyInformation = Storage for the new information
5533 * KeyInformationLength = Size of the information strucure
5534 * RETURNS: Status
5535 */
5536
5537 NTSTATUS
5538 STDCALL
5539 NtSetInformationKey(
5540 IN HANDLE KeyHandle,
5541 IN KEY_SET_INFORMATION_CLASS KeyInformationClass,
5542 IN PVOID KeyInformation,
5543 IN ULONG KeyInformationLength
5544 );
5545
5546 /*
5547 * FUNCTION: Changes a set of object specific parameters
5548 * ARGUMENTS:
5549 * ObjectHandle =
5550 * ObjectInformationClass = Index to the set of parameters to change.
5551
5552 ObjectHandleInformation OBJECT_HANDLE_ATTRIBUTE_INFORMATION
5553
5554
5555 * ObjectInformation = Caller supplies storage for parameters to set.
5556 * Length = Size of the storage supplied
5557 * RETURNS: Status
5558 */
5559 NTSTATUS
5560 STDCALL
5561 NtSetInformationObject(
5562 IN HANDLE ObjectHandle,
5563 IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
5564 IN PVOID ObjectInformation,
5565 IN ULONG Length
5566 );
5567
5568 /*
5569 * FUNCTION: Sets the characteristics of a timer
5570 * ARGUMENTS:
5571 * TimerHandle = Handle to the timer
5572 * DueTime = Time before the timer becomes signalled for the first time.
5573 * TimerApcRoutine = Completion routine can be called on time completion
5574 * TimerContext = Argument to the completion routine
5575 * Resume = Specifies if the timer should repeated after completing one cycle
5576 * Period = Cycle of the timer
5577 * REMARKS: This routine maps to the win32 SetWaitableTimer.
5578 * RETURNS: Status
5579 */
5580 NTSTATUS
5581 STDCALL
5582 NtSetTimer(
5583 IN HANDLE TimerHandle,
5584 IN PLARGE_INTEGER DueTime,
5585 IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL,
5586 IN PVOID TimerContext OPTIONAL,
5587 IN BOOLEAN ResumeTimer,
5588 IN LONG Period OPTIONAL,
5589 OUT PBOOLEAN PreviousState OPTIONAL
5590 );
5591
5592 /*
5593 * FUNCTION: Unloads a registry key.
5594 * ARGUMENTS:
5595 * KeyHandle = Handle to the registry key
5596 * REMARK:
5597 * This procedure maps to the win32 procedure RegUnloadKey
5598 * RETURNS: Status
5599 */
5600 NTSTATUS
5601 STDCALL
5602 NtUnloadKey(
5603 IN POBJECT_ATTRIBUTES KeyObjectAttributes
5604 );
5605
5606 /*
5607 * FUNCTION: Unlocks a range of virtual memory.
5608 * ARGUMENTS:
5609 * ProcessHandle = Handle to the process
5610 * BaseAddress = Lower boundary of the range of bytes to unlock.
5611 * NumberOfBytesToUnlock = Offset to the upper boundary to unlock.
5612 * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked.
5613 * REMARK:
5614 This procedure maps to the win32 procedure VirtualUnlock
5615 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PAGE_WAS_ULOCKED ]
5616 */
5617 NTSTATUS
5618 STDCALL
5619 NtUnlockVirtualMemory(
5620 IN HANDLE ProcessHandle,
5621 IN PVOID BaseAddress,
5622 IN ULONG NumberOfBytesToUnlock,
5623 OUT PULONG NumberOfBytesUnlocked OPTIONAL
5624 );
5625
5626 /*
5627 * FUNCTION: Waits for multiple objects to become signalled.
5628 * ARGUMENTS:
5629 * Count = The number of objects
5630 * Object = The array of object handles
5631 * WaitType = Can be one of the values UserMode or KernelMode
5632 * Alertable = If true the wait is alertable.
5633 * Time = The maximum wait time.
5634 * REMARKS:
5635 * This function maps to the win32 WaitForMultipleObjectEx.
5636 * RETURNS: Status
5637 */
5638 NTSTATUS
5639 STDCALL
5640 NtWaitForMultipleObjects (
5641 IN ULONG Count,
5642 IN HANDLE Object[],
5643 IN WAIT_TYPE WaitType,
5644 IN BOOLEAN Alertable,
5645 IN PLARGE_INTEGER Time
5646 );
5647
5648
5649
5650
5651
5652 #ifndef __USE_W32API
5653
5654 /*
5655 * FUNCTION: Continues a thread with the specified context
5656 * ARGUMENTS:
5657 * Context = Specifies the processor context
5658 * IrqLevel = Specifies the Interupt Request Level to continue with. Can
5659 * be PASSIVE_LEVEL or APC_LEVEL
5660 * REMARKS
5661 * NtContinue can be used to continue after an exception or apc.
5662 * RETURNS: Status
5663 */
5664 //FIXME This function might need another parameter
5665
5666 NTSTATUS STDCALL ZwContinue(IN PCONTEXT Context, IN CINT IrqLevel);
5667
5668 /*
5669 * FUNCTION: Retrieves the system time
5670 * ARGUMENTS:
5671 * CurrentTime (OUT) = Caller should supply storage for the resulting time.
5672 * RETURNS: Status
5673 *
5674 */
5675
5676 NTSTATUS
5677 STDCALL
5678 ZwQuerySystemTime (
5679 OUT PLARGE_INTEGER CurrentTime
5680 );
5681
5682 /*
5683 * FUNCTION: Copies a handle from one process space to another
5684 * ARGUMENTS:
5685 * SourceProcessHandle = The source process owning the handle. The source process should have opened
5686 * the SourceHandle with PROCESS_DUP_HANDLE access.
5687 * SourceHandle = The handle to the object.
5688 * TargetProcessHandle = The destination process owning the handle
5689 * TargetHandle (OUT) = Caller should supply storage for the duplicated handle.
5690 * DesiredAccess = The desired access to the handle.
5691 * InheritHandle = Indicates wheter the new handle will be inheritable or not.
5692 * Options = Specifies special actions upon duplicating the handle. Can be
5693 * one of the values DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS.
5694 * DUPLICATE_CLOSE_SOURCE specifies that the source handle should be
5695 * closed after duplicating. DUPLICATE_SAME_ACCESS specifies to ignore
5696 * the DesiredAccess paramter and just grant the same access to the new
5697 * handle.
5698 * RETURNS: Status
5699 * REMARKS: This function maps to the win32 DuplicateHandle.
5700 */
5701
5702 NTSTATUS
5703 STDCALL
5704 NtDuplicateObject(
5705 IN HANDLE SourceProcessHandle,
5706 IN HANDLE SourceHandle,
5707 IN HANDLE TargetProcessHandle,
5708 OUT PHANDLE TargetHandle,
5709 IN ACCESS_MASK DesiredAccess,
5710 IN BOOLEAN InheritHandle,
5711 IN ULONG Options
5712 );
5713
5714 NTSTATUS
5715 STDCALL
5716 ZwDuplicateObject(
5717 IN HANDLE SourceProcessHandle,
5718 IN PHANDLE SourceHandle,
5719 IN HANDLE TargetProcessHandle,
5720 OUT PHANDLE TargetHandle,
5721 IN ACCESS_MASK DesiredAccess,
5722 IN BOOLEAN InheritHandle,
5723 IN ULONG Options
5724 );
5725
5726 /*
5727 * FUNCTION: Checks a clients access rights to a object and issues a audit a alarm. ( it logs the access )
5728 * ARGUMENTS:
5729 * SubsystemName = Specifies the name of the subsystem, can be "WIN32" or "DEBUG"
5730 * ObjectHandle =
5731 * ObjectTypeName =
5732 * ObjectName =
5733 * SecurityDescriptor =
5734 * DesiredAcces =
5735 * GenericMapping =
5736 * ObjectCreation =
5737 * GrantedAccess =
5738 * AccessStatus =
5739 * GenerateOnClose =
5740 * REMARKS: The arguments map to the win32 AccessCheck
5741 * RETURNS: Status
5742 */
5743
5744 NTSTATUS
5745 STDCALL
5746 ZwAccessCheckAndAuditAlarm(
5747 IN PUNICODE_STRING SubsystemName,
5748 IN PHANDLE ObjectHandle,
5749 IN PUNICODE_STRING ObjectTypeName,
5750 IN PUNICODE_STRING ObjectName,
5751 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5752 IN ACCESS_MASK DesiredAccess,
5753 IN PGENERIC_MAPPING GenericMapping,
5754 IN BOOLEAN ObjectCreation,
5755 OUT PACCESS_MASK GrantedAccess,
5756 OUT PNTSTATUS AccessStatus,
5757 OUT PBOOLEAN GenerateOnClose
5758 );
5759
5760 /*
5761 * FUNCTION: Adds an atom to the global atom table
5762 * ARGUMENTS:
5763 * AtomName = The string to add to the atom table.
5764 * AtomNameLength = Length of the atom name
5765 * Atom (OUT) = Caller supplies storage for the resulting atom.
5766 * REMARKS: The arguments map to the win32 add GlobalAddAtom.
5767 * RETURNS: Status
5768 */
5769 NTSTATUS
5770 STDCALL
5771 NtAddAtom(
5772 IN PWSTR AtomName,
5773 IN ULONG AtomNameLength,
5774 IN OUT PRTL_ATOM Atom
5775 );
5776
5777
5778 NTSTATUS
5779 STDCALL
5780 ZwAddAtom(
5781 IN PWSTR AtomName,
5782 IN ULONG AtomNameLength,
5783 IN OUT PRTL_ATOM Atom
5784 );
5785
5786 NTSTATUS
5787 STDCALL
5788 NtAllocateUuids(
5789 OUT PULARGE_INTEGER Time,
5790 OUT PULONG Range,
5791 OUT PULONG Sequence,
5792 OUT PUCHAR Seed
5793 );
5794
5795 NTSTATUS
5796 STDCALL
5797 ZwAllocateUuids(
5798 OUT PULARGE_INTEGER Time,
5799 OUT PULONG Range,
5800 OUT PULONG Sequence,
5801 OUT PUCHAR Seed
5802 );
5803
5804 NTSTATUS
5805 STDCALL
5806 ZwCancelTimer(
5807 IN HANDLE TimerHandle,
5808 OUT ULONG ElapsedTime
5809 );
5810
5811 /*
5812 * FUNCTION: Creates a paging file.
5813 * ARGUMENTS:
5814 * FileName = Name of the pagefile
5815 * InitialSize = Specifies the initial size in bytes
5816 * MaximumSize = Specifies the maximum size in bytes
5817 * Reserved = Reserved for future use
5818 * RETURNS: Status
5819 */
5820 NTSTATUS
5821 STDCALL
5822 ZwCreatePagingFile(
5823 IN PUNICODE_STRING FileName,
5824 IN PLARGE_INTEGER InitialSize,
5825 IN PLARGE_INTEGER MaxiumSize,
5826 IN ULONG Reserved
5827 );
5828
5829 /*
5830 * FUNCTION: Creates a user mode thread
5831 * ARGUMENTS:
5832 * ThreadHandle (OUT) = Caller supplied storage for the resulting handle
5833 * DesiredAccess = Specifies the allowed or desired access to the thread.
5834 * ObjectAttributes = Initialized attributes for the object.
5835 * ProcessHandle = Handle to the threads parent process.
5836 * ClientId (OUT) = Caller supplies storage for returned process id and thread id.
5837 * ThreadContext = Initial processor context for the thread.
5838 * InitialTeb = Initial user mode stack context for the thread.
5839 * CreateSuspended = Specifies if the thread is ready for scheduling
5840 * REMARKS:
5841 * This function maps to the win32 function CreateThread.
5842 * RETURNS: Status
5843 */
5844 NTSTATUS
5845 STDCALL
5846 ZwCreateThread(
5847 OUT PHANDLE ThreadHandle,
5848 IN ACCESS_MASK DesiredAccess,
5849 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
5850 IN HANDLE ProcessHandle,
5851 OUT PCLIENT_ID ClientId,
5852 IN PCONTEXT ThreadContext,
5853 IN PINITIAL_TEB InitialTeb,
5854 IN BOOLEAN CreateSuspended
5855 );
5856
5857 NTSTATUS
5858 STDCALL
5859 NtDuplicateToken(
5860 IN HANDLE ExistingToken,
5861 IN ACCESS_MASK DesiredAccess,
5862 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
5863 IN BOOLEAN EffectiveOnly,
5864 IN TOKEN_TYPE TokenType,
5865 OUT PHANDLE NewToken
5866 );
5867
5868 NTSTATUS
5869 STDCALL
5870 ZwDuplicateToken(
5871 IN HANDLE ExistingToken,
5872 IN ACCESS_MASK DesiredAccess,
5873 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
5874 IN BOOLEAN EffectiveOnly,
5875 IN TOKEN_TYPE TokenType,
5876 OUT PHANDLE NewToken
5877 );
5878
5879 /*
5880 * FUNCTION: Finds a atom
5881 * ARGUMENTS:
5882 * AtomName = Name to search for.
5883 * AtomNameLength = Length of the atom name
5884 * Atom = Caller supplies storage for the resulting atom
5885 * RETURNS: Status
5886 * REMARKS:
5887 * This funciton maps to the win32 GlobalFindAtom
5888 */
5889 NTSTATUS
5890 STDCALL
5891 NtFindAtom(
5892 IN PWSTR AtomName,
5893 IN ULONG AtomNameLength,
5894 OUT PRTL_ATOM Atom OPTIONAL
5895 );
5896
5897 NTSTATUS
5898 STDCALL
5899 ZwFindAtom(
5900 IN PWSTR AtomName,
5901 IN ULONG AtomNameLength,
5902 OUT PRTL_ATOM Atom OPTIONAL
5903 );
5904
5905 /*
5906 * FUNCTION: Flushes a the processors instruction cache
5907 * ARGUMENTS:
5908 * ProcessHandle = Points to the process owning the cache
5909 * BaseAddress = // might this be a image address ????
5910 * NumberOfBytesToFlush =
5911 * RETURNS: Status
5912 * REMARKS:
5913 * This funciton is used by debuggers
5914 */
5915 NTSTATUS
5916 STDCALL
5917 ZwFlushInstructionCache(
5918 IN HANDLE ProcessHandle,
5919 IN PVOID BaseAddress,
5920 IN UINT NumberOfBytesToFlush
5921 );
5922
5923 /*
5924 * FUNCTION: Flushes virtual memory to file
5925 * ARGUMENTS:
5926 * ProcessHandle = Points to the process that allocated the virtual memory
5927 * BaseAddress = Points to the memory address
5928 * NumberOfBytesToFlush = Limits the range to flush,
5929 * NumberOfBytesFlushed = Actual number of bytes flushed
5930 * RETURNS: Status
5931 * REMARKS:
5932 * Check return status on STATUS_NOT_MAPPED_DATA
5933 */
5934 NTSTATUS
5935 STDCALL
5936 ZwFlushVirtualMemory(
5937 IN HANDLE ProcessHandle,
5938 IN PVOID BaseAddress,
5939 IN ULONG NumberOfBytesToFlush,
5940 OUT PULONG NumberOfBytesFlushed OPTIONAL
5941 );
5942
5943 /*
5944 * FUNCTION: Retrieves the uptime of the system
5945 * ARGUMENTS:
5946 * UpTime = Number of clock ticks since boot.
5947 * RETURNS: Status
5948 */
5949 ULONG
5950 STDCALL
5951 ZwGetTickCount(
5952 VOID
5953 );
5954
5955 /*
5956 * FUNCTION: Loads a registry key.
5957 * ARGUMENTS:
5958 * KeyObjectAttributes = Key to be loaded
5959 * FileObjectAttributes = File to load the key from
5960 * REMARK:
5961 * This procedure maps to the win32 procedure RegLoadKey
5962 * RETURNS: Status
5963 */
5964 NTSTATUS
5965 STDCALL
5966 ZwLoadKey(
5967 IN POBJECT_ATTRIBUTES KeyObjectAttributes,
5968 IN POBJECT_ATTRIBUTES FileObjectAttributes
5969 );
5970
5971 /*
5972 * FUNCTION: Locks a range of virtual memory.
5973 * ARGUMENTS:
5974 * ProcessHandle = Handle to the process
5975 * BaseAddress = Lower boundary of the range of bytes to lock.
5976 * NumberOfBytesLock = Offset to the upper boundary.
5977 * NumberOfBytesLocked (OUT) = Number of bytes actually locked.
5978 * REMARK:
5979 This procedure maps to the win32 procedure VirtualLock.
5980 * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ]
5981 */
5982 NTSTATUS
5983 STDCALL
5984 ZwLockVirtualMemory(
5985 HANDLE ProcessHandle,
5986 PVOID BaseAddress,
5987 ULONG NumberOfBytesToLock,
5988 PULONG NumberOfBytesLocked
5989 );
5990
5991 NTSTATUS
5992 STDCALL
5993 ZwOpenObjectAuditAlarm(
5994 IN PUNICODE_STRING SubsystemName,
5995 IN PVOID HandleId,
5996 IN PUNICODE_STRING ObjectTypeName,
5997 IN PUNICODE_STRING ObjectName,
5998 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
5999 IN HANDLE ClientToken,
6000 IN ULONG DesiredAccess,
6001 IN ULONG GrantedAccess,
6002 IN PPRIVILEGE_SET Privileges,
6003 IN BOOLEAN ObjectCreation,
6004 IN BOOLEAN AccessGranted,
6005 OUT PBOOLEAN GenerateOnClose
6006 );
6007
6008 /*
6009 * FUNCTION: Set the access protection of a range of virtual memory
6010 * ARGUMENTS:
6011 * ProcessHandle = Handle to process owning the virtual address space
6012 * BaseAddress = Start address
6013 * NumberOfBytesToProtect = Delimits the range of virtual memory
6014 * for which the new access protection holds
6015 * NewAccessProtection = The new access proctection for the pages
6016 * OldAccessProtection = Caller should supply storage for the old
6017 * access protection
6018 *
6019 * REMARKS:
6020 * The function maps to the win32 VirtualProtectEx
6021 * RETURNS: Status
6022 */
6023 NTSTATUS
6024 STDCALL
6025 ZwProtectVirtualMemory(
6026 IN HANDLE ProcessHandle,
6027 IN PVOID *BaseAddress,
6028 IN ULONG *NumberOfBytesToProtect,
6029 IN ULONG NewAccessProtection,
6030 OUT PULONG OldAccessProtection
6031 );
6032
6033 NTSTATUS
6034 STDCALL
6035 NtQueryInformationAtom(
6036 IN RTL_ATOM Atom,
6037 IN ATOM_INFORMATION_CLASS AtomInformationClass,
6038 OUT PVOID AtomInformation,
6039 IN ULONG AtomInformationLength,
6040 OUT PULONG ReturnLength OPTIONAL
6041 );
6042
6043 NTSTATUS
6044 STDCALL
6045 ZwQueryInformationAtom(
6046 IN RTL_ATOM Atom,
6047 IN ATOM_INFORMATION_CLASS AtomInformationClass,
6048 OUT PVOID AtomInformation,
6049 IN ULONG AtomInformationLength,
6050 OUT PULONG ReturnLength OPTIONAL
6051 );
6052
6053 /*
6054 * FUNCTION: Query information about the content of a directory object
6055 * ARGUMENTS:
6056 DirectoryHandle =
6057 Buffer = Buffer must be large enough to hold the name strings too
6058 ReturnSingleEntry = If TRUE :return the index of the next object in this directory in ObjectIndex
6059 If FALSE: return the number of objects in this directory in ObjectIndex
6060 RestartScan = If TRUE: ignore input value of ObjectIndex always start at index 0
6061 If FALSE use input value of ObjectIndex
6062 Context = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
6063 ReturnLength = Actual size of the ObjectIndex ???
6064 * RETURNS: Status
6065 */
6066 NTSTATUS
6067 STDCALL
6068 ZwQueryDirectoryObject(
6069 IN HANDLE DirectoryHandle,
6070 OUT PVOID Buffer,
6071 IN ULONG BufferLength,
6072 IN BOOLEAN ReturnSingleEntry,
6073 IN BOOLEAN RestartScan,
6074 IN OUT PULONG Context,
6075 OUT PULONG ReturnLength OPTIONAL
6076 );
6077
6078 /*
6079 * FUNCTION: Queries the information of a process object.
6080 * ARGUMENTS:
6081 * ProcessHandle = Handle to the process object
6082 * ProcessInformation = Index to a certain information structure
6083
6084 ProcessBasicInformation PROCESS_BASIC_INFORMATION
6085 ProcessQuotaLimits QUOTA_LIMITS
6086 ProcessIoCounters IO_COUNTERS
6087 ProcessVmCounters VM_COUNTERS
6088 ProcessTimes KERNEL_USER_TIMES
6089 ProcessBasePriority KPRIORITY
6090 ProcessRaisePriority KPRIORITY
6091 ProcessDebugPort HANDLE
6092 ProcessExceptionPort HANDLE
6093 ProcessAccessToken PROCESS_ACCESS_TOKEN
6094 ProcessLdtInformation LDT_ENTRY ??
6095 ProcessLdtSize ULONG
6096 ProcessDefaultHardErrorMode ULONG
6097 ProcessIoPortHandlers // kernel mode only
6098 ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS
6099 ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION
6100 ProcessUserModeIOPL (I/O Privilege Level)
6101 ProcessEnableAlignmentFaultFixup BOOLEAN
6102 ProcessPriorityClass ULONG
6103 ProcessWx86Information ULONG
6104 ProcessHandleCount ULONG
6105 ProcessAffinityMask ULONG
6106 ProcessPooledQuotaLimits QUOTA_LIMITS
6107 MaxProcessInfoClass
6108
6109 * ProcessInformation = Caller supplies storage for the process information structure
6110 * ProcessInformationLength = Size of the process information structure
6111 * ReturnLength = Actual number of bytes written
6112
6113 * REMARK:
6114 * This procedure maps to the win32 GetProcessTimes, GetProcessVersion,
6115 GetProcessWorkingSetSize, GetProcessPriorityBoost, GetProcessAffinityMask, GetPriorityClass,
6116 GetProcessShutdownParameters functions.
6117 * RETURNS: Status
6118 */
6119
6120 NTSTATUS
6121 STDCALL
6122 NtQueryInformationProcess(
6123 IN HANDLE ProcessHandle,
6124 IN PROCESSINFOCLASS ProcessInformationClass,
6125 OUT PVOID ProcessInformation,
6126 IN ULONG ProcessInformationLength,
6127 OUT PULONG ReturnLength OPTIONAL
6128 );
6129
6130 NTSTATUS
6131 STDCALL
6132 ZwQueryInformationProcess(
6133 IN HANDLE ProcessHandle,
6134 IN PROCESSINFOCLASS ProcessInformationClass,
6135 OUT PVOID ProcessInformation,
6136 IN ULONG ProcessInformationLength,
6137 OUT PULONG ReturnLength OPTIONAL
6138 );
6139
6140 /*
6141 * FUNCTION: Query the interval and the clocksource for profiling
6142 * ARGUMENTS:
6143 Interval =
6144 ClockSource =
6145 * RETURNS: Status
6146 */
6147 NTSTATUS
6148 STDCALL
6149 ZwQueryIntervalProfile(
6150 IN KPROFILE_SOURCE ProfileSource,
6151 OUT PULONG Interval
6152 );
6153
6154 /*
6155 * FUNCTION: Queries the information of a object.
6156 * ARGUMENTS:
6157 ObjectHandle = Handle to a object
6158 ObjectInformationClass = Index to a certain information structure
6159
6160 ObjectBasicInformation OBJECT_BASIC_INFORMATION
6161 ObjectNameInformation OBJECT_NAME_INFORMATION
6162 ObjectTypeInformation OBJECT_TYPE_INFORMATION
6163 ObjectAllTypesInformation OBJECT_ALL_TYPES_INFORMATION
6164 ObjectHandleInformation OBJECT_HANDLE_ATTRIBUTES_INFORMATION
6165
6166 ObjectInformation = Caller supplies storage for resulting information
6167 Length = Size of the supplied storage
6168 ResultLength = Bytes written
6169 */
6170
6171 NTSTATUS
6172 STDCALL
6173 ZwQueryObject(
6174 IN HANDLE ObjectHandle,
6175 IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
6176 OUT PVOID ObjectInformation,
6177 IN ULONG Length,
6178 OUT PULONG ResultLength OPTIONAL
6179 );
6180
6181 NTSTATUS
6182 STDCALL
6183 NtQuerySecurityObject(
6184 IN HANDLE Handle,
6185 IN SECURITY_INFORMATION SecurityInformation,
6186 OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
6187 IN ULONG Length,
6188 OUT PULONG ResultLength
6189 );
6190
6191 NTSTATUS
6192 STDCALL
6193 ZwQuerySecurityObject(
6194 IN HANDLE Handle,
6195 IN SECURITY_INFORMATION SecurityInformation,
6196 OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
6197 IN ULONG Length,
6198 OUT PULONG ResultLength
6199 );
6200
6201 /*
6202 * FUNCTION: Queries the virtual memory information.
6203 * ARGUMENTS:
6204 ProcessHandle = Process owning the virtual address space
6205 BaseAddress = Points to the page where the information is queried for.
6206 * VirtualMemoryInformationClass = Index to a certain information structure
6207
6208 MemoryBasicInformation MEMORY_BASIC_INFORMATION
6209
6210 * VirtualMemoryInformation = caller supplies storage for the information structure
6211 * Length = size of the structure
6212 ResultLength = Data written
6213 * RETURNS: Status
6214 *
6215 */
6216
6217 NTSTATUS
6218 STDCALL
6219 ZwQueryVirtualMemory(
6220 IN HANDLE ProcessHandle,
6221 IN PVOID Address,
6222 IN IN CINT VirtualMemoryInformationClass,
6223 OUT PVOID VirtualMemoryInformation,
6224 IN ULONG Length,
6225 OUT PULONG ResultLength
6226 );
6227
6228 /*
6229 * FUNCTION: Raises a hard error (stops the system)
6230 * ARGUMENTS:
6231 * Status = Status code of the hard error
6232 * Unknown2 = ??
6233 * Unknown3 = ??
6234 * Unknown4 = ??
6235 * Unknown5 = ??
6236 * Unknown6 = ??
6237 * RETURNS: Status
6238 *
6239 */
6240 NTSTATUS
6241 STDCALL
6242 ZwRaiseHardError(
6243 IN NTSTATUS Status,
6244 ULONG Unknown2,
6245 ULONG Unknown3,
6246 ULONG Unknown4,
6247 ULONG Unknown5,
6248 ULONG Unknown6
6249 );
6250
6251 /*
6252 * FUNCTION: Sets the information of a registry key.
6253 * ARGUMENTS:
6254 * KeyHandle = Handle to the registry key
6255 * KeyInformationClass = Index to the a certain information structure.
6256 Can be one of the following values:
6257
6258 * KeyLastWriteTimeInformation KEY_LAST_WRITE_TIME_INFORMATION
6259
6260 KeyInformation = Storage for the new information
6261 * KeyInformationLength = Size of the information strucure
6262 * RETURNS: Status
6263 */
6264
6265 NTSTATUS
6266 STDCALL
6267 ZwSetInformationKey(
6268 IN HANDLE KeyHandle,
6269 IN KEY_SET_INFORMATION_CLASS KeyInformationClass,
6270 IN PVOID KeyInformation,
6271 IN ULONG KeyInformationLength
6272 );
6273
6274 /*
6275 * FUNCTION: Changes a set of object specific parameters
6276 * ARGUMENTS:
6277 * ObjectHandle =
6278 * ObjectInformationClass = Index to the set of parameters to change.
6279
6280 ObjectHandleInformation OBJECT_HANDLE_ATTRIBUTE_INFORMATION
6281
6282
6283 * ObjectInformation = Caller supplies storage for parameters to set.
6284 * Length = Size of the storage supplied
6285 * RETURNS: Status
6286 */
6287 NTSTATUS
6288 STDCALL
6289 ZwSetInformationObject(
6290 IN HANDLE ObjectHandle,
6291 IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
6292 IN PVOID ObjectInformation,
6293 IN ULONG Length
6294 );
6295
6296 /*
6297 * FUNCTION: Changes a set of process specific parameters
6298 * ARGUMENTS:
6299 * ProcessHandle = Handle to the process
6300 * ProcessInformationClass = Index to a information structure.
6301 *
6302 * ProcessBasicInformation PROCESS_BASIC_INFORMATION
6303 * ProcessQuotaLimits QUOTA_LIMITS
6304 * ProcessBasePriority KPRIORITY
6305 * ProcessRaisePriority KPRIORITY
6306 * ProcessDebugPort HANDLE
6307 * ProcessExceptionPort HANDLE
6308 * ProcessAccessToken PROCESS_ACCESS_TOKEN
6309 * ProcessDefaultHardErrorMode ULONG
6310 * ProcessPriorityClass ULONG
6311 * ProcessAffinityMask KAFFINITY //??
6312 *
6313 * ProcessInformation = Caller supplies storage for information to set.
6314 * ProcessInformationLength = Size of the information structure
6315 * RETURNS: Status
6316 */
6317 NTSTATUS
6318 STDCALL
6319 NtSetInformationProcess(
6320 IN HANDLE ProcessHandle,
6321 IN PROCESSINFOCLASS ProcessInformationClass,
6322 IN PVOID ProcessInformation,
6323 IN ULONG ProcessInformationLength
6324 );
6325
6326 NTSTATUS
6327 STDCALL
6328 ZwSetInformationProcess(
6329 IN HANDLE ProcessHandle,
6330 IN PROCESSINFOCLASS ProcessInformationClass,
6331 IN PVOID ProcessInformation,
6332 IN ULONG ProcessInformationLength
6333 );
6334
6335 /*
6336 * FUNCTION: Sets the characteristics of a timer
6337 * ARGUMENTS:
6338 * TimerHandle = Handle to the timer
6339 * DueTime = Time before the timer becomes signalled for the first time.
6340 * TimerApcRoutine = Completion routine can be called on time completion
6341 * TimerContext = Argument to the completion routine
6342 * Resume = Specifies if the timer should repeated after completing one cycle
6343 * Period = Cycle of the timer
6344 * REMARKS: This routine maps to the win32 SetWaitableTimer.
6345 * RETURNS: Status
6346 */
6347 NTSTATUS
6348 STDCALL
6349 ZwSetTimer(
6350 IN HANDLE TimerHandle,
6351 IN PLARGE_INTEGER DueTime,
6352 IN PTIMER_APC_ROUTINE TimerApcRoutine OPTIONAL,
6353 IN PVOID TimerContext OPTIONAL,
6354 IN BOOLEAN ResumeTimer,
6355 IN LONG Period OPTIONAL,
6356 OUT PBOOLEAN PreviousState OPTIONAL
6357 );
6358
6359 NTSTATUS STDCALL
6360 NtSetUuidSeed(IN PUCHAR Seed);
6361
6362 NTSTATUS STDCALL
6363 ZwSetUuidSeed(IN PUCHAR Seed);
6364
6365 /*
6366 * FUNCTION: Unloads a registry key.
6367 * ARGUMENTS:
6368 * KeyHandle = Handle to the registry key
6369 * REMARK:
6370 * This procedure maps to the win32 procedure RegUnloadKey
6371 * RETURNS: Status
6372 */
6373 NTSTATUS
6374 STDCALL
6375 ZwUnloadKey(
6376 IN POBJECT_ATTRIBUTES KeyObjectAttributes
6377 );
6378
6379 /*
6380 * FUNCTION: Unlocks a range of virtual memory.
6381 * ARGUMENTS:
6382 * ProcessHandle = Handle to the process
6383 * BaseAddress = Lower boundary of the range of bytes to unlock.
6384 * NumberOfBytesToUnlock = Offset to the upper boundary to unlock.
6385 * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked.
6386 * REMARK:
6387 This procedure maps to the win32 procedure VirtualUnlock
6388 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PAGE_WAS_ULOCKED ]
6389 */
6390 NTSTATUS
6391 STDCALL
6392 ZwUnlockVirtualMemory(
6393 IN HANDLE ProcessHandle,
6394 IN PVOID BaseAddress,
6395 IN ULONG NumberOfBytesToUnlock,
6396 OUT PULONG NumberOfBytesUnlocked OPTIONAL
6397 );
6398
6399 /*
6400 * FUNCTION: Waits for multiple objects to become signalled.
6401 * ARGUMENTS:
6402 * Count = The number of objects
6403 * Object = The array of object handles
6404 * WaitType = Can be one of the values UserMode or KernelMode
6405 * Alertable = If true the wait is alertable.
6406 * Time = The maximum wait time.
6407 * REMARKS:
6408 * This function maps to the win32 WaitForMultipleObjectEx.
6409 * RETURNS: Status
6410 */
6411 NTSTATUS
6412 STDCALL
6413 ZwWaitForMultipleObjects (
6414 IN ULONG Count,
6415 IN HANDLE Object[],
6416 IN WAIT_TYPE WaitType,
6417 IN BOOLEAN Alertable,
6418 IN PLARGE_INTEGER Time
6419 );
6420
6421 /*
6422 * FUNCTION: Creates a profile
6423 * ARGUMENTS:
6424 * ProfileHandle (OUT) = Caller supplied storage for the resulting handle
6425 * ObjectAttribute = Initialized attributes for the object
6426 * ImageBase = Start address of executable image
6427 * ImageSize = Size of the image
6428 * Granularity = Bucket size
6429 * Buffer = Caller supplies buffer for profiling info
6430 * ProfilingSize = Buffer size
6431 * ClockSource = Specify 0 / FALSE ??
6432 * ProcessorMask = A value of -1 indicates disables per processor profiling,
6433 otherwise bit set for the processor to profile.
6434 * REMARKS:
6435 * This function maps to the win32 CreateProcess.
6436 * RETURNS: Status
6437 */
6438
6439 NTSTATUS
6440 STDCALL
6441 ZwCreateProfile(
6442 OUT PHANDLE ProfileHandle,
6443 IN HANDLE Process OPTIONAL,
6444 IN PVOID ImageBase,
6445 IN ULONG ImageSize,
6446 IN ULONG BucketSize,
6447 IN PVOID Buffer,
6448 IN ULONG BufferSize,
6449 IN KPROFILE_SOURCE ProfileSource,
6450 IN KAFFINITY Affinity
6451 );
6452
6453 /*
6454 * FUNCTION: Delays the execution of the calling thread.
6455 * ARGUMENTS:
6456 * Alertable = If TRUE the thread is alertable during is wait period
6457 * Interval = Specifies the interval to wait.
6458 * RETURNS: Status
6459 */
6460 NTSTATUS
6461 STDCALL
6462 ZwDelayExecution(
6463 IN BOOLEAN Alertable,
6464 IN PLARGE_INTEGER DelayInterval
6465 );
6466
6467 /*
6468 * FUNCTION: Extends a section
6469 * ARGUMENTS:
6470 * SectionHandle = Handle to the section
6471 * NewMaximumSize = Adjusted size
6472 * RETURNS: Status
6473 */
6474 NTSTATUS
6475 STDCALL
6476 ZwExtendSection(
6477 IN HANDLE SectionHandle,
6478 IN PLARGE_INTEGER NewMaximumSize
6479 );
6480
6481 /*
6482 * FUNCTION: Queries the information of a section object.
6483 * ARGUMENTS:
6484 * SectionHandle = Handle to the section link object
6485 * SectionInformationClass = Index to a certain information structure
6486 * SectionInformation (OUT)= Caller supplies storage for resulting information
6487 * Length = Size of the supplied storage
6488 * ResultLength = Data written
6489 * RETURNS: Status
6490 *
6491 */
6492 NTSTATUS
6493 STDCALL
6494 ZwQuerySection(
6495 IN HANDLE SectionHandle,
6496 IN CINT SectionInformationClass,
6497 OUT PVOID SectionInformation,
6498 IN ULONG Length,
6499 OUT PULONG ResultLength
6500 );
6501
6502 typedef struct _SECTION_IMAGE_INFORMATION
6503 {
6504 ULONG_PTR EntryPoint;
6505 ULONG Unknown1;
6506 ULONG_PTR StackReserve;
6507 ULONG_PTR StackCommit;
6508 ULONG Subsystem;
6509 USHORT MinorSubsystemVersion;
6510 USHORT MajorSubsystemVersion;
6511 ULONG Unknown2;
6512 ULONG Characteristics;
6513 USHORT ImageNumber;
6514 BOOLEAN Executable;
6515 UCHAR Unknown3;
6516 ULONG Unknown4[3];
6517 } SECTION_IMAGE_INFORMATION, *PSECTION_IMAGE_INFORMATION;
6518
6519 #endif /* !__USE_W32API */
6520
6521 /*
6522 * FUNCTION: Loads a registry key.
6523 * ARGUMENTS:
6524 * KeyObjectAttributes = Key to be loaded
6525 * FileObjectAttributes = File to load the key from
6526 * Flags = ???
6527 * REMARK:
6528 * This procedure maps to the win32 procedure RegLoadKey
6529 * RETURNS: Status
6530 */
6531 NTSTATUS
6532 STDCALL
6533 NtLoadKey2(
6534 IN POBJECT_ATTRIBUTES KeyObjectAttributes,
6535 IN POBJECT_ATTRIBUTES FileObjectAttributes,
6536 IN ULONG Flags
6537 );
6538
6539 NTSTATUS
6540 STDCALL
6541 ZwLoadKey2(
6542 IN POBJECT_ATTRIBUTES KeyObjectAttributes,
6543 IN POBJECT_ATTRIBUTES FileObjectAttributes,
6544 IN ULONG Flags
6545 );
6546
6547 /*
6548 * FUNCTION: Retrieves the system time
6549 * ARGUMENTS:
6550 * CurrentTime (OUT) = Caller should supply storage for the resulting time.
6551 * RETURNS: Status
6552 *
6553 */
6554
6555 NTSTATUS
6556 STDCALL
6557 NtQuerySystemTime (
6558 OUT PLARGE_INTEGER CurrentTime
6559 );
6560
6561 /*
6562 * FUNCTION: Queries the information of a object.
6563 * ARGUMENTS:
6564 ObjectHandle = Handle to a object
6565 ObjectInformationClass = Index to a certain information structure
6566
6567 ObjectBasicInformation OBJECT_BASIC_INFORMATION
6568 ObjectNameInformation OBJECT_NAME_INFORMATION
6569 ObjectTypeInformation OBJECT_TYPE_INFORMATION
6570 ObjectAllTypesInformation OBJECT_ALL_TYPES_INFORMATION
6571 ObjectHandleInformation OBJECT_HANDLE_ATTRIBUTE_INFORMATION
6572
6573 ObjectInformation = Caller supplies storage for resulting information
6574 Length = Size of the supplied storage
6575 ResultLength = Bytes written
6576 */
6577
6578 NTSTATUS
6579 STDCALL
6580 NtQueryObject(
6581 IN HANDLE ObjectHandle,
6582 IN OBJECT_INFORMATION_CLASS ObjectInformationClass,
6583 OUT PVOID ObjectInformation,
6584 IN ULONG Length,
6585 OUT PULONG ResultLength OPTIONAL
6586 );
6587
6588 /* BEGIN REACTOS ONLY */
6589
6590 BOOLEAN STDCALL
6591 ExInitializeBinaryTree(IN PBINARY_TREE Tree,
6592 IN PKEY_COMPARATOR Compare,
6593 IN BOOLEAN UseNonPagedPool);
6594
6595 VOID STDCALL
6596 ExDeleteBinaryTree(IN PBINARY_TREE Tree);
6597
6598 VOID STDCALL
6599 ExInsertBinaryTree(IN PBINARY_TREE Tree,
6600 IN PVOID Key,
6601 IN PVOID Value);
6602
6603 BOOLEAN STDCALL
6604 ExSearchBinaryTree(IN PBINARY_TREE Tree,
6605 IN PVOID Key,
6606 OUT PVOID * Value);
6607
6608 BOOLEAN STDCALL
6609 ExRemoveBinaryTree(IN PBINARY_TREE Tree,
6610 IN PVOID Key,
6611 IN PVOID * Value);
6612
6613 BOOLEAN STDCALL
6614 ExTraverseBinaryTree(IN PBINARY_TREE Tree,
6615 IN TRAVERSE_METHOD Method,
6616 IN PTRAVERSE_ROUTINE Routine,
6617 IN PVOID Context);
6618
6619 BOOLEAN STDCALL
6620 ExInitializeSplayTree(IN PSPLAY_TREE Tree,
6621 IN PKEY_COMPARATOR Compare,
6622 IN BOOLEAN Weighted,
6623 IN BOOLEAN UseNonPagedPool);
6624
6625 VOID STDCALL
6626 ExDeleteSplayTree(IN PSPLAY_TREE Tree);
6627
6628 VOID STDCALL
6629 ExInsertSplayTree(IN PSPLAY_TREE Tree,
6630 IN PVOID Key,
6631 IN PVOID Value);
6632
6633 BOOLEAN STDCALL
6634 ExSearchSplayTree(IN PSPLAY_TREE Tree,
6635 IN PVOID Key,
6636 OUT PVOID * Value);
6637
6638 BOOLEAN STDCALL
6639 ExRemoveSplayTree(IN PSPLAY_TREE Tree,
6640 IN PVOID Key,
6641 IN PVOID * Value);
6642
6643 BOOLEAN STDCALL
6644 ExWeightOfSplayTree(IN PSPLAY_TREE Tree,
6645 OUT PULONG Weight);
6646
6647 BOOLEAN STDCALL
6648 ExTraverseSplayTree(IN PSPLAY_TREE Tree,
6649 IN TRAVERSE_METHOD Method,
6650 IN PTRAVERSE_ROUTINE Routine,
6651 IN PVOID Context);
6652
6653 BOOLEAN STDCALL
6654 ExInitializeHashTable(IN PHASH_TABLE HashTable,
6655 IN ULONG HashTableSize,
6656 IN PKEY_COMPARATOR Compare OPTIONAL,
6657 IN BOOLEAN UseNonPagedPool);
6658
6659 VOID STDCALL
6660 ExDeleteHashTable(IN PHASH_TABLE HashTable);
6661
6662 VOID STDCALL
6663 ExInsertHashTable(IN PHASH_TABLE HashTable,
6664 IN PVOID Key,
6665 IN ULONG KeyLength,
6666 IN PVOID Value);
6667
6668 BOOLEAN STDCALL
6669 ExSearchHashTable(IN PHASH_TABLE HashTable,
6670 IN PVOID Key,
6671 IN ULONG KeyLength,
6672 OUT PVOID * Value);
6673
6674 BOOLEAN STDCALL
6675 ExRemoveHashTable(IN PHASH_TABLE HashTable,
6676 IN PVOID Key,
6677 IN ULONG KeyLength,
6678 IN PVOID * Value);
6679
6680 /* END REACTOS ONLY */
6681
6682 #endif /* __DDK_ZW_H */