source: trunk/include/win/ntddk.h@ 9631

Last change on this file since 9631 was 9631, checked in by sandervl, 23 years ago

PF: header updates

File size: 29.9 KB
Line 
1/*
2 this file defines interfaces mainly exposed to device drivers and
3 native nt dll's
4
5*/
6#ifndef __WINE_NTDDK_H
7#define __WINE_NTDDK_H
8
9#include "ntdef.h"
10#include "winnt.h"
11#include "winreg.h"
12#include "winbase.h" /* FIXME: should be taken out sometimes */
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/******************
19 * asynchronous I/O
20 */
21#undef Status /* conflict with X11-includes*/
22
23typedef struct _IO_STATUS_BLOCK
24{
25 union {
26 NTSTATUS Status;
27 PVOID Pointer;
28 } DUMMYUNIONNAME;
29 ULONG_PTR Information;
30} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
31
32#ifdef __WIN32OS2__
33typedef VOID (* NTAPI PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved );
34#else
35typedef VOID (NTAPI *PIO_APC_ROUTINE) ( PVOID ApcContext, PIO_STATUS_BLOCK IoStatusBlock, ULONG Reserved );
36#endif
37
38/*
39 registry
40 */
41
42 /* key information */
43typedef struct _KEY_BASIC_INFORMATION {
44 LARGE_INTEGER LastWriteTime;
45 ULONG TitleIndex;
46 ULONG NameLength;
47 WCHAR Name[1];
48} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION;
49
50typedef struct _KEY_NODE_INFORMATION
51{
52 LARGE_INTEGER LastWriteTime;
53 ULONG TitleIndex;
54 ULONG ClassOffset;
55 ULONG ClassLength;
56 ULONG NameLength;
57 WCHAR Name[1];
58/* Class[1]; */
59} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION;
60
61typedef struct _KEY_FULL_INFORMATION
62{
63 LARGE_INTEGER LastWriteTime;
64 ULONG TitleIndex;
65 ULONG ClassOffset;
66 ULONG ClassLength;
67 ULONG SubKeys;
68 ULONG MaxNameLen;
69 ULONG MaxClassLen;
70 ULONG Values;
71 ULONG MaxValueNameLen;
72 ULONG MaxValueDataLen;
73 WCHAR Class[1];
74} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION;
75
76typedef enum _KEY_INFORMATION_CLASS
77{
78 KeyBasicInformation,
79 KeyNodeInformation,
80 KeyFullInformation
81} KEY_INFORMATION_CLASS;
82
83typedef struct _KEY_VALUE_ENTRY
84{
85 PUNICODE_STRING ValueName;
86 ULONG DataLength;
87 ULONG DataOffset;
88 ULONG Type;
89} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY;
90
91/* value information */
92typedef struct _KEY_VALUE_BASIC_INFORMATION
93{
94 ULONG TitleIndex;
95 ULONG Type;
96 ULONG NameLength;
97 WCHAR Name[1];
98} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION;
99
100typedef struct _KEY_VALUE_FULL_INFORMATION
101{
102 ULONG TitleIndex;
103 ULONG Type;
104 ULONG DataOffset;
105 ULONG DataLength;
106 ULONG NameLength;
107 WCHAR Name[1];
108/* UCHAR Data[1];*/
109} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION;
110
111typedef struct _KEY_VALUE_PARTIAL_INFORMATION
112{
113 ULONG TitleIndex;
114 ULONG Type;
115 ULONG DataLength;
116 UCHAR Data[1];
117} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION;
118
119typedef enum _KEY_VALUE_INFORMATION_CLASS
120{
121 KeyValueBasicInformation,
122 KeyValueFullInformation,
123 KeyValuePartialInformation,
124 KeyValueFullInformationAlign64,
125 KeyValuePartialInformationAlign64
126} KEY_VALUE_INFORMATION_CLASS;
127
128NTSTATUS WINAPI RtlFormatCurrentUserKeyPath(
129 PUNICODE_STRING KeyPath);
130
131/* thread information */
132
133typedef enum _THREADINFOCLASS
134{ ThreadBasicInformation,
135 ThreadTimes,
136 ThreadPriority,
137 ThreadBasePriority,
138 ThreadAffinityMask,
139 ThreadImpersonationToken,
140 ThreadDescriptorTableEntry,
141 ThreadEnableAlignmentFaultFixup,
142 ThreadEventPair_Reusable,
143 ThreadQuerySetWin32StartAddress,
144 ThreadZeroTlsCell,
145 ThreadPerformanceCount,
146 ThreadAmILastThread,
147 ThreadIdealProcessor,
148 ThreadPriorityBoost,
149 ThreadSetTlsArrayAddress,
150 ThreadIsIoPending,
151 MaxThreadInfoClass
152} THREADINFOCLASS;
153
154typedef struct {
155/* This is used by NtQuerySystemInformation */
156 FILETIME ftCreationTime;
157 DWORD dwUnknown1;
158 DWORD dwStartAddress;
159 DWORD dwOwningPID;
160 DWORD dwThreadID;
161 DWORD dwCurrentPriority;
162 DWORD dwBasePriority;
163 DWORD dwContextSwitches;
164 DWORD dwThreadState;
165 DWORD dwWaitReason;
166 DWORD dwUnknown2[5];
167} THREADINFO, *PTHREADINFO;
168
169/* file information */
170
171typedef enum _FILE_INFORMATION_CLASS {
172 FileDirectoryInformation = 1,
173 FileFullDirectoryInformation,
174 FileBothDirectoryInformation,
175 FileBasicInformation,
176 FileStandardInformation,
177 FileInternalInformation,
178 FileEaInformation,
179 FileAccessInformation,
180 FileNameInformation,
181 FileRenameInformation,
182 FileLinkInformation,
183 FileNamesInformation,
184 FileDispositionInformation,
185 FilePositionInformation,
186 FileFullEaInformation,
187 FileModeInformation,
188 FileAlignmentInformation,
189 FileAllInformation,
190 FileAllocationInformation,
191 FileEndOfFileInformation,
192 FileAlternateNameInformation,
193 FileStreamInformation,
194 FilePipeInformation,
195 FilePipeLocalInformation,
196 FilePipeRemoteInformation,
197 FileMailslotQueryInformation,
198 FileMailslotSetInformation,
199 FileCompressionInformation,
200 FileObjectIdInformation,
201 FileCompletionInformation,
202 FileMoveClusterInformation,
203 FileQuotaInformation,
204 FileReparsePointInformation,
205 FileNetworkOpenInformation,
206 FileAttributeTagInformation,
207 FileTrackingInformation,
208 FileMaximumInformation
209} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
210
211typedef enum _FSINFOCLASS {
212 FileFsVolumeInformation = 1,
213 FileFsLabelInformation,
214 FileFsSizeInformation,
215 FileFsDeviceInformation,
216 FileFsAttributeInformation,
217 FileFsControlInformation,
218 FileFsFullSizeInformation,
219 FileFsObjectIdInformation,
220 FileFsMaximumInformation
221} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS;
222
223typedef enum _SECTION_INHERIT
224{
225 ViewShare = 1,
226 ViewUnmap = 2
227
228} SECTION_INHERIT;
229
230/* object information */
231
232typedef enum _OBJECT_INFORMATION_CLASS
233{
234 DunnoTheConstants1
235
236} OBJECT_INFORMATION_CLASS, *POBJECT_INFORMATION_CLASS;
237
238
239/* system information */
240
241typedef enum SYSTEM_INFORMATION_CLASS
242{ SystemBasicInformation = 0,
243 Unknown1,
244 SystemPerformanceInformation,
245 SystemTimeInformation,
246 Unknown4,
247 SystemProcessInformation,
248 Unknown6,
249 Unknown7,
250 Unknown8,
251 Unknown9,
252 Unknown10,
253 SystemDriverInformation,
254 Unknown12,
255 Unknown13,
256 Unknown14,
257 Unknown15,
258 SystemHandleList,
259 Unknown17,
260 Unknown18,
261 Unknown19,
262 Unknown20,
263 SystemCacheInformation
264} SYSTEM_INFORMATION_CLASS, *PSYSTEM_INFORMATION_CLASS;
265
266typedef struct {
267/* System Information Class 0x00 */
268 DWORD dwUnknown1;
269 ULONG uKeMaximumIncrement;
270 ULONG uPageSize;
271 ULONG uMmNumberOfPhysicalPages;
272 ULONG uMmLowestPhysicalPage;
273 ULONG uMmHighestPhysicalPage;
274 ULONG uAllocationGranularity;
275 PVOID pLowestUserAddress;
276 PVOID pMmHighestUserAddress;
277 ULONG uKeActiveProcessors;
278 BYTE bKeNumberProcessors;
279 BYTE bUnknown2;
280 WORD wUnknown3;
281} SYSTEM_BASIC_INFORMATION;
282
283typedef struct {
284/* System Information Class 0x02 */
285 LARGE_INTEGER liIdleTime;
286 DWORD dwSpare[76];
287} SYSTEM_PERFORMANCE_INFORMATION;
288
289typedef struct {
290/* System Information Class 0x03 */
291 LARGE_INTEGER liKeBootTime;
292 LARGE_INTEGER liKeSystemTime;
293 LARGE_INTEGER liExpTimeZoneBias;
294 ULONG uCurrentTimeZoneId;
295 DWORD dwReserved;
296} SYSTEM_TIME_INFORMATION;
297
298typedef struct {
299/* System Information Class 0x05 */
300 DWORD dwOffset;
301 DWORD dwThreadCount;
302 DWORD dwUnknown1[6];
303 FILETIME ftCreationTime;
304 DWORD dwUnknown2[5];
305 WCHAR* pszProcessName;
306 DWORD dwBasePriority;
307 DWORD dwProcessID;
308 DWORD dwParentProcessID;
309 DWORD dwHandleCount;
310 DWORD dwUnknown3;
311 DWORD dwUnknown4;
312 DWORD dwVirtualBytesPeak;
313 DWORD dwVirtualBytes;
314 DWORD dwPageFaults;
315 DWORD dwWorkingSetPeak;
316 DWORD dwWorkingSet;
317 DWORD dwUnknown5;
318 DWORD dwPagedPool;
319 DWORD dwUnknown6;
320 DWORD dwNonPagedPool;
321 DWORD dwPageFileBytesPeak;
322 DWORD dwPrivateBytes;
323 DWORD dwPageFileBytes;
324 DWORD dwUnknown7[4];
325#ifdef __WIN32OS2__
326 THREADINFO ti[1];
327#else
328 THREADINFO ti[0];
329#endif
330} SYSTEM_PROCESS_INFORMATION;
331
332typedef struct {
333/* System Information Class 0x0b */
334 PVOID pvAddress;
335 DWORD dwUnknown1;
336 DWORD dwUnknown2;
337 DWORD dwEntryIndex;
338 DWORD dwUnknown3;
339 char szName[MAX_PATH + 1];
340} SYSTEM_DRIVER_INFORMATION;
341
342typedef struct {
343/* System Information Class 0x10 */
344 USHORT dwPID;
345 USHORT dwCreatorBackTraceIndex;
346 BYTE bObjectType;
347 BYTE bHandleAttributes;
348 USHORT usHandleOffset;
349 DWORD dwKeObject;
350 ULONG ulGrantedAccess;
351} HANDLEINFO, *PHANDLEINFO;
352
353typedef struct {
354/* System Information Class 0x15 */
355 ULONG CurrentSize;
356 ULONG PeakSize;
357 ULONG PageFaultCount;
358 ULONG MinimumWorkingSet;
359 ULONG MaximumWorkingSet;
360 ULONG unused[4];
361} SYSTEM_CACHE_INFORMATION;
362
363/* reading coffee grounds... */
364typedef struct _THREAD_INFO
365{ DWORD Unknown1[6];
366 DWORD ThreadID;
367 DWORD Unknown2[3];
368 DWORD Status;
369 DWORD WaitReason;
370 DWORD Unknown3[4];
371} THREAD_INFO, PTHREAD_INFO;
372
373typedef struct _VM_COUNTERS_
374{ ULONG PeakVirtualSize;
375 ULONG VirtualSize;
376 ULONG PageFaultCount;
377 ULONG PeakWorkingSetSize;
378 ULONG WorkingSetSize;
379 ULONG QuotaPeakPagedPoolUsage;
380 ULONG QuotaPagedPoolUsage;
381 ULONG QuotaPeakNonPagedPoolUsage;
382 ULONG QuotaNonPagedPoolUsage;
383 ULONG PagefileUsage;
384 ULONG PeakPagefileUsage;
385} VM_COUNTERS, *PVM_COUNTERS;
386
387/* process information */
388
389typedef struct _PROCESS_INFO
390{ DWORD Offset; /* 00 offset to next PROCESS_INFO ok*/
391 DWORD ThreadCount; /* 04 number of ThreadInfo member ok */
392 DWORD Unknown1[6];
393 FILETIME CreationTime; /* 20 */
394 DWORD Unknown2[5];
395 PWCHAR ProcessName; /* 3c ok */
396 DWORD BasePriority;
397 DWORD ProcessID; /* 44 ok*/
398 DWORD ParentProcessID;
399 DWORD HandleCount;
400 DWORD Unknown3[2]; /* 50 */
401 ULONG PeakVirtualSize;
402 ULONG VirtualSize;
403 ULONG PageFaultCount;
404 ULONG PeakWorkingSetSize;
405 ULONG WorkingSetSize;
406 ULONG QuotaPeakPagedPoolUsage;
407 ULONG QuotaPagedPoolUsage;
408 ULONG QuotaPeakNonPagedPoolUsage;
409 ULONG QuotaNonPagedPoolUsage;
410 ULONG PagefileUsage;
411 ULONG PeakPagefileUsage;
412 DWORD PrivateBytes;
413 DWORD Unknown6[4];
414 THREAD_INFO ati[ANYSIZE_ARRAY]; /* 94 size=0x40*/
415} PROCESS_INFO, PPROCESS_INFO;
416
417NTSTATUS WINAPI NtQuerySystemInformation(
418 IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
419 OUT PVOID SystemInformation,
420 IN ULONG Length,
421 OUT PULONG ResultLength);
422
423/*
424 * system configuration
425 */
426
427
428typedef struct _SYSTEM_TIME_ADJUSTMENT
429{
430 ULONG TimeAdjustment;
431 BOOLEAN TimeAdjustmentDisabled;
432
433} SYSTEM_TIME_ADJUSTMENT, *PSYSTEM_TIME_ADJUSTMENT;
434
435typedef struct _SYSTEM_CONFIGURATION_INFO
436{
437 union
438 { ULONG OemId;
439 struct
440 { WORD ProcessorArchitecture;
441 WORD Reserved;
442 } tag1;
443 } tag2;
444 ULONG PageSize;
445 PVOID MinimumApplicationAddress;
446 PVOID MaximumApplicationAddress;
447 ULONG ActiveProcessorMask;
448 ULONG NumberOfProcessors;
449 ULONG ProcessorType;
450 ULONG AllocationGranularity;
451 WORD ProcessorLevel;
452 WORD ProcessorRevision;
453
454} SYSTEM_CONFIGURATION_INFO, *PSYSTEM_CONFIGURATION_INFO;
455
456
457/*
458 * NtQueryProcessInformation
459 */
460
461/* parameter ProcessInformationClass */
462
463typedef enum _PROCESSINFOCLASS
464{ ProcessBasicInformation,
465 ProcessQuotaLimits,
466 ProcessIoCounters,
467 ProcessVmCounters,
468 ProcessTimes,
469 ProcessBasePriority,
470 ProcessRaisePriority,
471 ProcessDebugPort,
472 ProcessExceptionPort,
473 ProcessAccessToken,
474 ProcessLdtInformation,
475 ProcessLdtSize,
476 ProcessDefaultHardErrorMode,
477 ProcessIoPortHandlers,
478 ProcessPooledUsageAndLimits,
479 ProcessWorkingSetWatch,
480 ProcessUserModeIOPL,
481 ProcessEnableAlignmentFaultFixup,
482 ProcessPriorityClass,
483 ProcessWx86Information,
484 ProcessHandleCount,
485 ProcessAffinityMask,
486 ProcessPriorityBoost,
487 ProcessDeviceMap,
488 ProcessSessionInformation,
489 ProcessForegroundInformation,
490 ProcessWow64Information,
491 MaxProcessInfoClass
492} PROCESSINFOCLASS;
493
494/* parameter ProcessInformation (depending on ProcessInformationClass) */
495
496typedef struct _PROCESS_BASIC_INFORMATION
497{ DWORD ExitStatus;
498 DWORD PebBaseAddress;
499 DWORD AffinityMask;
500 DWORD BasePriority;
501 ULONG UniqueProcessId;
502 ULONG InheritedFromUniqueProcessId;
503} PROCESS_BASIC_INFORMATION;
504
505NTSTATUS WINAPI NtQueryInformationProcess(
506 IN HANDLE ProcessHandle,
507 IN PROCESSINFOCLASS ProcessInformationClass,
508 OUT PVOID ProcessInformation,
509 IN ULONG ProcessInformationLength,
510 OUT PULONG ReturnLength);
511
512#define NtCurrentProcess() ( (HANDLE) -1 )
513
514/*
515 * timer
516 */
517
518typedef enum _TIMER_TYPE
519{
520 NotificationTimer,
521 SynchronizationTimer
522
523} TIMER_TYPE;
524
525/* token functions */
526
527NTSTATUS WINAPI NtOpenProcessToken(
528 HANDLE ProcessHandle,
529 DWORD DesiredAccess,
530 HANDLE *TokenHandle);
531
532NTSTATUS WINAPI NtOpenThreadToken(
533 HANDLE ThreadHandle,
534 DWORD DesiredAccess,
535 BOOLEAN OpenAsSelf,
536 HANDLE *TokenHandle);
537
538NTSTATUS WINAPI NtAdjustPrivilegesToken(
539 IN HANDLE TokenHandle,
540 IN BOOLEAN DisableAllPrivileges,
541 IN PTOKEN_PRIVILEGES NewState,
542 IN DWORD BufferLength,
543 OUT PTOKEN_PRIVILEGES PreviousState,
544 OUT PDWORD ReturnLength);
545
546NTSTATUS WINAPI NtQueryInformationToken(
547 HANDLE token,
548 DWORD tokeninfoclass,
549 LPVOID tokeninfo,
550 DWORD tokeninfolength,
551 LPDWORD retlen );
552
553/* sid functions */
554
555BOOLEAN WINAPI RtlAllocateAndInitializeSid (
556 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
557 BYTE nSubAuthorityCount,
558 DWORD nSubAuthority0, DWORD nSubAuthority1,
559 DWORD nSubAuthority2, DWORD nSubAuthority3,
560 DWORD nSubAuthority4, DWORD nSubAuthority5,
561 DWORD nSubAuthority6, DWORD nSubAuthority7,
562 PSID *pSid );
563
564BOOL WINAPI RtlInitializeSid(
565 PSID pSid,
566 PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority,
567 BYTE nSubAuthorityCount);
568
569DWORD WINAPI RtlFreeSid(
570 PSID pSid);
571
572BOOL WINAPI RtlEqualSid(
573 PSID pSid1,
574 PSID pSid2 );
575
576DWORD WINAPI RtlLengthRequiredSid(
577 DWORD nrofsubauths);
578
579DWORD WINAPI RtlLengthSid(
580 PSID sid);
581
582LPDWORD WINAPI RtlSubAuthoritySid(
583 PSID PSID,
584 DWORD nr);
585
586LPBYTE WINAPI RtlSubAuthorityCountSid(
587 PSID pSid);
588
589DWORD WINAPI RtlCopySid(
590 DWORD len,
591 PSID to,
592 PSID from);
593
594BOOL WINAPI RtlValidSid(
595 PSID pSid);
596
597BOOL WINAPI RtlEqualPrefixSid(
598 PSID pSid1,
599 PSID pSid2);
600
601PSID_IDENTIFIER_AUTHORITY WINAPI RtlIdentifierAuthoritySid(
602 PSID pSid );
603
604/* security descriptor functions */
605
606NTSTATUS WINAPI RtlCreateSecurityDescriptor(
607 PSECURITY_DESCRIPTOR lpsd,
608 DWORD rev);
609
610NTSTATUS WINAPI RtlValidSecurityDescriptor(
611 PSECURITY_DESCRIPTOR SecurityDescriptor);
612
613ULONG WINAPI RtlLengthSecurityDescriptor(
614 PSECURITY_DESCRIPTOR SecurityDescriptor);
615
616NTSTATUS WINAPI RtlGetDaclSecurityDescriptor(
617 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
618 OUT PBOOLEAN lpbDaclPresent,
619 OUT PACL *pDacl,
620 OUT PBOOLEAN lpbDaclDefaulted);
621
622NTSTATUS WINAPI RtlSetDaclSecurityDescriptor (
623 PSECURITY_DESCRIPTOR lpsd,
624 BOOLEAN daclpresent,
625 PACL dacl,
626 BOOLEAN dacldefaulted );
627
628NTSTATUS WINAPI RtlGetSaclSecurityDescriptor(
629 IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
630 OUT PBOOLEAN lpbSaclPresent,
631 OUT PACL *pSacl,
632 OUT PBOOLEAN lpbSaclDefaulted);
633
634NTSTATUS WINAPI RtlSetSaclSecurityDescriptor (
635 PSECURITY_DESCRIPTOR lpsd,
636 BOOLEAN saclpresent,
637 PACL sacl,
638 BOOLEAN sacldefaulted);
639
640NTSTATUS WINAPI RtlGetOwnerSecurityDescriptor(
641 PSECURITY_DESCRIPTOR SecurityDescriptor,
642 PSID *Owner,
643 PBOOLEAN OwnerDefaulted);
644
645NTSTATUS WINAPI RtlSetOwnerSecurityDescriptor(
646 PSECURITY_DESCRIPTOR lpsd,
647 PSID owner,
648 BOOLEAN ownerdefaulted);
649
650NTSTATUS WINAPI RtlSetGroupSecurityDescriptor (
651 PSECURITY_DESCRIPTOR lpsd,
652 PSID group,
653 BOOLEAN groupdefaulted);
654
655NTSTATUS WINAPI RtlGetGroupSecurityDescriptor(
656 PSECURITY_DESCRIPTOR SecurityDescriptor,
657 PSID *Group,
658 PBOOLEAN GroupDefaulted);
659
660NTSTATUS WINAPI RtlMakeSelfRelativeSD(
661 IN PSECURITY_DESCRIPTOR pAbsoluteSecurityDescriptor,
662 IN PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
663 IN OUT LPDWORD lpdwBufferLength);
664
665NTSTATUS WINAPI RtlGetControlSecurityDescriptor(
666 PSECURITY_DESCRIPTOR pSecurityDescriptor,
667 PSECURITY_DESCRIPTOR_CONTROL pControl,
668 LPDWORD lpdwRevision);
669
670/* acl functions */
671
672NTSTATUS WINAPI RtlCreateAcl(
673 PACL acl,
674 DWORD size,
675 DWORD rev);
676
677BOOLEAN WINAPI RtlFirstFreeAce(
678 PACL acl,
679 PACE_HEADER *x);
680
681NTSTATUS WINAPI RtlAddAce(
682 PACL acl,
683 DWORD rev,
684 DWORD xnrofaces,
685 PACE_HEADER acestart,
686 DWORD acelen);
687
688BOOL WINAPI RtlAddAccessAllowedAce(
689 IN OUT PACL pAcl,
690 IN DWORD dwAceRevision,
691 IN DWORD AccessMask,
692 IN PSID pSid);
693
694BOOL WINAPI AddAccessAllowedAceEx(
695 IN OUT PACL pAcl,
696 IN DWORD dwAceRevision,
697 IN DWORD AceFlags,
698 IN DWORD AccessMask,
699 IN PSID pSid);
700
701DWORD WINAPI RtlGetAce(
702 PACL pAcl,
703 DWORD dwAceIndex,
704 LPVOID *pAce );
705
706/* string functions */
707
708DWORD WINAPI RtlAnsiStringToUnicodeSize(const STRING*);
709NTSTATUS WINAPI RtlAnsiStringToUnicodeString(UNICODE_STRING*,const STRING *,BOOLEAN);
710NTSTATUS WINAPI RtlAppendAsciizToString(STRING*,LPCSTR);
711NTSTATUS WINAPI RtlAppendStringToString(STRING*,const STRING*);
712NTSTATUS WINAPI RtlAppendUnicodeStringToString(UNICODE_STRING*,const UNICODE_STRING*);
713NTSTATUS WINAPI RtlAppendUnicodeToString(UNICODE_STRING*,LPCWSTR);
714LONG WINAPI RtlCompareString(const STRING*,const STRING*,BOOLEAN);
715LONG WINAPI RtlCompareUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
716void WINAPI RtlCopyString(STRING*,const STRING*);
717void WINAPI RtlCopyUnicodeString(UNICODE_STRING*,const UNICODE_STRING*);
718BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
719BOOLEAN WINAPI RtlCreateUnicodeStringFromAsciiz(PUNICODE_STRING,LPCSTR);
720void WINAPI RtlEraseUnicodeString(UNICODE_STRING*);
721BOOLEAN WINAPI RtlEqualString(const STRING*,const STRING*,BOOLEAN);
722BOOLEAN WINAPI RtlEqualUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
723void WINAPI RtlFreeAnsiString(PSTRING);
724void WINAPI RtlFreeOemString(PSTRING);
725void WINAPI RtlFreeUnicodeString(PUNICODE_STRING);
726void WINAPI RtlInitAnsiString(PSTRING,LPCSTR);
727void WINAPI RtlInitString(PSTRING,LPCSTR);
728void WINAPI RtlInitUnicodeString(PUNICODE_STRING,LPCWSTR);
729NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
730NTSTATUS WINAPI RtlMultiByteToUnicodeSize(DWORD*,LPCSTR,UINT);
731UINT WINAPI RtlOemStringToUnicodeSize(const STRING*);
732NTSTATUS WINAPI RtlOemStringToUnicodeString(UNICODE_STRING*,const STRING*,BOOLEAN);
733NTSTATUS WINAPI RtlOemToUnicodeN(LPWSTR,DWORD,LPDWORD,LPCSTR,DWORD);
734BOOLEAN WINAPI RtlPrefixString(const STRING*,const STRING*,BOOLEAN);
735BOOLEAN WINAPI RtlPrefixUnicodeString(const UNICODE_STRING*,const UNICODE_STRING*,BOOLEAN);
736DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING*);
737NTSTATUS WINAPI RtlUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
738DWORD WINAPI RtlUnicodeStringToOemSize(const UNICODE_STRING*);
739NTSTATUS WINAPI RtlUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
740NTSTATUS WINAPI RtlUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
741NTSTATUS WINAPI RtlUnicodeToMultiByteSize(DWORD*,LPCWSTR,UINT);
742NTSTATUS WINAPI RtlUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
743NTSTATUS WINAPI RtlUpcaseUnicodeString(UNICODE_STRING*,const UNICODE_STRING *,BOOLEAN);
744NTSTATUS WINAPI RtlUpcaseUnicodeStringToAnsiString(STRING*,const UNICODE_STRING*,BOOLEAN);
745NTSTATUS WINAPI RtlUpcaseUnicodeStringToOemString(STRING*,const UNICODE_STRING*,BOOLEAN);
746NTSTATUS WINAPI RtlUpcaseUnicodeToMultiByteN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
747NTSTATUS WINAPI RtlUpcaseUnicodeToOemN(LPSTR,DWORD,LPDWORD,LPCWSTR,DWORD);
748
749DWORD WINAPI RtlIsTextUnicode(
750 LPVOID buf,
751 DWORD len,
752 DWORD *pf);
753
754/* resource functions */
755
756typedef struct _RTL_RWLOCK {
757 CRITICAL_SECTION rtlCS;
758 HANDLE hSharedReleaseSemaphore;
759 UINT uSharedWaiters;
760 HANDLE hExclusiveReleaseSemaphore;
761 UINT uExclusiveWaiters;
762 INT iNumberActive;
763 HANDLE hOwningThreadId;
764 DWORD dwTimeoutBoost;
765 PVOID pDebugInfo;
766} RTL_RWLOCK, *LPRTL_RWLOCK;
767
768VOID WINAPI RtlInitializeResource(
769 LPRTL_RWLOCK);
770
771VOID WINAPI RtlDeleteResource(
772 LPRTL_RWLOCK);
773
774BYTE WINAPI RtlAcquireResourceExclusive(
775 LPRTL_RWLOCK, BYTE fWait);
776
777BYTE WINAPI RtlAcquireResourceShared(
778 LPRTL_RWLOCK, BYTE fWait);
779
780VOID WINAPI RtlReleaseResource(
781 LPRTL_RWLOCK);
782
783VOID WINAPI RtlDumpResource(
784 LPRTL_RWLOCK);
785
786/* time functions */
787
788typedef struct _TIME_FIELDS
789{ CSHORT Year;
790 CSHORT Month;
791 CSHORT Day;
792 CSHORT Hour;
793 CSHORT Minute;
794 CSHORT Second;
795 CSHORT Milliseconds;
796 CSHORT Weekday;
797} TIME_FIELDS;
798
799typedef TIME_FIELDS *PTIME_FIELDS;
800
801VOID WINAPI RtlSystemTimeToLocalTime(
802 IN PLARGE_INTEGER SystemTime,
803 OUT PLARGE_INTEGER LocalTime);
804
805VOID WINAPI RtlTimeToTimeFields(
806 PLARGE_INTEGER liTime,
807 PTIME_FIELDS TimeFields);
808
809BOOLEAN WINAPI RtlTimeFieldsToTime(
810 PTIME_FIELDS tfTimeFields,
811 PLARGE_INTEGER Time);
812
813VOID WINAPI RtlTimeToElapsedTimeFields(
814 PLARGE_INTEGER liTime,
815 PTIME_FIELDS TimeFields);
816
817void WINAPI NtQuerySystemTime( LARGE_INTEGER *time );
818
819BOOLEAN WINAPI RtlTimeToSecondsSince1980( const FILETIME *time, LPDWORD res );
820BOOLEAN WINAPI RtlTimeToSecondsSince1970( const FILETIME *time, LPDWORD res );
821void WINAPI RtlSecondsSince1970ToTime( DWORD time, FILETIME *res );
822void WINAPI RtlSecondsSince1980ToTime( DWORD time, FILETIME *res );
823
824typedef struct tagRTL_BITMAP {
825 ULONG SizeOfBitMap; /* Number of bits in the bitmap */
826 LPBYTE BitMapBuffer; /* Bitmap data, assumed sized to a DWORD boundary */
827} RTL_BITMAP, *PRTL_BITMAP;
828
829typedef const RTL_BITMAP *PCRTL_BITMAP;
830
831typedef struct tagRTL_BITMAP_RUN {
832 ULONG StartOfRun; /* Bit position at which run starts - FIXME: Name? */
833 ULONG SizeOfRun; /* Size of the run in bits - FIXME: Name? */
834} RTL_BITMAP_RUN, *PRTL_BITMAP_RUN;
835
836typedef const RTL_BITMAP_RUN *PCRTL_BITMAP_RUN;
837
838/* heap functions */
839
840/* Data structure for heap definition. This includes various
841 sizing parameters and callback routines, which, if left NULL,
842 result in default behavior */
843
844typedef struct
845{ ULONG Length; /* = sizeof(RTL_HEAP_DEFINITION) */
846 ULONG Unknown[11];
847} RTL_HEAP_DEFINITION, *PRTL_HEAP_DEFINITION;
848
849HANDLE WINAPI RtlCreateHeap(ULONG,PVOID,ULONG,ULONG,PVOID,PRTL_HEAP_DEFINITION);
850HANDLE WINAPI RtlDestroyHeap(HANDLE);
851PVOID WINAPI RtlAllocateHeap(HANDLE,ULONG,ULONG);
852BOOLEAN WINAPI RtlFreeHeap(HANDLE,ULONG,PVOID);
853PVOID WINAPI RtlReAllocateHeap(HANDLE,ULONG,PVOID,ULONG);
854ULONG WINAPI RtlCompactHeap(HANDLE,ULONG);
855BOOLEAN WINAPI RtlLockHeap(HANDLE);
856BOOLEAN WINAPI RtlUnlockHeap(HANDLE);
857ULONG WINAPI RtlSizeHeap(HANDLE,ULONG,PVOID);
858BOOLEAN WINAPI RtlValidateHeap(HANDLE,ULONG,PCVOID);
859ULONG WINAPI RtlGetProcessHeaps(ULONG,HANDLE*);
860NTSTATUS WINAPI RtlWalkHeap(HANDLE,PVOID);
861
862/* exception */
863
864void WINAPI NtRaiseException(
865 PEXCEPTION_RECORD,PCONTEXT,BOOL);
866
867void WINAPI RtlRaiseException(
868 PEXCEPTION_RECORD);
869
870void WINAPI RtlRaiseStatus(
871 NTSTATUS);
872
873void WINAPI RtlUnwind(
874 PEXCEPTION_FRAME,
875 LPVOID,
876 PEXCEPTION_RECORD,DWORD);
877
878/* process environment block */
879VOID WINAPI RtlAcquirePebLock(void);
880VOID WINAPI RtlReleasePebLock(void);
881
882/* mathematics */
883#if defined(__WIN32OS2__) && defined(__IBMC__)
884LARGE_INTEGER WINAPI RtlpConvertLongToLargeInteger( LONG a );
885LARGE_INTEGER WINAPI RtlpEnlargedIntegerMultiply( INT a, INT b );
886LARGE_INTEGER WINAPI RtlpExtendedMagicDivide( LARGE_INTEGER *a, LARGE_INTEGER *b, INT shift );
887LARGE_INTEGER WINAPI RtlpExtendedIntegerMultiply( LARGE_INTEGER *a, INT b );
888LARGE_INTEGER WINAPI RtlpExtendedLargeIntegerDivide( LARGE_INTEGER *a, INT b, INT *rem );
889LARGE_INTEGER WINAPI RtlpLargeIntegerAdd( LARGE_INTEGER *a, LARGE_INTEGER *b );
890LARGE_INTEGER WINAPI RtlpLargeIntegerArithmeticShift( LARGE_INTEGER *a, INT count );
891LARGE_INTEGER WINAPI RtlpLargeIntegerNegate( LARGE_INTEGER *a );
892LARGE_INTEGER WINAPI RtlpLargeIntegerShiftLeft( LARGE_INTEGER *a, INT count );
893LARGE_INTEGER WINAPI RtlpLargeIntegerShiftRight( LARGE_INTEGER *a, INT count );
894LARGE_INTEGER WINAPI RtlpLargeIntegerSubtract( LARGE_INTEGER *a, LARGE_INTEGER b );
895ULARGE_INTEGER WINAPI RtlpEnlargedUnsignedMultiply( UINT a, UINT b );
896LARGE_INTEGER WINAPI RtlpEnlargedUnsignedDivide( ULARGE_INTEGER a, UINT b, UINT *remptr );
897ULARGE_INTEGER WINAPI RtlpConvertUlongToLargeInteger( ULONG a );
898ULARGE_INTEGER WINAPI RtlpLargeIntegerDivide( ULARGE_INTEGER *a, ULARGE_INTEGER *b, ULARGE_INTEGER *rem );
899
900#else
901
902LONGLONG WINAPI RtlConvertLongToLargeInteger( LONG a );
903LONGLONG WINAPI RtlEnlargedIntegerMultiply( INT a, INT b );
904LONGLONG WINAPI RtlExtendedMagicDivide( LONGLONG a, LONGLONG b, INT shift );
905LONGLONG WINAPI RtlExtendedIntegerMultiply( LONGLONG a, INT b );
906LONGLONG WINAPI RtlExtendedLargeIntegerDivide( LONGLONG a, INT b, INT *rem );
907LONGLONG WINAPI RtlLargeIntegerAdd( LONGLONG a, LONGLONG b );
908LONGLONG WINAPI RtlLargeIntegerArithmeticShift( LONGLONG a, INT count );
909LONGLONG WINAPI RtlLargeIntegerNegate( LONGLONG a );
910LONGLONG WINAPI RtlLargeIntegerShiftLeft( LONGLONG a, INT count );
911LONGLONG WINAPI RtlLargeIntegerShiftRight( LONGLONG a, INT count );
912LONGLONG WINAPI RtlLargeIntegerSubtract( LONGLONG a, LONGLONG b );
913ULONGLONG WINAPI RtlEnlargedUnsignedMultiply( UINT a, UINT b );
914UINT WINAPI RtlEnlargedUnsignedDivide( ULONGLONG a, UINT b, UINT *remptr );
915ULONGLONG WINAPI RtlConvertUlongToLargeInteger( ULONG a );
916ULONGLONG WINAPI RtlLargeIntegerDivide( ULONGLONG a, ULONGLONG b, ULONGLONG *rem );
917
918#endif
919
920/* environment */
921DWORD WINAPI RtlCreateEnvironment(
922 DWORD x1,
923 DWORD x2);
924
925DWORD WINAPI RtlDestroyEnvironment(
926 DWORD x);
927
928DWORD WINAPI RtlQueryEnvironmentVariable_U(
929 DWORD x1,
930 PUNICODE_STRING key,
931 PUNICODE_STRING val) ;
932
933DWORD WINAPI RtlSetEnvironmentVariable(
934 DWORD x1,
935 PUNICODE_STRING key,
936 PUNICODE_STRING val);
937
938/* object security */
939
940DWORD WINAPI RtlNewSecurityObject(
941 DWORD x1,
942 DWORD x2,
943 DWORD x3,
944 DWORD x4,
945 DWORD x5,
946 DWORD x6);
947
948DWORD WINAPI RtlDeleteSecurityObject(
949 DWORD x1);
950
951NTSTATUS WINAPI
952NtQuerySecurityObject(
953 IN HANDLE Object,
954 IN SECURITY_INFORMATION RequestedInformation,
955 OUT PSECURITY_DESCRIPTOR pSecurityDesriptor,
956 IN ULONG Length,
957 OUT PULONG ResultLength);
958
959NTSTATUS WINAPI
960NtSetSecurityObject(
961 IN HANDLE Handle,
962 IN SECURITY_INFORMATION SecurityInformation,
963 IN PSECURITY_DESCRIPTOR SecurityDescriptor);
964
965/* registry functions */
966
967NTSTATUS WINAPI NtCreateKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,
968 const UNICODE_STRING*,ULONG,PULONG);
969NTSTATUS WINAPI NtDeleteKey(HANDLE);
970NTSTATUS WINAPI NtDeleteValueKey(HANDLE,const UNICODE_STRING*);
971NTSTATUS WINAPI NtOpenKey(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*);
972NTSTATUS WINAPI NtQueryKey(HANDLE,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
973NTSTATUS WINAPI NtSetValueKey(HANDLE,const UNICODE_STRING*,ULONG,ULONG,const void*,ULONG);
974NTSTATUS WINAPI NtEnumerateKey(HANDLE,ULONG,KEY_INFORMATION_CLASS,void*,DWORD,DWORD*);
975NTSTATUS WINAPI NtQueryValueKey(HANDLE,const UNICODE_STRING*,KEY_VALUE_INFORMATION_CLASS,
976 void*,DWORD,DWORD*);
977NTSTATUS WINAPI NtLoadKey(const OBJECT_ATTRIBUTES*,const OBJECT_ATTRIBUTES*);
978
979
980NTSTATUS WINAPI NtEnumerateValueKey(
981 HANDLE KeyHandle,
982 ULONG Index,
983 KEY_VALUE_INFORMATION_CLASS KeyInformationClass,
984 PVOID KeyInformation,
985 ULONG Length,
986 PULONG ResultLength);
987
988NTSTATUS WINAPI NtFlushKey(HANDLE KeyHandle);
989
990NTSTATUS WINAPI NtNotifyChangeKey(
991 IN HANDLE KeyHandle,
992 IN HANDLE Event,
993 IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
994 IN PVOID ApcContext OPTIONAL,
995 OUT PIO_STATUS_BLOCK IoStatusBlock,
996 IN ULONG CompletionFilter,
997 IN BOOLEAN Asynchroneous,
998 OUT PVOID ChangeBuffer,
999 IN ULONG Length,
1000 IN BOOLEAN WatchSubtree);
1001
1002NTSTATUS WINAPI NtQueryMultipleValueKey(
1003 HANDLE KeyHandle,
1004 PVALENTW ListOfValuesToQuery,
1005 ULONG NumberOfItems,
1006 PVOID MultipleValueInformation,
1007 ULONG Length,
1008 PULONG ReturnLength);
1009
1010NTSTATUS WINAPI NtReplaceKey(
1011 IN POBJECT_ATTRIBUTES ObjectAttributes,
1012 IN HANDLE Key,
1013 IN POBJECT_ATTRIBUTES ReplacedObjectAttributes);
1014
1015NTSTATUS WINAPI NtRestoreKey(
1016 HANDLE KeyHandle,
1017 HANDLE FileHandle,
1018 ULONG RestoreFlags);
1019
1020NTSTATUS WINAPI NtSaveKey(
1021 IN HANDLE KeyHandle,
1022 IN HANDLE FileHandle);
1023
1024NTSTATUS WINAPI NtSetInformationKey(
1025 IN HANDLE KeyHandle,
1026 IN const int KeyInformationClass,
1027 IN PVOID KeyInformation,
1028 IN ULONG KeyInformationLength);
1029
1030NTSTATUS WINAPI NtUnloadKey(
1031 IN HANDLE KeyHandle);
1032
1033NTSTATUS WINAPI NtClose(
1034 HANDLE Handle);
1035
1036NTSTATUS WINAPI NtTerminateProcess( HANDLE handle, LONG exit_code );
1037NTSTATUS WINAPI NtTerminateThread( HANDLE handle, LONG exit_code );
1038
1039NTSTATUS WINAPI NtClearEvent(HANDLE);
1040NTSTATUS WINAPI NtCreateEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *,BOOLEAN,BOOLEAN);
1041NTSTATUS WINAPI NtCreateSemaphore(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES*,ULONG,ULONG);
1042NTSTATUS WINAPI NtOpenEvent(PHANDLE,ACCESS_MASK,const OBJECT_ATTRIBUTES *attr);
1043NTSTATUS WINAPI NtPulseEvent(HANDLE,PULONG);
1044NTSTATUS WINAPI NtReleaseSemaphore(HANDLE,ULONG,PULONG);
1045NTSTATUS WINAPI NtResetEvent(HANDLE,PULONG);
1046NTSTATUS WINAPI NtSetEvent(HANDLE,PULONG);
1047
1048NTSTATUS WINAPI RtlInitializeCriticalSection( RTL_CRITICAL_SECTION *crit );
1049NTSTATUS WINAPI RtlInitializeCriticalSectionAndSpinCount( RTL_CRITICAL_SECTION *crit, DWORD spincount );
1050NTSTATUS WINAPI RtlDeleteCriticalSection( RTL_CRITICAL_SECTION *crit );
1051NTSTATUS WINAPI RtlpWaitForCriticalSection( RTL_CRITICAL_SECTION *crit );
1052NTSTATUS WINAPI RtlpUnWaitCriticalSection( RTL_CRITICAL_SECTION *crit );
1053NTSTATUS WINAPI RtlEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
1054BOOL WINAPI RtlTryEnterCriticalSection( RTL_CRITICAL_SECTION *crit );
1055NTSTATUS WINAPI RtlLeaveCriticalSection( RTL_CRITICAL_SECTION *crit );
1056
1057/* string functions */
1058extern LPSTR _strlwr( LPSTR str );
1059extern LPSTR _strupr( LPSTR str );
1060
1061/* misc */
1062
1063#if defined(__i386__) && defined(__GNUC__)
1064static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
1065static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }
1066#else /* __i386__ && __GNUC__ */
1067void WINAPI DbgBreakPoint(void);
1068void WINAPI DbgUserBreakPoint(void);
1069#endif /* __i386__ && __GNUC__ */
1070void WINAPIV DbgPrint(LPCSTR fmt, ...);
1071
1072DWORD WINAPI RtlAdjustPrivilege(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
1073DWORD WINAPI RtlIntegerToChar(DWORD x1,DWORD x2,DWORD x3,DWORD x4);
1074LPVOID WINAPI RtlNormalizeProcessParams(LPVOID x);
1075DWORD WINAPI RtlNtStatusToDosError(DWORD error);
1076BOOLEAN WINAPI RtlGetNtProductType(LPDWORD type);
1077PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule);
1078
1079DWORD WINAPI RtlOpenCurrentUser(
1080 IN ACCESS_MASK DesiredAccess,
1081 OUT PHANDLE KeyHandle);
1082
1083BOOLEAN WINAPI RtlDosPathNameToNtPathName_U( LPWSTR from,PUNICODE_STRING us,DWORD x2,DWORD x3);
1084BOOL WINAPI RtlImpersonateSelf(SECURITY_IMPERSONATION_LEVEL ImpersonationLevel);
1085
1086NTSTATUS WINAPI
1087NtAccessCheck(
1088 IN PSECURITY_DESCRIPTOR SecurityDescriptor,
1089 IN HANDLE ClientToken,
1090 IN ACCESS_MASK DesiredAccess,
1091 IN PGENERIC_MAPPING GenericMapping,
1092 OUT PPRIVILEGE_SET PrivilegeSet,
1093 OUT PULONG ReturnLength,
1094 OUT PULONG GrantedAccess,
1095 OUT PBOOLEAN AccessStatus);
1096
1097#ifdef __cplusplus
1098}
1099#endif
1100
1101#endif
Note: See TracBrowser for help on using the repository browser.