Make running tests on a visible desktop a mandatory requirement
Dmitry Timoshkov
dmitry at baikal.ru
Sat Mar 12 02:44:31 CST 2005
"Paul Vriens" <Paul.Vriens at xs4all.nl> wrote:
> When running the latest winetest from Paul' page, I get on my win98 box:
>
> C:\WINDOWS\Desktop>C:\WINDOWS\DESKTOP\WINETE~1.EXE
> Assertion failed: pGetUserObjectInformationA(wstation, UOI_FLAGS,
> &uoflags, size
> of(uoflags), &len), file
> /home/paul/Production/wine-cross-source/programs/winete
> st/main.c, line 82
>
> abnormal program termination
>
> This doesn't seem right ;-)
Thanks for the report. assert() was supposed to catch exactly that kind
of breakage.
Changelog:
Dmitry Timoshkov <dmitry at codeweavers.com>
Special case Win9x platforms in the desktop visibility test, in Win98
GetUserObjectInformation is a stub returning ERROR_CALL_NOT_IMPLEMENTED.
--
Dmitry.
-------------- next part --------------
--- cvs/hq/wine/programs/winetest/main.c Fri Mar 11 00:08:58 2005
+++ wine/programs/winetest/main.c Sat Mar 12 08:31:12 2005
@@ -69,21 +69,26 @@ static int running_under_wine ()
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 ()
More information about the wine-patches
mailing list