ReactOS  0.4.13-dev-101-g0ca4b50
privileges.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: Local Security Authority (LSA) Server
4  * FILE: reactos/dll/win32/lsasrv/privileges.c
5  * PURPOSE: Privilege lookup functions
6  *
7  * PROGRAMMERS: Eric Kohl <eric.kohl@reactos.org>
8  */
9 
10 #include "lsasrv.h"
11 #include "resources.h"
12 
13 typedef struct
14 {
19 
20 typedef struct
21 {
24 } RIGHT_DATA;
25 
26 
27 /* GLOBALS *****************************************************************/
28 
30 {
60 };
61 
62 static const RIGHT_DATA WellKnownRights[] =
63 {
74 };
75 
76 
77 /* FUNCTIONS ***************************************************************/
78 
82 {
83  PRPC_UNICODE_STRING NameBuffer;
84  ULONG Priv;
85 
86  if (Value->HighPart != 0 ||
87  (Value->LowPart < SE_MIN_WELL_KNOWN_PRIVILEGE ||
89  {
91  }
92 
93  for (Priv = 0; Priv < ARRAYSIZE(WellKnownPrivileges); Priv++)
94  {
95  if (Value->LowPart == WellKnownPrivileges[Priv].Luid.LowPart &&
96  Value->HighPart == WellKnownPrivileges[Priv].Luid.HighPart)
97  {
98  NameBuffer = MIDL_user_allocate(sizeof(RPC_UNICODE_STRING));
99  if (NameBuffer == NULL)
100  return STATUS_NO_MEMORY;
101 
102  NameBuffer->Length = wcslen(WellKnownPrivileges[Priv].Name) * sizeof(WCHAR);
103  NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR);
104 
105  NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength);
106  if (NameBuffer->Buffer == NULL)
107  {
108  MIDL_user_free(NameBuffer);
109  return STATUS_NO_MEMORY;
110  }
111 
112  wcscpy(NameBuffer->Buffer, WellKnownPrivileges[Priv].Name);
113 
114  *Name = NameBuffer;
115 
116  return STATUS_SUCCESS;
117  }
118  }
119 
121 }
122 
123 
124 NTSTATUS
126  USHORT ClientLanguage,
127  USHORT ClientSystemDefaultLanguage,
128  PRPC_UNICODE_STRING *DisplayName,
129  USHORT *LanguageReturned)
130 {
131  PRPC_UNICODE_STRING DisplayNameBuffer;
133  ULONG Index;
134  UINT nLength;
135 
136  TRACE("LsarpLookupPrivilegeDisplayName(%p 0x%04hu 0x%04hu %p %p)",
137  Name, ClientLanguage, ClientSystemDefaultLanguage, DisplayName, LanguageReturned);
138 
139  if (Name->Length == 0 || Name->Buffer == NULL)
141 
142  hInstance = GetModuleHandleW(L"lsasrv.dll");
143 
145  {
146  if (_wcsicmp(Name->Buffer, WellKnownPrivileges[Index].Name) == 0)
147  {
148  TRACE("Index: %u\n", Index);
151  ClientLanguage);
152  if (nLength != 0)
153  {
154  DisplayNameBuffer = MIDL_user_allocate(sizeof(RPC_UNICODE_STRING));
155  if (DisplayNameBuffer == NULL)
156  return STATUS_NO_MEMORY;
157 
158  DisplayNameBuffer->Length = nLength * sizeof(WCHAR);
159  DisplayNameBuffer->MaximumLength = DisplayNameBuffer->Length + sizeof(WCHAR);
160 
161  DisplayNameBuffer->Buffer = MIDL_user_allocate(DisplayNameBuffer->MaximumLength);
162  if (DisplayNameBuffer->Buffer == NULL)
163  {
164  MIDL_user_free(DisplayNameBuffer);
165  return STATUS_NO_MEMORY;
166  }
167 
170  ClientLanguage,
171  DisplayNameBuffer->Buffer,
172  nLength);
173 
174  *DisplayName = DisplayNameBuffer;
175  *LanguageReturned = ClientLanguage;
176  }
177  else
178  {
181  ClientSystemDefaultLanguage);
182  if (nLength != 0)
183  {
184  DisplayNameBuffer = MIDL_user_allocate(sizeof(RPC_UNICODE_STRING));
185  if (DisplayNameBuffer == NULL)
186  return STATUS_NO_MEMORY;
187 
188  DisplayNameBuffer->Length = nLength * sizeof(WCHAR);
189  DisplayNameBuffer->MaximumLength = DisplayNameBuffer->Length + sizeof(WCHAR);
190 
191  DisplayNameBuffer->Buffer = MIDL_user_allocate(DisplayNameBuffer->MaximumLength);
192  if (DisplayNameBuffer->Buffer == NULL)
193  {
194  MIDL_user_free(DisplayNameBuffer);
195  return STATUS_NO_MEMORY;
196  }
197 
200  ClientSystemDefaultLanguage,
201  DisplayNameBuffer->Buffer,
202  nLength);
203 
204  *DisplayName = DisplayNameBuffer;
205  *LanguageReturned = ClientSystemDefaultLanguage;
206  }
207  else
208  {
210 #if 0
213  0x409);
214 #endif
215  }
216  }
217 
218  return STATUS_SUCCESS;
219  }
220  }
221 
223 }
224 
225 
226 PLUID
229 {
230  ULONG Priv;
231 
232  if (Name->Length == 0 || Name->Buffer == NULL)
233  return NULL;
234 
235  for (Priv = 0; Priv < ARRAYSIZE(WellKnownPrivileges); Priv++)
236  {
237  if (_wcsicmp(Name->Buffer, WellKnownPrivileges[Priv].Name) == 0)
238  return (PLUID)&(WellKnownPrivileges[Priv].Luid);
239  }
240 
241  return NULL;
242 }
243 
244 
245 NTSTATUS
246 LsarpEnumeratePrivileges(DWORD *EnumerationContext,
247  PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer,
248  DWORD PreferedMaximumLength)
249 {
251  ULONG EnumIndex;
252  ULONG EnumCount = 0;
253  ULONG RequiredLength = 0;
254  ULONG i;
255  BOOLEAN MoreEntries = FALSE;
257 
258  EnumIndex = *EnumerationContext;
259 
260  for (; EnumIndex < ARRAYSIZE(WellKnownPrivileges); EnumIndex++)
261  {
262  TRACE("EnumIndex: %lu\n", EnumIndex);
263  TRACE("Privilege Name: %S\n", WellKnownPrivileges[EnumIndex].Name);
264  TRACE("Name Length: %lu\n", wcslen(WellKnownPrivileges[EnumIndex].Name));
265 
266  if ((RequiredLength +
267  wcslen(WellKnownPrivileges[EnumIndex].Name) * sizeof(WCHAR) +
268  sizeof(UNICODE_NULL) +
269  sizeof(LSAPR_POLICY_PRIVILEGE_DEF)) > PreferedMaximumLength)
270  {
271  MoreEntries = TRUE;
272  break;
273  }
274 
275  RequiredLength += (wcslen(WellKnownPrivileges[EnumIndex].Name) * sizeof(WCHAR) +
276  sizeof(UNICODE_NULL) + sizeof(LSAPR_POLICY_PRIVILEGE_DEF));
277  EnumCount++;
278  }
279 
280  TRACE("EnumCount: %lu\n", EnumCount);
281  TRACE("RequiredLength: %lu\n", RequiredLength);
282 
283  if (EnumCount == 0)
284  goto done;
285 
287  if (Privileges == NULL)
288  {
290  goto done;
291  }
292 
293  EnumIndex = *EnumerationContext;
294 
295  for (i = 0; i < EnumCount; i++, EnumIndex++)
296  {
297  Privileges[i].LocalValue = WellKnownPrivileges[EnumIndex].Luid;
298 
299  Privileges[i].Name.Length = (USHORT)wcslen(WellKnownPrivileges[EnumIndex].Name) * sizeof(WCHAR);
300  Privileges[i].Name.MaximumLength = (USHORT)Privileges[i].Name.Length + sizeof(UNICODE_NULL);
301 
302  Privileges[i].Name.Buffer = MIDL_user_allocate(Privileges[i].Name.MaximumLength);
303  if (Privileges[i].Name.Buffer == NULL)
304  {
306  goto done;
307  }
308 
309  memcpy(Privileges[i].Name.Buffer,
310  WellKnownPrivileges[EnumIndex].Name,
311  Privileges[i].Name.Length);
312  }
313 
314 done:
315  if (NT_SUCCESS(Status))
316  {
317  EnumerationBuffer->Entries = EnumCount;
318  EnumerationBuffer->Privileges = Privileges;
319  *EnumerationContext += EnumCount;
320  }
321  else
322  {
323  if (Privileges != NULL)
324  {
325  for (i = 0; i < EnumCount; i++)
326  {
327  if (Privileges[i].Name.Buffer != NULL)
328  MIDL_user_free(Privileges[i].Name.Buffer);
329  }
330 
332  }
333  }
334 
335  if ((Status == STATUS_SUCCESS) && (MoreEntries != FALSE))
337 
338  return Status;
339 }
340 
341 
342 NTSTATUS
345 {
346  PRPC_UNICODE_STRING NameBuffer;
347  ULONG i;
348 
349  for (i = 0; i < ARRAYSIZE(WellKnownRights); i++)
350  {
351  if (WellKnownRights[i].Flag == RightValue)
352  {
353  NameBuffer = MIDL_user_allocate(sizeof(RPC_UNICODE_STRING));
354  if (NameBuffer == NULL)
355  return STATUS_NO_MEMORY;
356 
357  NameBuffer->Length = wcslen(WellKnownRights[i].Name) * sizeof(WCHAR);
358  NameBuffer->MaximumLength = NameBuffer->Length + sizeof(WCHAR);
359 
360  NameBuffer->Buffer = MIDL_user_allocate(NameBuffer->MaximumLength);
361  if (NameBuffer->Buffer == NULL)
362  {
363  MIDL_user_free(NameBuffer);
365  }
366 
367  wcscpy(NameBuffer->Buffer, WellKnownRights[i].Name);
368 
369  *Name = NameBuffer;
370 
371  return STATUS_SUCCESS;
372  }
373  }
374 
376 }
377 
378 
382 {
383  ULONG i;
384 
385  if (Name->Length == 0 || Name->Buffer == NULL)
386  return 0;
387 
388  for (i = 0; i < ARRAYSIZE(WellKnownRights); i++)
389  {
390  if (_wcsicmp(Name->Buffer, WellKnownRights[i].Name) == 0)
391  return WellKnownRights[i].Flag;
392  }
393 
394  return 0;
395 }
396 
397 /* EOF */
#define SE_AUDIT_NAME
Definition: winnt_old.h:385
#define IDS_BACKUP_PRIVILEGE
Definition: resources.h:68
#define IDS_CREATE_PAGEFILE_PRIVILEGE
Definition: resources.h:66
static const PRIVILEGE_DATA WellKnownPrivileges[]
Definition: privileges.c:29
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define SE_CREATE_PERMANENT_PRIVILEGE
Definition: security.c:670
#define SECURITY_ACCESS_SERVICE_LOGON
Definition: ntlsa.h:51
#define SE_SECURITY_NAME
Definition: winnt_old.h:372
#define IN
Definition: typedefs.h:38
#define IDS_CREATE_GLOBAL_PRIVILEGE
Definition: resources.h:81
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define IDS_MANAGE_VOLUME_PRIVILEGE
Definition: resources.h:79
#define SE_SYSTEM_PROFILE_NAME
Definition: winnt_old.h:375
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define SE_CREATE_TOKEN_PRIVILEGE
Definition: security.c:656
#define SE_DENY_NETWORK_LOGON_NAME
Definition: ntsecapi.h:109
#define SE_ENABLE_DELEGATION_NAME
Definition: winnt_old.h:391
#define SE_PROF_SINGLE_PROCESS_NAME
Definition: winnt_old.h:377
#define SE_LOCK_MEMORY_PRIVILEGE
Definition: security.c:658
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define SE_BACKUP_NAME
#define IDS_SHUTDOWN_PRIVILEGE
Definition: resources.h:70
struct _LSAPR_POLICY_PRIVILEGE_DEF LSAPR_POLICY_PRIVILEGE_DEF
#define SE_DENY_REMOTE_INTERACTIVE_LOGON_NAME
Definition: ntsecapi.h:113
#define IDS_AUDIT_PRIVILEGE
Definition: resources.h:72
#define SE_MANAGE_VOLUME_NAME
Definition: winnt_old.h:392
LONG NTSTATUS
Definition: precomp.h:26
#define SE_DEBUG_PRIVILEGE
Definition: security.c:674
#define SE_LOAD_DRIVER_PRIVILEGE
Definition: security.c:664
#define IDS_LOCK_MEMORY_PRIVILEGE
Definition: resources.h:55
_In_ DWORD nLength
Definition: wincon.h:461
#define SE_RESTORE_PRIVILEGE
Definition: security.c:672
LPCWSTR Name
Definition: privileges.c:16
#define SE_SYSTEMTIME_PRIVILEGE
Definition: security.c:666
#define SE_TAKE_OWNERSHIP_PRIVILEGE
Definition: security.c:663
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define IDS_ASSIGNPRIMARYTOKEN_PRIVILEGE
Definition: resources.h:54
#define SE_SYNC_AGENT_PRIVILEGE
Definition: security.c:680
#define IDS_PROF_SINGLE_PROCESS_PRIVILEGE
Definition: resources.h:64
INT LsapLoadStringEx(_In_ HINSTANCE hInstance, _In_ UINT uId, _In_ USHORT usLanguage, _Out_ LPWSTR lpBuffer, _Out_ INT nBufferMax)
Definition: utils.c:99
#define IDS_RESTORE_PRIVILEGE
Definition: resources.h:69
int32_t INT
Definition: typedefs.h:56
#define IDS_DEBUG_PRIVILEGE
Definition: resources.h:71
#define IDS_INC_BASE_PRIORITY_PRIVILEGE
Definition: resources.h:65
#define SE_CREATE_PAGEFILE_NAME
Definition: winnt_old.h:379
#define SECURITY_ACCESS_DENY_BATCH_LOGON
Definition: ntlsa.h:55
static const RIGHT_DATA WellKnownRights[]
Definition: privileges.c:62
#define IDS_IMPERSONATE_PRIVILEGE
Definition: resources.h:80
INT LsapGetResourceStringLengthEx(_In_ HINSTANCE hInstance, _In_ UINT uId, _In_ USHORT usLanguage)
Definition: utils.c:64
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HINSTANCE hInstance
Definition: charmap.c:20
#define SECURITY_ACCESS_BATCH_LOGON
Definition: ntlsa.h:50
#define SE_TCB_PRIVILEGE
Definition: security.c:661
#define SE_NETWORK_LOGON_NAME
Definition: ntsecapi.h:105
LPCWSTR Name
Definition: privileges.c:23
#define UNICODE_NULL
#define SE_IMPERSONATE_NAME
Definition: winnt_old.h:393
#define SE_UNDOCK_NAME
Definition: winnt_old.h:389
#define SE_LOCK_MEMORY_NAME
Definition: winnt_old.h:367
#define IDS_ENABLE_DELEGATION_PRIVILEGE
Definition: resources.h:78
#define SE_CREATE_GLOBAL_PRIVILEGE
Definition: security.c:684
#define SE_SYSTEMTIME_NAME
Definition: winnt_old.h:376
unsigned char BOOLEAN
#define IDS_SYSTEM_ENVIRONMENT_PRIVILEGE
Definition: resources.h:73
#define IDS_SECURITY_PRIVILEGE
Definition: resources.h:59
smooth NULL
Definition: ftsmooth.c:416
#define SE_SYNC_AGENT_NAME
Definition: winnt_old.h:390
#define SE_MAX_WELL_KNOWN_PRIVILEGE
Definition: security.c:685
#define SE_UNDOCK_PRIVILEGE
Definition: security.c:679
NTSTATUS LsarpLookupPrivilegeName(PLUID Value, PRPC_UNICODE_STRING *Name)
Definition: privileges.c:80
#define SE_SHUTDOWN_PRIVILEGE
Definition: security.c:673
#define SE_SYSTEM_ENVIRONMENT_NAME
Definition: winnt_old.h:386
ULONG Flag
Definition: privileges.c:22
#define IDS_MACHINE_ACCOUNT_PRIVILEGE
Definition: resources.h:57
#define SE_CREATE_PAGEFILE_PRIVILEGE
Definition: security.c:669
#define SE_INCREASE_QUOTA_PRIVILEGE
Definition: security.c:659
#define SE_MIN_WELL_KNOWN_PRIVILEGE
Definition: security.c:655
#define SE_CHANGE_NOTIFY_PRIVILEGE
Definition: security.c:677
#define SE_SECURITY_PRIVILEGE
Definition: security.c:662
#define TRACE(s)
Definition: solgame.cpp:4
ACCESS_MASK LsapLookupAccountRightValue(IN PRPC_UNICODE_STRING Name)
Definition: privileges.c:380
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define SE_TCB_NAME
Definition: winnt_old.h:371
DWORD LowPart
#define STATUS_NO_SUCH_PRIVILEGE
Definition: ntstatus.h:318
#define SE_CREATE_PERMANENT_NAME
Definition: winnt_old.h:380
Definition: xml2sdb.h:79
static const UCHAR Index[8]
Definition: usbohci.c:18
#define IDS_SYNC_AGENT_PRIVILEGE
Definition: resources.h:77
#define IDS_TCB_PRIVILEGE
Definition: resources.h:58
#define SE_REMOTE_SHUTDOWN_PRIVILEGE
Definition: security.c:678
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET * Privileges
Definition: sefuncs.h:13
NTSTATUS LsapLookupAccountRightName(ULONG RightValue, PRPC_UNICODE_STRING *Name)
Definition: privileges.c:343
#define SECURITY_ACCESS_DENY_INTERACTIVE_LOGON
Definition: ntlsa.h:53
#define SECURITY_ACCESS_DENY_REMOTE_INTERACTIVE_LOGON
Definition: ntlsa.h:58
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
#define IDS_REMOTE_SHUTDOWN_PRIVILEGE
Definition: resources.h:75
LONG HighPart
#define SE_RESTORE_NAME
#define SE_INC_BASE_PRIORITY_NAME
Definition: winnt_old.h:378
#define IDS_CREATE_TOKEN_PRIVILEGE
Definition: resources.h:53
#define SE_REMOTE_INTERACTIVE_LOGON_NAME
Definition: ntsecapi.h:112
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define SE_CREATE_GLOBAL_NAME
Definition: winnt_old.h:394
#define SE_INC_BASE_PRIORITY_PRIVILEGE
Definition: security.c:668
unsigned short Length
Definition: msv1_0.h:53
#define SECURITY_ACCESS_DENY_SERVICE_LOGON
Definition: ntlsa.h:56
#define STATUS_MORE_ENTRIES
Definition: udferr_usr.h:124
#define SE_DENY_INTERACTIVE_LOGON_NAME
Definition: ntsecapi.h:108
PLUID LsarpLookupPrivilegeValue(IN PRPC_UNICODE_STRING Name)
Definition: privileges.c:227
#define SE_DENY_SERVICE_LOGON_NAME
Definition: ntsecapi.h:111
Status
Definition: gdiplustypes.h:24
#define IDS_LOAD_DRIVER_PRIVILEGE
Definition: resources.h:61
#define SECURITY_ACCESS_INTERACTIVE_LOGON
Definition: ntlsa.h:48
#define SE_REMOTE_SHUTDOWN_NAME
Definition: winnt_old.h:388
#define SE_ENABLE_DELEGATION_PRIVILEGE
Definition: security.c:681
#define SE_IMPERSONATE_PRIVILEGE
Definition: security.c:683
#define IDS_TAKE_OWNERSHIP_PRIVILEGE
Definition: resources.h:60
#define SE_MANAGE_VOLUME_PRIVILEGE
Definition: security.c:682
#define SE_DENY_BATCH_LOGON_NAME
Definition: ntsecapi.h:110
unsigned short USHORT
Definition: pedump.c:61
PLSAPR_POLICY_PRIVILEGE_DEF Privileges
Definition: lsa.idl:88
#define SE_CHANGE_NOTIFY_NAME
Definition: winnt_old.h:387
_In_ ULONG _Out_opt_ PULONG RequiredLength
Definition: wmifuncs.h:29
#define SE_TAKE_OWNERSHIP_NAME
Definition: winnt_old.h:373
#define IDS_INCREASE_QUOTA_PRIVILEGE
Definition: resources.h:56
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
#define SE_SYSTEM_PROFILE_PRIVILEGE
Definition: security.c:665
unsigned int UINT
Definition: ndis.h:50
#define SE_ASSIGNPRIMARYTOKEN_NAME
Definition: winnt_old.h:366
#define SE_PROF_SINGLE_PROCESS_PRIVILEGE
Definition: security.c:667
#define SE_CREATE_TOKEN_NAME
Definition: winnt_old.h:365
#define SECURITY_ACCESS_DENY_NETWORK_LOGON
Definition: ntlsa.h:54
NTSTATUS LsarpLookupPrivilegeDisplayName(PRPC_UNICODE_STRING Name, USHORT ClientLanguage, USHORT ClientSystemDefaultLanguage, PRPC_UNICODE_STRING *DisplayName, USHORT *LanguageReturned)
Definition: privileges.c:125
#define SECURITY_ACCESS_REMOTE_INTERACTIVE_LOGON
Definition: ntlsa.h:57
#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE
Definition: security.c:676
#define SE_SHUTDOWN_NAME
Definition: winnt_old.h:383
#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE
Definition: security.c:657
unsigned int ULONG
Definition: retypes.h:1
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:845
#define SE_BACKUP_PRIVILEGE
Definition: security.c:671
#define SE_DEBUG_NAME
Definition: winnt_old.h:384
void *__RPC_USER MIDL_user_allocate(SIZE_T size)
Definition: irotp.c:371
#define SE_MACHINE_ACCOUNT_NAME
Definition: winnt_old.h:370
#define IDS_CREATE_PERMANENT_PRIVILEGE
Definition: resources.h:67
#define SE_INTERACTIVE_LOGON_NAME
Definition: ntsecapi.h:104
#define SE_INCREASE_QUOTA_NAME
Definition: winnt_old.h:368
NTSTATUS LsarpEnumeratePrivileges(DWORD *EnumerationContext, PLSAPR_PRIVILEGE_ENUM_BUFFER EnumerationBuffer, DWORD PreferedMaximumLength)
Definition: privileges.c:246
return STATUS_SUCCESS
Definition: btrfs.c:2725
void __RPC_USER MIDL_user_free(void *p)
Definition: irotp.c:376
#define SE_AUDIT_PRIVILEGE
Definition: security.c:675
#define IDS_SYSTEMTIME_PRIVILEGE
Definition: resources.h:63
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define SE_LOAD_DRIVER_NAME
Definition: winnt_old.h:374
#define SECURITY_ACCESS_NETWORK_LOGON
Definition: ntlsa.h:49
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define IDS_SYSTEM_PROFILE_PRIVILEGE
Definition: resources.h:62
unsigned short MaximumLength
Definition: msv1_0.h:54
#define IDS_CHANGE_NOTIFY_PRIVILEGE
Definition: resources.h:74
#define IDS_UNDOCK_PRIVILEGE
Definition: resources.h:76
#define SE_SERVICE_LOGON_NAME
Definition: ntsecapi.h:107
#define SE_BATCH_LOGON_NAME
Definition: ntsecapi.h:106
#define SE_MACHINE_ACCOUNT_PRIVILEGE
Definition: security.c:660
wchar_t * Buffer
Definition: msv1_0.h:55