ReactOS 0.4.15-dev-8021-g7ce96fd
ShellCommandSACL.cpp
Go to the documentation of this file.
1/*
2 * regexpl - Console Registry Explorer
3 *
4 * Copyright (C) 2000-2005 Nedko Arnaudov <nedko@users.sourceforge.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
22// ShellCommandSACL.cpp: implementation of the CShellCommandSACL class.
23//
25
26#include "ph.h"
27#include "ShellCommandSACL.h"
28#include "RegistryExplorer.h"
29#include "SecurityDescriptor.h"
30
31#define SACL_CMD _T("SACL")
32#define SACL_CMD_LENGTH COMMAND_LENGTH(SACL_CMD)
33#define SACL_CMD_SHORT_DESC SACL_CMD _T(" command is used to view")/*"/edit"*/_T(" key's SACL.\n")
34
36// Construction/Destruction
38
40{
41
42}
43
45{
46
47}
48
50{
51 if (_tcsicmp(pchCommand,SACL_CMD) == 0)
52 return TRUE;
53 if (_tcsnicmp(pchCommand,SACL_CMD _T(".."),SACL_CMD_LENGTH+2*sizeof(TCHAR)) == 0)
54 return TRUE;
55 if (_tcsnicmp(pchCommand,SACL_CMD _T("/") ,SACL_CMD_LENGTH+1*sizeof(TCHAR)) == 0)
56 return TRUE;
57 if (_tcsnicmp(pchCommand,SACL_CMD _T("\\"),SACL_CMD_LENGTH+1*sizeof(TCHAR)) == 0)
58 return TRUE;
59 return FALSE;
60}
61
63{
64#define ERROR_MSG_BUFFER_SIZE 1024
65 TCHAR pszError_msg[ERROR_MSG_BUFFER_SIZE];
66 pszError_msg[ERROR_MSG_BUFFER_SIZE-1] = 0;
67
68 rArguments.ResetArgumentIteration();
69
70 const TCHAR *pszKey = NULL;
71 BOOL blnDo = TRUE;
72 BOOL blnBadParameter = FALSE;
73 BOOL blnHelp = FALSE;
74 const TCHAR *pszParameter;
75 const TCHAR *pszCommandItself = rArguments.GetNextArgument();
76 DWORD dwError;
77 PISECURITY_DESCRIPTOR pSecurityDescriptor = NULL;
79 HANDLE hThreadToken = INVALID_HANDLE_VALUE;
80
81 if ((_tcsnicmp(pszCommandItself,SACL_CMD _T(".."),SACL_CMD_LENGTH+2*sizeof(TCHAR)) == 0)||
82 (_tcsnicmp(pszCommandItself,SACL_CMD _T("\\"),SACL_CMD_LENGTH+1*sizeof(TCHAR)) == 0))
83 {
84 pszKey = pszCommandItself + SACL_CMD_LENGTH;
85 }
86 else if (_tcsnicmp(pszCommandItself,SACL_CMD _T("/"),SACL_CMD_LENGTH+1*sizeof(TCHAR)) == 0)
87 {
88 pszParameter = pszCommandItself + SACL_CMD_LENGTH;
89 goto CheckSACLArgument;
90 }
91
92 while((pszParameter = rArguments.GetNextArgument()) != NULL)
93 {
94CheckSACLArgument:
95 blnBadParameter = FALSE;
96 if ((_tcsicmp(pszParameter,_T("/?")) == 0)||
97 (_tcsicmp(pszParameter,_T("-?")) == 0))
98 {
99 blnHelp = TRUE;
100 blnDo = pszKey != NULL;
101 }
102 else if (!pszKey)
103 {
104 pszKey = pszParameter;
105 blnDo = TRUE;
106 }
107 else
108 {
109 blnBadParameter = TRUE;
110 }
111 if (blnBadParameter)
112 {
113 rConsole.Write(_T("Bad parameter: "));
114 rConsole.Write(pszParameter);
115 rConsole.Write(_T("\n"));
116 }
117 }
118
120
121 ASSERT(hThreadToken == INVALID_HANDLE_VALUE);
122
123 // Open thread token
125 { // OpenThreadToken failed
126 dwError = GetLastError();
127 if (dwError != ERROR_NO_TOKEN)
128 {
129 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot open thread token.\nOpenThreadToken fails with error: %u\n"),(unsigned int)dwError);
130 goto Error;
131 }
132
133 // If the thread does not have an access token, we'll examine the
134 // access token associated with the process.
136 {
137 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot open process token.\nOpenProcessToken fails with error: %u\n"),(unsigned int)GetLastError());
138 goto Error;
139 }
140 }
141
142 ASSERT(hThreadToken != INVALID_HANDLE_VALUE);
143
144 // enable SeSecurityPrivilege privilege
145 TOKEN_PRIVILEGES priv;
146 priv.PrivilegeCount = 1;
149 NULL, // lookup privilege on local system
150 SE_SECURITY_NAME, // privilege to lookup
151 &(priv.Privileges[0].Luid))) // receives LUID of privilege
152 {
153 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot retrieve the locally unique identifier for %s privilege.\nLookupPrivilegeValue error: %u\n"),SE_SECURITY_NAME,(unsigned int)GetLastError());
154 goto Error;
155 }
156
157 BOOL blnAdjRet;
158 blnAdjRet = AdjustTokenPrivileges(
159 hThreadToken,
160 FALSE,
161 &priv,
162 sizeof(TOKEN_PRIVILEGES),
164 (PDWORD)NULL);
165 dwError = GetLastError();
166 if (!blnAdjRet)
167 {
168 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot enable %s privilege.\nAdjustTokenPrivileges fails with error: %u%s\n"),SE_SECURITY_NAME,(unsigned int)dwError,(dwError == 5)?_T(" (Access denied)"):_T(""));
169 goto Error;
170 }
171
172 if (dwError != ERROR_SUCCESS)
173 {
174 if (dwError == ERROR_NOT_ALL_ASSIGNED)
175 {
176 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot enable %s privilege.\nThe token does not have the %s privilege\n"),SE_SECURITY_NAME,SE_SECURITY_NAME);
177 }
178 else
179 {
180 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot enable %s privilege.\nAdjustTokenPrivileges succeds with error: %u\n"),SE_SECURITY_NAME,(unsigned int)dwError);
181 }
182
183 goto Error;
184 }
185
187 {
189 blnDo = FALSE;
190 }
191
192 if (blnHelp)
193 {
194 rConsole.Write(GetHelpString());
195 }
196
197 if (blnDo&&blnHelp)
198 rConsole.Write(_T("\n"));
199
200 if (!blnDo)
201 return 0;
202
203 if (Key.IsRoot())
204 {
206 goto Error;
207 }
208
209 DWORD dwSecurityDescriptorLength;
210 rConsole.Write(_T("Key : "));
211 rConsole.Write(_T("\\"));
212
213 rConsole.Write(Key.GetKeyName());
214 rConsole.Write(_T("\n"));
215 dwError = Key.GetSecurityDescriptorLength(&dwSecurityDescriptorLength);
216 if (dwError != ERROR_SUCCESS)
217 {
218 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot get security descriptor's length for current key.\nError: %u\n"),(unsigned int)dwError);
219 goto Error;
220 }
221
222 pSecurityDescriptor = (PISECURITY_DESCRIPTOR) new (std::nothrow) unsigned char [dwSecurityDescriptorLength];
223 if (!pSecurityDescriptor)
224 {
225 _tcsncpy(pszError_msg,_T("\nOut of memory.\n"),ERROR_MSG_BUFFER_SIZE-1);
226 goto Error;
227 }
228
229 DWORD dwSecurityDescriptorLength1;
230 dwSecurityDescriptorLength1 = dwSecurityDescriptorLength;
231 dwError = Key.GetSecurityDescriptor((SECURITY_INFORMATION)SACL_SECURITY_INFORMATION,pSecurityDescriptor,&dwSecurityDescriptorLength1);
232 if (dwError != ERROR_SUCCESS)
233 {
234 _sntprintf(pszError_msg,ERROR_MSG_BUFFER_SIZE-1,_T("\nCannot get security descriptor for current key.\nError: %u%s\n"),(unsigned int)dwError,(dwError == 1314)?_T("(A required privilege is not held by the client.)\n"):_T(""));
235 goto Error;
236 }
237
238 sd.AssociateDescriptor(pSecurityDescriptor);
239 sd.BeginSACLInteration();
240
241 if ((!sd.DescriptorContainsSACL())||(sd.HasNULLSACL()))
242 {
243 _tcsncpy(pszError_msg,_T("Key has not SACL.\n"),ERROR_MSG_BUFFER_SIZE-1);
244 goto Error;
245 }
246
247 if (!sd.HasValidSACL())
248 {
249 _tcsncpy(pszError_msg,_T("Invalid SACL.\n"),ERROR_MSG_BUFFER_SIZE-1);
250 goto Error;
251 }
252
253 DWORD nACECount;
254 nACECount = sd.GetSACLEntriesCount();
255 rConsole.Write(_T("SACL has "));
256 TCHAR Buffer[256];
257 rConsole.Write(_itoa(nACECount,Buffer,10));
258 rConsole.Write(_T(" ACEs.\n"));
259 ASSERT(sizeof(ACL) == 8);
260 rConsole.Write(_T("\n"));
261 for (DWORD i = 0 ; i < nACECount ; i++)
262 {
263 rConsole.Write(_T("\n"));
264 rConsole.Write(_T("\tACE Index: "));
265 rConsole.Write(_itoa(i,Buffer,10));
266 rConsole.Write(_T("\n"));
267 rConsole.Write(_T("\tAudit Type: "));
268 BOOL blnFailed, blnSuccessful;
269 if (sd.GetSACLEntry(i,blnFailed,blnSuccessful) != CSecurityDescriptor::SystemAudit)
270 {
271 rConsole.Write(_T("Unknown ACE type.\nCannot continue ACE list dump.\n"));
272 goto AbortDumpSACL;
273 }
274
275 if (blnFailed)
276 rConsole.Write(_T("Failed access"));
277
278 if (blnFailed && blnSuccessful)
279 rConsole.Write(_T(" & "));
280 if (blnSuccessful)
281 rConsole.Write(_T("Successful access"));
282 rConsole.Write(_T("\n"));
283
284 PSID pSID = sd.GetCurrentACE_SID();
285 if ((pSID == NULL)||(!IsValidSid(pSID)))
286 {
287 rConsole.Write(_T("\tInvalid SID.\n"));
288 }
289
290 DWORD dwSIDStringSize = 0;
291 BOOL blnRet = GetTextualSid(pSID,NULL,&dwSIDStringSize);
292 ASSERT(!blnRet);
294 TCHAR *pszSID = new (std::nothrow) TCHAR[dwSIDStringSize];
295
296 if (!pszSID)
297 {
298 _tcsncpy(pszError_msg,_T("\nOut of memory.\n"),ERROR_MSG_BUFFER_SIZE-1);
299 goto Error;
300 }
301
302 if(!GetTextualSid(pSID,pszSID,&dwSIDStringSize))
303 {
304 dwError = GetLastError();
306 rConsole.Write(_T("Error "));
307 TCHAR Buffer[256];
308 rConsole.Write(_itoa(dwError,Buffer,10));
309 rConsole.Write(_T("\nGetting string representation of SID\n"));
310 }
311 else
312 {
313 rConsole.Write(_T("\tSID: "));
314 rConsole.Write(pszSID);
315 rConsole.Write(_T("\n"));
316 }
317 delete[] pszSID;
318
319 TCHAR *pszName, *pszDomainName;
320 DWORD dwNameBufferLength, dwDomainNameBufferLength;
321 dwNameBufferLength = 1024;
322 dwDomainNameBufferLength = 1024;
323
324 pszName = new (std::nothrow) TCHAR [dwNameBufferLength];
325 if (!pszName)
326 {
327 _tcsncpy(pszError_msg,_T("\nOut of memory.\n"),ERROR_MSG_BUFFER_SIZE-1);
328 goto Error;
329 }
330
331 pszDomainName = new (std::nothrow) TCHAR [dwDomainNameBufferLength];
332 if (!pszDomainName)
333 {
334 _tcsncpy(pszError_msg,_T("\nOut of memory.\n"),ERROR_MSG_BUFFER_SIZE-1);
335 delete[] pszName;
336 goto Error;
337 }
338
339 DWORD dwNameLength = dwNameBufferLength, dwDomainNameLength = dwDomainNameBufferLength;
340 SID_NAME_USE Use;
341 if (!LookupAccountSid(NULL,pSID,pszName,&dwNameLength,pszDomainName,&dwDomainNameLength,&Use))
342 {
343 rConsole.Write(_T("Error "));
344 TCHAR Buffer[256];
345 rConsole.Write(_itoa(GetLastError(),Buffer,10));
346 rConsole.Write(_T("\n"));
347 }
348 else
349 {
350 rConsole.Write(_T("\tTrustee Domain: "));
351 rConsole.Write(pszDomainName);
352 rConsole.Write(_T("\n"));
353 rConsole.Write(_T("\tTrustee Name: "));
354 rConsole.Write(pszName);
355 rConsole.Write(_T("\n\tSID type: "));
356 rConsole.Write(GetSidTypeName(Use));
357 rConsole.Write(_T("\n"));
358 }
359 DWORD dwAccessMask;
360 sd.GetCurrentACE_AccessMask(dwAccessMask);
361 wsprintf(Buffer,_T("\tAccess Mask: 0x%08lX\n"),dwAccessMask);
362 rConsole.Write(Buffer);
363 if (dwAccessMask & GENERIC_READ)
364 {
365 rConsole.Write(_T("\t\tGENERIC_READ\n"));
366 }
367 if (dwAccessMask & GENERIC_WRITE)
368 {
369 rConsole.Write(_T("\t\tGENERIC_WRITE\n"));
370 }
371 if (dwAccessMask & GENERIC_EXECUTE)
372 {
373 rConsole.Write(_T("\t\tGENERIC_EXECUTE\n"));
374 }
375 if (dwAccessMask & GENERIC_ALL)
376 {
377 rConsole.Write(_T("\t\tGENERIC_ALL\n"));
378 }
379 if (dwAccessMask & SYNCHRONIZE)
380 {
381 rConsole.Write(_T("\t\tSYNCHRONIZE\n"));
382 }
383 if (dwAccessMask & WRITE_OWNER)
384 {
385 rConsole.Write(_T("\t\tWRITE_OWNER\n"));
386 }
387 if (dwAccessMask & WRITE_DAC)
388 {
389 rConsole.Write(_T("\t\tWRITE_DAC\n"));
390 }
391 if (dwAccessMask & READ_CONTROL)
392 {
393 rConsole.Write(_T("\t\tREAD_CONTROL\n"));
394 }
395 if (dwAccessMask & DELETE)
396 {
397 rConsole.Write(_T("\t\tDELETE\n"));
398 }
399 if (dwAccessMask & KEY_CREATE_LINK)
400 {
401 rConsole.Write(_T("\t\tKEY_CREATE_LINK\n"));
402 }
403 if (dwAccessMask & KEY_NOTIFY)
404 {
405 rConsole.Write(_T("\t\tKEY_NOTIFY\n"));
406 }
407 if (dwAccessMask & KEY_ENUMERATE_SUB_KEYS)
408 {
409 rConsole.Write(_T("\t\tKEY_ENUMERATE_SUB_KEYS\n"));
410 }
411 if (dwAccessMask & KEY_CREATE_SUB_KEY)
412 {
413 rConsole.Write(_T("\t\tKEY_CREATE_SUB_KEY\n"));
414 }
415 if (dwAccessMask & KEY_SET_VALUE)
416 {
417 rConsole.Write(_T("\t\tKEY_SET_VALUE\n"));
418 }
419 if (dwAccessMask & KEY_QUERY_VALUE)
420 {
421 rConsole.Write(_T("\t\tKEY_QUERY_VALUE\n"));
422 }
423
424 delete[] pszName;
425 delete[] pszDomainName;
426 } // for
427
428AbortDumpSACL:
429 ASSERT(pSecurityDescriptor);
430 delete pSecurityDescriptor;
431
432 VERIFY(CloseHandle(hThreadToken));
433
434 return 0;
435Error:
436 if (pSecurityDescriptor)
437 delete pSecurityDescriptor;
438
439 if (hThreadToken != INVALID_HANDLE_VALUE)
440 VERIFY(CloseHandle(hThreadToken));
441
442 rConsole.Write(pszError_msg);
443 return 0;
444}
445
447{
449 _T("Syntax: ") SACL_CMD _T(" [<KEY>] [/?]\n\n")
450 _T(" <KEY> - Optional relative path of desired key.\n")
451 _T(" /? - This help.\n\n")
452 _T("Without parameters, command displays SACL of current key.\n");
453}
454
456{
457 return SACL_CMD_SHORT_DESC;
458}
#define COMMAND_NA_ON_ROOT
#define ERROR_MSG_BUFFER_SIZE
Definition: RegistryTree.h:12
const TCHAR * GetSidTypeName(SID_NAME_USE Use)
BOOL GetTextualSid(PSID pSid, LPTSTR TextualSid, LPDWORD lpdwBufferLen)
#define SACL_CMD
#define SACL_CMD_LENGTH
#define SACL_CMD_SHORT_DESC
BOOL Error
Definition: chkdsk.c:66
Definition: bufpool.h:45
void ResetArgumentIteration()
TCHAR * GetNextArgument()
BOOL Write(const TCHAR *p, DWORD dwChars=0)
Definition: Console.cpp:90
BOOL GetKey(const TCHAR *pchRelativePath, REGSAM DesiredAccess, CRegistryKey &rKey)
const TCHAR * GetLastErrorDescription()
virtual const TCHAR * GetHelpString()
CShellCommandSACL(CRegistryTree &rTree)
virtual ~CShellCommandSACL()
virtual int Execute(CConsole &rConsole, CArgumentParser &rArguments)
CRegistryTree & m_rTree
virtual const TCHAR * GetHelpShortDescriptionString()
virtual BOOL Match(const TCHAR *pchCommand)
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
BOOL WINAPI IsValidSid(PSID pSid)
Definition: security.c:819
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
Definition: security.c:336
#define CloseHandle
Definition: compat.h:739
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define GetCurrentProcess()
Definition: compat.h:759
#define GENERIC_READ
Definition: compat.h:135
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
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
_CRTIMP char *__cdecl _itoa(_In_ int _Value, _Pre_notnull_ _Post_z_ char *_Dest, _In_ int _Radix)
#define _tcsncpy
Definition: tchar.h:1410
enum _SID_NAME_USE SID_NAME_USE
#define ASSERT(a)
Definition: mode.c:44
static const WCHAR sd[]
Definition: suminfo.c:286
DWORD SECURITY_INFORMATION
Definition: ms-dtyp.idl:311
#define SYNCHRONIZE
Definition: nt_native.h:61
#define WRITE_DAC
Definition: nt_native.h:59
#define ACCESS_SYSTEM_SECURITY
Definition: nt_native.h:77
#define KEY_CREATE_SUB_KEY
Definition: nt_native.h:1018
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019
#define GENERIC_ALL
Definition: nt_native.h:92
#define DELETE
Definition: nt_native.h:57
#define READ_CONTROL
Definition: nt_native.h:58
#define WRITE_OWNER
Definition: nt_native.h:60
#define KEY_CREATE_LINK
Definition: nt_native.h:1021
#define GENERIC_WRITE
Definition: nt_native.h:90
#define KEY_NOTIFY
Definition: nt_native.h:1020
#define GENERIC_EXECUTE
Definition: nt_native.h:91
#define KEY_SET_VALUE
Definition: nt_native.h:1017
DWORD * PDWORD
Definition: pedump.c:68
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
#define VERIFY(e)
Definition: ph.h:34
#define _T(x)
Definition: vfdio.h:22
#define LookupPrivilegeValue
Definition: winbase.h:3870
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define LookupAccountSid
Definition: winbase.h:3867
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define ERROR_NOT_ALL_ASSIGNED
Definition: winerror.h:782
#define ERROR_NO_TOKEN
Definition: winerror.h:587
#define SE_SECURITY_NAME
Definition: winnt_old.h:373
#define wsprintf
Definition: winuser.h:5865
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
#define SACL_SECURITY_INFORMATION
Definition: setypes.h:126
char TCHAR
Definition: xmlstorage.h:189
#define _tcsnicmp
Definition: xmlstorage.h:207
#define _sntprintf
Definition: xmlstorage.h:201
#define _tcsicmp
Definition: xmlstorage.h:205