- Properly implement LookupIconIdFromDirectoryEx.

- Remove hack for GetDeviceCaps.
- This fixes one part of the Win32k Initialization Bug. If this change creates a problem some where else, the problem is not in this change. 

svn path=/trunk/; revision=38189
This commit is contained in:
James Tabor
2008-12-19 22:33:11 +00:00
parent 2b40f401d6
commit 6a59679c8e
3 changed files with 10 additions and 8 deletions
-5
View File
@@ -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) )
+8 -3
View File
@@ -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)
+2
View File
@@ -153,6 +153,8 @@ EnableWindow(HWND hWnd,
SHORT WINAPI
GetAsyncKeyState(int vKey)
{
if (vKey < 0 || vKey > 256)
return 0;
return (SHORT) NtUserGetAsyncKeyState((DWORD) vKey);
}