Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2009-02-03 03:00:00 +0300
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:15:59 +0300
commit8874e4fbc9faabdcff719b9b2ac8ebad4f282bbe (patch)
tree4180f817b3d10dc34cde8b7ccc8c589eae4b26d3 /CPP/Windows
parent1dc92281fa580c11a79fef9fc862a6ce354a76ac (diff)
4.654.65
Diffstat (limited to 'CPP/Windows')
-rwxr-xr-xCPP/Windows/Control/Trackbar.h2
-rwxr-xr-xCPP/Windows/Security.cpp15
-rwxr-xr-xCPP/Windows/Security.h2
-rwxr-xr-xCPP/Windows/Thread.h3
4 files changed, 12 insertions, 10 deletions
diff --git a/CPP/Windows/Control/Trackbar.h b/CPP/Windows/Control/Trackbar.h
index bbd7009a..64120f98 100755
--- a/CPP/Windows/Control/Trackbar.h
+++ b/CPP/Windows/Control/Trackbar.h
@@ -20,7 +20,7 @@ public:
{ SendMessage(TBM_SETTICFREQ, freq); }
int GetPos()
- { return SendMessage(TBM_GETPOS); }
+ { return (int)SendMessage(TBM_GETPOS); }
};
}}
diff --git a/CPP/Windows/Security.cpp b/CPP/Windows/Security.cpp
index 24001c49..bb8c3a9a 100755
--- a/CPP/Windows/Security.cpp
+++ b/CPP/Windows/Security.cpp
@@ -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))
diff --git a/CPP/Windows/Security.h b/CPP/Windows/Security.h
index 976f746b..90cf2caf 100755
--- a/CPP/Windows/Security.h
+++ b/CPP/Windows/Security.h
@@ -3,7 +3,7 @@
#ifndef __WINDOWS_SECURITY_H
#define __WINDOWS_SECURITY_H
-#include "Windows/Defs.h"
+#include "Defs.h"
#include <NTSecAPI.h>
diff --git a/CPP/Windows/Thread.h b/CPP/Windows/Thread.h
index 9c427608..39104f4a 100755
--- a/CPP/Windows/Thread.h
+++ b/CPP/Windows/Thread.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)); }