ReactOS 0.4.15-dev-6669-g8227c5d
utils.cpp File Reference
#include "precomp.h"
Include dependency graph for utils.cpp:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static BOOL OpenEffectiveToken (DWORD DesiredAccess, HANDLE *phToken)
 
EXTERN_C BOOL WINAPI SHOpenEffectiveToken (_Out_ LPHANDLE phToken)
 
EXTERN_C DWORD WINAPI SHGetUserSessionId (_In_opt_ HANDLE hToken)
 
EXTERN_C HRESULT WINAPI SHInvokePrivilegedFunctionW (_In_z_ LPCWSTR pszName, _In_ PRIVILEGED_FUNCTION fn, _In_opt_ LPARAM lParam)
 
EXTERN_C BOOL WINAPI SHTestTokenPrivilegeW (_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName)
 
EXTERN_C HINSTANCE WINAPI SHGetShellStyleHInstance (VOID)
 
EXTERN_C HRESULT WINAPI SHCreatePropertyBag (_In_ REFIID riid, _Out_ void **ppvObj)
 
EXTERN_C LPSTR WINAPI SheRemoveQuotesA (LPSTR psz)
 
EXTERN_C LPWSTR WINAPI SheRemoveQuotesW (LPWSTR psz)
 
EXTERN_C BOOL WINAPI SHFindComputer (LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
 
static HRESULT Int64ToStr (_In_ LONGLONG llValue, _Out_writes_z_(cchValue) LPWSTR pszValue, _In_ UINT cchValue)
 
static VOID Int64GetNumFormat (_Out_ NUMBERFMTW *pDest, _In_opt_ const NUMBERFMTW *pSrc, _In_ DWORD dwNumberFlags, _Out_writes_z_(cchDecimal) LPWSTR pszDecimal, _In_ INT cchDecimal, _Out_writes_z_(cchThousand) LPWSTR pszThousand, _In_ INT cchThousand)
 
EXTERN_C INT WINAPI Int64ToString (_In_ LONGLONG llValue, _Out_writes_z_(cchOut) LPWSTR pszOut, _In_ UINT cchOut, _In_ BOOL bUseFormat, _In_opt_ const NUMBERFMTW *pNumberFormat, _In_ DWORD dwNumberFlags)
 
EXTERN_C INT WINAPI LargeIntegerToString (_In_ const LARGE_INTEGER *pLargeInt, _Out_writes_z_(cchOut) LPWSTR pszOut, _In_ UINT cchOut, _In_ BOOL bUseFormat, _In_opt_ const NUMBERFMTW *pNumberFormat, _In_ DWORD dwNumberFlags)
 

Function Documentation

◆ Int64GetNumFormat()

static VOID Int64GetNumFormat ( _Out_ NUMBERFMTW pDest,
_In_opt_ const NUMBERFMTW pSrc,
_In_ DWORD  dwNumberFlags,
_Out_writes_z_(cchDecimal) LPWSTR  pszDecimal,
_In_ INT  cchDecimal,
_Out_writes_z_(cchThousand) LPWSTR  pszThousand,
_In_ INT  cchThousand 
)
static

Definition at line 346 of file utils.cpp.

354{
355 WCHAR szBuff[20];
356
357 if (pSrc)
358 *pDest = *pSrc;
359 else
360 dwNumberFlags = 0;
361
362 if (!(dwNumberFlags & FMT_USE_NUMDIGITS))
363 {
365 pDest->NumDigits = StrToIntW(szBuff);
366 }
367
368 if (!(dwNumberFlags & FMT_USE_LEADZERO))
369 {
371 pDest->LeadingZero = StrToIntW(szBuff);
372 }
373
374 if (!(dwNumberFlags & FMT_USE_GROUPING))
375 {
377 pDest->Grouping = StrToIntW(szBuff);
378 }
379
380 if (!(dwNumberFlags & FMT_USE_DECIMAL))
381 {
382 GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, pszDecimal, cchDecimal);
383 pDest->lpDecimalSep = pszDecimal;
384 }
385
386 if (!(dwNumberFlags & FMT_USE_THOUSAND))
387 {
388 GetLocaleInfoW(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, pszThousand, cchThousand);
389 pDest->lpThousandSep = pszThousand;
390 }
391
392 if (!(dwNumberFlags & FMT_USE_NEGNUMBER))
393 {
395 pDest->NegativeOrder = StrToIntW(szBuff);
396 }
397}
INT WINAPI StrToIntW(LPCWSTR lpString)
Definition: string.c:411
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1108
#define LOCALE_USER_DEFAULT
#define _countof(array)
Definition: sndvol32.h:68
#define FMT_USE_THOUSAND
Definition: undocshell.h:666
#define FMT_USE_GROUPING
Definition: undocshell.h:664
#define FMT_USE_NUMDIGITS
Definition: undocshell.h:662
#define FMT_USE_NEGNUMBER
Definition: undocshell.h:667
#define FMT_USE_LEADZERO
Definition: undocshell.h:663
#define FMT_USE_DECIMAL
Definition: undocshell.h:665
#define LOCALE_SGROUPING
Definition: winnls.h:44
#define LOCALE_SDECIMAL
Definition: winnls.h:42
#define LOCALE_IDIGITS
Definition: winnls.h:45
#define LOCALE_STHOUSAND
Definition: winnls.h:43
#define LOCALE_INEGNUMBER
Definition: winnls.h:47
#define LOCALE_ILZERO
Definition: winnls.h:46
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by Int64ToString().

