user32: sizeof DDEPOKE and DDEDATA is six, which is probably not what is expected, so use offsetof instead.
This commit is contained in:
parent
5d929b1374
commit
64acbb55b4
|
@ -724,7 +724,7 @@ static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPVOID pData, DWORD cbD
|
||||||
GlobalUnlock(hglobal);
|
GlobalUnlock(hglobal);
|
||||||
}
|
}
|
||||||
|
|
||||||
pXAct->hMem = GlobalAlloc(GHND | GMEM_DDESHARE, sizeof(DDEPOKE) + cbData);
|
pXAct->hMem = GlobalAlloc(GHND | GMEM_DDESHARE, FIELD_OFFSET(DDEPOKE, Value[cbData]));
|
||||||
ddePoke = GlobalLock(pXAct->hMem);
|
ddePoke = GlobalLock(pXAct->hMem);
|
||||||
if (!ddePoke)
|
if (!ddePoke)
|
||||||
{
|
{
|
||||||
|
|
|
@ -844,7 +844,7 @@ static WDML_QUEUE_STATE WDML_ServerHandlePoke(WDML_CONV* pConv, WDML_XACT* pXAct
|
||||||
if (!(pConv->instance->CBFflags & CBF_FAIL_POKES))
|
if (!(pConv->instance->CBFflags & CBF_FAIL_POKES))
|
||||||
{
|
{
|
||||||
hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, pDdePoke->Value,
|
hDdeData = DdeCreateDataHandle(pConv->instance->instanceID, pDdePoke->Value,
|
||||||
GlobalSize(pXAct->hMem) - sizeof(DDEPOKE) + 1,
|
GlobalSize(pXAct->hMem) - FIELD_OFFSET(DDEPOKE, Value),
|
||||||
0, 0, pDdePoke->cfFormat, 0);
|
0, 0, pDdePoke->cfFormat, 0);
|
||||||
if (hDdeData)
|
if (hDdeData)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1456,8 +1456,8 @@ static BOOL post_dde_message( struct packed_message *data, const struct send_mes
|
||||||
{
|
{
|
||||||
size = GlobalSize( (HGLOBAL)uiLo ) ;
|
size = GlobalSize( (HGLOBAL)uiLo ) ;
|
||||||
if ((info->msg == WM_DDE_ADVISE && size < sizeof(DDEADVISE)) ||
|
if ((info->msg == WM_DDE_ADVISE && size < sizeof(DDEADVISE)) ||
|
||||||
(info->msg == WM_DDE_DATA && size < sizeof(DDEDATA)) ||
|
(info->msg == WM_DDE_DATA && size < FIELD_OFFSET(DDEDATA, Value)) ||
|
||||||
(info->msg == WM_DDE_POKE && size < sizeof(DDEPOKE))
|
(info->msg == WM_DDE_POKE && size < FIELD_OFFSET(DDEPOKE, Value))
|
||||||
)
|
)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -699,10 +699,7 @@ static HDDEDATA CALLBACK server_ddeml_callback(UINT uType, UINT uFmt, HCONV hcon
|
||||||
|
|
||||||
ptr = (LPSTR)DdeAccessData(hdata, &size);
|
ptr = (LPSTR)DdeAccessData(hdata, &size);
|
||||||
ok(!lstrcmpA(ptr, "poke data\r\n"), "Expected 'poke data\\r\\n', got %s\n", ptr);
|
ok(!lstrcmpA(ptr, "poke data\r\n"), "Expected 'poke data\\r\\n', got %s\n", ptr);
|
||||||
todo_wine
|
ok(size == 12, "Expected 12, got %d\n", size);
|
||||||
{
|
|
||||||
ok(size == 14, "Expected 14, got %d\n", size);
|
|
||||||
}
|
|
||||||
DdeUnaccessData(hdata);
|
DdeUnaccessData(hdata);
|
||||||
|
|
||||||
size = DdeQueryStringA(server_pid, hsz2, str, MAX_PATH, CP_WINANSI);
|
size = DdeQueryStringA(server_pid, hsz2, str, MAX_PATH, CP_WINANSI);
|
||||||
|
@ -981,7 +978,7 @@ static HGLOBAL create_poke()
|
||||||
DDEPOKE *poke;
|
DDEPOKE *poke;
|
||||||
DWORD size;
|
DWORD size;
|
||||||
|
|
||||||
size = sizeof(DDEPOKE) + lstrlenA("poke data\r\n") + 1;
|
size = FIELD_OFFSET(DDEPOKE, Value[sizeof("poke data\r\n")]);
|
||||||
hglobal = GlobalAlloc(GMEM_DDESHARE, size);
|
hglobal = GlobalAlloc(GMEM_DDESHARE, size);
|
||||||
ok(hglobal != 0, "Expected non-NULL hglobal\n");
|
ok(hglobal != 0, "Expected non-NULL hglobal\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue