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

This commit is contained in:
Jeff Latimer 2009-01-14 18:29:18 +11:00 committed by Alexandre Julliard
parent 950514c8c3
commit 56784f60c1
2 changed files with 13 additions and 10 deletions

View File

@ -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)

View File

@ -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;