Update to 7-Zip Version 22.01

See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/c43cbc5f18/
This commit is contained in:
Tino Reichardt
2022-08-07 10:03:34 +02:00
parent 57558682a8
commit f9e0730191
47 changed files with 2485 additions and 812 deletions

View File

@@ -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