James Hawkins : user32: Set uiLo and uiHi to zero on error.

Alexandre Julliard julliard at winehq.org
Mon Sep 17 07:59:56 CDT 2007


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

Author: James Hawkins <truiken at gmail.com>
Date:   Sun Sep 16 18:27:02 2007 -0500

user32: Set uiLo and uiHi to zero on error.

---

 dlls/user32/dde_misc.c  |    6 +++---
 dlls/user32/tests/dde.c |   35 ++++++++++-------------------------
 2 files changed, 13 insertions(+), 28 deletions(-)

diff --git a/dlls/user32/dde_misc.c b/dlls/user32/dde_misc.c
index cac3192..974fde3 100644
--- a/dlls/user32/dde_misc.c
+++ b/dlls/user32/dde_misc.c
@@ -126,10 +126,10 @@ BOOL WINAPI UnpackDDElParam(UINT msg, LPARAM lParam,
     case WM_DDE_ADVISE:
     case WM_DDE_DATA:
     case WM_DDE_POKE:
-        if (!lParam) return FALSE;
-        if (!(params = GlobalLock( (HGLOBAL)lParam )))
+        if (!lParam || !(params = GlobalLock((HGLOBAL)lParam)))
         {
-            ERR("GlobalLock failed (%lx)\n", lParam);
+            if (uiLo) *uiLo = 0;
+            if (uiHi) *uiHi = 0;
             return FALSE;
         }
         TRACE("unpacked: low %08lx, high %08lx\n", params[0], params[1]);
diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c
index 2175b1a..054c686 100644
--- a/dlls/user32/tests/dde.c
+++ b/dlls/user32/tests/dde.c
@@ -710,21 +710,15 @@ static void test_UnpackDDElParam(void)
     hi = 0xbeef;
     ret = UnpackDDElParam(WM_DDE_ADVISE, (LPARAM)NULL, &lo, &hi);
     ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
-    todo_wine
-    {
-        ok(lo == 0, "Expected 0, got %08lx\n", lo);
-        ok(hi == 0, "Expected 0, got %08lx\n", hi);
-    }
+    ok(lo == 0, "Expected 0, got %08lx\n", lo);
+    ok(hi == 0, "Expected 0, got %08lx\n", hi);
 
     lo = 0xdead;
     hi = 0xbeef;
     ret = UnpackDDElParam(WM_DDE_ADVISE, 0xcafebabe, &lo, &hi);
     ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
-    todo_wine
-    {
-        ok(lo == 0, "Expected 0, got %08lx\n", lo);
-        ok(hi == 0, "Expected 0, got %08lx\n", hi);
-    }
+    ok(lo == 0, "Expected 0, got %08lx\n", lo);
+    ok(hi == 0, "Expected 0, got %08lx\n", hi);
 
     hglobal = GlobalAlloc(GMEM_DDESHARE, 2);
     ptr = GlobalLock(hglobal);
@@ -750,11 +744,8 @@ static void test_UnpackDDElParam(void)
     hi = 0xbeef;
     ret = UnpackDDElParam(WM_DDE_ACK, 0xcafebabe, &lo, &hi);
     ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
-    todo_wine
-    {
-        ok(lo == 0, "Expected 0, got %08lx\n", lo);
-        ok(hi == 0, "Expected 0, got %08lx\n", hi);
-    }
+    ok(lo == 0, "Expected 0, got %08lx\n", lo);
+    ok(hi == 0, "Expected 0, got %08lx\n", hi);
 
     lo = 0xdead;
     hi = 0xbeef;
@@ -767,11 +758,8 @@ static void test_UnpackDDElParam(void)
     hi = 0xbeef;
     ret = UnpackDDElParam(WM_DDE_DATA, 0xcafebabe, &lo, &hi);
     ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
-    todo_wine
-    {
-        ok(lo == 0, "Expected 0, got %08lx\n", lo);
-        ok(hi == 0, "Expected 0, got %08lx\n", hi);
-    }
+    ok(lo == 0, "Expected 0, got %08lx\n", lo);
+    ok(hi == 0, "Expected 0, got %08lx\n", hi);
 
     lo = 0xdead;
     hi = 0xbeef;
@@ -791,11 +779,8 @@ static void test_UnpackDDElParam(void)
     hi = 0xbeef;
     ret = UnpackDDElParam(WM_DDE_POKE, 0xcafebabe, &lo, &hi);
     ok(ret == FALSE, "Expected FALSE, got %d\n", ret);
-    todo_wine
-    {
-        ok(lo == 0, "Expected 0, got %08lx\n", lo);
-        ok(hi == 0, "Expected 0, got %08lx\n", hi);
-    }
+    ok(lo == 0, "Expected 0, got %08lx\n", lo);
+    ok(hi == 0, "Expected 0, got %08lx\n", hi);
 
     lo = 0xdead;
     hi = 0xbeef;




More information about the wine-cvs mailing list