◆ Int64ToStr()

static HRESULT Int64ToStr ( _In_ LONGLONG  llValue,
_Out_writes_z_(cchValue) LPWSTR  pszValue,
_In_ UINT  cchValue 
)
static

Definition at line 301 of file utils.cpp.

305{
306 WCHAR szBuff[40];
307 UINT ich = 0, ichValue;
308#if (WINVER >= _WIN32_WINNT_VISTA)
309 BOOL bMinus = (llValue < 0);
310
311 if (bMinus)
312 llValue = -llValue;
313#endif
314
315 if (cchValue <= 0)
316 return E_FAIL;
317
318 do
319 {
320 szBuff[ich++] = (WCHAR)(L'0' + (llValue % 10));
321 llValue /= 10;
322 } while (llValue != 0 && ich < _countof(szBuff) - 1);
323
324#if (WINVER >= _WIN32_WINNT_VISTA)
325 if (bMinus && ich < _countof(szBuff))
326 szBuff[ich++] = '-';
327#endif
328
329 for (ichValue = 0; ich > 0 && ichValue < cchValue; ++ichValue)
330 {
331 --ich;
332 pszValue[ichValue] = szBuff[ich];
333 }
334
335 if (ichValue >= cchValue)
336 {
337 pszValue[cchValue - 1] = UNICODE_NULL;
338 return E_FAIL;
339 }
340
341 pszValue[ichValue] = UNICODE_NULL;
342 return S_OK;
343}
#define E_FAIL
Definition: ddrawi.h:102
unsigned int BOOL
Definition: ntddk_ex.h:94
#define S_OK
Definition: intsafe.h:52
unsigned int UINT
Definition: ndis.h:50
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50

Referenced by Int64ToString().

◆ Int64ToString()

EXTERN_C INT WINAPI Int64ToString ( _In_ LONGLONG  llValue,
_Out_writes_z_(cchOut) LPWSTR  pszOut,
_In_ UINT  cchOut,
_In_ BOOL  bUseFormat,
_In_opt_ const NUMBERFMTW pNumberFormat,
_In_ DWORD  dwNumberFlags 
)

Definition at line 406 of file utils.cpp.

413{
414 INT ret;
415 NUMBERFMTW NumFormat;
416 WCHAR szValue[80], szDecimalSep[6], szThousandSep[6];
417
418 Int64ToStr(llValue, szValue, _countof(szValue));
419
420 if (bUseFormat)
421 {
422 Int64GetNumFormat(&NumFormat, pNumberFormat, dwNumberFlags,
423 szDecimalSep, _countof(szDecimalSep),
424 szThousandSep, _countof(szThousandSep));
425 ret = GetNumberFormatW(LOCALE_USER_DEFAULT, 0, szValue, &NumFormat, pszOut, cchOut);
426 if (ret)
427 --ret;
428 return ret;
429 }
430
431 if (FAILED(StringCchCopyW(pszOut, cchOut, szValue)))
432 return 0;
433
434 return lstrlenW(pszOut);
435}
#define lstrlenW
Definition: compat.h:750
static VOID Int64GetNumFormat(_Out_ NUMBERFMTW *pDest, _In_opt_ const NUMBERFMTW *pSrc, _In_ DWORD dwNumberFlags, _Out_writes_z_(cchDecimal) LPWSTR pszDecimal, _In_ INT cchDecimal, _Out_writes_z_(cchThousand) LPWSTR pszThousand, _In_ INT cchThousand)
Definition: utils.cpp:346
static HRESULT Int64ToStr(_In_ LONGLONG llValue, _Out_writes_z_(cchValue) LPWSTR pszValue, _In_ UINT cchValue)
Definition: utils.cpp:301
#define FAILED(hr)
Definition: intsafe.h:51
INT WINAPI GetNumberFormatW(LCID lcid, DWORD dwFlags, LPCWSTR lpszValue, const NUMBERFMTW *lpFormat, LPWSTR lpNumberStr, int cchOut)
Definition: lcformat.c:1212
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
int32_t INT
Definition: typedefs.h:58
int ret

