Fixed DdeGetData when called for getting size.

This commit is contained in:
Eric Pouech 2002-02-26 00:37:57 +00:00 committed by Alexandre Julliard
parent ed792972d9
commit 92e838f263
1 changed files with 7 additions and 3 deletions

View File

@ -1349,13 +1349,17 @@ DWORD WINAPI DdeGetData(HDDEDATA hData, LPBYTE pDst, DWORD cbMax, DWORD cbOff)
DWORD dwSize, dwRet;
LPBYTE pByte;
TRACE("(%08lx,%p,%ld,%ld)\n",(DWORD)hData,pDst,cbMax,cbOff);
TRACE("(%08lx,%p,%ld,%ld)\n",(DWORD)hData, pDst, cbMax, cbOff);
pByte = DdeAccessData(hData, &dwSize);
if (pByte)
{
if (cbOff + cbMax < dwSize)
if (!pDst)
{
dwRet = dwSize;
}
else if (cbOff + cbMax < dwSize)
{
dwRet = cbMax;
}
@ -1401,7 +1405,7 @@ LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize)
{
*pcbDataSize = GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD);
}
TRACE("=> %08lx (%lu)\n", (DWORD)(pDdh + 1), GlobalSize(hMem) - sizeof(DDE_DATAHANDLE_HEAD));
return (LPBYTE)(pDdh + 1);
}