--- mstools/h/ddeml.h 2018/08/09 18:20:29 1.1 +++ mstools/h/ddeml.h 2018/08/09 18:23:01 1.1.1.3 @@ -1,4 +1,4 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects +/*++ BUILD Version: 0001 // Increment this if a change has global effects --*/ /*****************************************************************************\ * * @@ -6,19 +6,23 @@ * * * Version 3.10 * * * * -* Copyright (c) 1992, Microsoft Corp. All rights reserved. * +* Copyright (c) 1993, Microsoft Corp. All rights reserved. * * * \*****************************************************************************/ #ifndef _INC_DDEMLH #define _INC_DDEMLH +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + /******** public types ********/ -typedef DWORD HCONVLIST; -typedef DWORD HCONV; -typedef DWORD HSZ; -typedef DWORD HDDEDATA; -#define EXPENTRY +typedef DWORD HCONVLIST; +typedef DWORD HCONV; +typedef DWORD HSZ; +typedef DWORD HDDEDATA; +#define EXPENTRY CALLBACK /* the following structure is for use with XTYP_WILDCONNECT processing. */ @@ -38,6 +42,7 @@ typedef struct tagCONVCONTEXT { int iCodePage; /* codepage used for topic/item strings. */ DWORD dwLangID; /* language ID for topic/item strings. */ DWORD dwSecurity; /* Private security code. */ + SECURITY_QUALITY_OF_SERVICE qos; /* client side's quality of service */ } CONVCONTEXT; typedef CONVCONTEXT FAR *PCONVCONTEXT; @@ -59,6 +64,8 @@ typedef struct tagCONVINFO { UINT wLastError; /* last transaction error. */ HCONVLIST hConvList; /* parent hConvList if this conversation is in a list */ CONVCONTEXT ConvCtxt; /* conversation context */ + HWND hwnd; /* window handle for this conversation */ + HWND hwndPartner; /* partner window handle for this conversation */ } CONVINFO; typedef CONVINFO FAR *PCONVINFO; @@ -87,31 +94,32 @@ typedef CONVINFO FAR *PCONVINFO; /***** conversation status bits (fsStatus) *****/ -#define ST_CONNECTED 0x0001 -#define ST_ADVISE 0x0002 -#define ST_ISLOCAL 0x0004 -#define ST_BLOCKED 0x0008 -#define ST_CLIENT 0x0010 -#define ST_TERMINATED 0x0020 -#define ST_INLIST 0x0040 -#define ST_BLOCKNEXT 0x0080 -#define ST_ISSELF 0x0100 +#define ST_CONNECTED 0x0001 +#define ST_ADVISE 0x0002 +#define ST_ISLOCAL 0x0004 +#define ST_BLOCKED 0x0008 +#define ST_CLIENT 0x0010 +#define ST_TERMINATED 0x0020 +#define ST_INLIST 0x0040 +#define ST_BLOCKNEXT 0x0080 +#define ST_ISSELF 0x0100 /* DDE constants for wStatus field */ -#define DDE_FACK 0x8000 -#define DDE_FBUSY 0x4000 -#define DDE_FDEFERUPD 0x4000 -#define DDE_FACKREQ 0x8000 -#define DDE_FRELEASE 0x2000 -#define DDE_FREQUESTED 0x1000 -#define DDE_FACKRESERVED 0x3ff0 -#define DDE_FADVRESERVED 0x3fff -#define DDE_FDATRESERVED 0x4fff -#define DDE_FPOKRESERVED 0xdfff -#define DDE_FAPPSTATUS 0x00ff -#define DDE_FNOTPROCESSED 0x0000 +#define DDE_FACK 0x8000 +#define DDE_FBUSY 0x4000 +#define DDE_FDEFERUPD 0x4000 +#define DDE_FACKREQ 0x8000 +#define DDE_FRELEASE 0x2000 +#define DDE_FREQUESTED 0x1000 +#define DDE_FAPPSTATUS 0x00ff +#define DDE_FNOTPROCESSED 0x0000 + +#define DDE_FACKRESERVED (~(DDE_FACK | DDE_FBUSY | DDE_FAPPSTATUS)) +#define DDE_FADVRESERVED (~(DDE_FACKREQ | DDE_FDEFERUPD)) +#define DDE_FDATRESERVED (~(DDE_FACKREQ | DDE_FRELEASE | DDE_FREQUESTED)) +#define DDE_FPOKRESERVED (~(DDE_FRELEASE)) /***** message filter hook types *****/ @@ -163,21 +171,33 @@ typedef CONVINFO FAR *PCONVINFO; /****** public strings used in DDE ******/ -#define SZDDESYS_TOPIC "System" -#define SZDDESYS_ITEM_TOPICS "Topics" -#define SZDDESYS_ITEM_SYSITEMS "SysItems" -#define SZDDESYS_ITEM_RTNMSG "ReturnMessage" -#define SZDDESYS_ITEM_STATUS "Status" -#define SZDDESYS_ITEM_FORMATS "Formats" -#define SZDDESYS_ITEM_HELP "Help" -#define SZDDE_ITEM_ITEMLIST "TopicItemList" +#ifdef UNICODE +#define SZDDESYS_TOPIC L"System" +#define SZDDESYS_ITEM_TOPICS L"Topics" +#define SZDDESYS_ITEM_SYSITEMS L"SysItems" +#define SZDDESYS_ITEM_RTNMSG L"ReturnMessage" +#define SZDDESYS_ITEM_STATUS L"Status" +#define SZDDESYS_ITEM_FORMATS L"Formats" +#define SZDDESYS_ITEM_HELP L"Help" +#define SZDDE_ITEM_ITEMLIST L"TopicItemList" +#else +#define SZDDESYS_TOPIC "System" +#define SZDDESYS_ITEM_TOPICS "Topics" +#define SZDDESYS_ITEM_SYSITEMS "SysItems" +#define SZDDESYS_ITEM_RTNMSG "ReturnMessage" +#define SZDDESYS_ITEM_STATUS "Status" +#define SZDDESYS_ITEM_FORMATS "Formats" +#define SZDDESYS_ITEM_HELP "Help" +#define SZDDE_ITEM_ITEMLIST "TopicItemList" +#endif /****** API entry points ******/ typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv, HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2); -typedef FNCALLBACK *PFNCALLBACK; +typedef HDDEDATA (CALLBACK *PFNCALLBACK)(UINT wType, UINT wFmt, HCONV hConv, + HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2); #define CBR_BLOCK 0xffffffffL @@ -188,9 +208,9 @@ UINT WINAPI DdeInitializeA(LPDWORD pidIn UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback, DWORD afCmd, DWORD ulRes); #ifdef UNICODE -#define DdeInitialize DdeInitializeW +#define DdeInitialize DdeInitializeW #else -#define DdeInitialize DdeInitializeA +#define DdeInitialize DdeInitializeA #endif // !UNICODE /* @@ -228,14 +248,18 @@ UINT WINAPI DdeInitializeW(LPDWORD pidIn BOOL WINAPI DdeUninitialize(DWORD idInst); -/* conversation enumeration functions */ +/* + * conversation enumeration functions + */ HCONVLIST WINAPI DdeConnectList(DWORD idInst, HSZ hszService, HSZ hszTopic, HCONVLIST hConvList, PCONVCONTEXT pCC); HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev); BOOL WINAPI DdeDisconnectList(HCONVLIST hConvList); -/* conversation control functions */ +/* + * conversation control functions + */ HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic, PCONVCONTEXT pCC); @@ -246,11 +270,13 @@ BOOL WINAPI DdeSetUserHandle(HCONV hConv BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction); -/* app server interface functions */ +/* + * app server interface functions + */ BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem); BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd); -BOOL WINAPI DdeImpersonateClient(HCONV hCOnv); +BOOL WINAPI DdeImpersonateClient(HCONV hConv); #define EC_ENABLEALL 0 #define EC_ENABLEONE ST_BLOCKNEXT @@ -265,13 +291,17 @@ HDDEDATA WINAPI DdeNameService(DWORD idI #define DNS_FILTERON 0x0004 #define DNS_FILTEROFF 0x0008 -/* app client interface functions */ +/* + * app client interface functions + */ HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData, HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType, DWORD dwTimeout, LPDWORD pdwResult); -/* data transfer functions */ +/* + *data transfer functions + */ HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb, DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd); @@ -314,16 +344,16 @@ UINT WINAPI DdeGetLastError(DWORD idInst HSZ WINAPI DdeCreateStringHandleA(DWORD idInst, LPSTR psz, int iCodePage); HSZ WINAPI DdeCreateStringHandleW(DWORD idInst, LPWSTR psz, int iCodePage); #ifdef UNICODE -#define DdeCreateStringHandle DdeCreateStringHandleW +#define DdeCreateStringHandle DdeCreateStringHandleW #else -#define DdeCreateStringHandle DdeCreateStringHandleA +#define DdeCreateStringHandle DdeCreateStringHandleA #endif // !UNICODE DWORD WINAPI DdeQueryStringA(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, int iCodePage); DWORD WINAPI DdeQueryStringW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, int iCodePage); #ifdef UNICODE -#define DdeQueryString DdeQueryStringW +#define DdeQueryString DdeQueryStringW #else -#define DdeQueryString DdeQueryStringA +#define DdeQueryString DdeQueryStringA #endif // !UNICODE BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz); BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz); @@ -331,9 +361,9 @@ int WINAPI DdeCmpStringHandles(HSZ hsz1, #ifndef NODDEMLSPY -/* */ -/* DDEML public debugging header file info */ -/* */ +/* + * DDEML public debugging header file info + */ typedef struct tagDDEML_MSG_HOOK_DATA { // new for NT UINT uiLo; // unpacked lo and hi parts of lParam @@ -352,7 +382,7 @@ typedef struct tagMONMSGSTRUCT { WPARAM wParam; LPARAM lParam; DDEML_MSG_HOOK_DATA dmhd; // new for NT -} MONMSGSTRUCT; +} MONMSGSTRUCT, *PMONMSGSTRUCT; typedef struct tagMONCBSTRUCT { UINT cb; @@ -370,16 +400,31 @@ typedef struct tagMONCBSTRUCT { CONVCONTEXT cc; // new for NT for XTYP_CONNECT callbacks DWORD cbData; // new for NT for data peeking DWORD Data[8]; // new for NT for data peeking -} MONCBSTRUCT; +} MONCBSTRUCT, *PMONCBSTRUCT; -typedef struct tagMONHSZSTRUCT { +typedef struct tagMONHSZSTRUCTA { UINT cb; BOOL fsAction; /* MH_ value */ DWORD dwTime; HSZ hsz; HANDLE hTask; - char str[1]; -} MONHSZSTRUCT; + CHAR str[1]; +} MONHSZSTRUCTA, *PMONHSZSTRUCTA; +typedef struct tagMONHSZSTRUCTW { + UINT cb; + BOOL fsAction; /* MH_ value */ + DWORD dwTime; + HSZ hsz; + HANDLE hTask; + WCHAR str[1]; +} MONHSZSTRUCTW, *PMONHSZSTRUCTW; +#ifdef UNICODE +typedef MONHSZSTRUCTW MONHSZSTRUCT; +typedef PMONHSZSTRUCTW PMONHSZSTRUCT; +#else +typedef MONHSZSTRUCTA MONHSZSTRUCT; +typedef PMONHSZSTRUCTA PMONHSZSTRUCT; +#endif // UNICODE #define MH_CREATE 1 #define MH_KEEP 2 @@ -391,7 +436,7 @@ typedef struct tagMONERRSTRUCT { UINT wLastError; DWORD dwTime; HANDLE hTask; -} MONERRSTRUCT; +} MONERRSTRUCT, *PMONERRSTRUCT; typedef struct tagMONLINKSTRUCT { UINT cb; @@ -406,7 +451,7 @@ typedef struct tagMONLINKSTRUCT { BOOL fServer; HCONV hConvServer; HCONV hConvClient; -} MONLINKSTRUCT; +} MONLINKSTRUCT, *PMONLINKSTRUCT; typedef struct tagMONCONVSTRUCT { UINT cb; @@ -417,7 +462,7 @@ typedef struct tagMONCONVSTRUCT { HSZ hszTopic; HCONV hConvClient; // Globally unique value != apps local hConv HCONV hConvServer; // Globally unique value != apps local hConv -} MONCONVSTRUCT; +} MONCONVSTRUCT, PMONCONVSTRUCT; #define MAX_MONITORS 4 #define APPCLASS_MONITOR 0x00000001L @@ -438,6 +483,9 @@ typedef struct tagMONCONVSTRUCT { #define MF_MASK 0xFF000000 #endif /* NODDEMLSPY */ +#ifdef __cplusplus +} +#endif /* __cplusplus */ #endif /* _INC_DDEMLH */