Referenced by DoTestEntry(), LargeIntegerToString(), and Test_Int64ToString().

◆ LargeIntegerToString()

EXTERN_C INT WINAPI LargeIntegerToString ( _In_ const LARGE_INTEGER pLargeInt,
_Out_writes_z_(cchOut) LPWSTR  pszOut,
_In_ UINT  cchOut,
_In_ BOOL  bUseFormat,
_In_opt_ const NUMBERFMTW pNumberFormat,
_In_ DWORD  dwNumberFlags 
)

Definition at line 444 of file utils.cpp.

451{
452 return Int64ToString(pLargeInt->QuadPart, pszOut, cchOut, bUseFormat,
453 pNumberFormat, dwNumberFlags);
454}
EXTERN_C INT WINAPI Int64ToString(_In_ LONGLONG llValue, _Out_writes_z_(cchOut) LPWSTR pszOut, _In_ UINT cchOut, _In_ BOOL bUseFormat, _In_opt_ const NUMBERFMTW *pNumberFormat, _In_ DWORD dwNumberFlags)
Definition: utils.cpp:406

Referenced by DoTestEntry(), and Test_LargeIntegerToString().

◆ OpenEffectiveToken()

static BOOL OpenEffectiveToken ( DWORD  DesiredAccess,
HANDLE phToken 
)
static

Definition at line 12 of file utils.cpp.

13{
14 BOOL ret;
15
16 if (phToken == NULL)
17 {
19 return FALSE;
20 }
21
22 *phToken = NULL;
23
25 if (!ret && GetLastError() == ERROR_NO_TOKEN)
27
28 return ret;
29}
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:296
BOOL WINAPI OpenThreadToken(HANDLE ThreadHandle, DWORD DesiredAccess, BOOL OpenAsSelf, HANDLE *TokenHandle)
Definition: security.c:338
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define GetCurrentProcess()
Definition: compat.h:759
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
_In_opt_ LPSTR _In_opt_ LPSTR _In_ DWORD _In_ DWORD _Out_opt_ PHANDLE phToken
Definition: winbase.h:2705
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define ERROR_NO_TOKEN
Definition: winerror.h:587

Referenced by SHOpenEffectiveToken().

◆ SHCreatePropertyBag()

EXTERN_C HRESULT WINAPI SHCreatePropertyBag ( _In_ REFIID  riid,
_Out_ void **  ppvObj 
)

Definition at line 214 of file utils.cpp.

215{
217}
REFIID riid
Definition: atlbase.h:39
#define STGM_READWRITE
Definition: objbase.h:919
EXTERN_C HRESULT WINAPI SHCreatePropertyBagOnMemory(_In_ DWORD dwMode, _In_ REFIID riid, _Out_ void **ppvObj)
Definition: propbag.cpp:254

◆ SheRemoveQuotesA()

EXTERN_C LPSTR WINAPI SheRemoveQuotesA ( LPSTR  psz)

Definition at line 224 of file utils.cpp.

225{
226 PCHAR pch;
227
228 if (*psz == '"')
229 {
230 for (pch = psz + 1; *pch && *pch != '"'; ++pch)
231 {
232 *(pch - 1) = *pch;
233 }
234
235 if (*pch == '"')
236 *(pch - 1) = ANSI_NULL;
237 }
238
239 return psz;
240}
#define pch(ap)
Definition: match.c:418
#define ANSI_NULL
char * PCHAR
Definition: typedefs.h:51

◆ SheRemoveQuotesW()

EXTERN_C LPWSTR WINAPI SheRemoveQuotesW ( LPWSTR  psz)

Definition at line 249 of file utils.cpp.

250{
251 PWCHAR pch;
252
253 if (*psz == L'"')
254 {
255 for (pch = psz + 1; *pch && *pch != L'"'; ++pch)
256 {
257 *(pch - 1) = *pch;
258 }
259
260 if (*pch == L'"')
261 *(pch - 1) = UNICODE_NULL;
262 }
263
264 return psz;
265}
uint16_t * PWCHAR
Definition: typedefs.h:56

