diff --git a/reactos/dll/win32/gdi32/objects/dc.c b/reactos/dll/win32/gdi32/objects/dc.c index b37e9f44dd9..c2e55835b33 100644 --- a/reactos/dll/win32/gdi32/objects/dc.c +++ b/reactos/dll/win32/gdi32/objects/dc.c @@ -505,11 +505,6 @@ GetDeviceCaps(HDC hDC, } else { - // HAX!!!! - // Due to winlogon process/thread mapping issues we have this hax! - // FIXME!!! This is a victim of the Win32k Initialization BUG!!!!! - return NtGdiGetDeviceCaps(hDC,i); - if (!GdiGetHandleUserData((HGDIOBJ) hDC, GDI_OBJECT_TYPE_DC, (PVOID) &Dc_Attr)) return 0; if (!(Dc_Attr->ulDirty_ & DC_PRIMARY_DISPLAY) ) diff --git a/reactos/dll/win32/user32/windows/icon.c b/reactos/dll/win32/user32/windows/icon.c index 4d0aac5aab2..78e1da8de0d 100644 --- a/reactos/dll/win32/user32/windows/icon.c +++ b/reactos/dll/win32/user32/windows/icon.c @@ -658,6 +658,9 @@ LookupIconIdFromDirectoryEx(PBYTE xdir, { GRPCURSORICONDIR *dir = (GRPCURSORICONDIR*)xdir; UINT retVal = 0; + + GetConnected(); + if(dir && !dir->idReserved && (IMAGE_ICON == dir->idType || IMAGE_CURSOR == dir->idType)) { GRPCURSORICONDIRENTRY *entry = NULL; @@ -667,11 +670,13 @@ LookupIconIdFromDirectoryEx(PBYTE xdir, { ColorBits = 1; } + else if (g_psi->SystemMetrics[SM_SAMEDISPLAYFORMAT] || (cFlag & LR_VGACOLOR) ) + { + ColorBits = 4; + } else { - HDC hdc = CreateICW(NULL, NULL, NULL, NULL); - ColorBits = GetDeviceCaps(hdc, BITSPIXEL); - DeleteDC(hdc); + ColorBits = 0; } if(bIcon) diff --git a/reactos/dll/win32/user32/windows/input.c b/reactos/dll/win32/user32/windows/input.c index d15f2875ab8..94fd02dd761 100644 --- a/reactos/dll/win32/user32/windows/input.c +++ b/reactos/dll/win32/user32/windows/input.c @@ -153,6 +153,8 @@ EnableWindow(HWND hWnd, SHORT WINAPI GetAsyncKeyState(int vKey) { + if (vKey < 0 || vKey > 256) + return 0; return (SHORT) NtUserGetAsyncKeyState((DWORD) vKey); }