localspl/tests: Fallback to localmon.dll on NT4.0

Detlef Riekenberg wine.dev at web.de
Sat Oct 21 11:41:04 CDT 2006


Testing with localmon.dll on NT4.0 allow us to test the Dialogs
(AddPort, ConfigurePort, DeletePort), that where moved to a different
dll (localui.dll) with a complicated API since w2k.

Changelog:
- localspl/tests: Fallback to localmon.dll on NT4.0



-- 
 
By by ... Detlef

-------------- next part --------------
>From 70a05fb9b0e64b0cded1871a6c2fc4cea039f2e0 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Sat, 21 Oct 2006 18:03:51 +0200
Subject: [PATCH] localspl/tests: Fallback to localmon.dll for NT4
---
 dlls/localspl/tests/localmon.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/localspl/tests/localmon.c b/dlls/localspl/tests/localmon.c
index ca5ee97..d71fb64 100644
--- a/dlls/localspl/tests/localmon.c
+++ b/dlls/localspl/tests/localmon.c
@@ -36,6 +36,7 @@ #include "wine/test.h"
 /* ##### */
 
 static HMODULE  hdll;
+static HMODULE  hlocalmon;
 static LPMONITOREX (WINAPI *pInitializePrintMonitor)(LPWSTR);
 
 static LPMONITOREX pm;
@@ -74,16 +75,18 @@ static void test_InitializePrintMonitor(
 
     SetLastError(0xdeadbeef);
     res = pInitializePrintMonitor(NULL);
-    ok( (res == NULL) && (GetLastError() == ERROR_INVALID_PARAMETER),
-        "returned %p with %d\n (expected NULL with " \
+    /* The Parameter was unchecked before w2k */
+    ok( res || (GetLastError() == ERROR_INVALID_PARAMETER),
+        "returned %p with %d\n (expected '!= NULL' or: NULL with " \
         "ERROR_INVALID_PARAMETER)\n", res, GetLastError());
 
     SetLastError(0xdeadbeef);
     res = pInitializePrintMonitor(emptyW);
-    ok( (res == NULL) && (GetLastError() == ERROR_INVALID_PARAMETER),
-        "returned %p with %d\n (expected NULL with " \
+    ok( res || (GetLastError() == ERROR_INVALID_PARAMETER),
+        "returned %p with %d\n (expected '!= NULL' or: NULL with " \
         "ERROR_INVALID_PARAMETER)\n", res, GetLastError());
 
+
     /* Every call with a non-empty string returns the same Pointer */
     SetLastError(0xdeadbeef);
     res = pInitializePrintMonitor(Monitors_LocalPortW);
@@ -107,6 +110,13 @@ START_TEST(localmon)
     if (!hdll) return;
 
     pInitializePrintMonitor = (void *) GetProcAddress(hdll, "InitializePrintMonitor");
+    if (!pInitializePrintMonitor) {
+        /* The Monitor for "Local Ports" was in a seperate dll before w2k */
+        hlocalmon = LoadLibraryA("localmon.dll");
+        if (hlocalmon) {
+            pInitializePrintMonitor = (void *) GetProcAddress(hlocalmon, "InitializePrintMonitor");
+        }
+    }
     if (!pInitializePrintMonitor) return;
 
     /* Native localmon.dll / localspl.dll need a vaild Port-Entry in:
-- 
1.4.1



More information about the wine-patches mailing list