mirror of
https://github.com/reactos/reactos.git
synced 2025-06-06 01:40:36 +00:00
[SYSDM][USERINIT] Rewrite a if-condition in order to fail early, and save one level of code indentation.
This commit is contained in:
parent
33c210da37
commit
89860ab543
2 changed files with 80 additions and 80 deletions
|
@ -43,8 +43,9 @@ InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
|
|||
hLogo = (HBITMAP)LoadImageW(hInstance, MAKEINTRESOURCEW(IDB_ROSLOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||
hMask = (HBITMAP)LoadImageW(hInstance, MAKEINTRESOURCEW(IDB_ROSMASK), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||
|
||||
if (hLogo != NULL && hMask != NULL)
|
||||
{
|
||||
if (hLogo == NULL || hMask == NULL)
|
||||
goto Cleanup;
|
||||
|
||||
GetObject(hLogo, sizeof(logoBitmap), &logoBitmap);
|
||||
GetObject(hMask, sizeof(maskBitmap), &maskBitmap);
|
||||
|
||||
|
@ -88,7 +89,6 @@ InitLogo(PIMGINFO pImgInfo, HWND hwndDlg)
|
|||
pImgInfo->cySource = logoBitmap.bmHeight;
|
||||
pImgInfo->iBits = logoBitmap.bmBitsPixel;
|
||||
pImgInfo->iPlanes = logoBitmap.bmPlanes;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
if (hMask != NULL) DeleteObject(hMask);
|
||||
|
|
|
@ -78,8 +78,9 @@ static VOID InitLogo(HWND hwndDlg)
|
|||
hLogo = (HBITMAP)LoadImageW(hApplet, MAKEINTRESOURCEW(IDB_ROSBMP), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||
hMask = (HBITMAP)LoadImageW(hApplet, MAKEINTRESOURCEW(IDB_ROSMASK), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR);
|
||||
|
||||
if (hLogo != NULL && hMask != NULL)
|
||||
{
|
||||
if (hLogo == NULL || hMask == NULL)
|
||||
goto Cleanup;
|
||||
|
||||
GetObject(hLogo, sizeof(logoBitmap), &logoBitmap);
|
||||
GetObject(hMask, sizeof(maskBitmap), &maskBitmap);
|
||||
|
||||
|
@ -123,7 +124,6 @@ static VOID InitLogo(HWND hwndDlg)
|
|||
pImgInfo->cySource = logoBitmap.bmHeight;
|
||||
pImgInfo->iBits = logoBitmap.bmBitsPixel;
|
||||
pImgInfo->iPlanes = logoBitmap.bmPlanes;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
if (hMask != NULL) DeleteObject(hMask);
|
||||
|
|
Loading…
Reference in a new issue