user32: Convert an HDDEDATA handle to a DDEPOKE structure for WM_DDE_POKE.
This commit is contained in:
parent
88913f094b
commit
9fd2d443fe
|
@ -697,8 +697,11 @@ static WDML_QUEUE_STATE WDML_HandleExecuteReply(WDML_CONV* pConv, MSG* msg, WDML
|
||||||
static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPVOID pData, DWORD cbData,
|
static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPVOID pData, DWORD cbData,
|
||||||
UINT wFmt, HSZ hszItem)
|
UINT wFmt, HSZ hszItem)
|
||||||
{
|
{
|
||||||
WDML_XACT* pXAct;
|
DDE_DATAHANDLE_HEAD *dh;
|
||||||
ATOM atom;
|
WDML_XACT *pXAct;
|
||||||
|
DDEPOKE *ddePoke;
|
||||||
|
HGLOBAL hglobal;
|
||||||
|
ATOM atom;
|
||||||
|
|
||||||
TRACE("XTYP_POKE transaction\n");
|
TRACE("XTYP_POKE transaction\n");
|
||||||
|
|
||||||
|
@ -708,29 +711,33 @@ static WDML_XACT* WDML_ClientQueuePoke(WDML_CONV* pConv, LPVOID pData, DWORD cbD
|
||||||
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE, wFmt, hszItem);
|
pXAct = WDML_AllocTransaction(pConv->instance, WM_DDE_POKE, wFmt, hszItem);
|
||||||
if (!pXAct)
|
if (!pXAct)
|
||||||
{
|
{
|
||||||
GlobalDeleteAtom(atom);
|
GlobalDeleteAtom(atom);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cbData == (DWORD)-1)
|
if (cbData == (DWORD)-1)
|
||||||
{
|
{
|
||||||
pXAct->hMem = (HDDEDATA)pData;
|
hglobal = (HGLOBAL)pData;
|
||||||
|
dh = (DDE_DATAHANDLE_HEAD *)GlobalLock(hglobal);
|
||||||
|
cbData = GlobalSize(hglobal) - sizeof(DDE_DATAHANDLE_HEAD);
|
||||||
|
pData = (LPVOID)(dh + 1);
|
||||||
|
GlobalUnlock(hglobal);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
DDEPOKE* ddePoke;
|
|
||||||
|
|
||||||
pXAct->hMem = GlobalAlloc(GHND | GMEM_DDESHARE, sizeof(DDEPOKE) + cbData);
|
pXAct->hMem = GlobalAlloc(GHND | GMEM_DDESHARE, sizeof(DDEPOKE) + cbData);
|
||||||
ddePoke = GlobalLock(pXAct->hMem);
|
ddePoke = GlobalLock(pXAct->hMem);
|
||||||
if (ddePoke)
|
if (!ddePoke)
|
||||||
{
|
{
|
||||||
memcpy(ddePoke->Value, pData, cbData);
|
pConv->instance->lastError = DMLERR_MEMORY_ERROR;
|
||||||
ddePoke->fRelease = TRUE;
|
return NULL;
|
||||||
ddePoke->cfFormat = wFmt;
|
|
||||||
GlobalUnlock(pXAct->hMem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ddePoke->unused = 0;
|
||||||
|
ddePoke->fRelease = TRUE;
|
||||||
|
ddePoke->cfFormat = wFmt;
|
||||||
|
memcpy(ddePoke->Value, pData, cbData);
|
||||||
|
GlobalUnlock(pXAct->hMem);
|
||||||
|
|
||||||
pXAct->lParam = PackDDElParam(WM_DDE_POKE, (UINT_PTR)pXAct->hMem, atom);
|
pXAct->lParam = PackDDElParam(WM_DDE_POKE, (UINT_PTR)pXAct->hMem, atom);
|
||||||
|
|
||||||
return pXAct;
|
return pXAct;
|
||||||
|
|
|
@ -171,12 +171,9 @@ static LRESULT WINAPI dde_server_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPA
|
||||||
poke = GlobalLock((HGLOBAL)lo);
|
poke = GlobalLock((HGLOBAL)lo);
|
||||||
ok(poke != NULL, "Expected non-NULL poke\n");
|
ok(poke != NULL, "Expected non-NULL poke\n");
|
||||||
ok(poke->fReserved == 0, "Expected 0, got %d\n", poke->fReserved);
|
ok(poke->fReserved == 0, "Expected 0, got %d\n", poke->fReserved);
|
||||||
if (msg_index == 6) todo_wine
|
ok(poke->unused == 0, "Expected 0, got %d\n", poke->unused);
|
||||||
{
|
ok(poke->fRelease == TRUE, "Expected TRUE, got %d\n", poke->fRelease);
|
||||||
ok(poke->unused == 0, "Expected 0, got %d\n", poke->unused);
|
ok(poke->cfFormat == CF_TEXT, "Expected CF_TEXT, got %d\n", poke->cfFormat);
|
||||||
ok(poke->fRelease == TRUE, "Expected TRUE, got %d\n", poke->fRelease);
|
|
||||||
ok(poke->cfFormat == CF_TEXT, "Expected CF_TEXT, got %d\n", poke->cfFormat);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (msg_index == 5)
|
if (msg_index == 5)
|
||||||
ok(lstrcmpA((LPSTR)poke->Value, "poke data\r\n"),
|
ok(lstrcmpA((LPSTR)poke->Value, "poke data\r\n"),
|
||||||
|
|
Loading…
Reference in New Issue