mirror of
https://github.com/ip7z/7zip.git
synced 2026-04-21 06:03:40 +00:00
22.01
This commit is contained in:
parent
a3e1d22737
commit
93be7d4abf
47 changed files with 2484 additions and 811 deletions
|
|
@ -4,6 +4,9 @@
|
|||
|
||||
#include "SecurityUtils.h"
|
||||
|
||||
#define MY_CAST_FUNC (void(*)())
|
||||
// #define MY_CAST_FUNC
|
||||
|
||||
namespace NWindows {
|
||||
namespace NSecurity {
|
||||
|
||||
|
|
@ -50,8 +53,10 @@ static void MyLookupSids(CPolicy &policy, PSID ps)
|
|||
}
|
||||
*/
|
||||
|
||||
extern "C" {
|
||||
|
||||
#ifndef _UNICODE
|
||||
typedef BOOL (WINAPI * LookupAccountNameWP)(
|
||||
typedef BOOL (WINAPI * Func_LookupAccountNameW)(
|
||||
LPCWSTR lpSystemName,
|
||||
LPCWSTR lpAccountName,
|
||||
PSID Sid,
|
||||
|
|
@ -62,13 +67,17 @@ typedef BOOL (WINAPI * LookupAccountNameWP)(
|
|||
);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static PSID GetSid(LPWSTR accountName)
|
||||
{
|
||||
#ifndef _UNICODE
|
||||
HMODULE hModule = GetModuleHandle(TEXT("Advapi32.dll"));
|
||||
if (hModule == NULL)
|
||||
return NULL;
|
||||
LookupAccountNameWP lookupAccountNameW = (LookupAccountNameWP)GetProcAddress(hModule, "LookupAccountNameW");
|
||||
Func_LookupAccountNameW lookupAccountNameW = (Func_LookupAccountNameW)
|
||||
MY_CAST_FUNC
|
||||
GetProcAddress(hModule, "LookupAccountNameW");
|
||||
if (lookupAccountNameW == NULL)
|
||||
return NULL;
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue