2 * this file defines interfaces mainly exposed to device drivers and
5 * Copyright (C) the Wine project
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __WINE_NTDDK_H
23 #define __WINE_NTDDK_H
28 #include "winbase.h" /* FIXME: should be taken out sometimes */
37 #undef Status /* conflict with X11-includes*/
39 typedef struct _IO_STATUS_BLOCK
45 ULONG_PTR Information
;
46 } IO_STATUS_BLOCK
, *PIO_STATUS_BLOCK
;
48 typedef VOID (NTAPI
*PIO_APC_ROUTINE
) ( PVOID ApcContext
, PIO_STATUS_BLOCK IoStatusBlock
, ULONG Reserved
);
55 typedef struct _KEY_BASIC_INFORMATION
{
56 LARGE_INTEGER LastWriteTime
;
60 } KEY_BASIC_INFORMATION
, *PKEY_BASIC_INFORMATION
;
62 typedef struct _KEY_NODE_INFORMATION
64 LARGE_INTEGER LastWriteTime
;
71 } KEY_NODE_INFORMATION
, *PKEY_NODE_INFORMATION
;
73 typedef struct _KEY_FULL_INFORMATION
75 LARGE_INTEGER LastWriteTime
;
83 ULONG MaxValueNameLen
;
84 ULONG MaxValueDataLen
;
86 } KEY_FULL_INFORMATION
, *PKEY_FULL_INFORMATION
;
88 typedef enum _KEY_INFORMATION_CLASS
93 } KEY_INFORMATION_CLASS
;
95 typedef struct _KEY_VALUE_ENTRY
97 PUNICODE_STRING ValueName
;
101 } KEY_VALUE_ENTRY
, *PKEY_VALUE_ENTRY
;
103 /* value information */
104 typedef struct _KEY_VALUE_BASIC_INFORMATION
110 } KEY_VALUE_BASIC_INFORMATION
, *PKEY_VALUE_BASIC_INFORMATION
;
112 typedef struct _KEY_VALUE_FULL_INFORMATION
121 } KEY_VALUE_FULL_INFORMATION
, *PKEY_VALUE_FULL_INFORMATION
;
123 typedef struct _KEY_VALUE_PARTIAL_INFORMATION
129 } KEY_VALUE_PARTIAL_INFORMATION
, *PKEY_VALUE_PARTIAL_INFORMATION
;
131 typedef enum _KEY_VALUE_INFORMATION_CLASS
133 KeyValueBasicInformation
,
134 KeyValueFullInformation
,
135 KeyValuePartialInformation
,
136 KeyValueFullInformationAlign64
,
137 KeyValuePartialInformationAlign64
138 } KEY_VALUE_INFORMATION_CLASS
;
140 NTSTATUS WINAPI
RtlFormatCurrentUserKeyPath(
141 PUNICODE_STRING KeyPath
);
143 /* thread information */
145 typedef enum _THREADINFOCLASS
146 { ThreadBasicInformation
,
151 ThreadImpersonationToken
,
152 ThreadDescriptorTableEntry
,
153 ThreadEnableAlignmentFaultFixup
,
154 ThreadEventPair_Reusable
,
155 ThreadQuerySetWin32StartAddress
,
157 ThreadPerformanceCount
,
159 ThreadIdealProcessor
,
161 ThreadSetTlsArrayAddress
,
167 /* This is used by NtQuerySystemInformation */
168 FILETIME ftCreationTime
;
170 DWORD dwStartAddress
;
173 DWORD dwCurrentPriority
;
174 DWORD dwBasePriority
;
175 DWORD dwContextSwitches
;
179 } THREADINFO
, *PTHREADINFO
;
181 /* file information */
183 typedef enum _FILE_INFORMATION_CLASS
{
184 FileDirectoryInformation
= 1,
185 FileFullDirectoryInformation
,
186 FileBothDirectoryInformation
,
187 FileBasicInformation
,
188 FileStandardInformation
,
189 FileInternalInformation
,
191 FileAccessInformation
,
193 FileRenameInformation
,
195 FileNamesInformation
,
196 FileDispositionInformation
,
197 FilePositionInformation
,
198 FileFullEaInformation
,
200 FileAlignmentInformation
,
202 FileAllocationInformation
,
203 FileEndOfFileInformation
,
204 FileAlternateNameInformation
,
205 FileStreamInformation
,
207 FilePipeLocalInformation
,
208 FilePipeRemoteInformation
,
209 FileMailslotQueryInformation
,
210 FileMailslotSetInformation
,
211 FileCompressionInformation
,
212 FileObjectIdInformation
,
213 FileCompletionInformation
,
214 FileMoveClusterInformation
,
215 FileQuotaInformation
,
216 FileReparsePointInformation
,
217 FileNetworkOpenInformation
,
218 FileAttributeTagInformation
,
219 FileTrackingInformation
,
220 FileMaximumInformation
221 } FILE_INFORMATION_CLASS
, *PFILE_INFORMATION_CLASS
;
223 typedef enum _FSINFOCLASS
{
224 FileFsVolumeInformation
= 1,
225 FileFsLabelInformation
,
226 FileFsSizeInformation
,
227 FileFsDeviceInformation
,
228 FileFsAttributeInformation
,
229 FileFsControlInformation
,
230 FileFsFullSizeInformation
,
231 FileFsObjectIdInformation
,
232 FileFsMaximumInformation
233 } FS_INFORMATION_CLASS
, *PFS_INFORMATION_CLASS
;
235 typedef enum _SECTION_INHERIT
242 /* object information */
244 typedef enum _OBJECT_INFORMATION_CLASS
248 } OBJECT_INFORMATION_CLASS
, *POBJECT_INFORMATION_CLASS
;
251 /* system information */
253 typedef enum SYSTEM_INFORMATION_CLASS
254 { SystemBasicInformation
= 0,
256 SystemPerformanceInformation
,
257 SystemTimeInformation
,
259 SystemProcessInformation
,
265 SystemDriverInformation
,
275 SystemCacheInformation
276 } SYSTEM_INFORMATION_CLASS
, *PSYSTEM_INFORMATION_CLASS
;
279 /* System Information Class 0x00 */
281 ULONG uKeMaximumIncrement
;
283 ULONG uMmNumberOfPhysicalPages
;
284 ULONG uMmLowestPhysicalPage
;
285 ULONG uMmHighestPhysicalPage
;
286 ULONG uAllocationGranularity
;
287 PVOID pLowestUserAddress
;
288 PVOID pMmHighestUserAddress
;
289 ULONG uKeActiveProcessors
;
290 BYTE bKeNumberProcessors
;
293 } SYSTEM_BASIC_INFORMATION
;
296 /* System Information Class 0x02 */
297 LARGE_INTEGER liIdleTime
;
299 } SYSTEM_PERFORMANCE_INFORMATION
;
302 /* System Information Class 0x03 */
303 LARGE_INTEGER liKeBootTime
;
304 LARGE_INTEGER liKeSystemTime
;
305 LARGE_INTEGER liExpTimeZoneBias
;
306 ULONG uCurrentTimeZoneId
;
308 } SYSTEM_TIME_INFORMATION
;
311 /* System Information Class 0x05 */
315 FILETIME ftCreationTime
;
317 WCHAR
* pszProcessName
;
318 DWORD dwBasePriority
;
320 DWORD dwParentProcessID
;
324 DWORD dwVirtualBytesPeak
;
325 DWORD dwVirtualBytes
;
327 DWORD dwWorkingSetPeak
;
332 DWORD dwNonPagedPool
;
333 DWORD dwPageFileBytesPeak
;
334 DWORD dwPrivateBytes
;
335 DWORD dwPageFileBytes
;
338 } SYSTEM_PROCESS_INFORMATION
;
341 /* System Information Class 0x0b */
347 char szName
[MAX_PATH
+ 1];
348 } SYSTEM_DRIVER_INFORMATION
;
351 /* System Information Class 0x10 */
353 USHORT dwCreatorBackTraceIndex
;
355 BYTE bHandleAttributes
;
356 USHORT usHandleOffset
;
358 ULONG ulGrantedAccess
;
359 } HANDLEINFO
, *PHANDLEINFO
;
362 /* System Information Class 0x15 */
365 ULONG PageFaultCount
;
366 ULONG MinimumWorkingSet
;
367 ULONG MaximumWorkingSet
;
369 } SYSTEM_CACHE_INFORMATION
;
371 /* reading coffee grounds... */
372 typedef struct _THREAD_INFO
379 } THREAD_INFO
, PTHREAD_INFO
;
381 typedef struct _VM_COUNTERS_
382 { ULONG PeakVirtualSize
;
384 ULONG PageFaultCount
;
385 ULONG PeakWorkingSetSize
;
386 ULONG WorkingSetSize
;
387 ULONG QuotaPeakPagedPoolUsage
;
388 ULONG QuotaPagedPoolUsage
;
389 ULONG QuotaPeakNonPagedPoolUsage
;
390 ULONG QuotaNonPagedPoolUsage
;
392 ULONG PeakPagefileUsage
;
393 } VM_COUNTERS
, *PVM_COUNTERS
;
395 /* process information */
397 typedef struct _PROCESS_INFO
398 { DWORD Offset
; /* 00 offset to next PROCESS_INFO ok*/
399 DWORD ThreadCount
; /* 04 number of ThreadInfo member ok */
401 FILETIME CreationTime
; /* 20 */
403 PWCHAR ProcessName
; /* 3c ok */
405 DWORD ProcessID
; /* 44 ok*/
406 DWORD ParentProcessID
;
408 DWORD Unknown3
[2]; /* 50 */
409 ULONG PeakVirtualSize
;
411 ULONG PageFaultCount
;
412 ULONG PeakWorkingSetSize
;
413 ULONG WorkingSetSize
;
414 ULONG QuotaPeakPagedPoolUsage
;
415 ULONG QuotaPagedPoolUsage
;
416 ULONG QuotaPeakNonPagedPoolUsage
;
417 ULONG QuotaNonPagedPoolUsage
;
419 ULONG PeakPagefileUsage
;
422 THREAD_INFO ati
[ANYSIZE_ARRAY
]; /* 94 size=0x40*/
423 } PROCESS_INFO
, PPROCESS_INFO
;
425 NTSTATUS WINAPI
NtQuerySystemInformation(
426 IN SYSTEM_INFORMATION_CLASS SystemInformationClass
,
427 OUT PVOID SystemInformation
,
429 OUT PULONG ResultLength
);
432 * system configuration
436 typedef struct _SYSTEM_TIME_ADJUSTMENT
438 ULONG TimeAdjustment
;
439 BOOLEAN TimeAdjustmentDisabled
;
441 } SYSTEM_TIME_ADJUSTMENT
, *PSYSTEM_TIME_ADJUSTMENT
;
443 typedef struct _SYSTEM_CONFIGURATION_INFO
448 { WORD ProcessorArchitecture
;
453 PVOID MinimumApplicationAddress
;
454 PVOID MaximumApplicationAddress
;
455 ULONG ActiveProcessorMask
;
456 ULONG NumberOfProcessors
;
458 ULONG AllocationGranularity
;
460 WORD ProcessorRevision
;
462 } SYSTEM_CONFIGURATION_INFO
, *PSYSTEM_CONFIGURATION_INFO
;
466 * NtQueryProcessInformation
469 /* parameter ProcessInformationClass */
471 typedef enum _PROCESSINFOCLASS
472 { ProcessBasicInformation
,
478 ProcessRaisePriority
,
480 ProcessExceptionPort
,
482 ProcessLdtInformation
,
484 ProcessDefaultHardErrorMode
,
485 ProcessIoPortHandlers
,
486 ProcessPooledUsageAndLimits
,
487 ProcessWorkingSetWatch
,
489 ProcessEnableAlignmentFaultFixup
,
490 ProcessPriorityClass
,
491 ProcessWx86Information
,
494 ProcessPriorityBoost
,
496 ProcessSessionInformation
,
497 ProcessForegroundInformation
,
498 ProcessWow64Information
,
502 /* parameter ProcessInformation (depending on ProcessInformationClass) */
504 typedef struct _PROCESS_BASIC_INFORMATION
506 DWORD PebBaseAddress
;
509 ULONG UniqueProcessId
;
510 ULONG InheritedFromUniqueProcessId
;
511 } PROCESS_BASIC_INFORMATION
;
513 NTSTATUS WINAPI
NtQueryInformationProcess(
514 IN HANDLE ProcessHandle
,
515 IN PROCESSINFOCLASS ProcessInformationClass
,
516 OUT PVOID ProcessInformation
,
517 IN ULONG ProcessInformationLength
,
518 OUT PULONG ReturnLength
);
520 #define NtCurrentProcess() ( (HANDLE) -1 )
526 typedef enum _TIMER_TYPE
533 /* token functions */
535 NTSTATUS WINAPI
NtOpenProcessToken(
536 HANDLE ProcessHandle
,
538 HANDLE
*TokenHandle
);
540 NTSTATUS WINAPI
NtOpenThreadToken(
544 HANDLE
*TokenHandle
);
546 NTSTATUS WINAPI
NtAdjustPrivilegesToken(
547 IN HANDLE TokenHandle
,
548 IN BOOLEAN DisableAllPrivileges
,
549 IN PTOKEN_PRIVILEGES NewState
,
550 IN DWORD BufferLength
,
551 OUT PTOKEN_PRIVILEGES PreviousState
,
552 OUT PDWORD ReturnLength
);
554 NTSTATUS WINAPI
NtQueryInformationToken(
556 DWORD tokeninfoclass
,
558 DWORD tokeninfolength
,
563 BOOLEAN WINAPI
RtlAllocateAndInitializeSid (
564 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
565 BYTE nSubAuthorityCount
,
566 DWORD nSubAuthority0
, DWORD nSubAuthority1
,
567 DWORD nSubAuthority2
, DWORD nSubAuthority3
,
568 DWORD nSubAuthority4
, DWORD nSubAuthority5
,
569 DWORD nSubAuthority6
, DWORD nSubAuthority7
,
572 BOOL WINAPI
RtlInitializeSid(
574 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority
,
575 BYTE nSubAuthorityCount
);
577 DWORD WINAPI
RtlFreeSid(
580 BOOL WINAPI
RtlEqualSid(
584 DWORD WINAPI
RtlLengthRequiredSid(
587 DWORD WINAPI
RtlLengthSid(
590 LPDWORD WINAPI
RtlSubAuthoritySid(
594 LPBYTE WINAPI
RtlSubAuthorityCountSid(
597 DWORD WINAPI
RtlCopySid(
602 BOOL WINAPI
RtlValidSid(
605 BOOL WINAPI
RtlEqualPrefixSid(
609 PSID_IDENTIFIER_AUTHORITY WINAPI
RtlIdentifierAuthoritySid(
612 /* security descriptor functions */
614 NTSTATUS WINAPI
RtlCreateSecurityDescriptor(
615 PSECURITY_DESCRIPTOR lpsd
,
618 NTSTATUS WINAPI
RtlValidSecurityDescriptor(
619 PSECURITY_DESCRIPTOR SecurityDescriptor
);
621 ULONG WINAPI
RtlLengthSecurityDescriptor(
622 PSECURITY_DESCRIPTOR SecurityDescriptor
);
624 NTSTATUS WINAPI
RtlGetDaclSecurityDescriptor(
625 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
626 OUT PBOOLEAN lpbDaclPresent
,
628 OUT PBOOLEAN lpbDaclDefaulted
);
630 NTSTATUS WINAPI
RtlSetDaclSecurityDescriptor (
631 PSECURITY_DESCRIPTOR lpsd
,
634 BOOLEAN dacldefaulted
);
636 NTSTATUS WINAPI
RtlGetSaclSecurityDescriptor(
637 IN PSECURITY_DESCRIPTOR pSecurityDescriptor
,
638 OUT PBOOLEAN lpbSaclPresent
,
640 OUT PBOOLEAN lpbSaclDefaulted
);
642 NTSTATUS WINAPI
RtlSetSaclSecurityDescriptor (
643 PSECURITY_DESCRIPTOR lpsd
,
646 BOOLEAN sacldefaulted
);
648 NTSTATUS WINAPI
RtlGetOwnerSecurityDescriptor(
649 PSECURITY_DESCRIPTOR SecurityDescriptor
,
651 PBOOLEAN OwnerDefaulted
);
653 NTSTATUS WINAPI
RtlSetOwnerSecurityDescriptor(
654 PSECURITY_DESCRIPTOR lpsd
,
656 BOOLEAN ownerdefaulted
);
658 NTSTATUS WINAPI
RtlSetGroupSecurityDescriptor (
659 PSECURITY_DESCRIPTOR lpsd
,
661 BOOLEAN groupdefaulted
);
663 NTSTATUS WINAPI
RtlGetGroupSecurityDescriptor(
664 PSECURITY_DESCRIPTOR SecurityDescriptor
,
666 PBOOLEAN GroupDefaulted
);
668 NTSTATUS WINAPI
RtlMakeSelfRelativeSD(
669 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor
,
670 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor
,
671 IN OUT LPDWORD lpdwBufferLength
);
673 NTSTATUS WINAPI
RtlGetControlSecurityDescriptor(
674 PSECURITY_DESCRIPTOR pSecurityDescriptor
,
675 PSECURITY_DESCRIPTOR_CONTROL pControl
,
676 LPDWORD lpdwRevision
);
680 NTSTATUS WINAPI
RtlCreateAcl(
685 BOOLEAN WINAPI
RtlFirstFreeAce(
689 NTSTATUS WINAPI
RtlAddAce(
693 PACE_HEADER acestart
,
696 BOOL WINAPI
RtlAddAccessAllowedAce(
698 IN DWORD dwAceRevision
,
702 BOOL WINAPI
AddAccessAllowedAceEx(
704 IN DWORD dwAceRevision
,
709 DWORD WINAPI
RtlGetAce(
714 /* string functions */
716 DWORD WINAPI
RtlAnsiStringToUnicodeSize(const STRING
*);
717 NTSTATUS WINAPI
RtlAnsiStringToUnicodeString(UNICODE_STRING
*,const STRING
*,BOOLEAN
);
718 NTSTATUS WINAPI
RtlAppendAsciizToString(STRING
*,LPCSTR
);
719 NTSTATUS WINAPI
RtlAppendStringToString(STRING
*,const STRING
*);
720 NTSTATUS WINAPI
RtlAppendUnicodeStringToString(UNICODE_STRING
*,const UNICODE_STRING
*);
721 NTSTATUS WINAPI
RtlAppendUnicodeToString(UNICODE_STRING
*,LPCWSTR
);
722 LONG WINAPI
RtlCompareString(const STRING
*,const STRING
*,BOOLEAN
);
723 LONG WINAPI
RtlCompareUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
724 void WINAPI
RtlCopyString(STRING
*,const STRING
*);
725 void WINAPI
RtlCopyUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*);
726 BOOLEAN WINAPI
RtlCreateUnicodeString(PUNICODE_STRING
,LPCWSTR
);
727 BOOLEAN WINAPI
RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING
,LPCSTR
);
728 void WINAPI
RtlEraseUnicodeString(UNICODE_STRING
*);
729 BOOLEAN WINAPI
RtlEqualString(const STRING
*,const STRING
*,BOOLEAN
);
730 BOOLEAN WINAPI
RtlEqualUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
731 void WINAPI
RtlFreeAnsiString(PSTRING
);
732 void WINAPI
RtlFreeOemString(PSTRING
);
733 void WINAPI
RtlFreeUnicodeString(PUNICODE_STRING
);
734 void WINAPI
RtlInitAnsiString(PSTRING
,LPCSTR
);
735 void WINAPI
RtlInitString(PSTRING
,LPCSTR
);
736 void WINAPI
RtlInitUnicodeString(PUNICODE_STRING
,LPCWSTR
);
737 NTSTATUS WINAPI
RtlMultiByteToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
738 NTSTATUS WINAPI
RtlMultiByteToUnicodeSize(DWORD
*,LPCSTR
,UINT
);
739 UINT WINAPI
RtlOemStringToUnicodeSize(const STRING
*);
740 NTSTATUS WINAPI
RtlOemStringToUnicodeString(UNICODE_STRING
*,const STRING
*,BOOLEAN
);
741 NTSTATUS WINAPI
RtlOemToUnicodeN(LPWSTR
,DWORD
,LPDWORD
,LPCSTR
,DWORD
);
742 BOOLEAN WINAPI
RtlPrefixString(const STRING
*,const STRING
*,BOOLEAN
);
743 BOOLEAN WINAPI
RtlPrefixUnicodeString(const UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
744 DWORD WINAPI
RtlUnicodeStringToAnsiSize(const UNICODE_STRING
*);
745 NTSTATUS WINAPI
RtlUnicodeStringToAnsiString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
746 DWORD WINAPI
RtlUnicodeStringToOemSize(const UNICODE_STRING
*);
747 NTSTATUS WINAPI
RtlUnicodeStringToOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
748 NTSTATUS WINAPI
RtlUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
749 NTSTATUS WINAPI
RtlUnicodeToMultiByteSize(DWORD
*,LPCWSTR
,UINT
);
750 NTSTATUS WINAPI
RtlUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
751 NTSTATUS WINAPI
RtlUpcaseUnicodeString(UNICODE_STRING
*,const UNICODE_STRING
*,BOOLEAN
);
752 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToAnsiString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
753 NTSTATUS WINAPI
RtlUpcaseUnicodeStringToOemString(STRING
*,const UNICODE_STRING
*,BOOLEAN
);
754 NTSTATUS WINAPI
RtlUpcaseUnicodeToMultiByteN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
755 NTSTATUS WINAPI
RtlUpcaseUnicodeToOemN(LPSTR
,DWORD
,LPDWORD
,LPCWSTR
,DWORD
);
757 DWORD WINAPI
RtlIsTextUnicode(
762 int __cdecl
swprintf(LPWSTR
,LPCWSTR
,...);
764 /* resource functions */
766 typedef struct _RTL_RWLOCK
{
767 CRITICAL_SECTION rtlCS
;
768 HANDLE hSharedReleaseSemaphore
;
770 HANDLE hExclusiveReleaseSemaphore
;
771 UINT uExclusiveWaiters
;
773 HANDLE hOwningThreadId
;
774 DWORD dwTimeoutBoost
;
776 } RTL_RWLOCK
, *LPRTL_RWLOCK
;
778 VOID WINAPI
RtlInitializeResource(
781 VOID WINAPI
RtlDeleteResource(
784 BYTE WINAPI
RtlAcquireResourceExclusive(
785 LPRTL_RWLOCK
, BYTE fWait
);
787 BYTE WINAPI
RtlAcquireResourceShared(
788 LPRTL_RWLOCK
, BYTE fWait
);
790 VOID WINAPI
RtlReleaseResource(
793 VOID WINAPI
RtlDumpResource(
798 typedef struct _TIME_FIELDS
809 typedef TIME_FIELDS
*PTIME_FIELDS
;
811 VOID WINAPI
RtlSystemTimeToLocalTime(
812 IN PLARGE_INTEGER SystemTime
,
813 OUT PLARGE_INTEGER LocalTime
);
815 VOID WINAPI
RtlTimeToTimeFields(
816 PLARGE_INTEGER liTime
,
817 PTIME_FIELDS TimeFields
);
819 BOOLEAN WINAPI
RtlTimeFieldsToTime(
820 PTIME_FIELDS tfTimeFields
,
821 PLARGE_INTEGER Time
);
823 VOID WINAPI
RtlTimeToElapsedTimeFields(
824 PLARGE_INTEGER liTime
,
825 PTIME_FIELDS TimeFields
);
827 void WINAPI
NtQuerySystemTime( LARGE_INTEGER
*time
);
829 BOOLEAN WINAPI
RtlTimeToSecondsSince1980( const FILETIME
*time
, LPDWORD res
);
830 BOOLEAN WINAPI
RtlTimeToSecondsSince1970( const FILETIME
*time
, LPDWORD res
);
831 void WINAPI
RtlSecondsSince1970ToTime( DWORD time
, FILETIME
*res
);
832 void WINAPI
RtlSecondsSince1980ToTime( DWORD time
, FILETIME
*res
);
836 /* Data structure for heap definition. This includes various
837 sizing parameters and callback routines, which, if left NULL,
838 result in default behavior */
841 { ULONG Length
; /* = sizeof(RTL_HEAP_DEFINITION) */
843 } RTL_HEAP_DEFINITION
, *PRTL_HEAP_DEFINITION
;
845 HANDLE WINAPI
RtlCreateHeap(ULONG
,PVOID
,ULONG
,ULONG
,PVOID
,PRTL_HEAP_DEFINITION
);
846 HANDLE WINAPI
RtlDestroyHeap(HANDLE
);
847 PVOID WINAPI
RtlAllocateHeap(HANDLE
,ULONG
,ULONG
);
848 BOOLEAN WINAPI
RtlFreeHeap(HANDLE
,ULONG
,PVOID
);
849 PVOID WINAPI
RtlReAllocateHeap(HANDLE
,ULONG
,PVOID
,ULONG
);
850 ULONG WINAPI
RtlCompactHeap(HANDLE
,ULONG
);
851 BOOLEAN WINAPI
RtlLockHeap(HANDLE
);
852 BOOLEAN WINAPI
RtlUnlockHeap(HANDLE
);
853 ULONG WINAPI
RtlSizeHeap(HANDLE
,ULONG
,PVOID
);
854 BOOLEAN WINAPI
RtlValidateHeap(HANDLE
,ULONG
,PCVOID
);
855 ULONG WINAPI
RtlGetProcessHeaps(ULONG
,HANDLE
*);
856 NTSTATUS WINAPI
RtlWalkHeap(HANDLE
,PVOID
);
860 void WINAPI
NtRaiseException(
861 PEXCEPTION_RECORD
,PCONTEXT
,BOOL
);
863 void WINAPI
RtlRaiseException(
866 void WINAPI
RtlRaiseStatus(
869 void WINAPI
RtlUnwind(
872 PEXCEPTION_RECORD
,DWORD
);
874 /* process environment block */
875 VOID WINAPI
RtlAcquirePebLock(void);
876 VOID WINAPI
RtlReleasePebLock(void);
879 LONGLONG WINAPI
RtlConvertLongToLargeInteger( LONG a
);
880 LONGLONG WINAPI
RtlEnlargedIntegerMultiply( INT a
, INT b
);
881 LONGLONG WINAPI
RtlExtendedMagicDivide( LONGLONG a
, LONGLONG b
, INT shift
);
882 LONGLONG WINAPI
RtlExtendedIntegerMultiply( LONGLONG a
, INT b
);
883 LONGLONG WINAPI
RtlExtendedLargeIntegerDivide( LONGLONG a
, INT b
, INT
*rem
);
884 LONGLONG WINAPI
RtlLargeIntegerAdd( LONGLONG a
, LONGLONG b
);
885 LONGLONG WINAPI
RtlLargeIntegerArithmeticShift( LONGLONG a
, INT count
);
886 LONGLONG WINAPI
RtlLargeIntegerNegate( LONGLONG a
);
887 LONGLONG WINAPI
RtlLargeIntegerShiftLeft( LONGLONG a
, INT count
);
888 LONGLONG WINAPI
RtlLargeIntegerShiftRight( LONGLONG a
, INT count
);
889 LONGLONG WINAPI
RtlLargeIntegerSubtract( LONGLONG a
, LONGLONG b
);
890 ULONGLONG WINAPI
RtlEnlargedUnsignedMultiply( UINT a
, UINT b
);
891 UINT WINAPI
RtlEnlargedUnsignedDivide( ULONGLONG a
, UINT b
, UINT
*remptr
);
892 ULONGLONG WINAPI
RtlConvertUlongToLargeInteger( ULONG a
);
893 ULONGLONG WINAPI
RtlLargeIntegerDivide( ULONGLONG a
, ULONGLONG b
, ULONGLONG
*rem
);
896 DWORD WINAPI
RtlCreateEnvironment(
900 DWORD WINAPI
RtlDestroyEnvironment(
903 DWORD WINAPI
RtlQueryEnvironmentVariable_U(
906 PUNICODE_STRING val
) ;
908 DWORD WINAPI
RtlSetEnvironmentVariable(
911 PUNICODE_STRING val
);
913 /* object security */
915 DWORD WINAPI
RtlNewSecurityObject(
923 DWORD WINAPI
RtlDeleteSecurityObject(
927 NtQuerySecurityObject(
929 IN SECURITY_INFORMATION RequestedInformation
,
930 OUT PSECURITY_DESCRIPTOR pSecurityDesriptor
,
932 OUT PULONG ResultLength
);
937 IN SECURITY_INFORMATION SecurityInformation
,
938 IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
940 /* registry functions */
942 NTSTATUS WINAPI
NtCreateKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,
943 const UNICODE_STRING
*,ULONG
,PULONG
);
944 NTSTATUS WINAPI
NtDeleteKey(HANDLE
);
945 NTSTATUS WINAPI
NtDeleteValueKey(HANDLE
,const UNICODE_STRING
*);
946 NTSTATUS WINAPI
NtOpenKey(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*);
947 NTSTATUS WINAPI
NtQueryKey(HANDLE
,KEY_INFORMATION_CLASS
,void*,DWORD
,DWORD
*);
948 NTSTATUS WINAPI
NtSetValueKey(HANDLE
,const UNICODE_STRING
*,ULONG
,ULONG
,const void*,ULONG
);
949 NTSTATUS WINAPI
NtEnumerateKey(HANDLE
,ULONG
,KEY_INFORMATION_CLASS
,void*,DWORD
,DWORD
*);
950 NTSTATUS WINAPI
NtQueryValueKey(HANDLE
,const UNICODE_STRING
*,KEY_VALUE_INFORMATION_CLASS
,
952 NTSTATUS WINAPI
NtLoadKey(const OBJECT_ATTRIBUTES
*,const OBJECT_ATTRIBUTES
*);
955 NTSTATUS WINAPI
NtEnumerateValueKey(
958 KEY_VALUE_INFORMATION_CLASS KeyInformationClass
,
959 PVOID KeyInformation
,
961 PULONG ResultLength
);
963 NTSTATUS WINAPI
NtFlushKey(HANDLE KeyHandle
);
965 NTSTATUS WINAPI
NtNotifyChangeKey(
968 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL
,
969 IN PVOID ApcContext OPTIONAL
,
970 OUT PIO_STATUS_BLOCK IoStatusBlock
,
971 IN ULONG CompletionFilter
,
972 IN BOOLEAN Asynchroneous
,
973 OUT PVOID ChangeBuffer
,
975 IN BOOLEAN WatchSubtree
);
977 NTSTATUS WINAPI
NtQueryMultipleValueKey(
979 PVALENTW ListOfValuesToQuery
,
981 PVOID MultipleValueInformation
,
983 PULONG ReturnLength
);
985 NTSTATUS WINAPI
NtReplaceKey(
986 IN POBJECT_ATTRIBUTES ObjectAttributes
,
988 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes
);
990 NTSTATUS WINAPI
NtRestoreKey(
995 NTSTATUS WINAPI
NtSaveKey(
997 IN HANDLE FileHandle
);
999 NTSTATUS WINAPI
NtSetInformationKey(
1000 IN HANDLE KeyHandle
,
1001 IN
const int KeyInformationClass
,
1002 IN PVOID KeyInformation
,
1003 IN ULONG KeyInformationLength
);
1005 NTSTATUS WINAPI
NtUnloadKey(
1006 IN HANDLE KeyHandle
);
1008 NTSTATUS WINAPI
NtClose(
1011 NTSTATUS WINAPI
NtTerminateProcess( HANDLE handle
, LONG exit_code
);
1012 NTSTATUS WINAPI
NtTerminateThread( HANDLE handle
, LONG exit_code
);
1014 NTSTATUS WINAPI
NtClearEvent(HANDLE
);
1015 NTSTATUS WINAPI
NtCreateEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,BOOLEAN
,BOOLEAN
);
1016 NTSTATUS WINAPI
NtCreateSemaphore(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*,ULONG
,ULONG
);
1017 NTSTATUS WINAPI
NtOpenEvent(PHANDLE
,ACCESS_MASK
,const OBJECT_ATTRIBUTES
*attr
);
1018 NTSTATUS WINAPI
NtPulseEvent(HANDLE
,PULONG
);
1019 NTSTATUS WINAPI
NtReleaseSemaphore(HANDLE
,ULONG
,PULONG
);
1020 NTSTATUS WINAPI
NtResetEvent(HANDLE
,PULONG
);
1021 NTSTATUS WINAPI
NtSetEvent(HANDLE
,PULONG
);
1023 NTSTATUS WINAPI
RtlInitializeCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1024 NTSTATUS WINAPI
RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION
*crit
, DWORD spincount
);
1025 NTSTATUS WINAPI
RtlDeleteCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1026 NTSTATUS WINAPI
RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1027 NTSTATUS WINAPI
RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1028 NTSTATUS WINAPI
RtlEnterCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1029 BOOL WINAPI
RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1030 NTSTATUS WINAPI
RtlLeaveCriticalSection( RTL_CRITICAL_SECTION
*crit
);
1032 /* string functions */
1033 extern LPSTR
_strlwr( LPSTR str
);
1034 extern LPSTR
_strupr( LPSTR str
);
1038 #if defined(__i386__) && defined(__GNUC__)
1039 static inline void WINAPI
DbgBreakPoint(void) { __asm__
__volatile__("int3"); }
1040 static inline void WINAPI
DbgUserBreakPoint(void) { __asm__
__volatile__("int3"); }
1041 #else /* __i386__ && __GNUC__ */
1042 void WINAPI
DbgBreakPoint(void);
1043 void WINAPI
DbgUserBreakPoint(void);
1044 #endif /* __i386__ && __GNUC__ */
1045 void WINAPIV
DbgPrint(LPCSTR fmt
, ...);
1047 DWORD WINAPI
RtlAdjustPrivilege(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
1048 DWORD WINAPI
RtlIntegerToChar(DWORD x1
,DWORD x2
,DWORD x3
,DWORD x4
);
1049 LPVOID WINAPI
RtlNormalizeProcessParams(LPVOID x
);
1050 DWORD WINAPI
RtlNtStatusToDosError(DWORD error
);
1051 BOOLEAN WINAPI
RtlGetNtProductType(LPDWORD type
);
1052 PIMAGE_NT_HEADERS WINAPI
RtlImageNtHeader(HMODULE hModule
);
1054 DWORD WINAPI
RtlOpenCurrentUser(
1055 IN ACCESS_MASK DesiredAccess
,
1056 OUT PHANDLE KeyHandle
);
1058 BOOLEAN WINAPI
RtlDosPathNameToNtPathName_U( LPWSTR from
,PUNICODE_STRING us
,DWORD x2
,DWORD x3
);
1059 BOOL WINAPI
RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel
);
1063 IN PSECURITY_DESCRIPTOR SecurityDescriptor
,
1064 IN HANDLE ClientToken
,
1065 IN ACCESS_MASK DesiredAccess
,
1066 IN PGENERIC_MAPPING GenericMapping
,
1067 OUT PPRIVILEGE_SET PrivilegeSet
,
1068 OUT PULONG ReturnLength
,
1069 OUT PULONG GrantedAccess
,
1070 OUT PBOOLEAN AccessStatus
);