summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/lzma/CPP/Windows/SecurityUtils.cpp
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2023-05-04 02:41:16 +1000
committer Vas Crabb <vas@vastheman.com>2023-05-04 02:41:16 +1000
commita504bde3a7462b54fafd5cfc2f52e58d0f3218e1 (patch)
tree8b3108d572b1a0873a6cdbb4e8af1f17179545c3 /3rdparty/lzma/CPP/Windows/SecurityUtils.cpp
parentbefb9bf4a8cfdb2b693a32e32535b5eac522c5d8 (diff)
3rdparty/lzma: Updated to LZMA SDK version 22.01
Diffstat (limited to '3rdparty/lzma/CPP/Windows/SecurityUtils.cpp')
-rw-r--r--3rdparty/lzma/CPP/Windows/SecurityUtils.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/3rdparty/lzma/CPP/Windows/SecurityUtils.cpp b/3rdparty/lzma/CPP/Windows/SecurityUtils.cpp
index 67a9d7fdcb3..ede83faf565 100644
--- a/3rdparty/lzma/CPP/Windows/SecurityUtils.cpp
+++ b/3rdparty/lzma/CPP/Windows/SecurityUtils.cpp
@@ -2,10 +2,11 @@
#include "StdAfx.h"
-#include "../Common/MyString.h"
-
#include "SecurityUtils.h"
+#define MY_CAST_FUNC (void(*)())
+// #define MY_CAST_FUNC
+
namespace NWindows {
namespace NSecurity {
@@ -34,7 +35,7 @@ bool MyLookupAccountSid(LPCTSTR systemName, PSID sid,
static void SetLsaString(LPWSTR src, PLSA_UNICODE_STRING dest)
{
- int len = (int)wcslen(src);
+ size_t len = (size_t)wcslen(src);
dest->Length = (USHORT)(len * sizeof(WCHAR));
dest->MaximumLength = (USHORT)((len + 1) * sizeof(WCHAR));
dest->Buffer = src;
@@ -52,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,
@@ -64,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