1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Minor bugfixes (#950)

* Update Dlgcode.c

minor bugfixes

* GlobalMemoryStatus x64 bugfix

GlobalMemoryStatus deprecated in x64
This commit is contained in:
Wendigo
2022-08-25 09:57:34 +03:00
committed by GitHub
parent a23d4392fb
commit 46ecb1a66d
2 changed files with 12 additions and 6 deletions

View File

@@ -14547,7 +14547,10 @@ static bool RunAsDesktopUser(
LookupPrivilegeValueW(NULL, SE_INCREASE_QUOTA_NAME, &tkp.Privileges[0].Luid); LookupPrivilegeValueW(NULL, SE_INCREASE_QUOTA_NAME, &tkp.Privileges[0].Luid);
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
SetThreadToken (NULL, NULL); if (!SetThreadToken(NULL, NULL))
{
goto cleanup;
}
AdjustTokenPrivileges(hThreadToken, FALSE, &tkp, 0, NULL, NULL); AdjustTokenPrivileges(hThreadToken, FALSE, &tkp, 0, NULL, NULL);
dwLastErr = GetLastError(); dwLastErr = GetLastError();
@@ -14633,7 +14636,10 @@ cleanup:
if (hPrimaryToken) CloseHandle(hPrimaryToken); if (hPrimaryToken) CloseHandle(hPrimaryToken);
if (hShellProcess) CloseHandle(hShellProcess); if (hShellProcess) CloseHandle(hShellProcess);
if (hThreadToken) CloseHandle(hThreadToken); if (hThreadToken) CloseHandle(hThreadToken);
RevertToSelf ();
if (!RevertToSelf())
return false;
if (!retval) if (!retval)
SetLastError (dwLastErr); SetLastError (dwLastErr);
return retval; return retval;
@@ -15041,7 +15047,7 @@ ULONG GenericDropTarget::Release(void)
BOOL GenericDropTarget::Register(HWND hWnd) BOOL GenericDropTarget::Register(HWND hWnd)
{ {
if(NULL == hWnd) if(NULL == hWnd)
return E_FAIL; return FALSE;
OleInitialize(NULL); OleInitialize(NULL);
@@ -15262,7 +15268,7 @@ DWORD PasswordEditDropTarget::GotEnter(void)
HWND hChild = WindowFromPoint (m_DropPoint); HWND hChild = WindowFromPoint (m_DropPoint);
// check that we are on password edit control (we use maximum length to correctly identify password fields since they don't always have ES_PASSWORD style (if the the user checked show password) // check that we are on password edit control (we use maximum length to correctly identify password fields since they don't always have ES_PASSWORD style (if the the user checked show password)
if (hChild && GetClassName (hChild, szClassName, ARRAYSIZE (szClassName)) && (0 == _tcsicmp (szClassName, _T("EDIT"))) if (hChild && GetClassName (hChild, szClassName, ARRAYSIZE (szClassName)) && (0 == _tcsicmp (szClassName, _T("EDIT")))
&& (dwStyles = GetWindowLong (hChild, GWL_STYLE)) && !(dwStyles & ES_NUMBER) && (dwStyles = GetWindowLongPtr (hChild, GWL_STYLE)) && !(dwStyles & ES_NUMBER)
&& (maxLen = (int) SendMessage (hChild, EM_GETLIMITTEXT, 0, 0)) && (maxLen == MAX_PASSWORD || maxLen == MAX_LEGACY_PASSWORD) && (maxLen = (int) SendMessage (hChild, EM_GETLIMITTEXT, 0, 0)) && (maxLen == MAX_PASSWORD || maxLen == MAX_LEGACY_PASSWORD)
) )
{ {
@@ -15287,7 +15293,7 @@ void PasswordEditDropTarget::GotDrop(CLIPFORMAT format)
int maxLen; int maxLen;
HWND hChild = WindowFromPoint (m_DropPoint); HWND hChild = WindowFromPoint (m_DropPoint);
if (hChild && GetClassName (hChild, szClassName, ARRAYSIZE (szClassName)) && (0 == _tcsicmp (szClassName, _T("EDIT"))) if (hChild && GetClassName (hChild, szClassName, ARRAYSIZE (szClassName)) && (0 == _tcsicmp (szClassName, _T("EDIT")))
&& (dwStyles = GetWindowLong (hChild, GWL_STYLE)) && !(dwStyles & ES_NUMBER) && (dwStyles = GetWindowLongPtr (hChild, GWL_STYLE)) && !(dwStyles & ES_NUMBER)
&& (maxLen = (int) SendMessage (hChild, EM_GETLIMITTEXT, 0, 0)) && (maxLen == MAX_PASSWORD || maxLen == MAX_LEGACY_PASSWORD) && (maxLen = (int) SendMessage (hChild, EM_GETLIMITTEXT, 0, 0)) && (maxLen == MAX_PASSWORD || maxLen == MAX_LEGACY_PASSWORD)
) )
{ {

View File

@@ -872,7 +872,7 @@ BOOL FastPoll (void)
free physical memory, bytes in paging file, free bytes in paging free physical memory, bytes in paging file, free bytes in paging
file, user bytes of address space, and free user bytes */ file, user bytes of address space, and free user bytes */
memoryStatus.dwLength = sizeof (MEMORYSTATUS); memoryStatus.dwLength = sizeof (MEMORYSTATUS);
GlobalMemoryStatus (&memoryStatus); GlobalMemoryStatusEx (&memoryStatus);
RandaddBuf ((unsigned char *) &memoryStatus, sizeof (MEMORYSTATUS)); RandaddBuf ((unsigned char *) &memoryStatus, sizeof (MEMORYSTATUS));
/* Get thread and process creation time, exit time, time in kernel /* Get thread and process creation time, exit time, time in kernel