Commit 2cd2f122 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

user32: Set uiLo and uiHi to zero on error.

parent 1eaeb3e0
...@@ -126,10 +126,10 @@ BOOL WINAPI UnpackDDElParam(UINT msg, LPARAM lParam, ...@@ -126,10 +126,10 @@ BOOL WINAPI UnpackDDElParam(UINT msg, LPARAM lParam,
case WM_DDE_ADVISE: case WM_DDE_ADVISE:
case WM_DDE_DATA: case WM_DDE_DATA:
case WM_DDE_POKE: case WM_DDE_POKE:
if (!lParam) return FALSE; if (!lParam || !(params = GlobalLock((HGLOBAL)lParam)))
if (!(params = GlobalLock( (HGLOBAL)lParam )))
{ {
ERR("GlobalLock failed (%lx)\n", lParam); if (uiLo) *uiLo = 0;
if (uiHi) *uiHi = 0;
return FALSE; return FALSE;
} }
TRACE("unpacked: low %08lx, high %08lx\n", params[0], params[1]); TRACE("unpacked: low %08lx, high %08lx\n", params[0], params[1]);
......
...@@ -710,21 +710,15 @@ static void test_UnpackDDElParam(void) ...@@ -710,21 +710,15 @@ static void test_UnpackDDElParam(void)
hi = 0xbeef; hi = 0xbeef;
ret = UnpackDDElParam(WM_DDE_ADVISE, (LPARAM)NULL, &lo, &hi); ret = UnpackDDElParam(WM_DDE_ADVISE, (LPARAM)NULL, &lo, &hi);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret); 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; lo = 0xdead;
hi = 0xbeef; hi = 0xbeef;
ret = UnpackDDElParam(WM_DDE_ADVISE, 0xcafebabe, &lo, &hi); ret = UnpackDDElParam(WM_DDE_ADVISE, 0xcafebabe, &lo, &hi);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret); 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); hglobal = GlobalAlloc(GMEM_DDESHARE, 2);
ptr = GlobalLock(hglobal); ptr = GlobalLock(hglobal);
...@@ -750,11 +744,8 @@ static void test_UnpackDDElParam(void) ...@@ -750,11 +744,8 @@ static void test_UnpackDDElParam(void)
hi = 0xbeef; hi = 0xbeef;
ret = UnpackDDElParam(WM_DDE_ACK, 0xcafebabe, &lo, &hi); ret = UnpackDDElParam(WM_DDE_ACK, 0xcafebabe, &lo, &hi);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret); 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; lo = 0xdead;
hi = 0xbeef; hi = 0xbeef;
...@@ -767,11 +758,8 @@ static void test_UnpackDDElParam(void) ...@@ -767,11 +758,8 @@ static void test_UnpackDDElParam(void)
hi = 0xbeef; hi = 0xbeef;
ret = UnpackDDElParam(WM_DDE_DATA, 0xcafebabe, &lo, &hi); ret = UnpackDDElParam(WM_DDE_DATA, 0xcafebabe, &lo, &hi);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret); 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; lo = 0xdead;
hi = 0xbeef; hi = 0xbeef;
...@@ -791,11 +779,8 @@ static void test_UnpackDDElParam(void) ...@@ -791,11 +779,8 @@ static void test_UnpackDDElParam(void)
hi = 0xbeef; hi = 0xbeef;
ret = UnpackDDElParam(WM_DDE_POKE, 0xcafebabe, &lo, &hi); ret = UnpackDDElParam(WM_DDE_POKE, 0xcafebabe, &lo, &hi);
ok(ret == FALSE, "Expected FALSE, got %d\n", ret); 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; lo = 0xdead;
hi = 0xbeef; hi = 0xbeef;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment