This commit is contained in:
DavidXanatos 2024-03-16 18:52:10 +01:00
parent 78cd7929bf
commit c51e27e216
3 changed files with 10 additions and 4 deletions

View File

@ -1157,6 +1157,12 @@ _FX HDC Gdi_GetDummyDC(HDC dc, HWND hWnd)
if (!dummy)
dummy = map_insert(&Gui_DCCache, ret, NULL, sizeof(DUMMY_DC));
//
// Note: GetDC GetDCEx GetWindowDC must use ReleaseDC, while CreateDC must use DeleteDC
// We set bDelete = TRUE to make Gdi_OnFreeDC delete the DC and return NULL
// then Gui_ReleaseDC will not call __sys_ReleaseDC
//
dummy->bDelete = !!hWnd;
dummy->hBmp = bmp;

View File

@ -106,6 +106,7 @@ static ULONG_PTR Gui_HighestAddress = 0;
BOOLEAN Gui_RenameClasses = TRUE;
BOOLEAN Gui_OpenAllWinClasses = FALSE;
BOOLEAN Gui_UseProtectScreen = FALSE;
BOOLEAN Gui_UseBlockCapture = FALSE;
//---------------------------------------------------------------------------

View File

@ -95,9 +95,8 @@ _FX VOID Handle_SetDeleteOnClose(HANDLE FileHandle, BOOLEAN DeleteOnClose)
EnterCriticalSection(&Handle_StatusData_CritSec);
HANDLE_STATE* state = map_get(&Handle_StatusData, FileHandle);
if (!state) {
if (!state)
state = map_insert(&Handle_StatusData, FileHandle, NULL, sizeof(HANDLE_STATE));
}
state->DeleteOnClose = DeleteOnClose;
@ -170,9 +169,9 @@ _FX VOID Handle_ExecuteCloseHandler(HANDLE FileHandle, BOOLEAN* DeleteOnClose)
*DeleteOnClose = state->DeleteOnClose;
CloseHandlers = state->CloseHandlers;
if (state->RelocationPath) Dll_Free(state->RelocationPath);
}
map_remove(&Handle_StatusData, FileHandle);
map_remove(&Handle_StatusData, FileHandle);
}
LeaveCriticalSection(&Handle_StatusData_CritSec);