Detlef Riekenberg : spoolss/tests: Fix a test on vista/w2k8.

Alexandre Julliard julliard at winehq.org
Tue Aug 19 08:47:00 CDT 2008


Module: wine
Branch: master
Commit: f4a99193041295fce8e64b949c081e6297076d45
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4a99193041295fce8e64b949c081e6297076d45

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Sat Aug  9 23:59:47 2008 +0200

spoolss/tests: Fix a test on vista/w2k8.

---

 dlls/spoolss/tests/spoolss.c |   30 +++++++++++++++++++++++++-----
 1 files changed, 25 insertions(+), 5 deletions(-)

diff --git a/dlls/spoolss/tests/spoolss.c b/dlls/spoolss/tests/spoolss.c
index b0b544c..d65f101 100644
--- a/dlls/spoolss/tests/spoolss.c
+++ b/dlls/spoolss/tests/spoolss.c
@@ -41,6 +41,7 @@ static DWORD  (WINAPI * pSplInitializeWinSpoolDrv)(LPVOID *);
 static LPVOID fn_spl[WINSPOOL_TABLESIZE];
 static LPVOID fn_w2k[WINSPOOL_TABLESIZE];
 static LPVOID fn_xp[WINSPOOL_TABLESIZE];
+static LPVOID fn_v[WINSPOOL_TABLESIZE];
 
 /* ########################### */
 
@@ -89,6 +90,18 @@ static LPCSTR load_functions(void)
     fn_xp[7] = (void *) GetProcAddress(hwinspool, (LPSTR) 214);  /* RefCntUnloadDriver */
     fn_xp[8] = (void *) GetProcAddress(hwinspool, (LPSTR) 215);  /* ForceUnloadDriver */
 
+    memset(fn_v,  0xff, sizeof(fn_v));
+    fn_v[0] = (void *) GetProcAddress(hwinspool, "OpenPrinterW");
+    fn_v[1] = (void *) GetProcAddress(hwinspool, "ClosePrinter");
+    fn_v[2] = (void *) GetProcAddress(hwinspool, "SpoolerDevQueryPrintW");
+    fn_v[3] = (void *) GetProcAddress(hwinspool, "SpoolerPrinterEvent");
+    fn_v[4] = (void *) GetProcAddress(hwinspool, "DocumentPropertiesW");
+    fn_v[5] = (void *) GetProcAddress(hwinspool, (LPSTR) 212);  /* LoadPrinterDriver */
+    fn_v[6] = (void *) GetProcAddress(hwinspool, (LPSTR) 213);  /* RefCntLoadDriver */
+    fn_v[7] = (void *) GetProcAddress(hwinspool, (LPSTR) 214);  /* RefCntUnloadDriver */
+    fn_v[8] = (void *) GetProcAddress(hwinspool, (LPSTR) 215);  /* ForceUnloadDriver */
+    fn_v[9] = (void *) GetProcAddress(hwinspool, (LPSTR) 251);  /* 0xfb */
+
     return NULL;
 
 }
@@ -124,21 +137,28 @@ static void test_BuildOtherNamesFromMachineName(void)
 
 static void test_SplInitializeWinSpoolDrv(VOID)
 {
+    LPVOID *fn_ref = fn_xp;
     DWORD   res;
     LONG    id;
-    BOOL    is_xp;
 
     memset(fn_spl, 0xff, sizeof(fn_spl));
     SetLastError(0xdeadbeef);
     res = pSplInitializeWinSpoolDrv(fn_spl);
     ok(res, "got %u with %u (expected '!= 0')\n", res, GetLastError());
 
-    /* functions 0 to 5 are the same with "spoolss.dll" from w2k and xp */
-    is_xp = (fn_spl[6] == fn_xp[6]);
+    /* functions 0 to 5 are the same in "spoolss.dll" from w2k and above */
+    if (fn_spl[6] == fn_w2k[6]) {
+        fn_ref = fn_w2k;
+    }
+    if (fn_spl[9] == fn_v[9]) {
+        fn_ref = fn_v;
+    }
+
     id = 0;
     while (id < WINSPOOL_TABLESIZE) {
-        ok( fn_spl[id] == (is_xp ? fn_xp[id] : fn_w2k[id]),
-            "(#%02u) spoolss: %p,  xp: %p,  w2k: %p\n", id, fn_spl[id], fn_xp[id], fn_w2k[id]);
+        ok( fn_spl[id] == fn_ref[id],
+            "(#%02u) spoolss: %p (vista: %p,  xp: %p,  w2k: %p)\n",
+            id, fn_spl[id], fn_v[id], fn_xp[id], fn_w2k[id]);
         id++;
     }
 }




More information about the wine-cvs mailing list