Special case Win9x platforms in the desktop visibility test, in Win98
GetUserObjectInformation is a stub returning ERROR_CALL_NOT_IMPLEMENTED.
diff --git a/programs/winetest/main.c b/programs/winetest/main.c
index 30f1cab..316d483 100644
--- a/programs/winetest/main.c
+++ b/programs/winetest/main.c
@@ -69,21 +69,26 @@
static int running_on_visible_desktop ()
{
- FARPROC pGetProcessWindowStation = GetProcAddress(GetModuleHandle("user32.dll"), "GetProcessWindowStation");
+ HWND desktop;
+ HMODULE huser32 = GetModuleHandle("user32.dll");
+ FARPROC pGetProcessWindowStation = GetProcAddress(huser32, "GetProcessWindowStation");
+ FARPROC pGetUserObjectInformationA = GetProcAddress(huser32, "GetUserObjectInformationA");
- if (pGetProcessWindowStation)
+ desktop = GetDesktopWindow();
+ if (!GetWindowLongPtrW(desktop, GWLP_WNDPROC)) /* Win9x */
+ return IsWindowVisible(desktop);
+
+ if (pGetProcessWindowStation && pGetUserObjectInformationA)
{
DWORD len;
HWINSTA wstation;
USEROBJECTFLAGS uoflags;
- FARPROC pGetUserObjectInformationA = GetProcAddress(GetModuleHandle("user32.dll"), "GetUserObjectInformationA");
wstation = (HWINSTA)pGetProcessWindowStation();
assert(pGetUserObjectInformationA(wstation, UOI_FLAGS, &uoflags, sizeof(uoflags), &len));
return (uoflags.dwFlags & WSF_VISIBLE) != 0;
}
- else
- return IsWindowVisible(GetDesktopWindow());
+ return IsWindowVisible(desktop);
}
void print_version ()