[7/7] comctl32/listview: XP SP3 comctl32 V6 test workaround

Nikolay Sivov bunglehead at gmail.com
Sun Jun 21 17:50:29 CDT 2009


I didn't find a reason why only XP SP3 fails to create ListView window
after context switching so let's skip them for now: additional tests
will fail anyway.
Note that 2003 and higher work fine with that, so feel free
to contact me with any thoughts of making it work on XP SP3.

P.S. I tried to call initialization routine InitCommonControls
for new loaded V6 module, but I was stuck getting handle to it
and even full path to module with QueryActCtxW (only file name returned
properly).

Changelog:
    - XP SP3 comctl32 V6 test workaround

>From 48d43c0a05a9a5f717993584a7c7f2783bcc45bb Mon Sep 17 00:00:00 2001
From: Nikolay Sivov <bunglehead at gmail.com>
Date: Sun, 21 Jun 2009 18:01:11 +0400
Subject: XP SP3 comctl32 V6 test workaround

---
 dlls/comctl32/tests/listview.c |   51 ++++++++++++++++++++++++++-------------
 1 files changed, 34 insertions(+), 17 deletions(-)

diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c
index ecf1b07..470e183 100644
--- a/dlls/comctl32/tests/listview.c
+++ b/dlls/comctl32/tests/listview.c
@@ -3410,6 +3410,24 @@ static BOOL is_below_comctl_5(void)
     return !ret;
 }
 
+static void unload_v6_module(ULONG_PTR cookie)
+{
+    HANDLE hKernel32;
+    BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR);
+
+    hKernel32 = GetModuleHandleA("kernel32.dll");
+    pDeactivateActCtx = (void*)GetProcAddress(hKernel32, "DeactivateActCtx");
+    if (!pDeactivateActCtx)
+    {
+        win_skip("Activation contexts unsupported\n");
+        return;
+    }
+
+    pDeactivateActCtx(0, cookie);
+
+    DeleteFileA(manifest_name);
+}
+
 static BOOL load_v6_module(ULONG_PTR *pcookie)
 {
     HANDLE hKernel32;
@@ -3421,6 +3439,7 @@ static BOOL load_v6_module(ULONG_PTR *pcookie)
     BOOL ret;
     HANDLE file;
     DWORD written;
+    HWND hwnd;
 
     hKernel32 = GetModuleHandleA("kernel32.dll");
     pCreateActCtxA = (void*)GetProcAddress(hKernel32, "CreateActCtxA");
@@ -3468,26 +3487,24 @@ static BOOL load_v6_module(ULONG_PTR *pcookie)
         win_skip("A problem during context activation occured.\n");
         DeleteFileA(manifest_name);
     }
-
-    return ret;
-}
-
-static void unload_v6_module(ULONG_PTR cookie)
-{
-    HANDLE hKernel32;
-    BOOL (WINAPI *pDeactivateActCtx)(DWORD, ULONG_PTR);
-
-    hKernel32 = GetModuleHandleA("kernel32.dll");
-    pDeactivateActCtx = (void*)GetProcAddress(hKernel32, "DeactivateActCtx");
-    if (!pDeactivateActCtx)
+    else
     {
-        win_skip("Activation contexts unsupported\n");
-        return;
+        /* this is a XP SP3 failure workaround */
+        hwnd = CreateWindowExA(0, WC_LISTVIEW, "foo",
+                               WS_CHILD | WS_BORDER | WS_VISIBLE | LVS_REPORT,
+                               0, 0, 100, 100,
+                               hwndparent, NULL, GetModuleHandleA(NULL), NULL);
+        if (!IsWindow(hwnd))
+        {
+            win_skip("FIXME: failed to create ListView window.\n");
+            unload_v6_module(*pcookie);
+            return FALSE;
+        }
+        else
+            DestroyWindow(hwnd);
     }
 
-    pDeactivateActCtx(0, cookie);
-
-    DeleteFileA(manifest_name);
+    return ret;
 }
 
 static void test_get_set_view(void)
-- 
1.5.6.5





More information about the wine-patches mailing list