From 4fb3518e2ae8126c9c66f5546abadba6e9111ddb Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Fri, 12 Oct 2007 00:20:08 -0500 Subject: [PATCH] user32: Return DMLERR_INVALIDPARAMETER if hszItem is NULL. --- dlls/user32/dde_client.c | 9 +++++++-- dlls/user32/tests/dde.c | 10 ++-------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/dlls/user32/dde_client.c b/dlls/user32/dde_client.c index 16e6daa04bd..fe2dada8c49 100644 --- a/dlls/user32/dde_client.c +++ b/dlls/user32/dde_client.c @@ -1141,8 +1141,13 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS pXAct = WDML_ClientQueueExecute(pConv, pData, cbData); break; case XTYP_POKE: - pXAct = WDML_ClientQueuePoke(pConv, pData, cbData, wFmt, hszItem); - break; + if (!hszItem) + { + pConv->instance->lastError = DMLERR_INVALIDPARAMETER; + return 0; + } + pXAct = WDML_ClientQueuePoke(pConv, pData, cbData, wFmt, hszItem); + break; case XTYP_ADVSTART|XTYPF_NODATA: case XTYP_ADVSTART|XTYPF_NODATA|XTYPF_ACKREQ: case XTYP_ADVSTART: diff --git a/dlls/user32/tests/dde.c b/dlls/user32/tests/dde.c index 5d0c915b4da..1601cd16e4b 100644 --- a/dlls/user32/tests/dde.c +++ b/dlls/user32/tests/dde.c @@ -358,10 +358,7 @@ static void test_ddeml_client(void) ret = DdeGetLastError(client_pid); ok(op == NULL, "Expected NULL, got %p\n", op); ok(res == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", res); - todo_wine - { - ok(ret == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got %d\n", ret); - } + ok(ret == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got %d\n", ret); /* XTYP_POKE, no data */ res = 0xdeadbeef; @@ -370,10 +367,7 @@ static void test_ddeml_client(void) ret = DdeGetLastError(client_pid); ok(op == NULL, "Expected NULL, got %p\n", op); ok(res == 0xdeadbeef, "Expected 0xdeadbeef, got %d\n", res); - todo_wine - { - ok(ret == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got %d\n", ret); - } + ok(ret == DMLERR_INVALIDPARAMETER, "Expected DMLERR_INVALIDPARAMETER, got %d\n", ret); /* XTYP_POKE, wrong size */ res = 0xdeadbeef;