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