[MSGINA] gui: Remove superfluous DLG_DATA.TimerID (#2505)

And use a timer ID define, with a positive value; report SetTimer() failure.
This commit is contained in:
Serge Gautherie 2020-04-09 18:54:15 +02:00 committed by GitHub
parent b8dd046ee4
commit a5a426f867
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@
* PROJECT: ReactOS msgina.dll
* FILE: dll/win32/msgina/gui.c
* PURPOSE: ReactOS Logon GINA DLL
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
* PROGRAMMERS: Hervé Poussineau (hpoussin@reactos.org)
* Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
*/
@ -28,12 +28,14 @@ typedef struct _LEGALNOTICEDATA
LPWSTR pszText;
} LEGALNOTICEDATA, *PLEGALNOTICEDATA;
// Timer ID for the animated dialog bar.
#define IDT_BAR 1
typedef struct _DLG_DATA
{
PGINA_CONTEXT pgContext;
HBITMAP hLogoBitmap;
HBITMAP hBarBitmap;
UINT_PTR TimerID;
DWORD BarCounter;
DWORD LogoWidth;
DWORD LogoHeight;
@ -191,7 +193,10 @@ StatusDialogProc(
if (DlgData_LoadBitmaps(pDlgData))
{
pDlgData->TimerID = SetTimer(hwndDlg, -1, 20, NULL);
if (SetTimer(hwndDlg, IDT_BAR, 20, NULL) == 0)
{
ERR("SetTimer(IDT_BAR) failed: %d\n", GetLastError());
}
}
return TRUE;
}
@ -244,7 +249,7 @@ StatusDialogProc(
{
if (pDlgData && pDlgData->hBarBitmap)
{
KillTimer(hwndDlg, pDlgData->TimerID);
KillTimer(hwndDlg, IDT_BAR);
}
DlgData_Destroy(pDlgData);
return TRUE;