From 61c8d3432c9fe77f1b30f383e3f2bcd10c6ed936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bi=C8=99oc=20George?= Date: Thu, 20 Feb 2020 00:20:01 +0100 Subject: [PATCH] [MSGINA] Be sure to always initialize the cached DLG_DATA GINA context (#2360) The ReactOS logo banner is loaded from the GINA context whereas the animation bar is loaded from the main application instance. However, the aforementioned context is not initialized when WM_INITDIALOG occurs hence DlgData_LoadBitmaps() would fail on proceeding at loading the remaining bitmaps to be loaded. This fixes the regression introduced by commit 623dd26c (PR #2353). --- dll/win32/msgina/gui.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/dll/win32/msgina/gui.c b/dll/win32/msgina/gui.c index dd195d3fb62..dbe28c6636a 100644 --- a/dll/win32/msgina/gui.c +++ b/dll/win32/msgina/gui.c @@ -42,11 +42,12 @@ typedef struct _DLG_DATA } DLG_DATA, *PDLG_DATA; static PDLG_DATA -DlgData_Create(HWND hwndDlg) +DlgData_Create(HWND hwndDlg, PGINA_CONTEXT pgContext) { PDLG_DATA pDlgData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pDlgData)); if (pDlgData) { + pDlgData->pgContext = pgContext; SetWindowLongPtrW(hwndDlg, GWLP_USERDATA, (LONG_PTR)pDlgData); } return pDlgData; @@ -184,7 +185,7 @@ StatusDialogProc( SetDlgItemTextW(hwndDlg, IDC_STATUS_MESSAGE, msg->pMessage); SetEvent(msg->StartupEvent); - pDlgData = DlgData_Create(hwndDlg); + pDlgData = DlgData_Create(hwndDlg, msg->Context); if (pDlgData == NULL) return FALSE; @@ -394,12 +395,10 @@ WelcomeDialogProc( { case WM_INITDIALOG: { - pDlgData = DlgData_Create(hwndDlg); + pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam); if (pDlgData == NULL) return FALSE; - pDlgData->pgContext = (PGINA_CONTEXT)lParam; - DlgData_LoadBitmaps(pDlgData); return TRUE; } @@ -1168,13 +1167,11 @@ LogonDialogProc( { case WM_INITDIALOG: { - pDlgData = DlgData_Create(hwndDlg); + /* FIXME: take care of NoDomainUI */ + pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam); if (pDlgData == NULL) return FALSE; - /* FIXME: take care of NoDomainUI */ - pDlgData->pgContext = (PGINA_CONTEXT)lParam; - DlgData_LoadBitmaps(pDlgData); SetWelcomeText(hwndDlg); @@ -1444,12 +1441,10 @@ UnlockDialogProc( { case WM_INITDIALOG: { - pDlgData = DlgData_Create(hwndDlg); + pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam); if (pDlgData == NULL) return FALSE; - pDlgData->pgContext = (PGINA_CONTEXT)lParam; - SetWelcomeText(hwndDlg); SetLockMessage(hwndDlg, IDC_UNLOCK_MESSAGE, pDlgData->pgContext); @@ -1540,12 +1535,10 @@ LockedDialogProc( { case WM_INITDIALOG: { - pDlgData = DlgData_Create(hwndDlg); + pDlgData = DlgData_Create(hwndDlg, (PGINA_CONTEXT)lParam); if (pDlgData == NULL) return FALSE; - pDlgData->pgContext = (PGINA_CONTEXT)lParam; - DlgData_LoadBitmaps(pDlgData); SetWelcomeText(hwndDlg);