a821ab5a23b788f3553f96bc3b8756d1b5fb2b3f
[reactos.git] / reactos / include / ddk / zw.h
1
2 /* $Id: zw.h,v 1.54 2002/10/25 22:08:20 chorns Exp $
3 *
4 * COPYRIGHT: See COPYING in the top level directory
5 * PROJECT: ReactOS kernel
6 * PURPOSE: System call definitions
7 * FILE: include/ddk/zw.h
8 * REVISION HISTORY:
9 * ??/??/??: First few functions (David Welch)
10 * ??/??/??: Complete implementation by Ariadne
11 * 13/07/98: Reorganised things a bit (David Welch)
12 * 04/08/98: Added some documentation (Ariadne)
13 * 14/08/98: Added type TIME and change variable type from [1] to [0]
14 * 14/09/98: Added for each Nt call a corresponding Zw Call
15 */
16
17 #ifndef __DDK_ZW_H
18 #define __DDK_ZW_H
19
20 #include <ntos/security.h>
21 #include <napi/npipe.h>
22
23 //#define LCID ULONG
24 //#define SECURITY_INFORMATION ULONG
25 //typedef ULONG SECURITY_INFORMATION;
26
27
28 /*
29 * FUNCTION: Checks a clients access rights to a object
30 * ARGUMENTS:
31 * SecurityDescriptor = Security information against which the access is checked
32 * ClientToken = Represents a client
33 * DesiredAcces =
34 * GenericMapping =
35 * PrivilegeSet =
36 * ReturnLength = Bytes written
37 * GrantedAccess =
38 * AccessStatus = Indicates if the ClientToken allows the requested access
39 * REMARKS: The arguments map to the win32 AccessCheck
40 * RETURNS: Status
41 */
42
43 NTSTATUS
44 STDCALL
45 NtAccessCheck(
46 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
47 IN HANDLE ClientToken,
48 IN ACCESS_MASK DesiredAcces,
49 IN PGENERIC_MAPPING GenericMapping,
50 OUT PPRIVILEGE_SET PrivilegeSet,
51 OUT PULONG ReturnLength,
52 OUT PULONG GrantedAccess,
53 OUT PBOOLEAN AccessStatus
54 );
55
56 NTSTATUS
57 STDCALL
58 ZwAccessCheck(
59 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
60 IN HANDLE ClientToken,
61 IN ACCESS_MASK DesiredAcces,
62 IN PGENERIC_MAPPING GenericMapping,
63 OUT PPRIVILEGE_SET PrivilegeSet,
64 OUT PULONG ReturnLength,
65 OUT PULONG GrantedAccess,
66 OUT PBOOLEAN AccessStatus
67 );
68
69 /*
70 * FUNCTION: Checks a clients access rights to a object and issues a audit a alarm. ( it logs the access )
71 * ARGUMENTS:
72 * SubsystemName = Specifies the name of the subsystem, can be "WIN32" or "DEBUG"
73 * ObjectHandle =
74 * ObjectAttributes =
75 * DesiredAcces =
76 * GenericMapping =
77 * ObjectCreation =
78 * GrantedAccess =
79 * AccessStatus =
80 * GenerateOnClose =
81 * REMARKS: The arguments map to the win32 AccessCheck
82 * RETURNS: Status
83 */
84
85 NTSTATUS
86 STDCALL
87 NtAccessCheckAndAuditAlarm(
88 IN PUNICODE_STRING SubsystemName,
89 IN PHANDLE ObjectHandle,
90 IN POBJECT_ATTRIBUTES ObjectAttributes,
91 IN ACCESS_MASK DesiredAccess,
92 IN PGENERIC_MAPPING GenericMapping,
93 IN BOOLEAN ObjectCreation,
94 OUT PULONG GrantedAccess,
95 OUT PBOOLEAN AccessStatus,
96 OUT PBOOLEAN GenerateOnClose
97 );
98
99 NTSTATUS
100 STDCALL
101 ZwAccessCheckAndAuditAlarm(
102 IN PUNICODE_STRING SubsystemName,
103 IN PHANDLE ObjectHandle,
104 IN POBJECT_ATTRIBUTES ObjectAttributes,
105 IN ACCESS_MASK DesiredAccess,
106 IN PGENERIC_MAPPING GenericMapping,
107 IN BOOLEAN ObjectCreation,
108 OUT PULONG GrantedAccess,
109 OUT PBOOLEAN AccessStatus,
110 OUT PBOOLEAN GenerateOnClose
111 );
112
113 /*
114 * FUNCTION: Adds an atom to the global atom table
115 * ARGUMENTS:
116 * AtomString = The string to add to the atom table.
117 * Atom (OUT) = Caller supplies storage for the resulting atom.
118 * REMARKS: The arguments map to the win32 add GlobalAddAtom.
119 * RETURNS: Status
120 */
121 NTSTATUS
122 STDCALL
123 NtAddAtom(
124 IN PWSTR AtomName,
125 IN OUT PRTL_ATOM Atom
126 );
127
128
129 NTSTATUS
130 STDCALL
131 ZwAddAtom(
132 IN PWSTR AtomName,
133 IN OUT PRTL_ATOM Atom
134 );
135
136
137 /*
138 * FUNCTION: Adjusts the groups in an access token
139 * ARGUMENTS:
140 * TokenHandle = Specifies the access token
141 * ResetToDefault = If true the NewState parameter is ignored and the groups are set to
142 * their default state, if false the groups specified in
143 * NewState are set.
144 * NewState =
145 * BufferLength = Specifies the size of the buffer for the PreviousState.
146 * PreviousState =
147 * ReturnLength = Bytes written in PreviousState buffer.
148 * REMARKS: The arguments map to the win32 AdjustTokenGroups
149 * RETURNS: Status
150 */
151
152 NTSTATUS
153 STDCALL
154 NtAdjustGroupsToken(
155 IN HANDLE TokenHandle,
156 IN BOOLEAN ResetToDefault,
157 IN PTOKEN_GROUPS NewState,
158 IN ULONG BufferLength,
159 OUT PTOKEN_GROUPS PreviousState OPTIONAL,
160 OUT PULONG ReturnLength
161 );
162
163 NTSTATUS
164 STDCALL
165 ZwAdjustGroupsToken(
166 IN HANDLE TokenHandle,
167 IN BOOLEAN ResetToDefault,
168 IN PTOKEN_GROUPS NewState,
169 IN ULONG BufferLength,
170 OUT PTOKEN_GROUPS PreviousState,
171 OUT PULONG ReturnLength
172 );
173
174
175 /*
176 * FUNCTION:
177 *
178 * ARGUMENTS:
179 * TokenHandle = Handle to the access token
180 * DisableAllPrivileges = The resulting suspend count.
181 NewState =
182 BufferLength =
183 PreviousState =
184 ReturnLength =
185 * REMARK:
186 * The arguments map to the win32 AdjustTokenPrivileges
187 * RETURNS: Status
188 */
189
190 NTSTATUS
191 STDCALL
192 NtAdjustPrivilegesToken(
193 IN HANDLE TokenHandle,
194 IN BOOLEAN DisableAllPrivileges,
195 IN PTOKEN_PRIVILEGES NewState,
196 IN ULONG BufferLength,
197 OUT PTOKEN_PRIVILEGES PreviousState,
198 OUT PULONG ReturnLength
199 );
200
201 NTSTATUS
202 STDCALL
203 ZwAdjustPrivilegesToken(
204 IN HANDLE TokenHandle,
205 IN BOOLEAN DisableAllPrivileges,
206 IN PTOKEN_PRIVILEGES NewState,
207 IN ULONG BufferLength,
208 OUT PTOKEN_PRIVILEGES PreviousState,
209 OUT PULONG ReturnLength
210 );
211
212
213 /*
214 * FUNCTION: Decrements a thread's suspend count and places it in an alerted
215 * state.
216 * ARGUMENTS:
217 * ThreadHandle = Handle to the thread that should be resumed
218 * SuspendCount = The resulting suspend count.
219 * REMARK:
220 * A thread is resumed if its suspend count is 0
221 * RETURNS: Status
222 */
223 NTSTATUS
224 STDCALL
225 NtAlertResumeThread(
226 IN HANDLE ThreadHandle,
227 OUT PULONG SuspendCount
228 );
229
230 NTSTATUS
231 STDCALL
232 ZwAlertResumeThread(
233 IN HANDLE ThreadHandle,
234 OUT PULONG SuspendCount
235 );
236
237 /*
238 * FUNCTION: Puts the thread in a alerted state
239 * ARGUMENTS:
240 * ThreadHandle = Handle to the thread that should be alerted
241 * RETURNS: Status
242 */
243 NTSTATUS
244 STDCALL
245 NtAlertThread(
246 IN HANDLE ThreadHandle
247 );
248
249 NTSTATUS
250 STDCALL
251 ZwAlertThread(
252 IN HANDLE ThreadHandle
253 );
254
255
256 /*
257 * FUNCTION: Allocates a locally unique id
258 * ARGUMENTS:
259 * LocallyUniqueId = Locally unique number
260 * RETURNS: Status
261 */
262 NTSTATUS
263 STDCALL
264 NtAllocateLocallyUniqueId(
265 OUT LUID *LocallyUniqueId
266 );
267
268 NTSTATUS
269 STDCALL
270 ZwAllocateLocallyUniqueId(
271 OUT PLUID Luid
272 );
273
274 NTSTATUS
275 STDCALL
276 NtAllocateUuids(
277 PULARGE_INTEGER Time,
278 PULONG Range,
279 PULONG Sequence
280 );
281
282 NTSTATUS
283 STDCALL
284 ZwAllocateUuids(
285 PULARGE_INTEGER Time,
286 PULONG Range,
287 PULONG Sequence
288 );
289
290
291 /*
292 * FUNCTION: Allocates a block of virtual memory in the process address space
293 * ARGUMENTS:
294 * ProcessHandle = The handle of the process which owns the virtual memory
295 * BaseAddress = A pointer to the virtual memory allocated. If you supply a non zero
296 * value the system will try to allocate the memory at the address supplied. It rounds
297 * it down to a multiple if the page size.
298 * ZeroBits = (OPTIONAL) You can specify the number of high order bits that must be zero, ensuring that
299 * the memory will be allocated at a address below a certain value.
300 * RegionSize = The number of bytes to allocate
301 * AllocationType = Indicates the type of virtual memory you like to allocated,
302 * can be one of the values : MEM_COMMIT, MEM_RESERVE, MEM_RESET, MEM_TOP_DOWN
303 * Protect = Indicates the protection type of the pages allocated, can be a combination of
304 * PAGE_READONLY, PAGE_READWRITE, PAGE_EXECUTE_READ,
305 * PAGE_EXECUTE_READWRITE, PAGE_GUARD, PAGE_NOACCESS, PAGE_NOACCESS
306 * REMARKS:
307 * This function maps to the win32 VirtualAllocEx. Virtual memory is process based so the
308 * protocol starts with a ProcessHandle. I splitted the functionality of obtaining the actual address and specifying
309 * the start address in two parameters ( BaseAddress and StartAddress ) The NumberOfBytesAllocated specify the range
310 * and the AllocationType and ProctectionType map to the other two parameters.
311 * RETURNS: Status
312 */
313 NTSTATUS
314 STDCALL
315 NtAllocateVirtualMemory (
316 IN HANDLE ProcessHandle,
317 IN OUT PVOID *BaseAddress,
318 IN ULONG ZeroBits,
319 IN OUT PULONG RegionSize,
320 IN ULONG AllocationType,
321 IN ULONG Protect
322 );
323
324 NTSTATUS
325 STDCALL
326 ZwAllocateVirtualMemory (
327 IN HANDLE ProcessHandle,
328 IN OUT PVOID *BaseAddress,
329 IN ULONG ZeroBits,
330 IN OUT PULONG RegionSize,
331 IN ULONG AllocationType,
332 IN ULONG Protect);
333
334 /*
335 * FUNCTION: Returns from a callback into user mode
336 * ARGUMENTS:
337 * RETURN Status
338 */
339 //FIXME: this function might need 3 parameters
340 NTSTATUS STDCALL NtCallbackReturn(PVOID Result,
341 ULONG ResultLength,
342 NTSTATUS Status);
343
344 NTSTATUS STDCALL ZwCallbackReturn(PVOID Result,
345 ULONG ResultLength,
346 NTSTATUS Status);
347
348 /*
349 * FUNCTION: Cancels a IO request
350 * ARGUMENTS:
351 * FileHandle = Handle to the file
352 * IoStatusBlock =
353 *
354 * REMARKS:
355 * This function maps to the win32 CancelIo.
356 * RETURNS: Status
357 */
358 NTSTATUS
359 STDCALL
360 NtCancelIoFile(
361 IN HANDLE FileHandle,
362 OUT PIO_STATUS_BLOCK IoStatusBlock
363 );
364
365 NTSTATUS
366 STDCALL
367 ZwCancelIoFile(
368 IN HANDLE FileHandle,
369 OUT PIO_STATUS_BLOCK IoStatusBlock
370 );
371 /*
372 * FUNCTION: Cancels a timer
373 * ARGUMENTS:
374 * TimerHandle = Handle to the timer
375 * CurrentState = Specifies the state of the timer when cancelled.
376 * REMARKS:
377 * The arguments to this function map to the function CancelWaitableTimer.
378 * RETURNS: Status
379 */
380 NTSTATUS
381 STDCALL
382 NtCancelTimer(
383 IN HANDLE TimerHandle,
384 OUT PBOOLEAN CurrentState OPTIONAL
385 );
386
387 NTSTATUS
388 STDCALL
389 ZwCancelTimer(
390 IN HANDLE TimerHandle,
391 OUT ULONG ElapsedTime
392 );
393 /*
394 * FUNCTION: Sets the status of the event back to non-signaled
395 * ARGUMENTS:
396 * EventHandle = Handle to the event
397 * REMARKS:
398 * This function maps to win32 function ResetEvent.
399 * RETURcNS: Status
400 */
401
402 NTSTATUS
403 STDCALL
404 NtClearEvent(
405 IN HANDLE EventHandle
406 );
407
408 NTSTATUS
409 STDCALL
410 ZwClearEvent(
411 IN HANDLE EventHandle
412 );
413
414 /*
415 * FUNCTION: Closes an object handle
416 * ARGUMENTS:
417 * Handle = Handle to the object
418 * REMARKS:
419 * This function maps to the win32 function CloseHandle.
420 * RETURNS: Status
421 */
422
423 NTSTATUS
424 STDCALL
425 NtClose(
426 IN HANDLE Handle
427 );
428
429 NTSTATUS
430 STDCALL
431 ZwClose(
432 IN HANDLE Handle
433 );
434
435 /*
436 * FUNCTION: Generates an audit message when a handle to an object is dereferenced
437 * ARGUMENTS:
438 * SubsystemName =
439 HandleId = Handle to the object
440 GenerateOnClose =
441 * REMARKS:
442 * This function maps to the win32 function ObjectCloseAuditAlarm.
443 * RETURNS: Status
444 */
445
446 NTSTATUS
447 STDCALL
448 NtCloseObjectAuditAlarm(
449 IN PUNICODE_STRING SubsystemName,
450 IN PVOID HandleId,
451 IN BOOLEAN GenerateOnClose
452 );
453
454 NTSTATUS
455 STDCALL
456 ZwCloseObjectAuditAlarm(
457 IN PUNICODE_STRING SubsystemName,
458 IN PVOID HandleId,
459 IN BOOLEAN GenerateOnClose
460 );
461
462 /*
463 * FUNCTION: Continues a thread with the specified context
464 * ARGUMENTS:
465 * Context = Specifies the processor context
466 * IrqLevel = Specifies the Interupt Request Level to continue with. Can
467 * be PASSIVE_LEVEL or APC_LEVEL
468 * REMARKS
469 * NtContinue can be used to continue after an exception or apc.
470 * RETURNS: Status
471 */
472 //FIXME This function might need another parameter
473
474 NTSTATUS
475 STDCALL
476 NtContinue(
477 IN PCONTEXT Context,
478 IN BOOLEAN TestAlert
479 );
480
481 NTSTATUS STDCALL ZwContinue(IN PCONTEXT Context, IN CINT IrqLevel);
482
483
484 /*
485 * FUNCTION: Creates a directory object
486 * ARGUMENTS:
487 * DirectoryHandle (OUT) = Caller supplied storage for the resulting handle
488 * DesiredAccess = Specifies access to the directory
489 * ObjectAttribute = Initialized attributes for the object
490 * REMARKS: This function maps to the win32 CreateDirectory. A directory is like a file so it needs a
491 * handle, a access mask and a OBJECT_ATTRIBUTES structure to map the path name and the SECURITY_ATTRIBUTES.
492 * RETURNS: Status
493 */
494
495 NTSTATUS
496 STDCALL
497 NtCreateDirectoryObject(
498 OUT PHANDLE DirectoryHandle,
499 IN ACCESS_MASK DesiredAccess,
500 IN POBJECT_ATTRIBUTES ObjectAttributes
501 );
502
503 NTSTATUS
504 STDCALL
505 ZwCreateDirectoryObject(
506 OUT PHANDLE DirectoryHandle,
507 IN ACCESS_MASK DesiredAccess,
508 IN POBJECT_ATTRIBUTES ObjectAttributes
509 );
510
511 /*
512 * FUNCTION: Creates an event object
513 * ARGUMENTS:
514 * EventHandle (OUT) = Caller supplied storage for the resulting handle
515 * DesiredAccess = Specifies access to the event
516 * ObjectAttribute = Initialized attributes for the object
517 * ManualReset = manual-reset or auto-reset if true you have to reset the state of the event manually
518 * using NtResetEvent/NtClearEvent. if false the system will reset the event to a non-signalled state
519 * automatically after the system has rescheduled a thread waiting on the event.
520 * InitialState = specifies the initial state of the event to be signaled ( TRUE ) or non-signalled (FALSE).
521 * REMARKS: This function maps to the win32 CreateEvent. Demanding a out variable of type HANDLE,
522 * a access mask and a OBJECT_ATTRIBUTES structure mapping to the SECURITY_ATTRIBUTES. ManualReset and InitialState are
523 * both parameters aswell ( possibly the order is reversed ).
524 * RETURNS: Status
525 */
526
527 NTSTATUS
528 STDCALL
529 NtCreateEvent(
530 OUT PHANDLE EventHandle,
531 IN ACCESS_MASK DesiredAccess,
532 IN POBJECT_ATTRIBUTES ObjectAttributes,
533 IN BOOLEAN ManualReset,
534 IN BOOLEAN InitialState
535 );
536
537 NTSTATUS
538 STDCALL
539 ZwCreateEvent(
540 OUT PHANDLE EventHandle,
541 IN ACCESS_MASK DesiredAccess,
542 IN POBJECT_ATTRIBUTES ObjectAttributes,
543 IN BOOLEAN ManualReset,
544 IN BOOLEAN InitialState
545 );
546
547 /*
548 * FUNCTION: Creates an eventpair object
549 * ARGUMENTS:
550 * EventPairHandle (OUT) = Caller supplied storage for the resulting handle
551 * DesiredAccess = Specifies access to the event
552 * ObjectAttribute = Initialized attributes for the object
553 */
554
555 NTSTATUS
556 STDCALL
557 NtCreateEventPair(
558 OUT PHANDLE EventPairHandle,
559 IN ACCESS_MASK DesiredAccess,
560 IN POBJECT_ATTRIBUTES ObjectAttributes
561 );
562
563 NTSTATUS
564 STDCALL
565 ZwCreateEventPair(
566 OUT PHANDLE EventPairHandle,
567 IN ACCESS_MASK DesiredAccess,
568 IN POBJECT_ATTRIBUTES ObjectAttributes
569 );
570
571
572 /*
573 * FUNCTION: Creates or opens a file, directory or device object.
574 * ARGUMENTS:
575 * FileHandle (OUT) = Caller supplied storage for the resulting handle
576 * DesiredAccess = Specifies the allowed or desired access to the file can
577 * be a combination of DELETE | FILE_READ_DATA ..
578 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
579 * IoStatusBlock (OUT) = Caller supplied storage for the resulting status information, indicating if the
580 * the file is created and opened or allready existed and is just opened.
581 * FileAttributes = file attributes can be a combination of FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN ...
582 * ShareAccess = can be a combination of the following: FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
583 * CreateDisposition = specifies what the behavior of the system if the file allready exists.
584 * CreateOptions = specifies the behavior of the system on file creation.
585 * EaBuffer (OPTIONAL) = Extended Attributes buffer, applies only to files and directories.
586 * EaLength = Extended Attributes buffer size, applies only to files and directories.
587 * REMARKS: This function maps to the win32 CreateFile.
588 * RETURNS: Status
589 */
590
591 NTSTATUS
592 STDCALL
593 NtCreateFile(
594 OUT PHANDLE FileHandle,
595 IN ACCESS_MASK DesiredAccess,
596 IN POBJECT_ATTRIBUTES ObjectAttributes,
597 OUT PIO_STATUS_BLOCK IoStatusBlock,
598 IN PLARGE_INTEGER AllocationSize OPTIONAL,
599 IN ULONG FileAttributes,
600 IN ULONG ShareAccess,
601 IN ULONG CreateDisposition,
602 IN ULONG CreateOptions,
603 IN PVOID EaBuffer OPTIONAL,
604 IN ULONG EaLength
605 );
606
607 NTSTATUS
608 STDCALL
609 ZwCreateFile(
610 OUT PHANDLE FileHandle,
611 IN ACCESS_MASK DesiredAccess,
612 IN POBJECT_ATTRIBUTES ObjectAttributes,
613 OUT PIO_STATUS_BLOCK IoStatusBlock,
614 IN PLARGE_INTEGER AllocationSize OPTIONAL,
615 IN ULONG FileAttributes,
616 IN ULONG ShareAccess,
617 IN ULONG CreateDisposition,
618 IN ULONG CreateOptions,
619 IN PVOID EaBuffer OPTIONAL,
620 IN ULONG EaLength
621 );
622
623 /*
624 * FUNCTION: Creates or opens a file, directory or device object.
625 * ARGUMENTS:
626 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
627 * DesiredAccess = Specifies the allowed or desired access to the port
628 * IoStatusBlock =
629 * NumberOfConcurrentThreads =
630 * REMARKS: This function maps to the win32 CreateIoCompletionPort
631 * RETURNS:
632 * Status
633 */
634
635 NTSTATUS
636 STDCALL
637 NtCreateIoCompletion(
638 OUT PHANDLE CompletionPort,
639 IN ACCESS_MASK DesiredAccess,
640 OUT PIO_STATUS_BLOCK IoStatusBlock,
641 IN ULONG NumberOfConcurrentThreads
642 );
643
644 NTSTATUS
645 STDCALL
646 ZwCreateIoCompletion(
647 OUT PHANDLE CompletionPort,
648 IN ACCESS_MASK DesiredAccess,
649 OUT PIO_STATUS_BLOCK IoStatusBlock,
650 IN ULONG NumberOfConcurrentThreads
651 );
652
653
654 /*
655 * FUNCTION: Creates a mail slot file
656 * ARGUMENTS:
657 * MailSlotFileHandle (OUT) = Caller supplied storage for the resulting handle
658 * DesiredAccess = Specifies the allowed or desired access to the file
659 * ObjectAttributes = Contains the name of the mailslotfile.
660 * IoStatusBlock =
661 * FileAttributes =
662 * ShareAccess =
663 * MaxMessageSize =
664 * TimeOut =
665 *
666 * REMARKS: This funciton maps to the win32 function CreateMailSlot
667 * RETURNS:
668 * Status
669 */
670
671 NTSTATUS
672 STDCALL
673 NtCreateMailslotFile(
674 OUT PHANDLE MailSlotFileHandle,
675 IN ACCESS_MASK DesiredAccess,
676 IN POBJECT_ATTRIBUTES ObjectAttributes,
677 OUT PIO_STATUS_BLOCK IoStatusBlock,
678 IN ULONG FileAttributes,
679 IN ULONG ShareAccess,
680 IN ULONG MaxMessageSize,
681 IN PLARGE_INTEGER TimeOut
682 );
683
684 NTSTATUS
685 STDCALL
686 ZwCreateMailslotFile(
687 OUT PHANDLE MailSlotFileHandle,
688 IN ACCESS_MASK DesiredAccess,
689 IN POBJECT_ATTRIBUTES ObjectAttributes,
690 OUT PIO_STATUS_BLOCK IoStatusBlock,
691 IN ULONG FileAttributes,
692 IN ULONG ShareAccess,
693 IN ULONG MaxMessageSize,
694 IN PLARGE_INTEGER TimeOut
695 );
696
697 /*
698 * FUNCTION: Creates or opens a mutex
699 * ARGUMENTS:
700 * MutantHandle (OUT) = Caller supplied storage for the resulting handle
701 * DesiredAccess = Specifies the allowed or desired access to the port
702 * ObjectAttributes = Contains the name of the mutex.
703 * InitialOwner = If true the calling thread acquires ownership
704 * of the mutex.
705 * REMARKS: This funciton maps to the win32 function CreateMutex
706 * RETURNS:
707 * Status
708 */
709 NTSTATUS
710 STDCALL
711 NtCreateMutant(
712 OUT PHANDLE MutantHandle,
713 IN ACCESS_MASK DesiredAccess,
714 IN POBJECT_ATTRIBUTES ObjectAttributes,
715 IN BOOLEAN InitialOwner
716 );
717
718 NTSTATUS
719 STDCALL
720 ZwCreateMutant(
721 OUT PHANDLE MutantHandle,
722 IN ACCESS_MASK DesiredAccess,
723 IN POBJECT_ATTRIBUTES ObjectAttributes,
724 IN BOOLEAN InitialOwner
725 );
726
727
728 /*
729 * FUNCTION: Creates a paging file.
730 * ARGUMENTS:
731 * FileName = Name of the pagefile
732 * InitialSize = Specifies the initial size in bytes
733 * MaximumSize = Specifies the maximum size in bytes
734 * Reserved = Reserved for future use
735 * RETURNS: Status
736 */
737 NTSTATUS
738 STDCALL
739 NtCreatePagingFile(
740 IN PUNICODE_STRING FileName,
741 IN PLARGE_INTEGER InitialSize,
742 IN PLARGE_INTEGER MaxiumSize,
743 IN ULONG Reserved
744 );
745
746 NTSTATUS
747 STDCALL
748 ZwCreatePagingFile(
749 IN PUNICODE_STRING FileName,
750 IN PLARGE_INTEGER InitialSize,
751 IN PLARGE_INTEGER MaxiumSize,
752 IN ULONG Reserved
753 );
754
755 /*
756 * FUNCTION: Creates a process.
757 * ARGUMENTS:
758 * ProcessHandle (OUT) = Caller supplied storage for the resulting handle
759 * DesiredAccess = Specifies the allowed or desired access to the process can
760 * be a combinate of STANDARD_RIGHTS_REQUIRED| ..
761 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
762 * ParentProcess = Handle to the parent process.
763 * InheritObjectTable = Specifies to inherit the objects of the parent process if true.
764 * SectionHandle = Handle to a section object to back the image file
765 * DebugPort = Handle to a DebugPort if NULL the system default debug port will be used.
766 * ExceptionPort = Handle to a exception port.
767 * REMARKS:
768 * This function maps to the win32 CreateProcess.
769 * RETURNS: Status
770 */
771 NTSTATUS
772 STDCALL
773 NtCreateProcess(
774 OUT PHANDLE ProcessHandle,
775 IN ACCESS_MASK DesiredAccess,
776 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
777 IN HANDLE ParentProcess,
778 IN BOOLEAN InheritObjectTable,
779 IN HANDLE SectionHandle OPTIONAL,
780 IN HANDLE DebugPort OPTIONAL,
781 IN HANDLE ExceptionPort OPTIONAL
782 );
783
784 NTSTATUS
785 STDCALL
786 ZwCreateProcess(
787 OUT PHANDLE ProcessHandle,
788 IN ACCESS_MASK DesiredAccess,
789 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
790 IN HANDLE ParentProcess,
791 IN BOOLEAN InheritObjectTable,
792 IN HANDLE SectionHandle OPTIONAL,
793 IN HANDLE DebugPort OPTIONAL,
794 IN HANDLE ExceptionPort OPTIONAL
795 );
796
797 /*
798 * FUNCTION: Creates a profile
799 * ARGUMENTS:
800 * ProfileHandle (OUT) = Caller supplied storage for the resulting handle
801 * ObjectAttribute = Initialized attributes for the object
802 * ImageBase = Start address of executable image
803 * ImageSize = Size of the image
804 * Granularity = Bucket size
805 * Buffer = Caller supplies buffer for profiling info
806 * ProfilingSize = Buffer size
807 * ClockSource = Specify 0 / FALSE ??
808 * ProcessorMask = A value of -1 indicates disables per processor profiling,
809 otherwise bit set for the processor to profile.
810 * REMARKS:
811 * This function maps to the win32 CreateProcess.
812 * RETURNS: Status
813 */
814
815 NTSTATUS
816 STDCALL
817 NtCreateProfile(OUT PHANDLE ProfileHandle,
818 IN HANDLE ProcessHandle,
819 IN PVOID ImageBase,
820 IN ULONG ImageSize,
821 IN ULONG Granularity,
822 OUT PULONG Buffer,
823 IN ULONG ProfilingSize,
824 IN KPROFILE_SOURCE Source,
825 IN ULONG ProcessorMask);
826
827 NTSTATUS
828 STDCALL
829 ZwCreateProfile(
830 OUT PHANDLE ProfileHandle,
831 IN POBJECT_ATTRIBUTES ObjectAttributes,
832 IN ULONG ImageBase,
833 IN ULONG ImageSize,
834 IN ULONG Granularity,
835 OUT PVOID Buffer,
836 IN ULONG ProfilingSize,
837 IN ULONG ClockSource,
838 IN ULONG ProcessorMask
839 );
840
841 /*
842 * FUNCTION: Creates a section object.
843 * ARGUMENTS:
844 * SectionHandle (OUT) = Caller supplied storage for the resulting handle
845 * DesiredAccess = Specifies the desired access to the section can be a combination of STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_WRITE |
846 * SECTION_MAP_READ | SECTION_MAP_EXECUTE.
847 * ObjectAttribute = Initialized attributes for the object can be used to create a named section
848 * MaxiumSize = Maximizes the size of the memory section. Must be non-NULL for a page-file backed section.
849 * If value specified for a mapped file and the file is not large enough, file will be extended.
850 * SectionPageProtection = Can be a combination of PAGE_READONLY | PAGE_READWRITE | PAGE_WRITEONLY | PAGE_WRITECOPY.
851 * AllocationAttributes = can be a combination of SEC_IMAGE | SEC_RESERVE
852 * FileHanlde = Handle to a file to create a section mapped to a file instead of a memory backed section.
853 * RETURNS: Status
854 */
855
856 NTSTATUS
857 STDCALL
858 NtCreateSection(
859 OUT PHANDLE SectionHandle,
860 IN ACCESS_MASK DesiredAccess,
861 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
862 IN PLARGE_INTEGER MaximumSize OPTIONAL,
863 IN ULONG SectionPageProtection OPTIONAL,
864 IN ULONG AllocationAttributes,
865 IN HANDLE FileHandle OPTIONAL
866 );
867
868 NTSTATUS
869 STDCALL
870 ZwCreateSection(
871 OUT PHANDLE SectionHandle,
872 IN ACCESS_MASK DesiredAccess,
873 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
874 IN PLARGE_INTEGER MaximumSize OPTIONAL,
875 IN ULONG SectionPageProtection OPTIONAL,
876 IN ULONG AllocationAttributes,
877 IN HANDLE FileHandle OPTIONAL
878 );
879
880 /*
881 * FUNCTION: Creates a semaphore object for interprocess synchronization.
882 * ARGUMENTS:
883 * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle
884 * DesiredAccess = Specifies the allowed or desired access to the semaphore.
885 * ObjectAttribute = Initialized attributes for the object.
886 * InitialCount = Not necessary zero, might be smaller than zero.
887 * MaximumCount = Maxiumum count the semaphore can reach.
888 * RETURNS: Status
889 * REMARKS:
890 * The semaphore is set to signaled when its count is greater than zero, and non-signaled when its count is zero.
891 */
892
893 //FIXME: should a semaphore's initial count allowed to be smaller than zero ??
894 NTSTATUS
895 STDCALL
896 NtCreateSemaphore(
897 OUT PHANDLE SemaphoreHandle,
898 IN ACCESS_MASK DesiredAccess,
899 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
900 IN LONG InitialCount,
901 IN LONG MaximumCount
902 );
903
904 NTSTATUS
905 STDCALL
906 ZwCreateSemaphore(
907 OUT PHANDLE SemaphoreHandle,
908 IN ACCESS_MASK DesiredAccess,
909 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
910 IN LONG InitialCount,
911 IN LONG MaximumCount
912 );
913
914 /*
915 * FUNCTION: Creates a symbolic link object
916 * ARGUMENTS:
917 * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle
918 * DesiredAccess = Specifies the allowed or desired access to the thread.
919 * ObjectAttributes = Initialized attributes for the object.
920 * Name = Target name of the symbolic link
921 * RETURNS: Status
922 */
923 NTSTATUS
924 STDCALL
925 NtCreateSymbolicLinkObject(
926 OUT PHANDLE SymbolicLinkHandle,
927 IN ACCESS_MASK DesiredAccess,
928 IN POBJECT_ATTRIBUTES ObjectAttributes,
929 IN PUNICODE_STRING Name
930 );
931
932 NTSTATUS
933 STDCALL
934 ZwCreateSymbolicLinkObject(
935 OUT PHANDLE SymbolicLinkHandle,
936 IN ACCESS_MASK DesiredAccess,
937 IN POBJECT_ATTRIBUTES ObjectAttributes,
938 IN PUNICODE_STRING Name
939 );
940
941 /*
942 * FUNCTION: Creates a user mode thread
943 * ARGUMENTS:
944 * ThreadHandle (OUT) = Caller supplied storage for the resulting handle
945 * DesiredAccess = Specifies the allowed or desired access to the thread.
946 * ObjectAttributes = Initialized attributes for the object.
947 * ProcessHandle = Handle to the threads parent process.
948 * ClientId (OUT) = Caller supplies storage for returned process id and thread id.
949 * ThreadContext = Initial processor context for the thread.
950 * InitialTeb = Initial user mode stack context for the thread.
951 * CreateSuspended = Specifies if the thread is ready for scheduling
952 * REMARKS:
953 * This function maps to the win32 function CreateThread.
954 * RETURNS: Status
955 */
956 NTSTATUS
957 STDCALL
958 NtCreateThread(
959 OUT PHANDLE ThreadHandle,
960 IN ACCESS_MASK DesiredAccess,
961 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
962 IN HANDLE ProcessHandle,
963 OUT PCLIENT_ID ClientId,
964 IN PCONTEXT ThreadContext,
965 IN PINITIAL_TEB InitialTeb,
966 IN BOOLEAN CreateSuspended
967 );
968
969 NTSTATUS
970 STDCALL
971 ZwCreateThread(
972 OUT PHANDLE ThreadHandle,
973 IN ACCESS_MASK DesiredAccess,
974 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
975 IN HANDLE ProcessHandle,
976 OUT PCLIENT_ID ClientId,
977 IN PCONTEXT ThreadContext,
978 IN PINITIAL_TEB InitialTeb,
979 IN BOOLEAN CreateSuspended
980 );
981
982 /*
983 * FUNCTION: Creates a waitable timer.
984 * ARGUMENTS:
985 * TimerHandle (OUT) = Caller supplied storage for the resulting handle
986 * DesiredAccess = Specifies the allowed or desired access to the timer.
987 * ObjectAttributes = Initialized attributes for the object.
988 * TimerType = Specifies if the timer should be reset manually.
989 * REMARKS:
990 * This function maps to the win32 CreateWaitableTimer. lpTimerAttributes and lpTimerName map to
991 * corresponding fields in OBJECT_ATTRIBUTES structure.
992 * RETURNS: Status
993 */
994 NTSTATUS
995 STDCALL
996 NtCreateTimer(
997 OUT PHANDLE TimerHandle,
998 IN ACCESS_MASK DesiredAccess,
999 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1000 IN TIMER_TYPE TimerType
1001 );
1002
1003 NTSTATUS
1004 STDCALL
1005 ZwCreateTimer(
1006 OUT PHANDLE TimerHandle,
1007 IN ACCESS_MASK DesiredAccess,
1008 IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
1009 IN TIMER_TYPE TimerType
1010 );
1011
1012 /*
1013 * FUNCTION: Creates a token.
1014 * ARGUMENTS:
1015 * TokenHandle (OUT) = Caller supplied storage for the resulting handle
1016 * DesiredAccess = Specifies the allowed or desired access to the process can
1017 * be a combinate of STANDARD_RIGHTS_REQUIRED| ..
1018 * ObjectAttribute = Initialized attributes for the object, contains the rootdirectory and the filename
1019 * TokenType =
1020 * AuthenticationId =
1021 * ExpirationTime =
1022 * TokenUser =
1023 * TokenGroups =
1024 * TokenPrivileges =
1025 * TokenOwner =
1026 * TokenPrimaryGroup =
1027 * TokenDefaultDacl =
1028 * TokenSource =
1029 * REMARKS:
1030 * This function does not map to a win32 function
1031 * RETURNS: Status
1032 */
1033
1034 NTSTATUS
1035 STDCALL
1036 NtCreateToken(
1037 OUT PHANDLE TokenHandle,
1038 IN ACCESS_MASK DesiredAccess,
1039 IN POBJECT_ATTRIBUTES ObjectAttributes,
1040 IN TOKEN_TYPE TokenType,
1041 IN PLUID AuthenticationId,
1042 IN PLARGE_INTEGER ExpirationTime,
1043 IN PTOKEN_USER TokenUser,
1044 IN PTOKEN_GROUPS TokenGroups,
1045 IN PTOKEN_PRIVILEGES TokenPrivileges,
1046 IN PTOKEN_OWNER TokenOwner,
1047 IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
1048 IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
1049 IN PTOKEN_SOURCE TokenSource
1050 );
1051
1052 NTSTATUS
1053 STDCALL
1054 ZwCreateToken(
1055 OUT PHANDLE TokenHandle,
1056 IN ACCESS_MASK DesiredAccess,
1057 IN POBJECT_ATTRIBUTES ObjectAttributes,
1058 IN TOKEN_TYPE TokenType,
1059 IN PLUID AuthenticationId,
1060 IN PLARGE_INTEGER ExpirationTime,
1061 IN PTOKEN_USER TokenUser,
1062 IN PTOKEN_GROUPS TokenGroups,
1063 IN PTOKEN_PRIVILEGES TokenPrivileges,
1064 IN PTOKEN_OWNER TokenOwner,
1065 IN PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
1066 IN PTOKEN_DEFAULT_DACL TokenDefaultDacl,
1067 IN PTOKEN_SOURCE TokenSource
1068 );
1069
1070 /*
1071 * FUNCTION: Returns the callers thread TEB.
1072 * RETURNS: The resulting teb.
1073 */
1074 #if 0
1075 NT_TEB *
1076 STDCALL
1077 NtCurrentTeb(VOID
1078 );
1079 #endif
1080
1081 /*
1082 * FUNCTION: Delays the execution of the calling thread.
1083 * ARGUMENTS:
1084 * Alertable = If TRUE the thread is alertable during is wait period
1085 * Interval = Specifies the interval to wait.
1086 * RETURNS: Status
1087 */
1088 NTSTATUS STDCALL NtDelayExecution(IN ULONG Alertable, IN TIME* Interval);
1089
1090 NTSTATUS
1091 STDCALL
1092 ZwDelayExecution(
1093 IN BOOLEAN Alertable,
1094 IN TIME *Interval
1095 );
1096
1097
1098 /*
1099 * FUNCTION: Deletes an atom from the global atom table
1100 * ARGUMENTS:
1101 * Atom = Identifies the atom to delete
1102 * REMARKS:
1103 * The function maps to the win32 GlobalDeleteAtom
1104 * RETURNS: Status
1105 */
1106 NTSTATUS
1107 STDCALL
1108 NtDeleteAtom(
1109 IN RTL_ATOM Atom
1110 );
1111
1112 NTSTATUS
1113 STDCALL
1114 ZwDeleteAtom(
1115 IN RTL_ATOM Atom
1116 );
1117
1118 /*
1119 * FUNCTION: Deletes a file or a directory
1120 * ARGUMENTS:
1121 * ObjectAttributes = Name of the file which should be deleted
1122 * REMARKS:
1123 * This system call is functionally equivalent to NtSetInformationFile
1124 * setting the disposition information.
1125 * The function maps to the win32 DeleteFile.
1126 * RETURNS: Status
1127 */
1128 NTSTATUS
1129 STDCALL
1130 NtDeleteFile(
1131 IN POBJECT_ATTRIBUTES ObjectAttributes
1132 );
1133
1134 NTSTATUS
1135 STDCALL
1136 ZwDeleteFile(
1137 IN POBJECT_ATTRIBUTES ObjectAttributes
1138 );
1139
1140 /*
1141 * FUNCTION: Deletes a registry key
1142 * ARGUMENTS:
1143 * KeyHandle = Handle of the key
1144 * RETURNS: Status
1145 */
1146 NTSTATUS
1147 STDCALL
1148 NtDeleteKey(
1149 IN HANDLE KeyHandle
1150 );
1151 NTSTATUS
1152 STDCALL
1153 ZwDeleteKey(
1154 IN HANDLE KeyHandle
1155 );
1156
1157 /*
1158 * FUNCTION: Generates a audit message when an object is deleted
1159 * ARGUMENTS:
1160 * SubsystemName = Spefies the name of the subsystem can be 'WIN32' or 'DEBUG'
1161 * HandleId= Handle to an audit object
1162 * GenerateOnClose = Value returned by NtAccessCheckAndAuditAlarm
1163 * REMARKS: This function maps to the win32 ObjectCloseAuditAlarm
1164 * RETURNS: Status
1165 */
1166
1167 NTSTATUS
1168 STDCALL
1169 NtDeleteObjectAuditAlarm (
1170 IN PUNICODE_STRING SubsystemName,
1171 IN PVOID HandleId,
1172 IN BOOLEAN GenerateOnClose
1173 );
1174
1175 NTSTATUS
1176 STDCALL
1177 ZwDeleteObjectAuditAlarm (
1178 IN PUNICODE_STRING SubsystemName,
1179 IN PVOID HandleId,
1180 IN BOOLEAN GenerateOnClose
1181 );
1182
1183
1184 /*
1185 * FUNCTION: Deletes a value from a registry key
1186 * ARGUMENTS:
1187 * KeyHandle = Handle of the key
1188 * ValueName = Name of the value to delete
1189 * RETURNS: Status
1190 */
1191
1192 NTSTATUS
1193 STDCALL
1194 NtDeleteValueKey(
1195 IN HANDLE KeyHandle,
1196 IN PUNICODE_STRING ValueName
1197 );
1198
1199 NTSTATUS
1200 STDCALL
1201 ZwDeleteValueKey(
1202 IN HANDLE KeyHandle,
1203 IN PUNICODE_STRING ValueName
1204 );
1205 /*
1206 * FUNCTION: Sends IOCTL to the io sub system
1207 * ARGUMENTS:
1208 * DeviceHandle = Points to the handle that is created by NtCreateFile
1209 * Event = Event to synchronize on STATUS_PENDING
1210 * ApcRoutine = Asynchroneous procedure callback
1211 * ApcContext = Callback context.
1212 * IoStatusBlock = Caller should supply storage for extra information..
1213 * IoControlCode = Contains the IO Control command. This is an
1214 * index to the structures in InputBuffer and OutputBuffer.
1215 * InputBuffer = Caller should supply storage for input buffer if IOTL expects one.
1216 * InputBufferSize = Size of the input bufffer
1217 * OutputBuffer = Caller should supply storage for output buffer if IOTL expects one.
1218 * OutputBufferSize = Size of the input bufffer
1219 * RETURNS: Status
1220 */
1221
1222 NTSTATUS
1223 STDCALL
1224 NtDeviceIoControlFile(
1225 IN HANDLE DeviceHandle,
1226 IN HANDLE Event OPTIONAL,
1227 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
1228 IN PVOID UserApcContext OPTIONAL,
1229 OUT PIO_STATUS_BLOCK IoStatusBlock,
1230 IN ULONG IoControlCode,
1231 IN PVOID InputBuffer,
1232 IN ULONG InputBufferSize,
1233 OUT PVOID OutputBuffer,
1234 IN ULONG OutputBufferSize
1235 );
1236
1237 NTSTATUS
1238 STDCALL
1239 ZwDeviceIoControlFile(
1240 IN HANDLE DeviceHandle,
1241 IN HANDLE Event OPTIONAL,
1242 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
1243 IN PVOID UserApcContext OPTIONAL,
1244 OUT PIO_STATUS_BLOCK IoStatusBlock,
1245 IN ULONG IoControlCode,
1246 IN PVOID InputBuffer,
1247 IN ULONG InputBufferSize,
1248 OUT PVOID OutputBuffer,
1249 IN ULONG OutputBufferSize
1250 );
1251 /*
1252 * FUNCTION: Displays a string on the blue screen
1253 * ARGUMENTS:
1254 * DisplayString = The string to display
1255 * RETURNS: Status
1256 */
1257
1258 NTSTATUS
1259 STDCALL
1260 NtDisplayString(
1261 IN PUNICODE_STRING DisplayString
1262 );
1263
1264 NTSTATUS
1265 STDCALL
1266 ZwDisplayString(
1267 IN PUNICODE_STRING DisplayString
1268 );
1269
1270 /*
1271 * FUNCTION: Copies a handle from one process space to another
1272 * ARGUMENTS:
1273 * SourceProcessHandle = The source process owning the handle. The source process should have opened
1274 * the SourceHandle with PROCESS_DUP_HANDLE access.
1275 * SourceHandle = The handle to the object.
1276 * TargetProcessHandle = The destination process owning the handle
1277 * TargetHandle (OUT) = Caller should supply storage for the duplicated handle.
1278 * DesiredAccess = The desired access to the handle.
1279 * InheritHandle = Indicates wheter the new handle will be inheritable or not.
1280 * Options = Specifies special actions upon duplicating the handle. Can be
1281 * one of the values DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS.
1282 * DUPLICATE_CLOSE_SOURCE specifies that the source handle should be
1283 * closed after duplicating. DUPLICATE_SAME_ACCESS specifies to ignore
1284 * the DesiredAccess paramter and just grant the same access to the new
1285 * handle.
1286 * RETURNS: Status
1287 * REMARKS: This function maps to the win32 DuplicateHandle.
1288 */
1289
1290 NTSTATUS
1291 STDCALL
1292 NtDuplicateObject(
1293 IN HANDLE SourceProcessHandle,
1294 IN HANDLE SourceHandle,
1295 IN HANDLE TargetProcessHandle,
1296 OUT PHANDLE TargetHandle,
1297 IN ACCESS_MASK DesiredAccess,
1298 IN BOOLEAN InheritHandle,
1299 IN ULONG Options
1300 );
1301
1302 NTSTATUS
1303 STDCALL
1304 ZwDuplicateObject(
1305 IN HANDLE SourceProcessHandle,
1306 IN PHANDLE SourceHandle,
1307 IN HANDLE TargetProcessHandle,
1308 OUT PHANDLE TargetHandle,
1309 IN ACCESS_MASK DesiredAccess,
1310 IN BOOLEAN InheritHandle,
1311 IN ULONG Options
1312 );
1313
1314 NTSTATUS
1315 STDCALL
1316 NtDuplicateToken(
1317 IN HANDLE ExistingToken,
1318 IN ACCESS_MASK DesiredAccess,
1319 IN POBJECT_ATTRIBUTES ObjectAttributes,
1320 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
1321 IN TOKEN_TYPE TokenType,
1322 OUT PHANDLE NewToken
1323 );
1324
1325 NTSTATUS
1326 STDCALL
1327 ZwDuplicateToken(
1328 IN HANDLE ExistingToken,
1329 IN ACCESS_MASK DesiredAccess,
1330 IN POBJECT_ATTRIBUTES ObjectAttributes,
1331 IN SECURITY_IMPERSONATION_LEVEL ImpersonationLevel,
1332 IN TOKEN_TYPE TokenType,
1333 OUT PHANDLE NewToken
1334 );
1335 /*
1336 * FUNCTION: Returns information about the subkeys of an open key
1337 * ARGUMENTS:
1338 * KeyHandle = Handle of the key whose subkeys are to enumerated
1339 * Index = zero based index of the subkey for which information is
1340 * request
1341 * KeyInformationClass = Type of information returned
1342 * KeyInformation (OUT) = Caller allocated buffer for the information
1343 * about the key
1344 * Length = Length in bytes of the KeyInformation buffer
1345 * ResultLength (OUT) = Caller allocated storage which holds
1346 * the number of bytes of information retrieved
1347 * on return
1348 * RETURNS: Status
1349 */
1350 NTSTATUS
1351 STDCALL
1352 NtEnumerateKey(
1353 IN HANDLE KeyHandle,
1354 IN ULONG Index,
1355 IN KEY_INFORMATION_CLASS KeyInformationClass,
1356 OUT PVOID KeyInformation,
1357 IN ULONG Length,
1358 OUT PULONG ResultLength
1359 );
1360
1361 NTSTATUS
1362 STDCALL
1363 ZwEnumerateKey(
1364 IN HANDLE KeyHandle,
1365 IN ULONG Index,
1366 IN KEY_INFORMATION_CLASS KeyInformationClass,
1367 OUT PVOID KeyInformation,
1368 IN ULONG Length,
1369 OUT PULONG ResultLength
1370 );
1371 /*
1372 * FUNCTION: Returns information about the value entries of an open key
1373 * ARGUMENTS:
1374 * KeyHandle = Handle of the key whose value entries are to enumerated
1375 * Index = zero based index of the subkey for which information is
1376 * request
1377 * KeyInformationClass = Type of information returned
1378 * KeyInformation (OUT) = Caller allocated buffer for the information
1379 * about the key
1380 * Length = Length in bytes of the KeyInformation buffer
1381 * ResultLength (OUT) = Caller allocated storage which holds
1382 * the number of bytes of information retrieved
1383 * on return
1384 * RETURNS: Status
1385 */
1386 NTSTATUS
1387 STDCALL
1388 NtEnumerateValueKey(
1389 IN HANDLE KeyHandle,
1390 IN ULONG Index,
1391 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1392 OUT PVOID KeyValueInformation,
1393 IN ULONG Length,
1394 OUT PULONG ResultLength
1395 );
1396
1397 NTSTATUS
1398 STDCALL
1399 ZwEnumerateValueKey(
1400 IN HANDLE KeyHandle,
1401 IN ULONG Index,
1402 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
1403 OUT PVOID KeyValueInformation,
1404 IN ULONG Length,
1405 OUT PULONG ResultLength
1406 );
1407 /*
1408 * FUNCTION: Extends a section
1409 * ARGUMENTS:
1410 * SectionHandle = Handle to the section
1411 * NewMaximumSize = Adjusted size
1412 * RETURNS: Status
1413 */
1414 NTSTATUS
1415 STDCALL
1416 NtExtendSection(
1417 IN HANDLE SectionHandle,
1418 IN ULONG NewMaximumSize
1419 );
1420 NTSTATUS
1421 STDCALL
1422 ZwExtendSection(
1423 IN HANDLE SectionHandle,
1424 IN ULONG NewMaximumSize
1425 );
1426
1427 /*
1428 * FUNCTION: Finds a atom
1429 * ARGUMENTS:
1430 * AtomName = Name to search for.
1431 * Atom = Caller supplies storage for the resulting atom
1432 * RETURNS: Status
1433 * REMARKS:
1434 * This funciton maps to the win32 GlobalFindAtom
1435 */
1436 NTSTATUS
1437 STDCALL
1438 NtFindAtom(
1439 IN PWSTR AtomName,
1440 OUT PRTL_ATOM Atom OPTIONAL
1441 );
1442
1443 NTSTATUS
1444 STDCALL
1445 ZwFindAtom(
1446 IN PWSTR AtomName,
1447 OUT PRTL_ATOM Atom OPTIONAL
1448 );
1449
1450 /*
1451 * FUNCTION: Flushes chached file data to disk
1452 * ARGUMENTS:
1453 * FileHandle = Points to the file
1454 * IoStatusBlock = Caller must supply storage to receive the result of the flush
1455 * buffers operation. The information field is set to number of bytes
1456 * flushed to disk.
1457 * RETURNS: Status
1458 * REMARKS:
1459 * This funciton maps to the win32 FlushFileBuffers
1460 */
1461 NTSTATUS
1462 STDCALL
1463 NtFlushBuffersFile(
1464 IN HANDLE FileHandle,
1465 OUT PIO_STATUS_BLOCK IoStatusBlock
1466 );
1467
1468 NTSTATUS
1469 STDCALL
1470 ZwFlushBuffersFile(
1471 IN HANDLE FileHandle,
1472 OUT PIO_STATUS_BLOCK IoStatusBlock
1473 );
1474 /*
1475 * FUNCTION: Flushes a the processors instruction cache
1476 * ARGUMENTS:
1477 * ProcessHandle = Points to the process owning the cache
1478 * BaseAddress = // might this be a image address ????
1479 * NumberOfBytesToFlush =
1480 * RETURNS: Status
1481 * REMARKS:
1482 * This funciton is used by debuggers
1483 */
1484 NTSTATUS
1485 STDCALL
1486 NtFlushInstructionCache(
1487 IN HANDLE ProcessHandle,
1488 IN PVOID BaseAddress,
1489 IN UINT NumberOfBytesToFlush
1490 );
1491 NTSTATUS
1492 STDCALL
1493 ZwFlushInstructionCache(
1494 IN HANDLE ProcessHandle,
1495 IN PVOID BaseAddress,
1496 IN UINT NumberOfBytesToFlush
1497 );
1498 /*
1499 * FUNCTION: Flushes a registry key to disk
1500 * ARGUMENTS:
1501 * KeyHandle = Points to the registry key handle
1502 * RETURNS: Status
1503 * REMARKS:
1504 * This funciton maps to the win32 RegFlushKey.
1505 */
1506 NTSTATUS
1507 STDCALL
1508 NtFlushKey(
1509 IN HANDLE KeyHandle
1510 );
1511
1512 NTSTATUS
1513 STDCALL
1514 ZwFlushKey(
1515 IN HANDLE KeyHandle
1516 );
1517
1518 /*
1519 * FUNCTION: Flushes virtual memory to file
1520 * ARGUMENTS:
1521 * ProcessHandle = Points to the process that allocated the virtual memory
1522 * BaseAddress = Points to the memory address
1523 * NumberOfBytesToFlush = Limits the range to flush,
1524 * NumberOfBytesFlushed = Actual number of bytes flushed
1525 * RETURNS: Status
1526 * REMARKS:
1527 * Check return status on STATUS_NOT_MAPPED_DATA
1528 */
1529 NTSTATUS
1530 STDCALL
1531 NtFlushVirtualMemory(
1532 IN HANDLE ProcessHandle,
1533 IN PVOID BaseAddress,
1534 IN ULONG NumberOfBytesToFlush,
1535 OUT PULONG NumberOfBytesFlushed OPTIONAL
1536 );
1537 NTSTATUS
1538 STDCALL
1539 ZwFlushVirtualMemory(
1540 IN HANDLE ProcessHandle,
1541 IN PVOID BaseAddress,
1542 IN ULONG NumberOfBytesToFlush,
1543 OUT PULONG NumberOfBytesFlushed OPTIONAL
1544 );
1545
1546 /*
1547 * FUNCTION: Flushes the dirty pages to file
1548 * RETURNS: Status
1549 * FIXME: Not sure this does (how is the file specified)
1550 */
1551 NTSTATUS STDCALL NtFlushWriteBuffer(VOID);
1552 NTSTATUS STDCALL ZwFlushWriteBuffer(VOID);
1553
1554 /*
1555 * FUNCTION: Frees a range of virtual memory
1556 * ARGUMENTS:
1557 * ProcessHandle = Points to the process that allocated the virtual
1558 * memory
1559 * BaseAddress = Points to the memory address, rounded down to a
1560 * multiple of the pagesize
1561 * RegionSize = Limits the range to free, rounded up to a multiple of
1562 * the paging size
1563 * FreeType = Can be one of the values: MEM_DECOMMIT, or MEM_RELEASE
1564 * RETURNS: Status
1565 */
1566 NTSTATUS STDCALL NtFreeVirtualMemory(IN HANDLE ProcessHandle,
1567 IN PVOID *BaseAddress,
1568 IN PULONG RegionSize,
1569 IN ULONG FreeType);
1570 NTSTATUS STDCALL ZwFreeVirtualMemory(IN HANDLE ProcessHandle,
1571 IN PVOID *BaseAddress,
1572 IN PULONG RegionSize,
1573 IN ULONG FreeType);
1574
1575 /*
1576 * FUNCTION: Sends FSCTL to the filesystem
1577 * ARGUMENTS:
1578 * DeviceHandle = Points to the handle that is created by NtCreateFile
1579 * Event = Event to synchronize on STATUS_PENDING
1580 * ApcRoutine =
1581 * ApcContext =
1582 * IoStatusBlock = Caller should supply storage for
1583 * IoControlCode = Contains the File System Control command. This is an
1584 * index to the structures in InputBuffer and OutputBuffer.
1585 * FSCTL_GET_RETRIEVAL_POINTERS MAPPING_PAIR
1586 * FSCTL_GET_RETRIEVAL_POINTERS GET_RETRIEVAL_DESCRIPTOR
1587 * FSCTL_GET_VOLUME_BITMAP BITMAP_DESCRIPTOR
1588 * FSCTL_MOVE_FILE MOVEFILE_DESCRIPTOR
1589 *
1590 * InputBuffer = Caller should supply storage for input buffer if FCTL expects one.
1591 * InputBufferSize = Size of the input bufffer
1592 * OutputBuffer = Caller should supply storage for output buffer if FCTL expects one.
1593 * OutputBufferSize = Size of the input bufffer
1594 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
1595 * STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ]
1596 */
1597 NTSTATUS
1598 STDCALL
1599 NtFsControlFile(
1600 IN HANDLE DeviceHandle,
1601 IN HANDLE Event OPTIONAL,
1602 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1603 IN PVOID ApcContext OPTIONAL,
1604 OUT PIO_STATUS_BLOCK IoStatusBlock,
1605 IN ULONG IoControlCode,
1606 IN PVOID InputBuffer,
1607 IN ULONG InputBufferSize,
1608 OUT PVOID OutputBuffer,
1609 IN ULONG OutputBufferSize
1610 );
1611
1612 NTSTATUS
1613 STDCALL
1614 ZwFsControlFile(
1615 IN HANDLE DeviceHandle,
1616 IN HANDLE Event OPTIONAL,
1617 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1618 IN PVOID ApcContext OPTIONAL,
1619 OUT PIO_STATUS_BLOCK IoStatusBlock,
1620 IN ULONG IoControlCode,
1621 IN PVOID InputBuffer,
1622 IN ULONG InputBufferSize,
1623 OUT PVOID OutputBuffer,
1624 IN ULONG OutputBufferSize
1625 );
1626
1627 /*
1628 * FUNCTION: Retrieves the processor context of a thread
1629 * ARGUMENTS:
1630 * ThreadHandle = Handle to a thread
1631 * Context (OUT) = Caller allocated storage for the processor context
1632 * RETURNS: Status
1633 */
1634
1635 NTSTATUS
1636 STDCALL
1637 NtGetContextThread(
1638 IN HANDLE ThreadHandle,
1639 OUT PCONTEXT Context
1640 );
1641
1642 NTSTATUS
1643 STDCALL
1644 ZwGetContextThread(
1645 IN HANDLE ThreadHandle,
1646 OUT PCONTEXT Context
1647 );
1648 /*
1649 * FUNCTION: Retrieves the uptime of the system
1650 * ARGUMENTS:
1651 * UpTime = Number of clock ticks since boot.
1652 * RETURNS: Status
1653 */
1654 NTSTATUS
1655 STDCALL
1656 NtGetTickCount(
1657 PULONG UpTime
1658 );
1659
1660 NTSTATUS
1661 STDCALL
1662 ZwGetTickCount(
1663 PULONG UpTime
1664 );
1665
1666 /*
1667 * FUNCTION: Sets a thread to impersonate another
1668 * ARGUMENTS:
1669 * ThreadHandle = Server thread that will impersonate a client.
1670 ThreadToImpersonate = Client thread that will be impersonated
1671 SecurityQualityOfService = Specifies the impersonation level.
1672 * RETURNS: Status
1673 */
1674
1675 NTSTATUS
1676 STDCALL
1677 NtImpersonateThread(
1678 IN HANDLE ThreadHandle,
1679 IN HANDLE ThreadToImpersonate,
1680 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
1681 );
1682
1683 NTSTATUS
1684 STDCALL
1685 ZwImpersonateThread(
1686 IN HANDLE ThreadHandle,
1687 IN HANDLE ThreadToImpersonate,
1688 IN PSECURITY_QUALITY_OF_SERVICE SecurityQualityOfService
1689 );
1690
1691 /*
1692 * FUNCTION: Initializes the registry.
1693 * ARGUMENTS:
1694 * SetUpBoot = This parameter is true for a setup boot.
1695 * RETURNS: Status
1696 */
1697 NTSTATUS
1698 STDCALL
1699 NtInitializeRegistry(
1700 BOOLEAN SetUpBoot
1701 );
1702 NTSTATUS
1703 STDCALL
1704 ZwInitializeRegistry(
1705 BOOLEAN SetUpBoot
1706 );
1707
1708 /*
1709 * FUNCTION: Loads a driver.
1710 * ARGUMENTS:
1711 * DriverServiceName = Name of the driver to load
1712 * RETURNS: Status
1713 */
1714 NTSTATUS
1715 STDCALL
1716 NtLoadDriver(
1717 IN PUNICODE_STRING DriverServiceName
1718 );
1719
1720 NTSTATUS
1721 STDCALL
1722 ZwLoadDriver(
1723 IN PUNICODE_STRING DriverServiceName
1724 );
1725
1726 /*
1727 * FUNCTION: Loads a registry key.
1728 * ARGUMENTS:
1729 * KeyHandle = Handle to the registry key
1730 * ObjectAttributes = ???
1731 * REMARK:
1732 * This procedure maps to the win32 procedure RegLoadKey
1733 * RETURNS: Status
1734 */
1735 NTSTATUS
1736 STDCALL
1737 NtLoadKey(
1738 PHANDLE KeyHandle,
1739 POBJECT_ATTRIBUTES ObjectAttributes
1740 );
1741 NTSTATUS
1742 STDCALL
1743 ZwLoadKey(
1744 PHANDLE KeyHandle,
1745 POBJECT_ATTRIBUTES ObjectAttributes
1746 );
1747
1748 /*
1749 * FUNCTION: Loads a registry key.
1750 * ARGUMENTS:
1751 * KeyHandle = Handle to the registry key
1752 * ObjectAttributes = ???
1753 * Unknown3 = ???
1754 * REMARK:
1755 * This procedure maps to the win32 procedure RegLoadKey
1756 * RETURNS: Status
1757 */
1758 NTSTATUS
1759 STDCALL
1760 NtLoadKey2 (
1761 PHANDLE KeyHandle,
1762 POBJECT_ATTRIBUTES ObjectAttributes,
1763 ULONG Unknown3
1764 );
1765 NTSTATUS
1766 STDCALL
1767 ZwLoadKey2 (
1768 PHANDLE KeyHandle,
1769 POBJECT_ATTRIBUTES ObjectAttributes,
1770 ULONG Unknown3
1771 );
1772
1773 /*
1774 * FUNCTION: Locks a range of bytes in a file.
1775 * ARGUMENTS:
1776 * FileHandle = Handle to the file
1777 * Event = Should be null if apc is specified.
1778 * ApcRoutine = Asynchroneous Procedure Callback
1779 * ApcContext = Argument to the callback
1780 * IoStatusBlock (OUT) = Caller should supply storage for a structure containing
1781 * the completion status and information about the requested lock operation.
1782 * ByteOffset = Offset
1783 * Length = Number of bytes to lock.
1784 * Key = Special value to give other threads the possibility to unlock the file
1785 by supplying the key in a call to NtUnlockFile.
1786 * FailImmediatedly = If false the request will block untill the lock is obtained.
1787 * ExclusiveLock = Specifies whether a exclusive or a shared lock is obtained.
1788 * REMARK:
1789 This procedure maps to the win32 procedure LockFileEx. STATUS_PENDING is returned if the lock could
1790 not be obtained immediately, the device queue is busy and the IRP is queued.
1791 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
1792 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_LOCK_NOT_GRANTED ]
1793
1794 */
1795 NTSTATUS
1796 STDCALL
1797 NtLockFile(
1798 IN HANDLE FileHandle,
1799 IN HANDLE Event OPTIONAL,
1800 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1801 IN PVOID ApcContext OPTIONAL,
1802 OUT PIO_STATUS_BLOCK IoStatusBlock,
1803 IN PLARGE_INTEGER ByteOffset,
1804 IN PLARGE_INTEGER Length,
1805 IN PULONG Key,
1806 IN BOOLEAN FailImmediatedly,
1807 IN BOOLEAN ExclusiveLock
1808 );
1809
1810 NTSTATUS
1811 STDCALL
1812 ZwLockFile(
1813 IN HANDLE FileHandle,
1814 IN HANDLE Event OPTIONAL,
1815 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1816 IN PVOID ApcContext OPTIONAL,
1817 OUT PIO_STATUS_BLOCK IoStatusBlock,
1818 IN PLARGE_INTEGER ByteOffset,
1819 IN PLARGE_INTEGER Length,
1820 IN PULONG Key,
1821 IN BOOLEAN FailImmediatedly,
1822 IN BOOLEAN ExclusiveLock
1823 );
1824 /*
1825 * FUNCTION: Locks a range of virtual memory.
1826 * ARGUMENTS:
1827 * ProcessHandle = Handle to the process
1828 * BaseAddress = Lower boundary of the range of bytes to lock.
1829 * NumberOfBytesLock = Offset to the upper boundary.
1830 * NumberOfBytesLocked (OUT) = Number of bytes actually locked.
1831 * REMARK:
1832 This procedure maps to the win32 procedure VirtualLock
1833 * RETURNS: Status [STATUS_SUCCESS | STATUS_WAS_LOCKED ]
1834 */
1835 NTSTATUS
1836 STDCALL
1837 NtLockVirtualMemory(
1838 HANDLE ProcessHandle,
1839 PVOID BaseAddress,
1840 ULONG NumberOfBytesToLock,
1841 PULONG NumberOfBytesLocked
1842 );
1843 NTSTATUS
1844 STDCALL
1845 ZwLockVirtualMemory(
1846 HANDLE ProcessHandle,
1847 PVOID BaseAddress,
1848 ULONG NumberOfBytesToLock,
1849 PULONG NumberOfBytesLocked
1850 );
1851 /*
1852 * FUNCTION: Makes temporary object that will be removed at next boot.
1853 * ARGUMENTS:
1854 * Handle = Handle to object
1855 * RETURNS: Status
1856 */
1857
1858 NTSTATUS
1859 STDCALL
1860 NtMakeTemporaryObject(
1861 IN HANDLE Handle
1862 );
1863
1864 NTSTATUS
1865 STDCALL
1866 ZwMakeTemporaryObject(
1867 IN HANDLE Handle
1868 );
1869 /*
1870 * FUNCTION: Maps a view of a section into the virtual address space of a
1871 * process
1872 * ARGUMENTS:
1873 * SectionHandle = Handle of the section
1874 * ProcessHandle = Handle of the process
1875 * BaseAddress = Desired base address (or NULL) on entry
1876 * Actual base address of the view on exit
1877 * ZeroBits = Number of high order address bits that must be zero
1878 * CommitSize = Size in bytes of the initially committed section of
1879 * the view
1880 * SectionOffset = Offset in bytes from the beginning of the section
1881 * to the beginning of the view
1882 * ViewSize = Desired length of map (or zero to map all) on entry
1883 * Actual length mapped on exit
1884 * InheritDisposition = Specified how the view is to be shared with
1885 * child processes
1886 * AllocateType = Type of allocation for the pages
1887 * Protect = Protection for the committed region of the view
1888 * RETURNS: Status
1889 */
1890 NTSTATUS
1891 STDCALL
1892 NtMapViewOfSection(
1893 IN HANDLE SectionHandle,
1894 IN HANDLE ProcessHandle,
1895 IN OUT PVOID *BaseAddress,
1896 IN ULONG ZeroBits,
1897 IN ULONG CommitSize,
1898 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
1899 IN OUT PULONG ViewSize,
1900 IN SECTION_INHERIT InheritDisposition,
1901 IN ULONG AllocationType,
1902 IN ULONG AccessProtection
1903 );
1904
1905 NTSTATUS
1906 STDCALL
1907 ZwMapViewOfSection(
1908 IN HANDLE SectionHandle,
1909 IN HANDLE ProcessHandle,
1910 IN OUT PVOID *BaseAddress,
1911 IN ULONG ZeroBits,
1912 IN ULONG CommitSize,
1913 IN OUT PLARGE_INTEGER SectionOffset OPTIONAL,
1914 IN OUT PULONG ViewSize,
1915 IN SECTION_INHERIT InheritDisposition,
1916 IN ULONG AllocationType,
1917 IN ULONG AccessProtection
1918 );
1919
1920 /*
1921 * FUNCTION: Installs a notify for the change of a directory's contents
1922 * ARGUMENTS:
1923 * FileHandle = Handle to the directory
1924 Event =
1925 * ApcRoutine = Start address
1926 * ApcContext = Delimits the range of virtual memory
1927 * for which the new access protection holds
1928 * IoStatusBlock = The new access proctection for the pages
1929 * Buffer = Caller supplies storage for resulting information --> FILE_NOTIFY_INFORMATION
1930 * BufferSize = Size of the buffer
1931 CompletionFilter = Can be one of the following values:
1932 FILE_NOTIFY_CHANGE_FILE_NAME
1933 FILE_NOTIFY_CHANGE_DIR_NAME
1934 FILE_NOTIFY_CHANGE_NAME ( FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_DIR_NAME )
1935 FILE_NOTIFY_CHANGE_ATTRIBUTES
1936 FILE_NOTIFY_CHANGE_SIZE
1937 FILE_NOTIFY_CHANGE_LAST_WRITE
1938 FILE_NOTIFY_CHANGE_LAST_ACCESS
1939 FILE_NOTIFY_CHANGE_CREATION ( change of creation timestamp )
1940 FILE_NOTIFY_CHANGE_EA
1941 FILE_NOTIFY_CHANGE_SECURITY
1942 FILE_NOTIFY_CHANGE_STREAM_NAME
1943 FILE_NOTIFY_CHANGE_STREAM_SIZE
1944 FILE_NOTIFY_CHANGE_STREAM_WRITE
1945 WatchTree = If true the notify will be installed recursively on the targetdirectory and all subdirectories.
1946 *
1947 * REMARKS:
1948 * The function maps to the win32 FindFirstChangeNotification, FindNextChangeNotification
1949 * RETURNS: Status
1950 */
1951 NTSTATUS
1952 STDCALL
1953 NtNotifyChangeDirectoryFile(
1954 IN HANDLE FileHandle,
1955 IN HANDLE Event OPTIONAL,
1956 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1957 IN PVOID ApcContext OPTIONAL,
1958 OUT PIO_STATUS_BLOCK IoStatusBlock,
1959 OUT PVOID Buffer,
1960 IN ULONG BufferSize,
1961 IN ULONG CompletionFilter,
1962 IN BOOLEAN WatchTree
1963 );
1964
1965 NTSTATUS
1966 STDCALL
1967 ZwNotifyChangeDirectoryFile(
1968 IN HANDLE FileHandle,
1969 IN HANDLE Event OPTIONAL,
1970 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
1971 IN PVOID ApcContext OPTIONAL,
1972 OUT PIO_STATUS_BLOCK IoStatusBlock,
1973 OUT PVOID Buffer,
1974 IN ULONG BufferSize,
1975 IN ULONG CompletionFilter,
1976 IN BOOLEAN WatchTree
1977 );
1978
1979 /*
1980 * FUNCTION: Installs a notfication callback on registry changes
1981 * ARGUMENTS:
1982 KeyHandle = Handle to the registry key
1983 Event = Event that should be signalled on modification of the key
1984 ApcRoutine = Routine that should be called on modification of the key
1985 ApcContext = Argument to the ApcRoutine
1986 IoStatusBlock = ???
1987 CompletionFilter = Specifies the kind of notification the caller likes to receive.
1988 Can be a combination of the following values:
1989
1990 REG_NOTIFY_CHANGE_NAME
1991 REG_NOTIFY_CHANGE_ATTRIBUTES
1992 REG_NOTIFY_CHANGE_LAST_SET
1993 REG_NOTIFY_CHANGE_SECURITY
1994
1995
1996 Asynchroneous = If TRUE the changes are reported by signalling an event if false
1997 the function will not return before a change occurs.
1998 ChangeBuffer = Will return the old value
1999 Length = Size of the change buffer
2000 WatchSubtree = Indicates if the caller likes to receive a notification of changes in
2001 sub keys or not.
2002 * REMARKS: If the key is closed the event is signalled aswell.
2003 * RETURNS: Status
2004 */
2005
2006 NTSTATUS
2007 STDCALL
2008 NtNotifyChangeKey(
2009 IN HANDLE KeyHandle,
2010 IN HANDLE Event,
2011 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2012 IN PVOID ApcContext OPTIONAL,
2013 OUT PIO_STATUS_BLOCK IoStatusBlock,
2014 IN ULONG CompletionFilter,
2015 IN BOOLEAN Asynchroneous,
2016 OUT PVOID ChangeBuffer,
2017 IN ULONG Length,
2018 IN BOOLEAN WatchSubtree
2019 );
2020
2021 NTSTATUS
2022 STDCALL
2023 ZwNotifyChangeKey(
2024 IN HANDLE KeyHandle,
2025 IN HANDLE Event,
2026 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2027 IN PVOID ApcContext OPTIONAL,
2028 OUT PIO_STATUS_BLOCK IoStatusBlock,
2029 IN ULONG CompletionFilter,
2030 IN BOOLEAN Asynchroneous,
2031 OUT PVOID ChangeBuffer,
2032 IN ULONG Length,
2033 IN BOOLEAN WatchSubtree
2034 );
2035
2036 /*
2037 * FUNCTION: Opens an existing directory object
2038 * ARGUMENTS:
2039 * FileHandle (OUT) = Caller supplied storage for the resulting handle
2040 * DesiredAccess = Requested access to the directory
2041 * ObjectAttributes = Initialized attributes for the object
2042 * RETURNS: Status
2043 */
2044
2045 NTSTATUS
2046 STDCALL
2047 NtOpenDirectoryObject(
2048 OUT PHANDLE FileHandle,
2049 IN ACCESS_MASK DesiredAccess,
2050 IN POBJECT_ATTRIBUTES ObjectAttributes
2051 );
2052 NTSTATUS
2053 STDCALL
2054 ZwOpenDirectoryObject(
2055 OUT PHANDLE FileHandle,
2056 IN ACCESS_MASK DesiredAccess,
2057 IN POBJECT_ATTRIBUTES ObjectAttributes
2058 );
2059
2060 /*
2061 * FUNCTION: Opens an existing event
2062 * ARGUMENTS:
2063 * EventHandle (OUT) = Caller supplied storage for the resulting handle
2064 * DesiredAccess = Requested access to the event
2065 * ObjectAttributes = Initialized attributes for the object
2066 * RETURNS: Status
2067 */
2068 NTSTATUS
2069 STDCALL
2070 NtOpenEvent(
2071 OUT PHANDLE EventHandle,
2072 IN ACCESS_MASK DesiredAccess,
2073 IN POBJECT_ATTRIBUTES ObjectAttributes
2074 );
2075
2076 NTSTATUS
2077 STDCALL
2078 ZwOpenEvent(
2079 OUT PHANDLE EventHandle,
2080 IN ACCESS_MASK DesiredAccess,
2081 IN POBJECT_ATTRIBUTES ObjectAttributes
2082 );
2083
2084 /*
2085 * FUNCTION: Opens an existing event pair
2086 * ARGUMENTS:
2087 * EventHandle (OUT) = Caller supplied storage for the resulting handle
2088 * DesiredAccess = Requested access to the event
2089 * ObjectAttributes = Initialized attributes for the object
2090 * RETURNS: Status
2091 */
2092
2093 NTSTATUS
2094 STDCALL
2095 NtOpenEventPair(
2096 OUT PHANDLE EventPairHandle,
2097 IN ACCESS_MASK DesiredAccess,
2098 IN POBJECT_ATTRIBUTES ObjectAttributes
2099 );
2100
2101 NTSTATUS
2102 STDCALL
2103 ZwOpenEventPair(
2104 OUT PHANDLE EventPairHandle,
2105 IN ACCESS_MASK DesiredAccess,
2106 IN POBJECT_ATTRIBUTES ObjectAttributes
2107 );
2108 /*
2109 * FUNCTION: Opens an existing file
2110 * ARGUMENTS:
2111 * FileHandle (OUT) = Caller supplied storage for the resulting handle
2112 * DesiredAccess = Requested access to the file
2113 * ObjectAttributes = Initialized attributes for the object
2114 * IoStatusBlock =
2115 * ShareAccess =
2116 * OpenOptions =
2117 * RETURNS: Status
2118 */
2119 NTSTATUS
2120 STDCALL
2121 NtOpenFile(
2122 OUT PHANDLE FileHandle,
2123 IN ACCESS_MASK DesiredAccess,
2124 IN POBJECT_ATTRIBUTES ObjectAttributes,
2125 OUT PIO_STATUS_BLOCK IoStatusBlock,
2126 IN ULONG ShareAccess,
2127 IN ULONG OpenOptions
2128 );
2129
2130 NTSTATUS
2131 STDCALL
2132 ZwOpenFile(
2133 OUT PHANDLE FileHandle,
2134 IN ACCESS_MASK DesiredAccess,
2135 IN POBJECT_ATTRIBUTES ObjectAttributes,
2136 OUT PIO_STATUS_BLOCK IoStatusBlock,
2137 IN ULONG ShareAccess,
2138 IN ULONG OpenOptions
2139 );
2140
2141 /*
2142 * FUNCTION: Opens an existing io completion object
2143 * ARGUMENTS:
2144 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
2145 * DesiredAccess = Requested access to the io completion object
2146 * ObjectAttributes = Initialized attributes for the object
2147 * RETURNS: Status
2148 */
2149
2150 NTSTATUS
2151 STDCALL
2152 NtOpenIoCompletion(
2153 OUT PHANDLE CompetionPort,
2154 IN ACCESS_MASK DesiredAccess,
2155 IN POBJECT_ATTRIBUTES ObjectAttributes
2156 );
2157
2158 NTSTATUS
2159 STDCALL
2160 ZwOpenIoCompletion(
2161 OUT PHANDLE CompetionPort,
2162 IN ACCESS_MASK DesiredAccess,
2163 IN POBJECT_ATTRIBUTES ObjectAttributes
2164 );
2165
2166 /*
2167 * FUNCTION: Opens an existing key in the registry
2168 * ARGUMENTS:
2169 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
2170 * DesiredAccess = Requested access to the key
2171 * ObjectAttributes = Initialized attributes for the object
2172 * RETURNS: Status
2173 */
2174 NTSTATUS
2175 STDCALL
2176 NtOpenKey(
2177 OUT PHANDLE KeyHandle,
2178 IN ACCESS_MASK DesiredAccess,
2179 IN POBJECT_ATTRIBUTES ObjectAttributes
2180 );
2181
2182 NTSTATUS
2183 STDCALL
2184 ZwOpenKey(
2185 OUT PHANDLE KeyHandle,
2186 IN ACCESS_MASK DesiredAccess,
2187 IN POBJECT_ATTRIBUTES ObjectAttributes
2188 );
2189 /*
2190 * FUNCTION: Opens an existing key in the registry
2191 * ARGUMENTS:
2192 * MutantHandle (OUT) = Caller supplied storage for the resulting handle
2193 * DesiredAccess = Requested access to the mutant
2194 * ObjectAttribute = Initialized attributes for the object
2195 * RETURNS: Status
2196 */
2197 NTSTATUS
2198 STDCALL
2199 NtOpenMutant(
2200 OUT PHANDLE MutantHandle,
2201 IN ACCESS_MASK DesiredAccess,
2202 IN POBJECT_ATTRIBUTES ObjectAttributes
2203 );
2204 NTSTATUS
2205 STDCALL
2206 ZwOpenMutant(
2207 OUT PHANDLE MutantHandle,
2208 IN ACCESS_MASK DesiredAccess,
2209 IN POBJECT_ATTRIBUTES ObjectAttributes
2210 );
2211
2212 NTSTATUS
2213 STDCALL
2214 NtOpenObjectAuditAlarm(
2215 IN PUNICODE_STRING SubsystemName,
2216 IN PVOID HandleId,
2217 IN POBJECT_ATTRIBUTES ObjectAttributes,
2218 IN HANDLE ClientToken,
2219 IN ULONG DesiredAccess,
2220 IN ULONG GrantedAccess,
2221 IN PPRIVILEGE_SET Privileges,
2222 IN BOOLEAN ObjectCreation,
2223 IN BOOLEAN AccessGranted,
2224 OUT PBOOLEAN GenerateOnClose
2225 );
2226
2227 NTSTATUS
2228 STDCALL
2229 ZwOpenObjectAuditAlarm(
2230 IN PUNICODE_STRING SubsystemName,
2231 IN PVOID HandleId,
2232 IN POBJECT_ATTRIBUTES ObjectAttributes,
2233 IN HANDLE ClientToken,
2234 IN ULONG DesiredAccess,
2235 IN ULONG GrantedAccess,
2236 IN PPRIVILEGE_SET Privileges,
2237 IN BOOLEAN ObjectCreation,
2238 IN BOOLEAN AccessGranted,
2239 OUT PBOOLEAN GenerateOnClose
2240 );
2241 /*
2242 * FUNCTION: Opens an existing process
2243 * ARGUMENTS:
2244 * ProcessHandle (OUT) = Caller supplied storage for the resulting handle
2245 * DesiredAccess = Requested access to the process
2246 * ObjectAttribute = Initialized attributes for the object
2247 * ClientId = Identifies the process id to open
2248 * RETURNS: Status
2249 */
2250 NTSTATUS
2251 STDCALL
2252 NtOpenProcess (
2253 OUT PHANDLE ProcessHandle,
2254 IN ACCESS_MASK DesiredAccess,
2255 IN POBJECT_ATTRIBUTES ObjectAttributes,
2256 IN PCLIENT_ID ClientId
2257 );
2258 NTSTATUS
2259 STDCALL
2260 ZwOpenProcess (
2261 OUT PHANDLE ProcessHandle,
2262 IN ACCESS_MASK DesiredAccess,
2263 IN POBJECT_ATTRIBUTES ObjectAttributes,
2264 IN PCLIENT_ID ClientId
2265 );
2266 /*
2267 * FUNCTION: Opens an existing process
2268 * ARGUMENTS:
2269 * ProcessHandle = Handle of the process of which owns the token
2270 * DesiredAccess = Requested access to the token
2271 * TokenHandle (OUT) = Caller supplies storage for the resulting token.
2272 * REMARKS:
2273 This function maps to the win32
2274 * RETURNS: Status
2275 */
2276
2277 NTSTATUS
2278 STDCALL
2279 NtOpenProcessToken(
2280 IN HANDLE ProcessHandle,
2281 IN ACCESS_MASK DesiredAccess,
2282 OUT PHANDLE TokenHandle
2283 );
2284
2285 NTSTATUS
2286 STDCALL
2287 ZwOpenProcessToken(
2288 IN HANDLE ProcessHandle,
2289 IN ACCESS_MASK DesiredAccess,
2290 OUT PHANDLE TokenHandle
2291 );
2292
2293 /*
2294 * FUNCTION: Opens an existing section object
2295 * ARGUMENTS:
2296 * KeyHandle (OUT) = Caller supplied storage for the resulting handle
2297 * DesiredAccess = Requested access to the key
2298 * ObjectAttribute = Initialized attributes for the object
2299 * RETURNS: Status
2300 */
2301
2302 NTSTATUS
2303 STDCALL
2304 NtOpenSection(
2305 OUT PHANDLE SectionHandle,
2306 IN ACCESS_MASK DesiredAccess,
2307 IN POBJECT_ATTRIBUTES ObjectAttributes
2308 );
2309 NTSTATUS
2310 STDCALL
2311 ZwOpenSection(
2312 OUT PHANDLE SectionHandle,
2313 IN ACCESS_MASK DesiredAccess,
2314 IN POBJECT_ATTRIBUTES ObjectAttributes
2315 );
2316 /*
2317 * FUNCTION: Opens an existing semaphore
2318 * ARGUMENTS:
2319 * SemaphoreHandle (OUT) = Caller supplied storage for the resulting handle
2320 * DesiredAccess = Requested access to the semaphore
2321 * ObjectAttribute = Initialized attributes for the object
2322 * RETURNS: Status
2323 */
2324 NTSTATUS
2325 STDCALL
2326 NtOpenSemaphore(
2327 IN HANDLE SemaphoreHandle,
2328 IN ACCESS_MASK DesiredAcces,
2329 IN POBJECT_ATTRIBUTES ObjectAttributes
2330 );
2331 NTSTATUS
2332 STDCALL
2333 ZwOpenSemaphore(
2334 IN HANDLE SemaphoreHandle,
2335 IN ACCESS_MASK DesiredAcces,
2336 IN POBJECT_ATTRIBUTES ObjectAttributes
2337 );
2338 /*
2339 * FUNCTION: Opens an existing symbolic link
2340 * ARGUMENTS:
2341 * SymbolicLinkHandle (OUT) = Caller supplied storage for the resulting handle
2342 * DesiredAccess = Requested access to the symbolic link
2343 * ObjectAttribute = Initialized attributes for the object
2344 * RETURNS: Status
2345 */
2346 NTSTATUS
2347 STDCALL
2348 NtOpenSymbolicLinkObject(
2349 OUT PHANDLE SymbolicLinkHandle,
2350 IN ACCESS_MASK DesiredAccess,
2351 IN POBJECT_ATTRIBUTES ObjectAttributes
2352 );
2353 NTSTATUS
2354 STDCALL
2355 ZwOpenSymbolicLinkObject(
2356 OUT PHANDLE SymbolicLinkHandle,
2357 IN ACCESS_MASK DesiredAccess,
2358 IN POBJECT_ATTRIBUTES ObjectAttributes
2359 );
2360 /*
2361 * FUNCTION: Opens an existing thread
2362 * ARGUMENTS:
2363 * ThreadHandle (OUT) = Caller supplied storage for the resulting handle
2364 * DesiredAccess = Requested access to the thread
2365 * ObjectAttribute = Initialized attributes for the object
2366 * ClientId = Identifies the thread to open.
2367 * RETURNS: Status
2368 */
2369 NTSTATUS
2370 STDCALL
2371 NtOpenThread(
2372 OUT PHANDLE ThreadHandle,
2373 IN ACCESS_MASK DesiredAccess,
2374 IN POBJECT_ATTRIBUTES ObjectAttributes,
2375 IN PCLIENT_ID ClientId
2376 );
2377 NTSTATUS
2378 STDCALL
2379 ZwOpenThread(
2380 OUT PHANDLE ThreadHandle,
2381 IN ACCESS_MASK DesiredAccess,
2382 IN POBJECT_ATTRIBUTES ObjectAttributes,
2383 IN PCLIENT_ID ClientId
2384 );
2385
2386 NTSTATUS
2387 STDCALL
2388 NtOpenThreadToken(
2389 IN HANDLE ThreadHandle,
2390 IN ACCESS_MASK DesiredAccess,
2391 IN BOOLEAN OpenAsSelf,
2392 OUT PHANDLE TokenHandle
2393 );
2394
2395 NTSTATUS
2396 STDCALL
2397 ZwOpenThreadToken(
2398 IN HANDLE ThreadHandle,
2399 IN ACCESS_MASK DesiredAccess,
2400 IN BOOLEAN OpenAsSelf,
2401 OUT PHANDLE TokenHandle
2402 );
2403 /*
2404 * FUNCTION: Opens an existing timer
2405 * ARGUMENTS:
2406 * TimerHandle (OUT) = Caller supplied storage for the resulting handle
2407 * DesiredAccess = Requested access to the timer
2408 * ObjectAttribute = Initialized attributes for the object
2409 * RETURNS: Status
2410 */
2411 NTSTATUS
2412 STDCALL
2413 NtOpenTimer(
2414 OUT PHANDLE TimerHandle,
2415 IN ACCESS_MASK DesiredAccess,
2416 IN POBJECT_ATTRIBUTES ObjectAttributes
2417 );
2418 NTSTATUS
2419 STDCALL
2420 ZwOpenTimer(
2421 OUT PHANDLE TimerHandle,
2422 IN ACCESS_MASK DesiredAccess,
2423 IN POBJECT_ATTRIBUTES ObjectAttributes
2424 );
2425
2426 /*
2427 * FUNCTION: Checks an access token for specific privileges
2428 * ARGUMENTS:
2429 * ClientToken = Handle to a access token structure
2430 * RequiredPrivileges = Specifies the requested privileges.
2431 * Result = Caller supplies storage for the result. If PRIVILEGE_SET_ALL_NECESSARY is
2432 set in the Control member of PRIVILEGES_SET Result
2433 will only be TRUE if all privileges are present in the access token.
2434 * RETURNS: Status
2435 */
2436
2437 NTSTATUS
2438 STDCALL
2439 NtPrivilegeCheck(
2440 IN HANDLE ClientToken,
2441 IN PPRIVILEGE_SET RequiredPrivileges,
2442 IN PBOOLEAN Result
2443 );
2444
2445 NTSTATUS
2446 STDCALL
2447 ZwPrivilegeCheck(
2448 IN HANDLE ClientToken,
2449 IN PPRIVILEGE_SET RequiredPrivileges,
2450 IN PBOOLEAN Result
2451 );
2452
2453 NTSTATUS
2454 STDCALL
2455 NtPrivilegedServiceAuditAlarm(
2456 IN PUNICODE_STRING SubsystemName,
2457 IN PUNICODE_STRING ServiceName,
2458 IN HANDLE ClientToken,
2459 IN PPRIVILEGE_SET Privileges,
2460 IN BOOLEAN AccessGranted
2461 );
2462
2463 NTSTATUS
2464 STDCALL
2465 ZwPrivilegedServiceAuditAlarm(
2466 IN PUNICODE_STRING SubsystemName,
2467 IN PUNICODE_STRING ServiceName,
2468 IN HANDLE ClientToken,
2469 IN PPRIVILEGE_SET Privileges,
2470 IN BOOLEAN AccessGranted
2471 );
2472
2473 NTSTATUS
2474 STDCALL
2475 NtPrivilegeObjectAuditAlarm(
2476 IN PUNICODE_STRING SubsystemName,
2477 IN PVOID HandleId,
2478 IN HANDLE ClientToken,
2479 IN ULONG DesiredAccess,
2480 IN PPRIVILEGE_SET Privileges,
2481 IN BOOLEAN AccessGranted
2482 );
2483
2484 NTSTATUS
2485 STDCALL
2486 ZwPrivilegeObjectAuditAlarm(
2487 IN PUNICODE_STRING SubsystemName,
2488 IN PVOID HandleId,
2489 IN HANDLE ClientToken,
2490 IN ULONG DesiredAccess,
2491 IN PPRIVILEGE_SET Privileges,
2492 IN BOOLEAN AccessGranted
2493 );
2494
2495 /*
2496 * FUNCTION: Entry point for native applications
2497 * ARGUMENTS:
2498 * Peb = Pointes to the Process Environment Block (PEB)
2499 * REMARKS:
2500 * Native applications should use this function instead of a main.
2501 * Calling proces should terminate itself.
2502 * RETURNS: Status
2503 */
2504 VOID STDCALL
2505 NtProcessStartup(
2506 IN PPEB Peb
2507 );
2508
2509 /*
2510 * FUNCTION: Set the access protection of a range of virtual memory
2511 * ARGUMENTS:
2512 * ProcessHandle = Handle to process owning the virtual address space
2513 * BaseAddress = Start address
2514 * NumberOfBytesToProtect = Delimits the range of virtual memory
2515 * for which the new access protection holds
2516 * NewAccessProtection = The new access proctection for the pages
2517 * OldAccessProtection = Caller should supply storage for the old
2518 * access protection
2519 *
2520 * REMARKS:
2521 * The function maps to the win32 VirtualProtectEx
2522 * RETURNS: Status
2523 */
2524 NTSTATUS
2525 STDCALL
2526 NtProtectVirtualMemory(
2527 IN HANDLE ProcessHandle,
2528 IN PVOID BaseAddress,
2529 IN ULONG NumberOfBytesToProtect,
2530 IN ULONG NewAccessProtection,
2531 OUT PULONG OldAccessProtection
2532 );
2533
2534 NTSTATUS
2535 STDCALL
2536 ZwProtectVirtualMemory(
2537 IN HANDLE ProcessHandle,
2538 IN PVOID BaseAddress,
2539 IN ULONG NumberOfBytesToProtect,
2540 IN ULONG NewAccessProtection,
2541 OUT PULONG OldAccessProtection
2542 );
2543
2544
2545 /*
2546 * FUNCTION: Signals an event and resets it afterwards.
2547 * ARGUMENTS:
2548 * EventHandle = Handle to the event
2549 * PulseCount = Number of times the action is repeated
2550 * RETURNS: Status
2551 */
2552 NTSTATUS
2553 STDCALL
2554 NtPulseEvent(
2555 IN HANDLE EventHandle,
2556 IN PULONG PulseCount OPTIONAL
2557 );
2558
2559 NTSTATUS
2560 STDCALL
2561 ZwPulseEvent(
2562 IN HANDLE EventHandle,
2563 IN PULONG PulseCount OPTIONAL
2564 );
2565
2566 /*
2567 * FUNCTION: Queries the attributes of a file
2568 * ARGUMENTS:
2569 * ObjectAttributes = Initialized attributes for the object
2570 * Buffer = Caller supplies storage for the attributes
2571 * RETURNS: Status
2572 */
2573
2574 NTSTATUS STDCALL
2575 NtQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2576 OUT PFILE_BASIC_INFORMATION FileInformation);
2577
2578 NTSTATUS STDCALL
2579 ZwQueryAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2580 OUT PFILE_BASIC_INFORMATION FileInformation);
2581
2582 /*
2583 * FUNCTION: Queries the default locale id
2584 * ARGUMENTS:
2585 * UserProfile = Type of locale id
2586 * TRUE: thread locale id
2587 * FALSE: system locale id
2588 * DefaultLocaleId = Caller supplies storage for the locale id
2589 * RETURNS: Status
2590 */
2591
2592 NTSTATUS
2593 STDCALL
2594 NtQueryDefaultLocale(
2595 IN BOOLEAN UserProfile,
2596 OUT PLCID DefaultLocaleId
2597 );
2598
2599 NTSTATUS
2600 STDCALL
2601 ZwQueryDefaultLocale(
2602 IN BOOLEAN UserProfile,
2603 OUT PLCID DefaultLocaleId
2604 );
2605
2606 /*
2607 * FUNCTION: Queries a directory file.
2608 * ARGUMENTS:
2609 * FileHandle = Handle to a directory file
2610 * EventHandle = Handle to the event signaled on completion
2611 * ApcRoutine = Asynchroneous procedure callback, called on completion
2612 * ApcContext = Argument to the apc.
2613 * IoStatusBlock = Caller supplies storage for extended status information.
2614 * FileInformation = Caller supplies storage for the resulting information.
2615 *
2616 * FileNameInformation FILE_NAMES_INFORMATION
2617 * FileDirectoryInformation FILE_DIRECTORY_INFORMATION
2618 * FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION
2619 * FileBothDirectoryInformation FILE_BOTH_DIR_INFORMATION
2620 *
2621 * Length = Size of the storage supplied
2622 * FileInformationClass = Indicates the type of information requested.
2623 * ReturnSingleEntry = Specify true if caller only requests the first directory found.
2624 * FileName = Initial directory name to query, that may contain wild cards.
2625 * RestartScan = Number of times the action should be repeated
2626 * RETURNS: Status [ STATUS_SUCCESS, STATUS_ACCESS_DENIED, STATUS_INSUFFICIENT_RESOURCES,
2627 * STATUS_INVALID_PARAMETER, STATUS_INVALID_DEVICE_REQUEST, STATUS_BUFFER_OVERFLOW,
2628 * STATUS_INVALID_INFO_CLASS, STATUS_NO_SUCH_FILE, STATUS_NO_MORE_FILES ]
2629 */
2630
2631 NTSTATUS
2632 STDCALL
2633 NtQueryDirectoryFile(
2634 IN HANDLE FileHandle,
2635 IN HANDLE Event OPTIONAL,
2636 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2637 IN PVOID ApcContext OPTIONAL,
2638 OUT PIO_STATUS_BLOCK IoStatusBlock,
2639 OUT PVOID FileInformation,
2640 IN ULONG Length,
2641 IN FILE_INFORMATION_CLASS FileInformationClass,
2642 IN BOOLEAN ReturnSingleEntry,
2643 IN PUNICODE_STRING FileName OPTIONAL,
2644 IN BOOLEAN RestartScan
2645 );
2646
2647 NTSTATUS
2648 STDCALL
2649 ZwQueryDirectoryFile(
2650 IN HANDLE FileHandle,
2651 IN HANDLE Event OPTIONAL,
2652 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
2653 IN PVOID ApcContext OPTIONAL,
2654 OUT PIO_STATUS_BLOCK IoStatusBlock,
2655 OUT PVOID FileInformation,
2656 IN ULONG Length,
2657 IN FILE_INFORMATION_CLASS FileInformationClass,
2658 IN BOOLEAN ReturnSingleEntry,
2659 IN PUNICODE_STRING FileName OPTIONAL,
2660 IN BOOLEAN RestartScan
2661 );
2662
2663 /*
2664 * FUNCTION: Query information about the content of a directory object
2665 * ARGUMENTS:
2666 DirObjInformation = Buffer must be large enough to hold the name strings too
2667 GetNextIndex = If TRUE :return the index of the next object in this directory in ObjectIndex
2668 If FALSE: return the number of objects in this directory in ObjectIndex
2669 IgnoreInputIndex= If TRUE: ignore input value of ObjectIndex always start at index 0
2670 If FALSE use input value of ObjectIndex
2671 ObjectIndex = zero based index of object in the directory depends on GetNextIndex and IgnoreInputIndex
2672 DataWritten = Actual size of the ObjectIndex ???
2673 * RETURNS: Status
2674 */
2675 NTSTATUS
2676 STDCALL
2677 NtQueryDirectoryObject(
2678 IN HANDLE DirObjHandle,
2679 OUT POBJDIR_INFORMATION DirObjInformation,
2680 IN ULONG BufferLength,
2681 IN BOOLEAN GetNextIndex,
2682 IN BOOLEAN IgnoreInputIndex,
2683 IN OUT PULONG ObjectIndex,
2684 OUT PULONG DataWritten OPTIONAL
2685 );
2686
2687 NTSTATUS
2688 STDCALL
2689 ZwQueryDirectoryObject(
2690 IN HANDLE DirObjHandle,
2691 OUT POBJDIR_INFORMATION DirObjInformation,
2692 IN ULONG BufferLength,
2693 IN BOOLEAN GetNextIndex,
2694 IN BOOLEAN IgnoreInputIndex,
2695 IN OUT PULONG ObjectIndex,
2696 OUT PULONG DataWritten OPTIONAL
2697 );
2698
2699 /*
2700 * FUNCTION: Queries the extended attributes of a file
2701 * ARGUMENTS:
2702 * FileHandle = Handle to the event
2703 * IoStatusBlock = Number of times the action is repeated
2704 * Buffer
2705 * Length
2706 * ReturnSingleEntry
2707 * EaList
2708 * EaListLength
2709 * EaIndex
2710 * RestartScan
2711 * RETURNS: Status
2712 */
2713
2714 NTSTATUS
2715 STDCALL
2716 NtQueryEaFile(
2717 IN HANDLE FileHandle,
2718 OUT PIO_STATUS_BLOCK IoStatusBlock,
2719 OUT PVOID Buffer,
2720 IN ULONG Length,
2721 IN BOOLEAN ReturnSingleEntry,
2722 IN PVOID EaList OPTIONAL,
2723 IN ULONG EaListLength,
2724 IN PULONG EaIndex OPTIONAL,
2725 IN BOOLEAN RestartScan
2726 );
2727
2728 NTSTATUS
2729 STDCALL
2730 ZwQueryEaFile(
2731 IN HANDLE FileHandle,
2732 OUT PIO_STATUS_BLOCK IoStatusBlock,
2733 OUT PVOID Buffer,
2734 IN ULONG Length,
2735 IN BOOLEAN ReturnSingleEntry,
2736 IN PVOID EaList OPTIONAL,
2737 IN ULONG EaListLength,
2738 IN PULONG EaIndex OPTIONAL,
2739 IN BOOLEAN RestartScan
2740 );
2741
2742 /*
2743 * FUNCTION: Queries an event
2744 * ARGUMENTS:
2745 * EventHandle = Handle to the event
2746 * EventInformationClass = Index of the information structure
2747
2748 EventBasicInformation EVENT_BASIC_INFORMATION
2749
2750 * EventInformation = Caller supplies storage for the information structure
2751 * EventInformationLength = Size of the information structure
2752 * ReturnLength = Data written
2753 * RETURNS: Status
2754 */
2755 NTSTATUS
2756 STDCALL
2757 NtQueryEvent(
2758 IN HANDLE EventHandle,
2759 IN EVENT_INFORMATION_CLASS EventInformationClass,
2760 OUT PVOID EventInformation,
2761 IN ULONG EventInformationLength,
2762 OUT PULONG ReturnLength
2763 );
2764 NTSTATUS
2765 STDCALL
2766 ZwQueryEvent(
2767 IN HANDLE EventHandle,
2768 IN EVENT_INFORMATION_CLASS EventInformationClass,
2769 OUT PVOID EventInformation,
2770 IN ULONG EventInformationLength,
2771 OUT PULONG ReturnLength
2772 );
2773
2774 NTSTATUS STDCALL
2775 NtQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2776 OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation);
2777
2778 NTSTATUS STDCALL
2779 ZwQueryFullAttributesFile(IN POBJECT_ATTRIBUTES ObjectAttributes,
2780 OUT PFILE_NETWORK_OPEN_INFORMATION FileInformation);
2781
2782 NTSTATUS
2783 STDCALL
2784 NtQueryInformationAtom(
2785 IN RTL_ATOM Atom,
2786 IN ATOM_INFORMATION_CLASS AtomInformationClass,
2787 OUT PVOID AtomInformation,
2788 IN ULONG AtomInformationLength,
2789 OUT PULONG ReturnLength OPTIONAL
2790 );
2791
2792 NTSTATUS
2793 STDCALL
2794 NtQueryInformationAtom(
2795 IN RTL_ATOM Atom,
2796 IN ATOM_INFORMATION_CLASS AtomInformationClass,
2797 OUT PVOID AtomInformation,
2798 IN ULONG AtomInformationLength,
2799 OUT PULONG ReturnLength OPTIONAL
2800 );
2801
2802
2803 /*
2804 * FUNCTION: Queries the information of a file object.
2805 * ARGUMENTS:
2806 * FileHandle = Handle to the file object
2807 * IoStatusBlock = Caller supplies storage for extended information
2808 * on the current operation.
2809 * FileInformation = Storage for the new file information
2810 * Lenght = Size of the storage for the file information.
2811 * FileInformationClass = Indicates which file information is queried
2812
2813 FileDirectoryInformation FILE_DIRECTORY_INFORMATION
2814 FileFullDirectoryInformation FILE_FULL_DIRECTORY_INFORMATION
2815 FileBothDirectoryInformation FILE_BOTH_DIRECTORY_INFORMATION
2816 FileBasicInformation FILE_BASIC_INFORMATION
2817 FileStandardInformation FILE_STANDARD_INFORMATION
2818 FileInternalInformation FILE_INTERNAL_INFORMATION
2819 FileEaInformation FILE_EA_INFORMATION
2820 FileAccessInformation FILE_ACCESS_INFORMATION
2821 FileNameInformation FILE_NAME_INFORMATION
2822 FileRenameInformation FILE_RENAME_INFORMATION
2823 FileLinkInformation
2824 FileNamesInformation FILE_NAMES_INFORMATION
2825 FileDispositionInformation FILE_DISPOSITION_INFORMATION
2826 FilePositionInformation FILE_POSITION_INFORMATION
2827 FileFullEaInformation FILE_FULL_EA_INFORMATION
2828 FileModeInformation FILE_MODE_INFORMATION
2829 FileAlignmentInformation FILE_ALIGNMENT_INFORMATION
2830 FileAllInformation FILE_ALL_INFORMATION
2831
2832 FileEndOfFileInformation FILE_END_OF_FILE_INFORMATION
2833 FileAlternateNameInformation
2834 FileStreamInformation FILE_STREAM_INFORMATION
2835 FilePipeInformation
2836 FilePipeLocalInformation
2837 FilePipeRemoteInformation
2838 FileMailslotQueryInformation
2839 FileMailslotSetInformation
2840 FileCompressionInformation FILE_COMPRESSION_INFORMATION
2841 FileCopyOnWriteInformation
2842 FileCompletionInformation IO_COMPLETION_CONTEXT
2843 FileMoveClusterInformation
2844 FileOleClassIdInformation
2845 FileOleStateBitsInformation
2846 FileNetworkOpenInformation FILE_NETWORK_OPEN_INFORMATION
2847 FileObjectIdInformation
2848 FileOleAllInformation
2849 FileOleDirectoryInformation
2850 FileContentIndexInformation
2851 FileInheritContentIndexInformation
2852 FileOleInformation
2853 FileMaximumInformation
2854
2855 * REMARK:
2856 * This procedure maps to the win32 GetShortPathName, GetLongPathName,
2857 GetFullPathName, GetFileType, GetFileSize, GetFileTime functions.
2858 * RETURNS: Status
2859 */
2860 NTSTATUS
2861 STDCALL
2862 NtQueryInformationFile(
2863 IN HANDLE FileHandle,
2864 OUT PIO_STATUS_BLOCK IoStatusBlock,
2865 OUT PVOID FileInformation,
2866 IN ULONG Length,
2867 IN FILE_INFORMATION_CLASS FileInformationClass
2868 );
2869
2870 NTSTATUS
2871 STDCALL
2872 ZwQueryInformationFile(
2873 HANDLE FileHandle,
2874 PIO_STATUS_BLOCK IoStatusBlock,
2875 PVOID FileInformation,
2876 ULONG Length,
2877 FILE_INFORMATION_CLASS FileInformationClass
2878 );
2879
2880 /*
2881 * FUNCTION: Queries the information of a process object.
2882 * ARGUMENTS:
2883 * ProcessHandle = Handle to the process object
2884 * ProcessInformation = Index to a certain information structure
2885
2886 ProcessBasicInformation PROCESS_BASIC_INFORMATION
2887 ProcessQuotaLimits QUOTA_LIMITS
2888 ProcessIoCounters IO_COUNTERS
2889 ProcessVmCounters VM_COUNTERS
2890 ProcessTimes KERNEL_USER_TIMES
2891 ProcessBasePriority KPRIORITY
2892 ProcessRaisePriority KPRIORITY
2893 ProcessDebugPort HANDLE
2894 ProcessExceptionPort HANDLE
2895 ProcessAccessToken PROCESS_ACCESS_TOKEN
2896 ProcessLdtInformation LDT_ENTRY ??
2897 ProcessLdtSize ULONG
2898 ProcessDefaultHardErrorMode ULONG
2899 ProcessIoPortHandlers // kernel mode only
2900 ProcessPooledUsageAndLimits POOLED_USAGE_AND_LIMITS
2901 ProcessWorkingSetWatch PROCESS_WS_WATCH_INFORMATION
2902 ProcessUserModeIOPL (I/O Privilege Level)
2903 ProcessEnableAlignmentFaultFixup BOOLEAN
2904 ProcessPriorityClass ULONG
2905 ProcessWx86Information ULONG
2906 ProcessHandleCount ULONG
2907 ProcessAffinityMask ULONG
2908 ProcessPooledQuotaLimits QUOTA_LIMITS
2909 MaxProcessInfoClass
2910
2911 * ProcessInformation = Caller supplies storage for the process information structure
2912 * ProcessInformationLength = Size of the process information structure
2913 * ReturnLength = Actual number of bytes written
2914
2915 * REMARK:
2916 * This procedure maps to the win32 GetProcessTimes, GetProcessVersion,
2917 GetProcessWorkingSetSize, GetProcessPriorityBoost, GetProcessAffinityMask, GetPriorityClass,
2918 GetProcessShutdownParameters functions.
2919 * RETURNS: Status
2920 */
2921
2922 NTSTATUS
2923 STDCALL
2924 NtQueryInformationProcess(
2925 IN HANDLE ProcessHandle,
2926 IN CINT ProcessInformationClass,
2927 OUT PVOID ProcessInformation,
2928 IN ULONG ProcessInformationLength,
2929 OUT PULONG ReturnLength
2930 );
2931
2932 NTSTATUS
2933 STDCALL
2934 ZwQueryInformationProcess(
2935 IN HANDLE ProcessHandle,
2936 IN CINT ProcessInformationClass,
2937 OUT PVOID ProcessInformation,
2938 IN ULONG ProcessInformationLength,
2939 OUT PULONG ReturnLength
2940 );
2941
2942
2943 /*
2944 * FUNCTION: Queries the information of a thread object.
2945 * ARGUMENTS:
2946 * ThreadHandle = Handle to the thread object
2947 * ThreadInformationClass = Index to a certain information structure
2948
2949 ThreadBasicInformation THREAD_BASIC_INFORMATION
2950 ThreadTimes KERNEL_USER_TIMES
2951 ThreadPriority KPRIORITY
2952 ThreadBasePriority KPRIORITY
2953 ThreadAffinityMask KAFFINITY
2954 ThreadImpersonationToken
2955 ThreadDescriptorTableEntry
2956 ThreadEnableAlignmentFaultFixup
2957 ThreadEventPair
2958 ThreadQuerySetWin32StartAddress
2959 ThreadZeroTlsCell
2960 ThreadPerformanceCount
2961 ThreadAmILastThread BOOLEAN
2962 ThreadIdealProcessor ULONG
2963 ThreadPriorityBoost ULONG
2964 MaxThreadInfoClass
2965
2966
2967 * ThreadInformation = Caller supplies torage for the thread information
2968 * ThreadInformationLength = Size of the thread information structure
2969 * ReturnLength = Actual number of bytes written
2970
2971 * REMARK:
2972 * This procedure maps to the win32 GetThreadTimes, GetThreadPriority,
2973 GetThreadPriorityBoost functions.
2974 * RETURNS: Status
2975 */
2976
2977
2978 NTSTATUS
2979 STDCALL
2980 NtQueryInformationThread(
2981 IN HANDLE ThreadHandle,
2982 IN THREADINFOCLASS ThreadInformationClass,
2983 OUT PVOID ThreadInformation,
2984 IN ULONG ThreadInformationLength,
2985 OUT PULONG ReturnLength
2986 );
2987
2988
2989 NTSTATUS
2990 STDCALL
2991 NtQueryInformationToken(
2992 IN HANDLE TokenHandle,
2993 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
2994 OUT PVOID TokenInformation,
2995 IN ULONG TokenInformationLength,
2996 OUT PULONG ReturnLength
2997 );
2998
2999 NTSTATUS
3000 STDCALL
3001 ZwQueryInformationToken(
3002 IN HANDLE TokenHandle,
3003 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
3004 OUT PVOID TokenInformation,
3005 IN ULONG TokenInformationLength,
3006 OUT PULONG ReturnLength
3007 );
3008
3009 /*
3010 * FUNCTION: Query the interval and the clocksource for profiling
3011 * ARGUMENTS:
3012 Interval =
3013 ClockSource =
3014 * RETURNS: Status
3015 */
3016 NTSTATUS
3017 STDCALL
3018 NtQueryIntervalProfile(
3019 OUT PULONG Interval,
3020 OUT KPROFILE_SOURCE ClockSource
3021 );
3022
3023 NTSTATUS
3024 STDCALL
3025 ZwQueryIntervalProfile(
3026 OUT PULONG Interval,
3027 OUT KPROFILE_SOURCE ClockSource
3028 );
3029
3030
3031
3032 NTSTATUS
3033 STDCALL
3034 NtQueryIoCompletion(
3035 IN HANDLE CompletionPort,
3036 IN ULONG CompletionKey,
3037 OUT PIO_STATUS_BLOCK IoStatusBlock,
3038 OUT PULONG NumberOfBytesTransferred
3039 );
3040 NTSTATUS
3041 STDCALL
3042 ZwQueryIoCompletion(
3043 IN HANDLE CompletionPort,
3044 IN ULONG CompletionKey,
3045 OUT PIO_STATUS_BLOCK IoStatusBlock,
3046 OUT PULONG NumberOfBytesTransferred
3047 );
3048
3049
3050 /*
3051 * FUNCTION: Queries the information of a registry key object.
3052 * ARGUMENTS:
3053 KeyHandle = Handle to a registry key
3054 KeyInformationClass = Index to a certain information structure
3055 KeyInformation = Caller supplies storage for resulting information
3056 Length = Size of the supplied storage
3057 ResultLength = Bytes written
3058 */
3059 NTSTATUS
3060 STDCALL
3061 NtQueryKey(
3062 IN HANDLE KeyHandle,
3063 IN KEY_INFORMATION_CLASS KeyInformationClass,
3064 OUT PVOID KeyInformation,
3065 IN ULONG Length,
3066 OUT PULONG ResultLength
3067 );
3068
3069 NTSTATUS
3070 STDCALL
3071 ZwQueryKey(
3072 IN HANDLE KeyHandle,
3073 IN KEY_INFORMATION_CLASS KeyInformationClass,
3074 OUT PVOID KeyInformation,
3075 IN ULONG Length,
3076 OUT PULONG ResultLength
3077 );
3078
3079
3080 // draft
3081
3082 NTSTATUS
3083 STDCALL
3084 NtQueryMultipleValueKey(
3085 IN HANDLE KeyHandle,
3086 IN OUT PKEY_VALUE_ENTRY ValueList,
3087 IN ULONG NumberOfValues,
3088 OUT PVOID Buffer,
3089 IN OUT PULONG Length,
3090 OUT PULONG ReturnLength
3091 );
3092
3093 NTSTATUS
3094 STDCALL
3095 ZwQueryMultipleValueKey(
3096 IN HANDLE KeyHandle,
3097 IN OUT PKEY_VALUE_ENTRY ValueList,
3098 IN ULONG NumberOfValues,
3099 OUT PVOID Buffer,
3100 IN OUT PULONG Length,
3101 OUT PULONG ReturnLength
3102 );
3103
3104 /*
3105 * FUNCTION: Queries the information of a mutant object.
3106 * ARGUMENTS:
3107 MutantHandle = Handle to a mutant
3108 MutantInformationClass = Index to a certain information structure
3109 MutantInformation = Caller supplies storage for resulting information
3110 Length = Size of the supplied storage
3111 ResultLength = Bytes written
3112 */
3113 NTSTATUS
3114 STDCALL
3115 NtQueryMutant(
3116 IN HANDLE MutantHandle,
3117 IN CINT MutantInformationClass,
3118 OUT PVOID MutantInformation,
3119 IN ULONG Length,
3120 OUT PULONG ResultLength
3121 );
3122
3123 NTSTATUS
3124 STDCALL
3125 ZwQueryMutant(
3126 IN HANDLE MutantHandle,
3127 IN CINT MutantInformationClass,
3128 OUT PVOID MutantInformation,
3129 IN ULONG Length,
3130 OUT PULONG ResultLength
3131 );
3132 /*
3133 * FUNCTION: Queries the information of a object.
3134 * ARGUMENTS:
3135 ObjectHandle = Handle to a object
3136 ObjectInformationClass = Index to a certain information structure
3137
3138 ObjectBasicInformation
3139 ObjectTypeInformation OBJECT_TYPE_INFORMATION
3140 ObjectNameInformation OBJECT_NAME_INFORMATION
3141 ObjectDataInformation OBJECT_DATA_INFORMATION
3142
3143 ObjectInformation = Caller supplies storage for resulting information
3144 Length = Size of the supplied storage
3145 ResultLength = Bytes written
3146 */
3147
3148 NTSTATUS
3149 STDCALL
3150 NtQueryObject(
3151 IN HANDLE ObjectHandle,
3152 IN CINT ObjectInformationClass,
3153 OUT PVOID ObjectInformation,
3154 IN ULONG Length,
3155 OUT PULONG ResultLength
3156 );
3157
3158 NTSTATUS
3159 STDCALL
3160 ZwQueryObject(
3161 IN HANDLE ObjectHandle,
3162 IN CINT ObjectInformationClass,
3163 OUT PVOID ObjectInformation,
3164 IN ULONG Length,
3165 OUT PULONG ResultLength
3166 );
3167
3168 /*
3169 * FUNCTION: Queries the system ( high-resolution ) performance counter.
3170 * ARGUMENTS:
3171 * Counter = Performance counter
3172 * Frequency = Performance frequency
3173 * REMARKS:
3174 This procedure queries a tick count faster than 10ms ( The resolution for Intel®-based CPUs is about 0.8 microseconds.)
3175 This procedure maps to the win32 QueryPerformanceCounter, QueryPerformanceFrequency
3176 * RETURNS: Status
3177 *
3178 */
3179 NTSTATUS
3180 STDCALL
3181 NtQueryPerformanceCounter(
3182 IN PLARGE_INTEGER Counter,
3183 IN PLARGE_INTEGER Frequency
3184 );
3185
3186 NTSTATUS
3187 STDCALL
3188 ZwQueryPerformanceCounter(
3189 IN PLARGE_INTEGER Counter,
3190 IN PLARGE_INTEGER Frequency
3191 );
3192 /*
3193 * FUNCTION: Queries the information of a section object.
3194 * ARGUMENTS:
3195 * SectionHandle = Handle to the section link object
3196 * SectionInformationClass = Index to a certain information structure
3197 * SectionInformation (OUT)= Caller supplies storage for resulting information
3198 * Length = Size of the supplied storage
3199 * ResultLength = Data written
3200 * RETURNS: Status
3201 *
3202 */
3203 NTSTATUS
3204 STDCALL
3205 NtQuerySection(
3206 IN HANDLE SectionHandle,
3207 IN CINT SectionInformationClass,
3208 OUT PVOID SectionInformation,
3209 IN ULONG Length,
3210 OUT PULONG ResultLength
3211 );
3212
3213 NTSTATUS
3214 STDCALL
3215 ZwQuerySection(
3216 IN HANDLE SectionHandle,
3217 IN CINT SectionInformationClass,
3218 OUT PVOID SectionInformation,
3219 IN ULONG Length,
3220 OUT PULONG ResultLength
3221 );
3222
3223 NTSTATUS
3224 STDCALL
3225 NtQuerySecurityObject(
3226 IN HANDLE Object,
3227 IN CINT SecurityObjectInformationClass,
3228 OUT PVOID SecurityObjectInformation,
3229 IN ULONG Length,
3230 OUT PULONG ReturnLength
3231 );
3232
3233 NTSTATUS
3234 STDCALL
3235 ZwQuerySecurityObject(
3236 IN HANDLE Object,
3237 IN CINT SecurityObjectInformationClass,
3238 OUT PVOID SecurityObjectInformation,
3239 IN ULONG Length,
3240 OUT PULONG ReturnLength
3241 );
3242
3243
3244 /*
3245 * FUNCTION: Queries the information of a semaphore.
3246 * ARGUMENTS:
3247 * SemaphoreHandle = Handle to the semaphore object
3248 * SemaphoreInformationClass = Index to a certain information structure
3249
3250 SemaphoreBasicInformation SEMAPHORE_BASIC_INFORMATION
3251
3252 * SemaphoreInformation = Caller supplies storage for the semaphore information structure
3253 * Length = Size of the infomation structure
3254 */
3255 NTSTATUS
3256 STDCALL
3257 NtQuerySemaphore(
3258 IN HANDLE SemaphoreHandle,
3259 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
3260 OUT PVOID SemaphoreInformation,
3261 IN ULONG Length,
3262 OUT PULONG ReturnLength
3263 );
3264
3265 NTSTATUS
3266 STDCALL
3267 ZwQuerySemaphore(
3268 IN HANDLE SemaphoreHandle,
3269 IN SEMAPHORE_INFORMATION_CLASS SemaphoreInformationClass,
3270 OUT PVOID SemaphoreInformation,
3271 IN ULONG Length,
3272 OUT PULONG ReturnLength
3273 );
3274
3275
3276 /*
3277 * FUNCTION: Queries the information of a symbolic link object.
3278 * ARGUMENTS:
3279 * SymbolicLinkHandle = Handle to the symbolic link object
3280 * LinkTarget = resolved name of link
3281 * DataWritten = size of the LinkName.
3282 * RETURNS: Status
3283 *
3284 */
3285 NTSTATUS
3286 STDCALL
3287 NtQuerySymbolicLinkObject(
3288 IN HANDLE SymLinkObjHandle,
3289 OUT PUNICODE_STRING LinkTarget,
3290 OUT PULONG DataWritten OPTIONAL
3291 );
3292
3293 NTSTATUS
3294 STDCALL
3295 ZwQuerySymbolicLinkObject(
3296 IN HANDLE SymLinkObjHandle,
3297 OUT PUNICODE_STRING LinkName,
3298 OUT PULONG DataWritten OPTIONAL
3299 );
3300
3301
3302 /*
3303 * FUNCTION: Queries a system environment variable.
3304 * ARGUMENTS:
3305 * Name = Name of the variable
3306 * Value (OUT) = value of the variable
3307 * Length = size of the buffer
3308 * ReturnLength = data written
3309 * RETURNS: Status
3310 *
3311 */
3312 NTSTATUS
3313 STDCALL
3314 NtQuerySystemEnvironmentValue(
3315 IN PUNICODE_STRING Name,
3316 OUT PVOID Value,
3317 ULONG Length,
3318 PULONG ReturnLength
3319 );
3320
3321 NTSTATUS
3322 STDCALL
3323 ZwQuerySystemEnvironmentValue(
3324 IN PUNICODE_STRING Name,
3325 OUT PVOID Value,
3326 ULONG Length,
3327 PULONG ReturnLength
3328 );
3329
3330
3331 /*
3332 * FUNCTION: Queries the system information.
3333 * ARGUMENTS:
3334 * SystemInformationClass = Index to a certain information structure
3335
3336 SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
3337 SystemCacheInformation SYSTEM_CACHE_INFORMATION
3338 SystemConfigurationInformation CONFIGURATION_INFORMATION
3339
3340 * SystemInformation = caller supplies storage for the information structure
3341 * Length = size of the structure
3342 ResultLength = Data written
3343 * RETURNS: Status
3344 *
3345 */
3346 NTSTATUS
3347 STDCALL
3348 NtQuerySystemInformation(
3349 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
3350 OUT PVOID SystemInformation,
3351 IN ULONG Length,
3352 OUT PULONG ResultLength
3353 );
3354
3355 NTSTATUS
3356 STDCALL
3357 ZwQuerySystemInformation(
3358 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
3359 OUT PVOID SystemInformation,
3360 IN ULONG Length,
3361 OUT PULONG ResultLength
3362 );
3363
3364 /*
3365 * FUNCTION: Retrieves the system time
3366 * ARGUMENTS:
3367 * CurrentTime (OUT) = Caller should supply storage for the resulting time.
3368 * RETURNS: Status
3369 *
3370 */
3371
3372 NTSTATUS
3373 STDCALL
3374 NtQuerySystemTime (
3375 OUT TIME *CurrentTime
3376 );
3377
3378 NTSTATUS
3379 STDCALL
3380 ZwQuerySystemTime (
3381 OUT TIME *CurrentTime
3382 );
3383
3384 /*
3385 * FUNCTION: Queries information about a timer
3386 * ARGUMENTS:
3387 * TimerHandle = Handle to the timer
3388 TimerValueInformationClass = Index to a certain information structure
3389 TimerValueInformation = Caller supplies storage for the information structure
3390 Length = Size of the information structure
3391 ResultLength = Data written
3392 * RETURNS: Status
3393 *
3394 */
3395 NTSTATUS
3396 STDCALL
3397 NtQueryTimer(
3398 IN HANDLE TimerHandle,
3399 IN CINT TimerInformationClass,
3400 OUT PVOID TimerInformation,
3401 IN ULONG Length,
3402 OUT PULONG ResultLength
3403 );
3404 NTSTATUS
3405 STDCALL
3406 ZwQueryTimer(
3407 IN HANDLE TimerHandle,
3408 IN CINT TimerInformationClass,
3409 OUT PVOID TimerInformation,
3410 IN ULONG Length,
3411 OUT PULONG ResultLength
3412 );
3413
3414 /*
3415 * FUNCTION: Queries the timer resolution
3416 * ARGUMENTS:
3417 * MinimumResolution (OUT) = Caller should supply storage for the resulting time.
3418 Maximum Resolution (OUT) = Caller should supply storage for the resulting time.
3419 ActualResolution (OUT) = Caller should supply storage for the resulting time.
3420 * RETURNS: Status
3421 *
3422 */
3423
3424
3425 NTSTATUS
3426 STDCALL
3427 NtQueryTimerResolution (
3428 OUT PULONG MinimumResolution,
3429 OUT PULONG MaximumResolution,
3430 OUT PULONG ActualResolution
3431 );
3432
3433 NTSTATUS
3434 STDCALL
3435 ZwQueryTimerResolution (
3436 OUT PULONG MinimumResolution,
3437 OUT PULONG MaximumResolution,
3438 OUT PULONG ActualResolution
3439 );
3440
3441 /*
3442 * FUNCTION: Queries a registry key value
3443 * ARGUMENTS:
3444 * KeyHandle = Handle to the registry key
3445 ValueName = Name of the value in the registry key
3446 KeyValueInformationClass = Index to a certain information structure
3447
3448 KeyValueBasicInformation = KEY_VALUE_BASIC_INFORMATION
3449 KeyValueFullInformation = KEY_FULL_INFORMATION
3450 KeyValuePartialInformation = KEY_VALUE_PARTIAL_INFORMATION
3451
3452 KeyValueInformation = Caller supplies storage for the information structure
3453 Length = Size of the information structure
3454 ResultLength = Data written
3455 * RETURNS: Status
3456 *
3457 */
3458 NTSTATUS
3459 STDCALL
3460 NtQueryValueKey(
3461 IN HANDLE KeyHandle,
3462 IN PUNICODE_STRING ValueName,
3463 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
3464 OUT PVOID KeyValueInformation,
3465 IN ULONG Length,
3466 OUT PULONG ResultLength
3467 );
3468
3469 NTSTATUS
3470 STDCALL
3471 ZwQueryValueKey(
3472 IN HANDLE KeyHandle,
3473 IN PUNICODE_STRING ValueName,
3474 IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
3475 OUT PVOID KeyValueInformation,
3476 IN ULONG Length,
3477 OUT PULONG ResultLength
3478 );
3479
3480
3481
3482
3483 /*
3484 * FUNCTION: Queries the virtual memory information.
3485 * ARGUMENTS:
3486 ProcessHandle = Process owning the virtual address space
3487 BaseAddress = Points to the page where the information is queried for.
3488 * VirtualMemoryInformationClass = Index to a certain information structure
3489
3490 MemoryBasicInformation MEMORY_BASIC_INFORMATION
3491
3492 * VirtualMemoryInformation = caller supplies storage for the information structure
3493 * Length = size of the structure
3494 ResultLength = Data written
3495 * RETURNS: Status
3496 *
3497 */
3498
3499 NTSTATUS
3500 STDCALL
3501 NtQueryVirtualMemory(
3502 IN HANDLE ProcessHandle,
3503 IN PVOID Address,
3504 IN IN CINT VirtualMemoryInformationClass,
3505 OUT PVOID VirtualMemoryInformation,
3506 IN ULONG Length,
3507 OUT PULONG ResultLength
3508 );
3509 NTSTATUS
3510 STDCALL
3511 ZwQueryVirtualMemory(
3512 IN HANDLE ProcessHandle,
3513 IN PVOID Address,
3514 IN IN CINT VirtualMemoryInformationClass,
3515 OUT PVOID VirtualMemoryInformation,
3516 IN ULONG Length,
3517 OUT PULONG ResultLength
3518 );
3519
3520 /*
3521 * FUNCTION: Queries the volume information
3522 * ARGUMENTS:
3523 * FileHandle = Handle to a file object on the target volume
3524 * IoStatusBlock = Caller should supply storage for additional status information
3525 * ReturnLength = DataWritten
3526 * FsInformation = Caller should supply storage for the information structure.
3527 * Length = Size of the information structure
3528 * FsInformationClass = Index to a information structure
3529
3530 FileFsVolumeInformation FILE_FS_VOLUME_INFORMATION
3531 FileFsLabelInformation FILE_FS_LABEL_INFORMATION
3532 FileFsSizeInformation FILE_FS_SIZE_INFORMATION
3533 FileFsDeviceInformation FILE_FS_DEVICE_INFORMATION
3534 FileFsAttributeInformation FILE_FS_ATTRIBUTE_INFORMATION
3535 FileFsControlInformation
3536 FileFsQuotaQueryInformation --
3537 FileFsQuotaSetInformation --
3538 FileFsMaximumInformation
3539
3540 * RETURNS: Status [ STATUS_SUCCESS | STATUS_INSUFFICIENT_RESOURCES | STATUS_INVALID_PARAMETER |
3541 STATUS_INVALID_DEVICE_REQUEST | STATUS_BUFFER_OVERFLOW ]
3542 *
3543 */
3544 NTSTATUS
3545 STDCALL
3546 NtQueryVolumeInformationFile(
3547 IN HANDLE FileHandle,
3548 OUT PIO_STATUS_BLOCK IoStatusBlock,
3549 OUT PVOID FsInformation,
3550 IN ULONG Length,
3551 IN FS_INFORMATION_CLASS FsInformationClass
3552 );
3553
3554 NTSTATUS
3555 STDCALL
3556 ZwQueryVolumeInformationFile(
3557 IN HANDLE FileHandle,
3558 OUT PIO_STATUS_BLOCK IoStatusBlock,
3559 OUT PVOID FsInformation,
3560 IN ULONG Length,
3561 IN FS_INFORMATION_CLASS FsInformationClass
3562 );
3563 // draft
3564 // FIXME: Should I specify if the apc is user or kernel mode somewhere ??
3565 /*
3566 * FUNCTION: Queues a (user) apc to a thread.
3567 * ARGUMENTS:
3568 ThreadHandle = Thread to which the apc is queued.
3569 ApcRoutine = Points to the apc routine
3570 NormalContext = Argument to Apc Routine
3571 * SystemArgument1 = Argument of the Apc Routine
3572 SystemArgument2 = Argument of the Apc Routine
3573 * REMARK: If the apc is queued against a thread of a different process than the calling thread
3574 the apc routine should be specified in the address space of the queued thread's process.
3575 * RETURNS: Status
3576 */
3577
3578 NTSTATUS
3579 STDCALL
3580 NtQueueApcThread(
3581 HANDLE ThreadHandle,
3582 PKNORMAL_ROUTINE ApcRoutine,
3583 PVOID NormalContext,
3584 PVOID SystemArgument1,
3585 PVOID SystemArgument2);
3586
3587 NTSTATUS
3588 STDCALL
3589 ZwQueueApcThread(
3590 HANDLE ThreadHandle,
3591 PKNORMAL_ROUTINE ApcRoutine,
3592 PVOID NormalContext,
3593 PVOID SystemArgument1,
3594 PVOID SystemArgument2);
3595
3596
3597 /*
3598 * FUNCTION: Raises an exception
3599 * ARGUMENTS:
3600 * ExceptionRecord = Structure specifying the exception
3601 * Context = Context in which the excpetion is raised
3602 * IsDebugger =
3603 * RETURNS: Status
3604 *
3605 */
3606
3607 NTSTATUS
3608 STDCALL
3609 NtRaiseException(
3610 IN PEXCEPTION_RECORD ExceptionRecord,
3611 IN PCONTEXT Context,
3612 IN BOOLEAN SearchFrames
3613 );
3614
3615 NTSTATUS
3616 STDCALL
3617 ZwRaiseException(
3618 IN PEXCEPTION_RECORD ExceptionRecord,
3619 IN PCONTEXT Context,
3620 IN BOOLEAN SearchFrames
3621 );
3622
3623 /*
3624 * FUNCTION: Raises a hard error (stops the system)
3625 * ARGUMENTS:
3626 * Status = Status code of the hard error
3627 * Unknown2 = ??
3628 * Unknown3 = ??
3629 * Unknown4 = ??
3630 * Unknown5 = ??
3631 * Unknown6 = ??
3632 * RETURNS: Status
3633 *
3634 */
3635
3636 NTSTATUS
3637 STDCALL
3638 NtRaiseHardError(
3639 IN NTSTATUS Status,
3640 ULONG Unknown2,
3641 ULONG Unknown3,
3642 ULONG Unknown4,
3643 ULONG Unknown5,
3644 ULONG Unknown6
3645 );
3646
3647 NTSTATUS
3648 STDCALL
3649 ZwRaiseHardError(
3650 IN NTSTATUS Status,
3651 ULONG Unknown2,
3652 ULONG Unknown3,
3653 ULONG Unknown4,
3654 ULONG Unknown5,
3655 ULONG Unknown6
3656 );
3657
3658 /*
3659 * FUNCTION: Read a file
3660 * ARGUMENTS:
3661 * FileHandle = Handle of a file to read
3662 * Event = This event is signalled when the read operation completes
3663 * UserApcRoutine = Call back , if supplied Event should be NULL
3664 * UserApcContext = Argument to the callback
3665 * IoStatusBlock = Caller should supply storage for additional status information
3666 * Buffer = Caller should supply storage to receive the information
3667 * BufferLength = Size of the buffer
3668 * ByteOffset = Offset to start reading the file
3669 * Key = If a range is lock a matching key will allow the read to continue.
3670 * RETURNS: Status
3671 *
3672 */
3673
3674 NTSTATUS
3675 STDCALL
3676 NtReadFile(
3677 IN HANDLE FileHandle,
3678 IN HANDLE Event OPTIONAL,
3679 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3680 IN PVOID UserApcContext OPTIONAL,
3681 OUT PIO_STATUS_BLOCK IoStatusBlock,
3682 OUT PVOID Buffer,
3683 IN ULONG BufferLength,
3684 IN PLARGE_INTEGER ByteOffset OPTIONAL,
3685 IN PULONG Key OPTIONAL
3686 );
3687
3688 NTSTATUS
3689 STDCALL
3690 ZwReadFile(
3691 IN HANDLE FileHandle,
3692 IN HANDLE Event OPTIONAL,
3693 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3694 IN PVOID UserApcContext OPTIONAL,
3695 OUT PIO_STATUS_BLOCK IoStatusBlock,
3696 OUT PVOID Buffer,
3697 IN ULONG BufferLength,
3698 IN PLARGE_INTEGER ByteOffset OPTIONAL,
3699 IN PULONG Key OPTIONAL
3700 );
3701 /*
3702 * FUNCTION: Read a file using scattered io
3703 * ARGUMENTS:
3704 FileHandle = Handle of a file to read
3705 Event = This event is signalled when the read operation completes
3706 * UserApcRoutine = Call back , if supplied Event should be NULL
3707 UserApcContext = Argument to the callback
3708 IoStatusBlock = Caller should supply storage for additional status information
3709 BufferDescription = Caller should supply storage to receive the information
3710 BufferLength = Size of the buffer
3711 ByteOffset = Offset to start reading the file
3712 Key = Key = If a range is lock a matching key will allow the read to continue.
3713 * RETURNS: Status
3714 *
3715 */
3716 NTSTATUS
3717 STDCALL
3718 NtReadFileScatter(
3719 IN HANDLE FileHandle,
3720 IN HANDLE Event OPTIONAL,
3721 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3722 IN PVOID UserApcContext OPTIONAL,
3723 OUT PIO_STATUS_BLOCK UserIoStatusBlock,
3724 IN FILE_SEGMENT_ELEMENT BufferDescription[],
3725 IN ULONG BufferLength,
3726 IN PLARGE_INTEGER ByteOffset,
3727 IN PULONG Key OPTIONAL
3728 );
3729
3730 NTSTATUS
3731 STDCALL
3732 ZwReadFileScatter(
3733 IN HANDLE FileHandle,
3734 IN HANDLE Event OPTIONAL,
3735 IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL,
3736 IN PVOID UserApcContext OPTIONAL,
3737 OUT PIO_STATUS_BLOCK UserIoStatusBlock,
3738 IN FILE_SEGMENT_ELEMENT BufferDescription[],
3739 IN ULONG BufferLength,
3740 IN PLARGE_INTEGER ByteOffset,
3741 IN PULONG Key OPTIONAL
3742 );
3743 /*
3744 * FUNCTION: Copies a range of virtual memory to a buffer
3745 * ARGUMENTS:
3746 * ProcessHandle = Specifies the process owning the virtual address space
3747 * BaseAddress = Points to the address of virtual memory to start the read
3748 * Buffer = Caller supplies storage to copy the virtual memory to.
3749 * NumberOfBytesToRead = Limits the range to read
3750 * NumberOfBytesRead = The actual number of bytes read.
3751 * RETURNS: Status
3752 */
3753
3754 NTSTATUS
3755 STDCALL
3756 NtReadVirtualMemory(
3757 IN HANDLE ProcessHandle,
3758 IN PVOID BaseAddress,
3759 OUT PVOID Buffer,
3760 IN ULONG NumberOfBytesToRead,
3761 OUT PULONG NumberOfBytesRead
3762 );
3763 NTSTATUS
3764 STDCALL
3765 ZwReadVirtualMemory(
3766 IN HANDLE ProcessHandle,
3767 IN PVOID BaseAddress,
3768 OUT PVOID Buffer,
3769 IN ULONG NumberOfBytesToRead,
3770 OUT PULONG NumberOfBytesRead
3771 );
3772
3773
3774 /*
3775 * FUNCTION: Debugger can register for thread termination
3776 * ARGUMENTS:
3777 * TerminationPort = Port on which the debugger likes to be notified.
3778 * RETURNS: Status
3779 */
3780 NTSTATUS
3781 STDCALL
3782 NtRegisterThreadTerminatePort(
3783 HANDLE TerminationPort
3784 );
3785 NTSTATUS
3786 STDCALL
3787 ZwRegisterThreadTerminatePort(
3788 HANDLE TerminationPort
3789 );
3790
3791 /*
3792 * FUNCTION: Releases a mutant
3793 * ARGUMENTS:
3794 * MutantHandle = Handle to the mutant
3795 * ReleaseCount =
3796 * RETURNS: Status
3797 */
3798 NTSTATUS
3799 STDCALL
3800 NtReleaseMutant(
3801 IN HANDLE MutantHandle,
3802 IN PULONG ReleaseCount OPTIONAL
3803 );
3804
3805 NTSTATUS
3806 STDCALL
3807 ZwReleaseMutant(
3808 IN HANDLE MutantHandle,
3809 IN PULONG ReleaseCount OPTIONAL
3810 );
3811
3812 /*
3813 * FUNCTION: Releases a semaphore
3814 * ARGUMENTS:
3815 * SemaphoreHandle = Handle to the semaphore object
3816 * ReleaseCount = Number to decrease the semaphore count
3817 * PreviousCount = Previous semaphore count
3818 * RETURNS: Status
3819 */
3820 NTSTATUS
3821 STDCALL
3822 NtReleaseSemaphore(
3823 IN HANDLE SemaphoreHandle,
3824 IN LONG ReleaseCount,
3825 OUT PLONG PreviousCount
3826 );
3827
3828 NTSTATUS
3829 STDCALL
3830 ZwReleaseSemaphore(
3831 IN HANDLE SemaphoreHandle,
3832 IN LONG ReleaseCount,
3833 OUT PLONG PreviousCount
3834 );
3835
3836 /*
3837 * FUNCTION: Removes an io completion
3838 * ARGUMENTS:
3839 * CompletionPort (OUT) = Caller supplied storage for the resulting handle
3840 * CompletionKey = Requested access to the key
3841 * IoStatusBlock = Caller provides storage for extended status information
3842 * CompletionStatus = Current status of the io operation.
3843 * WaitTime = Time to wait if ..
3844 * RETURNS: Status
3845 */
3846 NTSTATUS
3847 STDCALL
3848 NtRemoveIoCompletion(
3849 IN HANDLE CompletionPort,
3850 OUT PULONG CompletionKey,
3851 OUT PIO_STATUS_BLOCK IoStatusBlock,
3852 OUT PULONG CompletionStatus,
3853 IN PLARGE_INTEGER WaitTime
3854 );
3855
3856 NTSTATUS
3857 STDCALL
3858 ZwRemoveIoCompletion(
3859 IN HANDLE CompletionPort,
3860 OUT PULONG CompletionKey,
3861 OUT PIO_STATUS_BLOCK IoStatusBlock,
3862 OUT PULONG CompletionStatus,
3863 IN PLARGE_INTEGER WaitTime
3864 );
3865 /*
3866 * FUNCTION: Replaces one registry key with another
3867 * ARGUMENTS:
3868 * ObjectAttributes = Specifies the attributes of the key
3869 * Key = Handle to the key
3870 * ReplacedObjectAttributes = The function returns the old object attributes
3871 * RETURNS: Status
3872 */
3873 NTSTATUS
3874 STDCALL
3875 NtReplaceKey(
3876 IN POBJECT_ATTRIBUTES ObjectAttributes,
3877 IN HANDLE Key,
3878 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes
3879 );
3880 NTSTATUS
3881 STDCALL
3882 ZwReplaceKey(
3883 IN POBJECT_ATTRIBUTES ObjectAttributes,
3884 IN HANDLE Key,
3885 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes
3886 );
3887
3888 /*
3889 * FUNCTION: Resets a event to a non signaled state
3890 * ARGUMENTS:
3891 * EventHandle = Handle to the event that should be reset
3892 * NumberOfWaitingThreads = The number of threads released.
3893 * RETURNS: Status
3894 */
3895 NTSTATUS
3896 STDCALL
3897 NtResetEvent(
3898 HANDLE EventHandle,
3899 PULONG NumberOfWaitingThreads OPTIONAL
3900 );
3901 NTSTATUS
3902 STDCALL
3903 ZwResetEvent(
3904 HANDLE EventHandle,
3905 PULONG NumberOfWaitingThreads OPTIONAL
3906 );
3907 //draft
3908 NTSTATUS
3909 STDCALL
3910 NtRestoreKey(
3911 HANDLE KeyHandle,
3912 HANDLE FileHandle,
3913 ULONG RestoreFlags
3914 );
3915
3916 NTSTATUS
3917 STDCALL
3918 ZwRestoreKey(
3919 HANDLE KeyHandle,
3920 HANDLE FileHandle,
3921 ULONG RestoreFlags
3922 );
3923 /*
3924 * FUNCTION: Decrements a thread's resume count
3925 * ARGUMENTS:
3926 * ThreadHandle = Handle to the thread that should be resumed
3927 * ResumeCount = The resulting resume count.
3928 * REMARK:
3929 * A thread is resumed if its suspend count is 0. This procedure maps to
3930 * the win32 ResumeThread function. ( documentation about the the suspend count can be found here aswell )
3931 * RETURNS: Status
3932 */
3933 NTSTATUS
3934 STDCALL
3935 NtResumeThread(
3936 IN HANDLE ThreadHandle,
3937 OUT PULONG SuspendCount
3938 );
3939 NTSTATUS
3940 STDCALL
3941 ZwResumeThread(
3942 IN HANDLE ThreadHandle,
3943 OUT PULONG SuspendCount
3944 );
3945 /*
3946 * FUNCTION: Writes the content of a registry key to ascii file
3947 * ARGUMENTS:
3948 * KeyHandle = Handle to the key
3949 * FileHandle = Handle of the file
3950 * REMARKS:
3951 This function maps to the Win32 RegSaveKey.
3952 * RETURNS: Status
3953 */
3954
3955 NTSTATUS
3956 STDCALL
3957 NtSaveKey(
3958 IN HANDLE KeyHandle,
3959 IN HANDLE FileHandle
3960 );
3961 NTSTATUS
3962 STDCALL
3963 ZwSaveKey(
3964 IN HANDLE KeyHandle,
3965 IN HANDLE FileHandle
3966 );
3967
3968 /*
3969 * FUNCTION: Sets the context of a specified thread.
3970 * ARGUMENTS:
3971 * ThreadHandle = Handle to the thread
3972 * Context = The processor context.
3973 * RETURNS: Status
3974 */
3975
3976 NTSTATUS
3977 STDCALL
3978 NtSetContextThread(
3979 IN HANDLE ThreadHandle,
3980 IN PCONTEXT Context
3981 );
3982 NTSTATUS
3983 STDCALL
3984 ZwSetContextThread(
3985 IN HANDLE ThreadHandle,
3986 IN PCONTEXT Context
3987 );
3988
3989 /*
3990 * FUNCTION: Sets the default locale id
3991 * ARGUMENTS:
3992 * UserProfile = Type of locale id
3993 * TRUE: thread locale id
3994 * FALSE: system locale id
3995 * DefaultLocaleId = Locale id
3996 * RETURNS: Status
3997 */
3998
3999 NTSTATUS
4000 STDCALL
4001 NtSetDefaultLocale(
4002 IN BOOLEAN UserProfile,
4003 IN LCID DefaultLocaleId
4004 );
4005
4006 NTSTATUS
4007 STDCALL
4008 ZwSetDefaultLocale(
4009 IN BOOLEAN UserProfile,
4010 IN LCID DefaultLocaleId
4011 );
4012
4013 /*
4014 * FUNCTION: Sets the default hard error port
4015 * ARGUMENTS:
4016 * PortHandle = Handle to the port
4017 * NOTE: The hard error port is used for first change exception handling
4018 * RETURNS: Status
4019 */
4020 NTSTATUS
4021 STDCALL
4022 NtSetDefaultHardErrorPort(
4023 IN HANDLE PortHandle
4024 );
4025 NTSTATUS
4026 STDCALL
4027 ZwSetDefaultHardErrorPort(
4028 IN HANDLE PortHandle
4029 );
4030
4031 /*
4032 * FUNCTION: Sets the extended attributes of a file.
4033 * ARGUMENTS:
4034 * FileHandle = Handle to the file
4035 * IoStatusBlock = Storage for a resulting status and information
4036 * on the current operation.
4037 * EaBuffer = Extended Attributes buffer.
4038 * EaBufferSize = Size of the extended attributes buffer
4039 * RETURNS: Status
4040 */
4041 NTSTATUS
4042 STDCALL
4043 NtSetEaFile(
4044 IN HANDLE FileHandle,
4045 IN PIO_STATUS_BLOCK IoStatusBlock,
4046 PVOID EaBuffer,
4047 ULONG EaBufferSize
4048 );
4049 NTSTATUS
4050 STDCALL
4051 ZwSetEaFile(
4052 IN HANDLE FileHandle,
4053 IN PIO_STATUS_BLOCK IoStatusBlock,
4054 PVOID EaBuffer,
4055 ULONG EaBufferSize
4056 );
4057
4058 //FIXME: should I return the event state ?
4059
4060 /*
4061 * FUNCTION: Sets the event to a signalled state.
4062 * ARGUMENTS:
4063 * EventHandle = Handle to the event
4064 * NumberOfThreadsReleased = The number of threads released
4065 * REMARK:
4066 * This procedure maps to the win32 SetEvent function.
4067 * RETURNS: Status
4068 */
4069
4070 NTSTATUS
4071 STDCALL
4072 NtSetEvent(
4073 IN HANDLE EventHandle,
4074 PULONG NumberOfThreadsReleased
4075 );
4076
4077 NTSTATUS
4078 STDCALL
4079 ZwSetEvent(
4080 IN HANDLE EventHandle,
4081 PULONG NumberOfThreadsReleased
4082 );
4083
4084 /*
4085 * FUNCTION: Sets the high part of an event pair
4086 * ARGUMENTS:
4087 EventPair = Handle to the event pair
4088 * RETURNS: Status
4089 */
4090
4091 NTSTATUS
4092 STDCALL
4093 NtSetHighEventPair(
4094 IN HANDLE EventPairHandle
4095 );
4096
4097 NTSTATUS
4098 STDCALL
4099 ZwSetHighEventPair(
4100 IN HANDLE EventPairHandle
4101 );
4102 /*
4103 * FUNCTION: Sets the high part of an event pair and wait for the low part
4104 * ARGUMENTS:
4105 EventPair = Handle to the event pair
4106 * RETURNS: Status
4107 */
4108 NTSTATUS
4109 STDCALL
4110 NtSetHighWaitLowEventPair(
4111 IN HANDLE EventPairHandle
4112 );
4113 NTSTATUS
4114 STDCALL
4115 ZwSetHighWaitLowEventPair(
4116 IN HANDLE EventPairHandle
4117 );
4118
4119 /*
4120 * FUNCTION: Sets the information of a file object.
4121 * ARGUMENTS:
4122 * FileHandle = Handle to the file object
4123 * IoStatusBlock = Caller supplies storage for extended information
4124 * on the current operation.
4125 * FileInformation = Storage for the new file information
4126 * Lenght = Size of the new file information.
4127 * FileInformationClass = Indicates to a certain information structure
4128
4129 FileNameInformation FILE_NAME_INFORMATION
4130 FileRenameInformation FILE_RENAME_INFORMATION
4131 FileStreamInformation FILE_STREAM_INFORMATION
4132 * FileCompletionInformation IO_COMPLETION_CONTEXT
4133
4134 * REMARK:
4135 * This procedure maps to the win32 SetEndOfFile, SetFileAttributes,
4136 * SetNamedPipeHandleState, SetMailslotInfo functions.
4137 * RETURNS: Status
4138 */
4139
4140
4141 NTSTATUS
4142 STDCALL
4143 NtSetInformationFile(
4144 IN HANDLE FileHandle,
4145 IN PIO_STATUS_BLOCK IoStatusBlock,
4146 IN PVOID FileInformation,
4147 IN ULONG Length,
4148 IN FILE_INFORMATION_CLASS FileInformationClass
4149 );
4150 NTSTATUS
4151 STDCALL
4152 ZwSetInformationFile(
4153 IN HANDLE FileHandle,
4154 IN PIO_STATUS_BLOCK IoStatusBlock,
4155 IN PVOID FileInformation,
4156 IN ULONG Length,
4157 IN FILE_INFORMATION_CLASS FileInformationClass
4158 );
4159
4160
4161
4162 /*
4163 * FUNCTION: Sets the information of a registry key.
4164 * ARGUMENTS:
4165 * KeyHandle = Handle to the registry key
4166 * KeyInformationClass = Index to the a certain information structure.
4167 Can be one of the following values:
4168
4169 * KeyWriteTimeInformation KEY_WRITE_TIME_INFORMATION
4170
4171 KeyInformation = Storage for the new information
4172 * KeyInformationLength = Size of the information strucure
4173 * RETURNS: Status
4174 */
4175
4176 NTSTATUS
4177 STDCALL
4178 NtSetInformationKey(
4179 IN HANDLE KeyHandle,
4180 IN CINT KeyInformationClass,
4181 IN PVOID KeyInformation,
4182 IN ULONG KeyInformationLength
4183 );
4184
4185 NTSTATUS
4186 STDCALL
4187 ZwSetInformationKey(
4188 IN HANDLE KeyHandle,
4189 IN CINT KeyInformationClass,
4190 IN PVOID KeyInformation,
4191 IN ULONG KeyInformationLength
4192 );
4193 /*
4194 * FUNCTION: Changes a set of object specific parameters
4195 * ARGUMENTS:
4196 * ObjectHandle =
4197 * ObjectInformationClass = Index to the set of parameters to change.
4198
4199
4200 ObjectBasicInformation
4201 ObjectTypeInformation OBJECT_TYPE_INFORMATION
4202 ObjectAllInformation
4203 ObjectDataInformation OBJECT_DATA_INFORMATION
4204 ObjectNameInformation OBJECT_NAME_INFORMATION
4205
4206
4207 * ObjectInformation = Caller supplies storage for parameters to set.
4208 * Length = Size of the storage supplied
4209 * RETURNS: Status
4210 */
4211 NTSTATUS
4212 STDCALL
4213 NtSetInformationObject(
4214 IN HANDLE ObjectHandle,
4215 IN CINT ObjectInformationClass,
4216 IN PVOID ObjectInformation,
4217 IN ULONG Length
4218 );
4219
4220 NTSTATUS
4221 STDCALL
4222 ZwSetInformationObject(
4223 IN HANDLE ObjectHandle,
4224 IN CINT ObjectInformationClass,
4225 IN PVOID ObjectInformation,
4226 IN ULONG Length
4227 );
4228
4229 /*
4230 * FUNCTION: Changes a set of process specific parameters
4231 * ARGUMENTS:
4232 * ProcessHandle = Handle to the process
4233 * ProcessInformationClass = Index to a information structure.
4234 *
4235 * ProcessBasicInformation PROCESS_BASIC_INFORMATION
4236 * ProcessQuotaLimits QUOTA_LIMITS
4237 * ProcessBasePriority KPRIORITY
4238 * ProcessRaisePriority KPRIORITY
4239 * ProcessDebugPort HANDLE
4240 * ProcessExceptionPort HANDLE
4241 * ProcessAccessToken PROCESS_ACCESS_TOKEN
4242 * ProcessDefaultHardErrorMode ULONG
4243 * ProcessPriorityClass ULONG
4244 * ProcessAffinityMask KAFFINITY //??
4245 *
4246 * ProcessInformation = Caller supplies storage for information to set.
4247 * ProcessInformationLength = Size of the information structure
4248 * RETURNS: Status
4249 */
4250 NTSTATUS
4251 STDCALL
4252 NtSetInformationProcess(
4253 IN HANDLE ProcessHandle,
4254 IN CINT ProcessInformationClass,
4255 IN PVOID ProcessInformation,
4256 IN ULONG ProcessInformationLength
4257 );
4258 NTSTATUS
4259 STDCALL
4260 ZwSetInformationProcess(
4261 IN HANDLE ProcessHandle,
4262 IN CINT ProcessInformationClass,
4263 IN PVOID ProcessInformation,
4264 IN ULONG ProcessInformationLength
4265 );
4266 /*
4267 * FUNCTION: Changes a set of thread specific parameters
4268 * ARGUMENTS:
4269 * ThreadHandle = Handle to the thread
4270 * ThreadInformationClass = Index to the set of parameters to change.
4271 * Can be one of the following values:
4272 *
4273 * ThreadBasicInformation THREAD_BASIC_INFORMATION
4274 * ThreadPriority KPRIORITY //???
4275 * ThreadBasePriority KPRIORITY
4276 * ThreadAffinityMask KAFFINITY //??
4277 * ThreadImpersonationToken ACCESS_TOKEN
4278 * ThreadIdealProcessor ULONG
4279 * ThreadPriorityBoost ULONG
4280 *
4281 * ThreadInformation = Caller supplies storage for parameters to set.
4282 * ThreadInformationLength = Size of the storage supplied
4283 * RETURNS: Status
4284 */
4285 NTSTATUS
4286 STDCALL
4287 NtSetInformationThread(
4288 IN HANDLE ThreadHandle,
4289 IN THREADINFOCLASS ThreadInformationClass,
4290 IN PVOID ThreadInformation,
4291 IN ULONG ThreadInformationLength
4292 );
4293 NTSTATUS
4294 STDCALL
4295 ZwSetInformationThread(
4296 IN HANDLE ThreadHandle,
4297 IN THREADINFOCLASS ThreadInformationClass,
4298 IN PVOID ThreadInformation,
4299 IN ULONG ThreadInformationLength
4300 );
4301
4302 /*
4303 * FUNCTION: Changes a set of token specific parameters
4304 * ARGUMENTS:
4305 * TokenHandle = Handle to the token
4306 * TokenInformationClass = Index to a certain information structure.
4307 * Can be one of the following values:
4308 *
4309 TokenUser TOKEN_USER
4310 TokenGroups TOKEN_GROUPS
4311 TokenPrivileges TOKEN_PRIVILEGES
4312 TokenOwner TOKEN_OWNER
4313 TokenPrimaryGroup TOKEN_PRIMARY_GROUP
4314 TokenDefaultDacl TOKEN_DEFAULT_DACL
4315 TokenSource TOKEN_SOURCE
4316 TokenType TOKEN_TYPE
4317 TokenImpersonationLevel TOKEN_IMPERSONATION_LEVEL
4318 TokenStatistics TOKEN_STATISTICS
4319 *
4320 * TokenInformation = Caller supplies storage for information structure.
4321 * TokenInformationLength = Size of the information structure
4322 * RETURNS: Status
4323 */
4324
4325 NTSTATUS
4326 STDCALL
4327 NtSetInformationToken(
4328 IN HANDLE TokenHandle,
4329 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
4330 OUT PVOID TokenInformation,
4331 IN ULONG TokenInformationLength
4332 );
4333
4334 NTSTATUS
4335 STDCALL
4336 ZwSetInformationToken(
4337 IN HANDLE TokenHandle,
4338 IN TOKEN_INFORMATION_CLASS TokenInformationClass,
4339 OUT PVOID TokenInformation,
4340 IN ULONG TokenInformationLength
4341 );
4342
4343
4344 /*
4345 * FUNCTION: Sets an io completion
4346 * ARGUMENTS:
4347 * CompletionPort =
4348 * CompletionKey =
4349 * IoStatusBlock =
4350 * NumberOfBytesToTransfer =
4351 * NumberOfBytesTransferred =
4352 * RETURNS: Status
4353 */
4354 NTSTATUS
4355 STDCALL
4356 NtSetIoCompletion(
4357 IN HANDLE CompletionPort,
4358 IN ULONG CompletionKey,
4359 OUT PIO_STATUS_BLOCK IoStatusBlock,
4360 IN ULONG NumberOfBytesToTransfer,
4361 OUT PULONG NumberOfBytesTransferred
4362 );
4363 NTSTATUS
4364 STDCALL
4365 ZwSetIoCompletion(
4366 IN HANDLE CompletionPort,
4367 IN ULONG CompletionKey,
4368 OUT PIO_STATUS_BLOCK IoStatusBlock,
4369 IN ULONG NumberOfBytesToTransfer,
4370 OUT PULONG NumberOfBytesTransferred
4371 );
4372
4373 /*
4374 * FUNCTION: Set properties for profiling
4375 * ARGUMENTS:
4376 * Interval =
4377 * ClockSource =
4378 * RETURNS: Status
4379 *
4380 */
4381
4382 NTSTATUS
4383 STDCALL
4384 NtSetIntervalProfile(
4385 ULONG Interval,
4386 KPROFILE_SOURCE ClockSource
4387 );
4388
4389 NTSTATUS
4390 STDCALL
4391 ZwSetIntervalProfile(
4392 ULONG Interval,
4393 KPROFILE_SOURCE ClockSource
4394 );
4395
4396
4397 /*
4398 * FUNCTION: Sets the low part of an event pair
4399 * ARGUMENTS:
4400 EventPair = Handle to the event pair
4401 * RETURNS: Status
4402 */
4403
4404 NTSTATUS
4405 STDCALL
4406 NtSetLowEventPair(
4407 HANDLE EventPair
4408 );
4409 NTSTATUS
4410 STDCALL
4411 ZwSetLowEventPair(
4412 HANDLE EventPair
4413 );
4414 /*
4415 * FUNCTION: Sets the low part of an event pair and wait for the high part
4416 * ARGUMENTS:
4417 EventPair = Handle to the event pair
4418 * RETURNS: Status
4419 */
4420 NTSTATUS
4421 STDCALL
4422 NtSetLowWaitHighEventPair(
4423 HANDLE EventPair
4424 );
4425 NTSTATUS
4426 STDCALL
4427 ZwSetLowWaitHighEventPair(
4428 HANDLE EventPair
4429 );
4430
4431 NTSTATUS
4432 STDCALL
4433 NtSetSecurityObject(
4434 IN HANDLE Handle,
4435 IN SECURITY_INFORMATION SecurityInformation,
4436 IN PSECURITY_DESCRIPTOR SecurityDescriptor
4437 );
4438
4439 NTSTATUS
4440 STDCALL
4441 ZwSetSecurityObject(
4442 IN HANDLE Handle,
4443 IN SECURITY_INFORMATION SecurityInformation,
4444 IN PSECURITY_DESCRIPTOR SecurityDescriptor
4445 );
4446
4447
4448 /*
4449 * FUNCTION: Sets a system environment variable
4450 * ARGUMENTS:
4451 * ValueName = Name of the environment variable
4452 * Value = Value of the environment variable
4453 * RETURNS: Status
4454 */
4455 NTSTATUS
4456 STDCALL
4457 NtSetSystemEnvironmentValue(
4458 IN PUNICODE_STRING VariableName,
4459 IN PUNICODE_STRING Value
4460 );
4461 NTSTATUS
4462 STDCALL
4463 ZwSetSystemEnvironmentValue(
4464 IN PUNICODE_STRING VariableName,
4465 IN PUNICODE_STRING Value
4466 );
4467 /*
4468 * FUNCTION: Sets system parameters
4469 * ARGUMENTS:
4470 * SystemInformationClass = Index to a particular set of system parameters
4471 * Can be one of the following values:
4472 *
4473 * SystemTimeAdjustmentInformation SYSTEM_TIME_ADJUSTMENT
4474 *
4475 * SystemInformation = Structure containing the parameters.
4476 * SystemInformationLength = Size of the structure.
4477 * RETURNS: Status
4478 */
4479 NTSTATUS
4480 STDCALL
4481 NtSetSystemInformation(
4482 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
4483 IN PVOID SystemInformation,
4484 IN ULONG SystemInformationLength
4485 );
4486
4487 NTSTATUS
4488 STDCALL
4489 ZwSetSystemInformation(
4490 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
4491 IN PVOID SystemInformation,
4492 IN ULONG SystemInformationLength
4493 );
4494
4495 /*
4496 * FUNCTION: Sets the system time
4497 * ARGUMENTS:
4498 * SystemTime = Old System time
4499 * NewSystemTime = New System time
4500 * RETURNS: Status
4501 */
4502 NTSTATUS
4503 STDCALL
4504 NtSetSystemTime(
4505 IN PLARGE_INTEGER SystemTime,
4506 IN PLARGE_INTEGER NewSystemTime OPTIONAL
4507 );
4508 NTSTATUS
4509 STDCALL
4510 ZwSetSystemTime(
4511 IN PLARGE_INTEGER SystemTime,
4512 IN PLARGE_INTEGER NewSystemTime OPTIONAL
4513 );
4514 /*
4515 * FUNCTION: Sets the characteristics of a timer
4516 * ARGUMENTS:
4517 * TimerHandle = Handle to the timer
4518 * DueTime = Time before the timer becomes signalled for the first time.
4519 * TimerApcRoutine = Completion routine can be called on time completion
4520 * TimerContext = Argument to the completion routine
4521 * Resume = Specifies if the timer should repeated after completing one cycle
4522 * Period = Cycle of the timer
4523 * REMARKS: This routine maps to the win32 SetWaitableTimer.
4524 * RETURNS: Status
4525 */
4526 NTSTATUS
4527 STDCALL
4528 NtSetTimer(
4529 IN HANDLE TimerHandle,
4530 IN PLARGE_INTEGER DueTime,
4531 IN PTIMERAPCROUTINE TimerApcRoutine,
4532 IN PVOID TimerContext,
4533 IN BOOL WakeTimer,
4534 IN ULONG Period OPTIONAL,
4535 OUT PBOOLEAN PreviousState OPTIONAL
4536 );
4537 NTSTATUS
4538 STDCALL
4539 ZwSetTimer(
4540 IN HANDLE TimerHandle,
4541 IN PLARGE_INTEGER DueTime,
4542 IN PTIMERAPCROUTINE TimerApcRoutine,
4543 IN PVOID TimerContext,
4544 IN BOOL WakeTimer,
4545 IN ULONG Period OPTIONAL,
4546 OUT PBOOLEAN PreviousState OPTIONAL
4547 );
4548
4549 /*
4550 * FUNCTION: Sets the frequency of the system timer
4551 * ARGUMENTS:
4552 * RequestedResolution =
4553 * SetOrUnset =
4554 * ActualResolution =
4555 * RETURNS: Status
4556 */
4557 NTSTATUS
4558 STDCALL
4559 NtSetTimerResolution(
4560 IN ULONG RequestedResolution,
4561 IN BOOL SetOrUnset,
4562 OUT PULONG ActualResolution
4563 );
4564 NTSTATUS
4565 STDCALL
4566 ZwSetTimerResolution(
4567 IN ULONG RequestedResolution,
4568 IN BOOL SetOrUnset,
4569 OUT PULONG ActualResolution
4570 );
4571
4572 /*
4573 * FUNCTION: Sets the value of a registry key
4574 * ARGUMENTS:
4575 * KeyHandle = Handle to a registry key
4576 * ValueName = Name of the value entry to change
4577 * TitleIndex = pointer to a structure containing the new volume information
4578 * Type = Type of the registry key. Can be one of the values:
4579 * REG_BINARY Unspecified binary data
4580 * REG_DWORD A 32 bit value
4581 * REG_DWORD_LITTLE_ENDIAN Same as REG_DWORD
4582 * REG_DWORD_BIG_ENDIAN A 32 bit value whose least significant byte is at the highest address
4583 * REG_EXPAND_SZ A zero terminated wide character string with unexpanded environment variables ( "%PATH%" )
4584 * REG_LINK A zero terminated wide character string referring to a symbolic link.
4585 * REG_MULTI_SZ A series of zero-terminated strings including a additional trailing zero
4586 * REG_NONE Unspecified type
4587 * REG_SZ A wide character string ( zero terminated )
4588 * REG_RESOURCE_LIST ??
4589 * REG_RESOURCE_REQUIREMENTS_LIST ??
4590 * REG_FULL_RESOURCE_DESCRIPTOR ??
4591 * Data = Contains the data for the registry key.
4592 * DataSize = size of the data.
4593 * RETURNS: Status
4594 */
4595 NTSTATUS
4596 STDCALL
4597 NtSetValueKey(
4598 IN HANDLE KeyHandle,
4599 IN PUNICODE_STRING ValueName,
4600 IN ULONG TitleIndex OPTIONAL,
4601 IN ULONG Type,
4602 IN PVOID Data,
4603 IN ULONG DataSize
4604 );
4605 NTSTATUS
4606 STDCALL
4607 ZwSetValueKey(
4608 IN HANDLE KeyHandle,
4609 IN PUNICODE_STRING ValueName,
4610 IN ULONG TitleIndex OPTIONAL,
4611 IN ULONG Type,
4612 IN PVOID Data,
4613 IN ULONG DataSize
4614 );
4615
4616 /*
4617 * FUNCTION: Sets the volume information.
4618 * ARGUMENTS:
4619 * FileHandle = Handle to the file
4620 * IoStatusBlock = Caller should supply storage for additional status information
4621 * VolumeInformation = pointer to a structure containing the new volume information
4622 * Length = size of the structure.
4623 * VolumeInformationClass = specifies the particular volume information to set
4624 * RETURNS: Status
4625 */
4626 NTSTATUS
4627 STDCALL
4628 NtSetVolumeInformationFile(
4629 IN HANDLE FileHandle,
4630 OUT PIO_STATUS_BLOCK IoStatusBlock,
4631 IN PVOID FsInformation,
4632 IN ULONG Length,
4633 IN FS_INFORMATION_CLASS FsInformationClass
4634 );
4635
4636 NTSTATUS
4637 STDCALL
4638 ZwSetVolumeInformationFile(
4639 IN HANDLE FileHandle,
4640 OUT PIO_STATUS_BLOCK IoStatusBlock,
4641 IN PVOID FsInformation,
4642 IN ULONG Length,
4643 IN FS_INFORMATION_CLASS FsInformationClass
4644 );
4645
4646 /*
4647 * FUNCTION: Shuts the system down
4648 * ARGUMENTS:
4649 * Action = Specifies the type of shutdown, it can be one of the following values:
4650 * ShutdownNoReboot, ShutdownReboot, ShutdownPowerOff
4651 * RETURNS: Status
4652 */
4653 NTSTATUS
4654 STDCALL
4655 NtShutdownSystem(
4656 IN SHUTDOWN_ACTION Action
4657 );
4658
4659 NTSTATUS
4660 STDCALL
4661 ZwShutdownSystem(
4662 IN SHUTDOWN_ACTION Action
4663 );
4664
4665
4666 /* --- PROFILING --- */
4667
4668 /*
4669 * FUNCTION: Starts profiling
4670 * ARGUMENTS:
4671 * ProfileHandle = Handle to the profile
4672 * RETURNS: Status
4673 */
4674
4675 NTSTATUS
4676 STDCALL
4677 NtStartProfile(
4678 HANDLE ProfileHandle
4679 );
4680
4681 NTSTATUS
4682 STDCALL
4683 ZwStartProfile(
4684 HANDLE ProfileHandle
4685 );
4686
4687 /*
4688 * FUNCTION: Stops profiling
4689 * ARGUMENTS:
4690 * ProfileHandle = Handle to the profile
4691 * RETURNS: Status
4692 */
4693
4694 NTSTATUS
4695 STDCALL
4696 NtStopProfile(
4697 HANDLE ProfileHandle
4698 );
4699
4700 NTSTATUS
4701 STDCALL
4702 ZwStopProfile(
4703 HANDLE ProfileHandle
4704 );
4705
4706 /* --- PROCESS MANAGEMENT --- */
4707
4708 //--NtSystemDebugControl
4709 /*
4710 * FUNCTION: Terminates the execution of a process.
4711 * ARGUMENTS:
4712 * ThreadHandle = Handle to the process
4713 * ExitStatus = The exit status of the process to terminate with.
4714 * REMARKS
4715 Native applications should kill themselves using this function.
4716 * RETURNS: Status
4717 */
4718 NTSTATUS
4719 STDCALL
4720 NtTerminateProcess(
4721 IN HANDLE ProcessHandle ,
4722 IN NTSTATUS ExitStatus
4723 );
4724 NTSTATUS
4725 STDCALL
4726 ZwTerminateProcess(
4727 IN HANDLE ProcessHandle ,
4728 IN NTSTATUS ExitStatus
4729 );
4730
4731 /* --- DEVICE DRIVER CONTROL --- */
4732
4733 /*
4734 * FUNCTION: Unloads a driver.
4735 * ARGUMENTS:
4736 * DriverServiceName = Name of the driver to unload
4737 * RETURNS: Status
4738 */
4739 NTSTATUS
4740 STDCALL
4741 NtUnloadDriver(
4742 IN PUNICODE_STRING DriverServiceName
4743 );
4744 NTSTATUS
4745 STDCALL
4746 ZwUnloadDriver(
4747 IN PUNICODE_STRING DriverServiceName
4748 );
4749
4750 /* --- VIRTUAL MEMORY MANAGEMENT --- */
4751
4752 /*
4753 * FUNCTION: Writes a range of virtual memory
4754 * ARGUMENTS:
4755 * ProcessHandle = The handle to the process owning the address space.
4756 * BaseAddress = The points to the address to write to
4757 * Buffer = Pointer to the buffer to write
4758 * NumberOfBytesToWrite = Offset to the upper boundary to write
4759 * NumberOfBytesWritten = Total bytes written
4760 * REMARKS:
4761 * This function maps to the win32 WriteProcessMemory
4762 * RETURNS: Status
4763 */
4764 NTSTATUS
4765 STDCALL
4766 NtWriteVirtualMemory(
4767 IN HANDLE ProcessHandle,
4768 IN PVOID BaseAddress,
4769 IN PVOID Buffer,
4770 IN ULONG NumberOfBytesToWrite,
4771 OUT PULONG NumberOfBytesWritten
4772 );
4773
4774 NTSTATUS
4775 STDCALL
4776 ZwWriteVirtualMemory(
4777 IN HANDLE ProcessHandle,
4778 IN PVOID BaseAddress,
4779 IN PVOID Buffer,
4780 IN ULONG NumberOfBytesToWrite,
4781 OUT PULONG NumberOfBytesWritten
4782 );
4783
4784 /*
4785 * FUNCTION: Unlocks a range of virtual memory.
4786 * ARGUMENTS:
4787 * ProcessHandle = Handle to the process
4788 * BaseAddress = Lower boundary of the range of bytes to unlock.
4789 * NumberOfBytesToUnlock = Offset to the upper boundary to unlock.
4790 * NumberOfBytesUnlocked (OUT) = Number of bytes actually unlocked.
4791 * REMARK:
4792 This procedure maps to the win32 procedure VirtualUnlock
4793 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PAGE_WAS_ULOCKED ]
4794 */
4795 NTSTATUS
4796 STDCALL
4797 NtUnlockVirtualMemory(
4798 IN HANDLE ProcessHandle,
4799 IN PVOID BaseAddress,
4800 IN ULONG NumberOfBytesToUnlock,
4801 OUT PULONG NumberOfBytesUnlocked OPTIONAL
4802 );
4803
4804 NTSTATUS
4805 STDCALL
4806 ZwUnlockVirtualMemory(
4807 IN HANDLE ProcessHandle,
4808 IN PVOID BaseAddress,
4809 IN ULONG NumberOfBytesToUnlock,
4810 OUT PULONG NumberOfBytesUnlocked OPTIONAL
4811 );
4812 /*
4813 * FUNCTION: Unmaps a piece of virtual memory backed by a file.
4814 * ARGUMENTS:
4815 * ProcessHandle = Handle to the process
4816 * BaseAddress = The address where the mapping begins
4817 * REMARK:
4818 This procedure maps to the win32 UnMapViewOfFile
4819 * RETURNS: Status
4820 */
4821 NTSTATUS
4822 STDCALL
4823 NtUnmapViewOfSection(
4824 IN HANDLE ProcessHandle,
4825 IN PVOID BaseAddress
4826 );
4827 NTSTATUS
4828 STDCALL
4829 ZwUnmapViewOfSection(
4830 IN HANDLE ProcessHandle,
4831 IN PVOID BaseAddress
4832 );
4833
4834 /* --- OBJECT SYNCHRONIZATION --- */
4835
4836 /*
4837 * FUNCTION: Signals an object and wait for an other one.
4838 * ARGUMENTS:
4839 * SignalObject = Handle to the object that should be signaled
4840 * WaitObject = Handle to the object that should be waited for
4841 * Alertable = True if the wait is alertable
4842 * Time = The time to wait
4843 * RETURNS: Status
4844 */
4845 NTSTATUS
4846 STDCALL
4847 NtSignalAndWaitForSingleObject(
4848 IN HANDLE SignalObject,
4849 IN HANDLE WaitObject,
4850 IN BOOLEAN Alertable,
4851 IN PLARGE_INTEGER Time
4852 );
4853
4854 NTSTATUS
4855 STDCALL
4856 NtSignalAndWaitForSingleObject(
4857 IN HANDLE SignalObject,
4858 IN HANDLE WaitObject,
4859 IN BOOLEAN Alertable,
4860 IN PLARGE_INTEGER Time
4861 );
4862
4863 /*
4864 * FUNCTION: Waits for multiple objects to become signalled.
4865 * ARGUMENTS:
4866 * Count = The number of objects
4867 * Object = The array of object handles
4868 * WaitType = Can be one of the values UserMode or KernelMode
4869 * Alertable = If true the wait is alertable.
4870 * Time = The maximum wait time.
4871 * REMARKS:
4872 * This function maps to the win32 WaitForMultipleObjectEx.
4873 * RETURNS: Status
4874 */
4875 NTSTATUS
4876 STDCALL
4877 NtWaitForMultipleObjects (
4878 IN ULONG Count,
4879 IN HANDLE Object[],
4880 IN CINT WaitType,
4881 IN BOOLEAN Alertable,
4882 IN PLARGE_INTEGER Time
4883 );
4884
4885 NTSTATUS
4886 STDCALL
4887 ZwWaitForMultipleObjects (
4888 IN ULONG Count,
4889 IN HANDLE Object[],
4890 IN CINT WaitType,
4891 IN BOOLEAN Alertable,
4892 IN PLARGE_INTEGER Time
4893 );
4894
4895 /*
4896 * FUNCTION: Waits for an object to become signalled.
4897 * ARGUMENTS:
4898 * Object = The object handle
4899 * Alertable = If true the wait is alertable.
4900 * Time = The maximum wait time.
4901 * REMARKS:
4902 * This function maps to the win32 WaitForSingleObjectEx.
4903 * RETURNS: Status
4904 */
4905 NTSTATUS
4906 STDCALL
4907 NtWaitForSingleObject (
4908 IN HANDLE Object,
4909 IN BOOLEAN Alertable,
4910 IN PLARGE_INTEGER Time
4911 );
4912
4913 NTSTATUS
4914 STDCALL
4915 ZwWaitForSingleObject (
4916 IN HANDLE Object,
4917 IN BOOLEAN Alertable,
4918 IN PLARGE_INTEGER Time
4919 );
4920
4921 /* --- EVENT PAIR OBJECT --- */
4922
4923 /*
4924 * FUNCTION: Waits for the high part of an eventpair to become signalled
4925 * ARGUMENTS:
4926 * EventPairHandle = Handle to the event pair.
4927 * RETURNS: Status
4928 */
4929
4930 NTSTATUS
4931 STDCALL
4932 NtWaitHighEventPair(
4933 IN HANDLE EventPairHandle
4934 );
4935
4936 NTSTATUS
4937 STDCALL
4938 ZwWaitHighEventPair(
4939 IN HANDLE EventPairHandle
4940 );
4941
4942 /*
4943 * FUNCTION: Waits for the low part of an eventpair to become signalled
4944 * ARGUMENTS:
4945 * EventPairHandle = Handle to the event pair.
4946 * RETURNS: Status
4947 */
4948 NTSTATUS
4949 STDCALL
4950 NtWaitLowEventPair(
4951 IN HANDLE EventPairHandle
4952 );
4953
4954 NTSTATUS
4955 STDCALL
4956 ZwWaitLowEventPair(
4957 IN HANDLE EventPairHandle
4958 );
4959
4960 /* --- FILE MANAGEMENT --- */
4961
4962 /*
4963 * FUNCTION: Unlocks a range of bytes in a file.
4964 * ARGUMENTS:
4965 * FileHandle = Handle to the file
4966 * IoStatusBlock = Caller should supply storage for a structure containing
4967 * the completion status and information about the requested unlock operation.
4968 The information field is set to the number of bytes unlocked.
4969 * ByteOffset = Offset to start the range of bytes to unlock
4970 * Length = Number of bytes to unlock.
4971 * Key = Special value to enable other threads to unlock a file than the
4972 thread that locked the file. The key supplied must match with the one obtained
4973 in a previous call to NtLockFile.
4974 * REMARK:
4975 This procedure maps to the win32 procedure UnlockFileEx. STATUS_PENDING is returned if the lock could
4976 not be obtained immediately, the device queue is busy and the IRP is queued.
4977 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
4978 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_RANGE_NOT_LOCKED ]
4979 */
4980 NTSTATUS
4981 STDCALL
4982 NtUnlockFile(
4983 IN HANDLE FileHandle,
4984 OUT PIO_STATUS_BLOCK IoStatusBlock,
4985 IN PLARGE_INTEGER ByteOffset,
4986 IN PLARGE_INTEGER Lenght,
4987 OUT PULONG Key OPTIONAL
4988 );
4989 NTSTATUS
4990 STDCALL
4991 ZwUnlockFile(
4992 IN HANDLE FileHandle,
4993 OUT PIO_STATUS_BLOCK IoStatusBlock,
4994 IN PLARGE_INTEGER ByteOffset,
4995 IN PLARGE_INTEGER Lenght,
4996 OUT PULONG Key OPTIONAL
4997 );
4998
4999 /*
5000 * FUNCTION: Writes data to a file
5001 * ARGUMENTS:
5002 * FileHandle = The handle a file ( from NtCreateFile )
5003 * Event = Specifies a event that will become signalled when the write operation completes.
5004 * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ]
5005 * ApcContext = Argument to the Apc Routine
5006 * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation.
5007 * Buffer = Caller should supply storage for a buffer that will contain the information to be written to file.
5008 * Length = Size in bytest of the buffer
5009 * 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.
5010 * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if
5011 * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset
5012 * should be created by specifying FILE_USE_FILE_POINTER_POSITION.
5013 * Key = Unused
5014 * REMARKS:
5015 * This function maps to the win32 WriteFile.
5016 * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL.
5017 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES
5018 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ]
5019 */
5020 NTSTATUS
5021 STDCALL
5022 NtWriteFile(
5023 IN HANDLE FileHandle,
5024 IN HANDLE Event OPTIONAL,
5025 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
5026 IN PVOID ApcContext OPTIONAL,
5027 OUT PIO_STATUS_BLOCK IoStatusBlock,
5028 IN PVOID Buffer,
5029 IN ULONG Length,
5030 IN PLARGE_INTEGER ByteOffset,
5031 IN PULONG Key OPTIONAL
5032 );
5033
5034 NTSTATUS
5035 STDCALL
5036 ZwWriteFile(
5037 IN HANDLE FileHandle,
5038 IN HANDLE Event OPTIONAL,
5039 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
5040 IN PVOID ApcContext OPTIONAL,
5041 OUT PIO_STATUS_BLOCK IoStatusBlock,
5042 IN PVOID Buffer,
5043 IN ULONG Length,
5044 IN PLARGE_INTEGER ByteOffset ,
5045 IN PULONG Key OPTIONAL
5046 );
5047
5048 /*
5049 * FUNCTION: Writes a file
5050 * ARGUMENTS:
5051 * FileHandle = The handle of the file
5052 * Event =
5053 * ApcRoutine = Asynchroneous Procedure Callback [ Should not be used by device drivers ]
5054 * ApcContext = Argument to the Apc Routine
5055 * IoStatusBlock = Caller should supply storage for a structure containing the completion status and information about the requested write operation.
5056 * BufferDescription = Caller should supply storage for a buffer that will contain the information to be written to file.
5057 * BufferLength = Size in bytest of the buffer
5058 * 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.
5059 * BytesOffset is ignored if the file is created with FILE_APPEND_DATA in the DesiredAccess. BytesOffset is also ignored if
5060 * the file is created with CreateOptions flags FILE_SYNCHRONOUS_IO_ALERT or FILE_SYNCHRONOUS_IO_NONALERT set, in that case a offset
5061 * should be created by specifying FILE_USE_FILE_POINTER_POSITION. Use FILE_WRITE_TO_END_OF_FILE to write to the EOF.
5062 * Key = If a matching key [ a key provided at NtLockFile ] is provided the write operation will continue even if a byte range is locked.
5063 * REMARKS:
5064 * This function maps to the win32 WriteFile.
5065 * Callers to NtWriteFile should run at IRQL PASSIVE_LEVEL.
5066 * RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES
5067 STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST | STATUS_FILE_LOCK_CONFLICT ]
5068 */
5069
5070 NTSTATUS
5071 STDCALL
5072 NtWriteFileGather(
5073 IN HANDLE FileHandle,
5074 IN HANDLE Event OPTIONAL,
5075 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
5076 IN PVOID ApcContext OPTIONAL,
5077 OUT PIO_STATUS_BLOCK IoStatusBlock,
5078 IN FILE_SEGMENT_ELEMENT BufferDescription[],
5079 IN ULONG BufferLength,
5080 IN PLARGE_INTEGER ByteOffset,
5081 IN PULONG Key OPTIONAL
5082 );
5083
5084 NTSTATUS
5085 STDCALL
5086 ZwWriteFileGather(
5087 IN HANDLE FileHandle,
5088 IN HANDLE Event OPTIONAL,
5089 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
5090 IN PVOID ApcContext OPTIONAL,
5091 OUT PIO_STATUS_BLOCK IoStatusBlock,
5092 IN FILE_SEGMENT_ELEMENT BufferDescription[],
5093 IN ULONG BufferLength,
5094 IN PLARGE_INTEGER ByteOffset,
5095 IN PULONG Key OPTIONAL
5096 );
5097
5098
5099 /* --- THREAD MANAGEMENT --- */
5100
5101 /*
5102 * FUNCTION: Increments a thread's resume count
5103 * ARGUMENTS:
5104 * ThreadHandle = Handle to the thread that should be resumed
5105 * PreviousSuspendCount = The resulting/previous suspend count.
5106 * REMARK:
5107 * A thread will be suspended if its suspend count is greater than 0. This procedure maps to
5108 * the win32 SuspendThread function. ( documentation about the the suspend count can be found here aswell )
5109 * The suspend count is not increased if it is greater than MAXIMUM_SUSPEND_COUNT.
5110 * RETURNS: Status
5111 */
5112 NTSTATUS
5113 STDCALL
5114 NtSuspendThread(
5115 IN HANDLE ThreadHandle,
5116 IN PULONG PreviousSuspendCount
5117 );
5118
5119 NTSTATUS
5120 STDCALL
5121 ZwSuspendThread(
5122 IN HANDLE ThreadHandle,
5123 IN PULONG PreviousSuspendCount
5124 );
5125
5126 /*
5127 * FUNCTION: Terminates the execution of a thread.
5128 * ARGUMENTS:
5129 * ThreadHandle = Handle to the thread
5130 * ExitStatus = The exit status of the thread to terminate with.
5131 * RETURNS: Status
5132 */
5133 NTSTATUS
5134 STDCALL
5135 NtTerminateThread(
5136 IN HANDLE ThreadHandle ,
5137 IN NTSTATUS ExitStatus
5138 );
5139 NTSTATUS
5140 STDCALL
5141 ZwTerminateThread(
5142 IN HANDLE ThreadHandle ,
5143 IN NTSTATUS ExitStatus
5144 );
5145 /*
5146 * FUNCTION: Tests to see if there are any pending alerts for the calling thread
5147 * RETURNS: Status
5148 */
5149 NTSTATUS
5150 STDCALL
5151 NtTestAlert(
5152 VOID
5153 );
5154 NTSTATUS
5155 STDCALL
5156 ZwTestAlert(
5157 VOID
5158 );
5159
5160 /*
5161 * FUNCTION: Yields the callers thread.
5162 * RETURNS: Status
5163 */
5164 NTSTATUS
5165 STDCALL
5166 NtYieldExecution(
5167 VOID
5168 );
5169
5170 NTSTATUS
5171 STDCALL
5172 ZwYieldExecution(
5173 VOID
5174 );
5175
5176
5177 /*
5178 * --- Local Procedure Call Facility
5179 * These prototypes are unknown as yet
5180 * (stack sizes by Peter-Michael Hager)
5181 */
5182
5183 /* --- REGISTRY --- */
5184
5185 /*
5186 * FUNCTION: Unloads a registry key.
5187 * ARGUMENTS:
5188 * KeyHandle = Handle to the registry key
5189 * REMARK:
5190 * This procedure maps to the win32 procedure RegUnloadKey
5191 * RETURNS: Status
5192 */
5193 NTSTATUS
5194 STDCALL
5195 NtUnloadKey(
5196 HANDLE KeyHandle
5197 );
5198 NTSTATUS
5199 STDCALL
5200 ZwUnloadKey(
5201 HANDLE KeyHandle
5202 );
5203
5204
5205 /* --- PLUG AND PLAY --- */
5206
5207 NTSTATUS
5208 STDCALL
5209 NtPlugPlayControl (
5210 VOID
5211 );
5212
5213 NTSTATUS
5214 STDCALL
5215 NtGetPlugPlayEvent (
5216 VOID
5217 );
5218
5219 /* --- POWER MANAGEMENT --- */
5220
5221 NTSTATUS STDCALL
5222 NtSetSystemPowerState(IN POWER_ACTION SystemAction,
5223 IN SYSTEM_POWER_STATE MinSystemState,
5224 IN ULONG Flags);
5225
5226 /* --- DEBUG SUBSYSTEM --- */
5227
5228 NTSTATUS STDCALL
5229 NtSystemDebugControl(DEBUG_CONTROL_CODE ControlCode,
5230 PVOID InputBuffer,
5231 ULONG InputBufferLength,
5232 PVOID OutputBuffer,
5233 ULONG OutputBufferLength,
5234 PULONG ReturnLength);
5235
5236 /* --- VIRTUAL DOS MACHINE (VDM) --- */
5237
5238 NTSTATUS
5239 STDCALL
5240 NtVdmControl (ULONG ControlCode, PVOID ControlData);
5241
5242
5243 /* --- WIN32 --- */
5244
5245 NTSTATUS STDCALL
5246 NtW32Call(IN ULONG RoutineIndex,
5247 IN PVOID Argument,
5248 IN ULONG ArgumentLength,
5249 OUT PVOID* Result OPTIONAL,
5250 OUT PULONG ResultLength OPTIONAL);
5251
5252 /* --- CHANNELS --- */
5253
5254 NTSTATUS
5255 STDCALL
5256 NtCreateChannel (
5257 VOID
5258 );
5259
5260 NTSTATUS
5261 STDCALL
5262 NtListenChannel (
5263 VOID
5264 );
5265
5266 NTSTATUS
5267 STDCALL
5268 NtOpenChannel (
5269 VOID
5270 );
5271
5272 NTSTATUS
5273 STDCALL
5274 NtReplyWaitSendChannel (
5275 VOID
5276 );
5277
5278 NTSTATUS
5279 STDCALL
5280 NtSendWaitReplyChannel (
5281 VOID
5282 );
5283
5284 NTSTATUS
5285 STDCALL
5286 NtSetContextChannel (
5287 VOID
5288 );
5289
5290 /* --- MISCELLANEA --- */
5291
5292 //NTSTATUS STDCALL NtSetLdtEntries(VOID);
5293 NTSTATUS
5294 STDCALL
5295 NtSetLdtEntries (
5296 HANDLE Thread,
5297 ULONG FirstEntry,
5298 PULONG Entries
5299 );
5300
5301
5302 NTSTATUS
5303 STDCALL
5304 NtQueryOleDirectoryFile (
5305 VOID
5306 );
5307
5308 #endif /* __DDK_ZW_H */