◆ SHFindComputer()

EXTERN_C BOOL WINAPI SHFindComputer ( LPCITEMIDLIST  pidlRoot,
LPCITEMIDLIST  pidlSavedSearch 
)

Definition at line 275 of file utils.cpp.

276{
277 UNREFERENCED_PARAMETER(pidlRoot);
278 UNREFERENCED_PARAMETER(pidlSavedSearch);
279
280 TRACE("%p %p\n", pidlRoot, pidlSavedSearch);
281
282 IContextMenu *pCM;
283 HRESULT hr = CoCreateInstance(CLSID_ShellSearchExt, NULL, CLSCTX_INPROC_SERVER,
284 IID_IContextMenu, (void **)&pCM);
285 if (FAILED(hr))
286 {
287 ERR("0x%08X\n", hr);
288 return hr;
289 }
290
291 CMINVOKECOMMANDINFO InvokeInfo = { sizeof(InvokeInfo) };
292 InvokeInfo.lpParameters = "{996E1EB1-B524-11D1-9120-00A0C98BA67D}";
293 InvokeInfo.nShow = SW_SHOWNORMAL;
294 hr = pCM->InvokeCommand(&InvokeInfo);
295 pCM->Release();
296
297 return SUCCEEDED(hr);
298}
#define ERR(fmt,...)
Definition: debug.h:110
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
HRESULT InvokeCommand([in] LPCMINVOKECOMMANDINFO lpici)
ULONG Release()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4
#define SW_SHOWNORMAL
Definition: winuser.h:764

Referenced by CTrayWindow::HandleCommand(), CTrayWindow::HandleHotKey(), and StartMenuHandler::ShowSearchComputer().

◆ SHGetShellStyleHInstance()

EXTERN_C HINSTANCE WINAPI SHGetShellStyleHInstance ( VOID  )

Definition at line 172 of file utils.cpp.

