blob: abebb826b5dfccdac15352df3526c8ee747ba964 [file] [log] [blame]
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +00001#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
Michael Veksler17822f41999-02-09 15:46:25 +000010#include "winbase.h"
11
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +000012#ifdef __cplusplus
13extern "C" {
14#endif
15
Marcus Meissner51505b11998-11-01 14:00:21 +000016typedef DWORD NTSTATUS;
17
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +000018#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
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +000029/* ACEs, directly starting after an ACL */
30typedef 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 */
60typedef struct _ACCESS_ALLOWED_ACE {
61 ACE_HEADER Header;
62 DWORD Mask;
63 DWORD SidStart;
64} ACCESS_ALLOWED_ACE,*LPACCESS_ALLOWED_ACE;
65
66typedef struct _ACCESS_DENIED_ACE {
67 ACE_HEADER Header;
68 DWORD Mask;
69 DWORD SidStart;
70} ACCESS_DENIED_ACE,*LPACCESS_DENIED_ACE;
71
72typedef struct _SYSTEM_AUDIT_ACE {
73 ACE_HEADER Header;
74 DWORD Mask;
75 DWORD SidStart;
76} SYSTEM_AUDIT_ACE,*LPSYSTEM_AUDIT_ACE;
77
78typedef struct _SYSTEM_ALARM_ACE {
79 ACE_HEADER Header;
80 DWORD Mask;
81 DWORD SidStart;
82} SYSTEM_ALARM_ACE,*LPSYSTEM_ALARM_ACE;
83
Alexandre Julliarde658d821997-11-30 17:45:40 +000084typedef enum tagSID_NAME_USE {
85 SidTypeUser = 1,
86 SidTypeGroup,
87 SidTypeDomain,
88 SidTypeAlias,
89 SidTypeWellKnownGroup,
90 SidTypeDeletedAccount,
91 SidTypeInvalid,
92 SidTypeUnknown
Juergen Schmiedcdbdab71999-02-12 13:44:38 +000093} SID_NAME_USE,*PSID_NAME_USE;
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +000094
Alex Korobka6479f0f1999-01-31 09:24:44 +000095typedef struct _RTL_RWLOCK {
96 CRITICAL_SECTION rtlCS;
Alexandre Julliarda3960291999-02-26 11:11:13 +000097 HANDLE hSharedReleaseSemaphore;
98 UINT uSharedWaiters;
99 HANDLE hExclusiveReleaseSemaphore;
100 UINT uExclusiveWaiters;
101 INT iNumberActive;
102 HANDLE hOwningThreadId;
Alex Korobka6479f0f1999-01-31 09:24:44 +0000103 DWORD dwTimeoutBoost;
104 PVOID pDebugInfo;
105} RTL_RWLOCK, *LPRTL_RWLOCK;
106
107VOID WINAPI RtlInitializeResource(LPRTL_RWLOCK);
108VOID WINAPI RtlDeleteResource(LPRTL_RWLOCK);
109BYTE WINAPI RtlAcquireResourceExclusive(LPRTL_RWLOCK, BYTE fWait);
110BYTE WINAPI RtlAcquireResourceShared(LPRTL_RWLOCK, BYTE fWait);
111VOID WINAPI RtlReleaseResource(LPRTL_RWLOCK);
112VOID WINAPI RtlDumpResource(LPRTL_RWLOCK);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000113
Alexandre Julliarda3960291999-02-26 11:11:13 +0000114BOOL WINAPI IsValidSid(PSID);
115BOOL WINAPI EqualSid(PSID,PSID);
116BOOL WINAPI EqualPrefixSid(PSID,PSID);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000117DWORD WINAPI GetSidLengthRequired(BYTE);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000118BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY,BYTE,DWORD,
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000119 DWORD,DWORD,DWORD,DWORD,DWORD,DWORD,
Juergen Schmiedcdbdab71999-02-12 13:44:38 +0000120 DWORD,PSID*);
121VOID* WINAPI FreeSid(PSID);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000122BOOL WINAPI InitializeSecurityDescriptor(SECURITY_DESCRIPTOR*,DWORD);
123BOOL WINAPI InitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
Juergen Schmiedcdbdab71999-02-12 13:44:38 +0000124DWORD* WINAPI GetSidSubAuthority(PSID,DWORD);
125BYTE * WINAPI GetSidSubAuthorityCount(PSID);
126DWORD WINAPI GetLengthSid(PSID);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000127BOOL WINAPI CopySid(DWORD,PSID,PSID);
128BOOL WINAPI LookupAccountSidA(LPCSTR,PSID,LPCSTR,LPDWORD,LPCSTR,LPDWORD,
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000129 PSID_NAME_USE);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000130BOOL WINAPI LookupAccountSidW(LPCWSTR,PSID,LPCWSTR,LPDWORD,LPCWSTR,LPDWORD,
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000131 PSID_NAME_USE);
Juergen Schmiedcdbdab71999-02-12 13:44:38 +0000132PSID_IDENTIFIER_AUTHORITY WINAPI GetSidIdentifierAuthority(PSID);
Alexandre Julliarda3960291999-02-26 11:11:13 +0000133INT WINAPI AccessResource(HMODULE,HRSRC);
Alexandre Julliard44ed71f1997-12-21 19:17:50 +0000134
Alexandre Julliardf0cbfa01997-02-15 14:29:56 +0000135#ifdef __cplusplus
136}
137#endif
138
139#endif /* __WINE_NTDLL_H */