Commit 92e838f2 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

Fixed DdeGetData when called for getting size.

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