173{
176 HRESULT hr;
177 CStringW strShellStyle;
178
179 TRACE("SHGetShellStyleHInstance called\n");
180
181 /* First, attempt to load the shellstyle dll from the current active theme */
183 if (FAILED(hr))
184 goto DoDefault;
185
186 /* Strip the theme filename */
188
189 strShellStyle = szPath;
190 strShellStyle += L"\\Shell\\";
191 strShellStyle += szColorName;
192 strShellStyle += L"\\ShellStyle.dll";
193
195 if (hInst)
196 return hInst;
197
198 /* Otherwise, use the version stored in the System32 directory */
199DoDefault:
200 if (!ExpandEnvironmentStringsW(L"%SystemRoot%\\System32\\ShellStyle.dll",
202 {
203 ERR("Expand failed\n");
204 return NULL;
205 }
207}
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:629
HRESULT WINAPI GetCurrentThemeName(LPWSTR pszThemeFileName, int dwMaxNameChars, LPWSTR pszColorBuff, int cchMaxColorChars, LPWSTR pszSizeBuff, int cchMaxSizeChars)
Definition: system.c:894
static const WCHAR szColorName[]
Definition: system.c:40
HINSTANCE hInst
Definition: dxdiag.c:13
LPCWSTR szPath
Definition: env.c:37
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:342

◆ SHGetUserSessionId()

EXTERN_C DWORD WINAPI SHGetUserSessionId ( _In_opt_ HANDLE  hToken)

Definition at line 43 of file utils.cpp.

44{
45 DWORD dwSessionId, dwLength;
46 BOOL bOpenToken = FALSE;
47
48 TRACE("%p\n", hToken);
49
50 if (!hToken)
51 bOpenToken = SHOpenEffectiveToken(&hToken);
52
53 if (!hToken ||
54 !GetTokenInformation(hToken, TokenSessionId, &dwSessionId, sizeof(dwSessionId), &dwLength))
55 {
56 dwSessionId = 0;
57 }
58
59 if (bOpenToken)
60 CloseHandle(hToken);
61
62 return dwSessionId;
63}
BOOL WINAPI GetTokenInformation(HANDLE TokenHandle, TOKEN_INFORMATION_CLASS TokenInformationClass, LPVOID TokenInformation, DWORD TokenInformationLength, PDWORD ReturnLength)
Definition: security.c:413
#define CloseHandle
Definition: compat.h:739
static DWORD DWORD * dwLength
Definition: fusion.c:86
EXTERN_C BOOL WINAPI SHOpenEffectiveToken(_Out_ LPHANDLE phToken)
Definition: utils.cpp:34
unsigned long DWORD
Definition: ntddk_ex.h:95
@ TokenSessionId
Definition: setypes.h:977

◆ SHInvokePrivilegedFunctionW()

EXTERN_C HRESULT WINAPI SHInvokePrivilegedFunctionW ( _In_z_ LPCWSTR  pszName,
_In_ PRIVILEGED_FUNCTION  fn,
_In_opt_ LPARAM  lParam 
)

Definition at line 70 of file utils.cpp.

74{
75 TRACE("(%s %p %p)\n", debugstr_w(pszName), fn, lParam);
76
77 if (!pszName || !fn)
78 return E_INVALIDARG;
79
80 HANDLE hToken = NULL;
81 TOKEN_PRIVILEGES NewPriv, PrevPriv;
82 BOOL bAdjusted = FALSE;
83
84 if (SHOpenEffectiveToken(&hToken) &&
85 ::LookupPrivilegeValueW(NULL, pszName, &NewPriv.Privileges[0].Luid))
86 {
87 NewPriv.PrivilegeCount = 1;
89
90 DWORD dwReturnSize;
91 bAdjusted = ::AdjustTokenPrivileges(hToken, FALSE, &NewPriv,
92 sizeof(PrevPriv), &PrevPriv, &dwReturnSize);
93 }
94
96
97 if (bAdjusted)
98 ::AdjustTokenPrivileges(hToken, FALSE, &PrevPriv, 0, NULL, NULL);
99
100 if (hToken)
101 ::CloseHandle(hToken);
102
103 return hr;
104}
LPARAM lParam
Definition: combotst.c:139
#define E_INVALIDARG
Definition: ddrawi.h:101
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:376
#define debugstr_w
Definition: kernel32.h:32
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63

◆ SHOpenEffectiveToken()

EXTERN_C BOOL WINAPI SHOpenEffectiveToken ( _Out_ LPHANDLE  phToken)

Definition at line 34 of file utils.cpp.

35{
36 TRACE("%p\n", phToken);
38}
static BOOL OpenEffectiveToken(DWORD DesiredAccess, HANDLE *phToken)
Definition: utils.cpp:12
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928

Referenced by SHGetUserSessionId(), SHInvokePrivilegedFunctionW(), and SHTestTokenPrivilegeW().

◆ SHTestTokenPrivilegeW()

EXTERN_C BOOL WINAPI SHTestTokenPrivilegeW ( _In_opt_ HANDLE  hToken,
_In_z_ LPCWSTR  lpName 
)

Definition at line 113 of file utils.cpp.

114{
115 LUID Luid;
117 PTOKEN_PRIVILEGES pTokenPriv;
118 HANDLE hNewToken = NULL;
119 BOOL ret = FALSE;
120
121 TRACE("(%p, %s)\n", hToken, debugstr_w(lpName));
122
123 if (!lpName)
124 return FALSE;
125
126 if (!hToken)
127 {
128 if (!SHOpenEffectiveToken(&hNewToken))
129 goto Quit;
130
131 if (!hNewToken)
132 return FALSE;
133
134 hToken = hNewToken;
135 }
136
137 if (!LookupPrivilegeValueW(NULL, lpName, &Luid))
138 return FALSE;
139
140 dwLength = 0;
142 goto Quit;
143
145 if (!pTokenPriv)
146 goto Quit;
147
148 if (GetTokenInformation(hToken, TokenPrivileges, pTokenPriv, dwLength, &dwLength))
149 {
150 UINT iPriv, cPrivs;
151 cPrivs = pTokenPriv->PrivilegeCount;
152 for (iPriv = 0; !ret && iPriv < cPrivs; ++iPriv)
153 {
154 ret = RtlEqualLuid(&Luid, &pTokenPriv->Privileges[iPriv].Luid);
155 }
156 }
157
158 LocalFree(pTokenPriv);
159
160Quit:
161 if (hToken == hNewToken)
162 CloseHandle(hNewToken);
163
164 return ret;
165}
HLOCAL NTAPI LocalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:1390
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define LPTR
Definition: winbase.h:381
_In_ LPCSTR lpName
Definition: winbase.h:2779
#define RtlEqualLuid(Luid1, Luid2)
Definition: rtlfuncs.h:301
@ TokenPrivileges
Definition: setypes.h:968
struct _TOKEN_PRIVILEGES * PTOKEN_PRIVILEGES

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )