mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 06:06:59 -06:00
4.65
This commit is contained in:
committed by
Kornel Lesiński
parent
1dc92281fa
commit
8874e4fbc9
@@ -20,7 +20,7 @@ public:
|
||||
{ SendMessage(TBM_SETTICFREQ, freq); }
|
||||
|
||||
int GetPos()
|
||||
{ return SendMessage(TBM_GETPOS); }
|
||||
{ return (int)SendMessage(TBM_GETPOS); }
|
||||
};
|
||||
|
||||
}}
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
// Windows/Security.h
|
||||
// Windows/Security.cpp
|
||||
|
||||
#include "StdAfx.h"
|
||||
|
||||
#include "Windows/Security.h"
|
||||
#include "Windows/Defs.h"
|
||||
|
||||
#include "Common/StringConvert.h"
|
||||
#include "Defs.h"
|
||||
#include "Security.h"
|
||||
|
||||
namespace NWindows {
|
||||
namespace NSecurity {
|
||||
@@ -105,6 +101,8 @@ static PSID GetSid(LPWSTR accountName)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define MY__SE_LOCK_MEMORY_NAME L"SeLockMemoryPrivilege"
|
||||
|
||||
bool AddLockMemoryPrivilege()
|
||||
{
|
||||
CPolicy policy;
|
||||
@@ -123,8 +121,9 @@ bool AddLockMemoryPrivilege()
|
||||
!= 0)
|
||||
return false;
|
||||
LSA_UNICODE_STRING userRights;
|
||||
UString s = GetUnicodeString(SE_LOCK_MEMORY_NAME);
|
||||
SetLsaString((LPWSTR)(LPCWSTR)s, &userRights);
|
||||
wchar_t s[128];
|
||||
wcscpy(s, MY__SE_LOCK_MEMORY_NAME);
|
||||
SetLsaString(s, &userRights);
|
||||
WCHAR userName[256 + 2];
|
||||
DWORD size = 256;
|
||||
if (!GetUserNameW(userName, &size))
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifndef __WINDOWS_SECURITY_H
|
||||
#define __WINDOWS_SECURITY_H
|
||||
|
||||
#include "Windows/Defs.h"
|
||||
#include "Defs.h"
|
||||
|
||||
#include <NTSecAPI.h>
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@ public:
|
||||
WRes Wait() { return Thread_Wait(&thread); }
|
||||
|
||||
#ifdef _WIN32
|
||||
operator HANDLE() { return thread.handle; }
|
||||
void Attach(HANDLE handle) { thread.handle = handle; }
|
||||
HANDLE Detach() { HANDLE h = thread.handle; thread.handle = NULL; return h; }
|
||||
DWORD Resume() { return ::ResumeThread(thread.handle); }
|
||||
DWORD Suspend() { return ::SuspendThread(thread.handle); }
|
||||
bool Terminate(DWORD exitCode) { return BOOLToBool(::TerminateThread(thread.handle, exitCode)); }
|
||||
|
||||
Reference in New Issue
Block a user