Added missing ReadClassStg prototype.
[wine] / include / ntdll.h
1 #ifndef __WINE_NTDLL_H
2 #define __WINE_NTDLL_H
3 /* ntdll.h 
4  *
5  * contains NT internal defines that don't show on the Win32 API level
6  *
7  * Copyright 1997 Marcus Meissner
8  */
9
10 #include "winbase.h"
11
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15
16 typedef DWORD NTSTATUS;
17
18 #define SID_REVISION                    (1)     /* Current revision */
19 #define SID_MAX_SUB_AUTHORITIES         (15)    /* current max subauths */
20 #define SID_RECOMMENDED_SUB_AUTHORITIES (1)     /* recommended subauths */
21
22 /* ACLs of NT */
23
24 #define ACL_REVISION    2
25
26 #define ACL_REVISION1   1
27 #define ACL_REVISION2   2
28
29 /* ACEs, directly starting after an ACL */
30 typedef struct _ACE_HEADER {
31         BYTE    AceType;
32         BYTE    AceFlags;
33         WORD    AceSize;
34 } ACE_HEADER,*LPACE_HEADER;
35
36 /* AceType */
37 #define ACCESS_ALLOWED_ACE_TYPE         0
38 #define ACCESS_DENIED_ACE_TYPE          1
39 #define SYSTEM_AUDIT_ACE_TYPE           2
40 #define SYSTEM_ALARM_ACE_TYPE           3
41
42 /* inherit AceFlags */
43 #define OBJECT_INHERIT_ACE              0x01
44 #define CONTAINER_INHERIT_ACE           0x02
45 #define NO_PROPAGATE_INHERIT_ACE        0x04
46 #define INHERIT_ONLY_ACE                0x08
47 #define VALID_INHERIT_FLAGS             0x0F
48
49 /* AceFlags mask for what events we (should) audit */
50 #define SUCCESSFUL_ACCESS_ACE_FLAG      0x40
51 #define FAILED_ACCESS_ACE_FLAG          0x80
52
53 /* different ACEs depending on AceType 
54  * SidStart marks the begin of a SID
55  * so the thing finally looks like this:
56  * 0: ACE_HEADER
57  * 4: ACCESS_MASK
58  * 8... : SID
59  */
60 typedef struct _ACCESS_ALLOWED_ACE {
61         ACE_HEADER      Header;
62         DWORD           Mask;
63         DWORD           SidStart;
64 } ACCESS_ALLOWED_ACE,*LPACCESS_ALLOWED_ACE;
65
66 typedef struct _ACCESS_DENIED_ACE {
67         ACE_HEADER      Header;
68         DWORD           Mask;
69         DWORD           SidStart;
70 } ACCESS_DENIED_ACE,*LPACCESS_DENIED_ACE;
71
72 typedef struct _SYSTEM_AUDIT_ACE {
73         ACE_HEADER      Header;
74         DWORD           Mask;
75         DWORD           SidStart;
76 } SYSTEM_AUDIT_ACE,*LPSYSTEM_AUDIT_ACE;
77
78 typedef struct _SYSTEM_ALARM_ACE {
79         ACE_HEADER      Header;
80         DWORD           Mask;
81         DWORD           SidStart;
82 } SYSTEM_ALARM_ACE,*LPSYSTEM_ALARM_ACE;
83
84 typedef enum tagSID_NAME_USE {
85         SidTypeUser = 1,
86         SidTypeGroup,
87         SidTypeDomain,
88         SidTypeAlias,
89         SidTypeWellKnownGroup,
90         SidTypeDeletedAccount,
91         SidTypeInvalid,
92         SidTypeUnknown
93 } SID_NAME_USE,*PSID_NAME_USE;
94
95 typedef struct _RTL_RWLOCK {
96         CRITICAL_SECTION        rtlCS;
97         HANDLE          hSharedReleaseSemaphore;
98         UINT                    uSharedWaiters;
99         HANDLE          hExclusiveReleaseSemaphore;
100         UINT                    uExclusiveWaiters;
101         INT                     iNumberActive;
102         HANDLE          hOwningThreadId;
103         DWORD                   dwTimeoutBoost;
104         PVOID                   pDebugInfo;
105 } RTL_RWLOCK, *LPRTL_RWLOCK;
106
107 VOID   WINAPI RtlInitializeResource(LPRTL_RWLOCK);
108 VOID   WINAPI RtlDeleteResource(LPRTL_RWLOCK);
109 BYTE   WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK, BYTE fWait);
110 BYTE   WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK, BYTE fWait);
111 VOID   WINAPI RtlReleaseResource(LPRTL_RWLOCK);
112 VOID   WINAPI RtlDumpResource(LPRTL_RWLOCK);
113
114 BOOL WINAPI IsValidSid(PSID);
115 BOOL WINAPI EqualSid(PSID,PSID);
116 BOOL WINAPI EqualPrefixSid(PSID,PSID);
117 DWORD  WINAPI GetSidLengthRequired(BYTE);
118 BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
119                                        DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
120                                        DWORD,PSID*);
121 VOID*  WINAPI FreeSid(PSID);
122 BOOL WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
123 BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
124 DWORD* WINAPI GetSidSubAuthority(PSID,DWORD);
125 BYTE * WINAPI GetSidSubAuthorityCount(PSID);
126 DWORD  WINAPI GetLengthSid(PSID);
127 BOOL WINAPI CopySid(DWORD,PSID,PSID);
128 BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
129                                   PSID_NAME_USE);
130 BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
131                                   PSID_NAME_USE);
132 PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
133 INT       WINAPI AccessResource(HMODULE,HRSRC);
134
135 #ifdef __cplusplus
136 }
137 #endif
138
139 #endif  /* __WINE_NTDLL_H */