Commit 56784f60 authored by Jeff Latimer's avatar Jeff Latimer Committed by Alexandre Julliard

user32: Check for NULL pData in DdeClientTransAction expecting to be passed a handle.

parent 950514c8
......@@ -632,6 +632,15 @@ static WDML_XACT* WDML_ClientQueueExecute(WDML_CONV* pConv, LPVOID pData, DWORD
TRACE("XTYP_EXECUTE transaction\n");
if (pData == NULL)
{
if (cbData == (DWORD)-1)
pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
else
pConv->instance->lastError = DMLERR_MEMORY_ERROR;
return NULL;
}
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_EXECUTE, 0, 0);
if (!pXAct)
return NULL;
......@@ -1154,13 +1163,10 @@ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HS
switch (wType)
{
case XTYP_EXECUTE:
/* Windows simply ignores hszItem and wFmt in this case */
if (pData == NULL)
{
pConv->instance->lastError = DMLERR_INVALIDPARAMETER;
return 0;
}
/* Windows simply ignores hszItem and wFmt in this case */
pXAct = WDML_ClientQueueExecute(pConv, pData, cbData);
if (pXAct == NULL)
return 0;
break;
case XTYP_POKE:
if (!hszItem)
......
......@@ -427,10 +427,7 @@ todo_wine
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_MEMORY_ERROR, "Expected DMLERR_MEMORY_ERROR, got %d\n", ret);
}
ok(ret == DMLERR_MEMORY_ERROR, "Expected DMLERR_MEMORY_ERROR, got %d\n", ret);
/* XTYP_EXECUTE, no data, -1 size */
res = 0xdeadbeef;
......
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