--- mstools/samples/ddeml/client/dde.c 2018/08/09 18:20:38 1.1.1.1 +++ mstools/samples/ddeml/client/dde.c 2018/08/09 18:21:26 1.1.1.2 @@ -10,6 +10,7 @@ #include #include #include "infoctrl.h" +#include "huge.h" CHAR szT[100]; @@ -212,8 +213,14 @@ XACT *pxact) * Show resulting data */ psz = GetTextData((HDDEDATA)pxact->ret); - SendMessage(hwndInfoCtrl, ICM_SETSTRING, ICSID_CENTER, - (DWORD)(LPSTR)psz); + if (!DdeCmpStringHandles(pxact->hszItem, hszHuge) && + !CheckHugeData((HDDEDATA)pxact->ret)) { + SendMessage(hwndInfoCtrl, ICM_SETSTRING, ICSID_CENTER, + (DWORD)(LPSTR)"Invalid Huge Data"); + } else { + SendMessage(hwndInfoCtrl, ICM_SETSTRING, ICSID_CENTER, + (DWORD)(LPSTR)psz); + } MyFree(psz); /* * free returned data since it is displayed. @@ -579,7 +586,7 @@ INT cbMax) if (fmt < 0xc000) { // predefined or integer format - just get the atom string // wierdly enough, GetClipboardFormatName() doesn't support this. - return(GlobalGetAtomName((ATOM)fmt, lpstr, cbMax)); + return(GlobalGetAtomName((ATOM)fmt, lpstr, cbMax)); } else { return(GetClipboardFormatName(fmt, lpstr, cbMax)); } @@ -644,4 +651,3 @@ HCONV hConv) InvalidateRect(hwnd, NULL, TRUE); return(DdeDisconnect(hConv)); } -