Annotation of mstools/h/ddeml.h, revision 1.1.1.1

1.1       root        1: /*++ BUILD Version: 0001    // Increment this if a change has global effects
                      2: 
                      3: /*****************************************************************************\
                      4: *                                                                             *
                      5: *  ddeml.h -    DDEML API header file
                      6: *                                                                             *
                      7: *               Version 3.10                                                  *                   *
                      8: *                                                                             *
                      9: *               Copyright (c) 1992, Microsoft Corp.  All rights reserved.     *
                     10: *                                                                             *
                     11: \*****************************************************************************/
                     12: #ifndef _INC_DDEMLH
                     13: #define _INC_DDEMLH
                     14: 
                     15: /******** public types ********/
                     16: 
                     17: typedef DWORD          HCONVLIST;
                     18: typedef DWORD          HCONV;
                     19: typedef DWORD          HSZ;
                     20: typedef DWORD          HDDEDATA;
                     21: #define EXPENTRY
                     22: 
                     23: /* the following structure is for use with XTYP_WILDCONNECT processing. */
                     24: 
                     25: typedef struct tagHSZPAIR {
                     26:     HSZ hszSvc;
                     27:     HSZ hszTopic;
                     28: } HSZPAIR;
                     29: typedef HSZPAIR FAR *PHSZPAIR;
                     30: 
                     31: /* The following structure is used by DdeConnect() and DdeConnectList() and
                     32:    by XTYP_CONNECT and XTYP_WILDCONNECT callbacks. */
                     33: 
                     34: typedef struct tagCONVCONTEXT {
                     35:     UINT        cb;             /* set to sizeof(CONVCONTEXT) */
                     36:     UINT        wFlags;         /* none currently defined. */
                     37:     UINT        wCountryID;     /* country code for topic/item strings used. */
                     38:     int         iCodePage;      /* codepage used for topic/item strings. */
                     39:     DWORD       dwLangID;       /* language ID for topic/item strings. */
                     40:     DWORD       dwSecurity;     /* Private security code. */
                     41: } CONVCONTEXT;
                     42: typedef CONVCONTEXT FAR *PCONVCONTEXT;
                     43: 
                     44: 
                     45: /* The following structure is used by DdeQueryConvInfo(): */
                     46: 
                     47: typedef struct tagCONVINFO {
                     48:     DWORD   cb;            /* sizeof(CONVINFO)  */
                     49:     DWORD   hUser;         /* user specified field  */
                     50:     HCONV   hConvPartner;  /* hConv on other end or 0 if non-ddemgr partner  */
                     51:     HSZ     hszSvcPartner; /* app name of partner if obtainable  */
                     52:     HSZ     hszServiceReq; /* AppName requested for connection  */
                     53:     HSZ     hszTopic;      /* Topic name for conversation  */
                     54:     HSZ     hszItem;       /* transaction item name or NULL if quiescent  */
                     55:     UINT    wFmt;          /* transaction format or NULL if quiescent  */
                     56:     UINT    wType;         /* XTYP_ for current transaction  */
                     57:     UINT    wStatus;       /* ST_ constant for current conversation  */
                     58:     UINT    wConvst;       /* XST_ constant for current transaction  */
                     59:     UINT    wLastError;    /* last transaction error.  */
                     60:     HCONVLIST hConvList;   /* parent hConvList if this conversation is in a list */
                     61:     CONVCONTEXT ConvCtxt;  /* conversation context */
                     62: } CONVINFO;
                     63: typedef CONVINFO FAR *PCONVINFO;
                     64: 
                     65: /***** conversation states (usState) *****/
                     66: 
                     67: #define     XST_NULL              0  /* quiescent states */
                     68: #define     XST_INCOMPLETE        1
                     69: #define     XST_CONNECTED         2
                     70: #define     XST_INIT1             3  /* mid-initiation states */
                     71: #define     XST_INIT2             4
                     72: #define     XST_REQSENT           5  /* active conversation states */
                     73: #define     XST_DATARCVD          6
                     74: #define     XST_POKESENT          7
                     75: #define     XST_POKEACKRCVD       8
                     76: #define     XST_EXECSENT          9
                     77: #define     XST_EXECACKRCVD      10
                     78: #define     XST_ADVSENT          11
                     79: #define     XST_UNADVSENT        12
                     80: #define     XST_ADVACKRCVD       13
                     81: #define     XST_UNADVACKRCVD     14
                     82: #define     XST_ADVDATASENT      15
                     83: #define     XST_ADVDATAACKRCVD   16
                     84: 
                     85: /* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
                     86: #define     CADV_LATEACK         0xFFFF
                     87: 
                     88: /***** conversation status bits (fsStatus) *****/
                     89: 
                     90: #define     ST_CONNECTED        0x0001
                     91: #define     ST_ADVISE           0x0002
                     92: #define     ST_ISLOCAL          0x0004
                     93: #define     ST_BLOCKED          0x0008
                     94: #define     ST_CLIENT           0x0010
                     95: #define     ST_TERMINATED       0x0020
                     96: #define     ST_INLIST           0x0040
                     97: #define     ST_BLOCKNEXT        0x0080
                     98: #define     ST_ISSELF           0x0100
                     99: 
                    100: 
                    101: /* DDE constants for wStatus field */
                    102: 
                    103: #define DDE_FACK               0x8000
                    104: #define DDE_FBUSY              0x4000
                    105: #define DDE_FDEFERUPD          0x4000
                    106: #define DDE_FACKREQ            0x8000
                    107: #define DDE_FRELEASE           0x2000
                    108: #define DDE_FREQUESTED         0x1000
                    109: #define DDE_FACKRESERVED       0x3ff0
                    110: #define DDE_FADVRESERVED       0x3fff
                    111: #define DDE_FDATRESERVED       0x4fff
                    112: #define DDE_FPOKRESERVED       0xdfff
                    113: #define DDE_FAPPSTATUS         0x00ff
                    114: #define DDE_FNOTPROCESSED   0x0000
                    115: 
                    116: /***** message filter hook types *****/
                    117: 
                    118: #define     MSGF_DDEMGR             0x8001
                    119: 
                    120: /***** codepage constants ****/
                    121: 
                    122: #define CP_WINANSI      1004    /* default codepage for windows & old DDE convs. */
                    123: #define CP_WINUNICODE   1200
                    124: 
                    125: /***** transaction types *****/
                    126: 
                    127: #define     XTYPF_NOBLOCK            0x0002  /* CBR_BLOCK will not work */
                    128: #define     XTYPF_NODATA             0x0004  /* DDE_FDEFERUPD */
                    129: #define     XTYPF_ACKREQ             0x0008  /* DDE_FACKREQ */
                    130: 
                    131: #define     XCLASS_MASK              0xFC00
                    132: #define     XCLASS_BOOL              0x1000
                    133: #define     XCLASS_DATA              0x2000
                    134: #define     XCLASS_FLAGS             0x4000
                    135: #define     XCLASS_NOTIFICATION      0x8000
                    136: 
                    137: #define     XTYP_ERROR              (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
                    138: #define     XTYP_ADVDATA            (0x0010 | XCLASS_FLAGS         )
                    139: #define     XTYP_ADVREQ             (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
                    140: #define     XTYP_ADVSTART           (0x0030 | XCLASS_BOOL          )
                    141: #define     XTYP_ADVSTOP            (0x0040 | XCLASS_NOTIFICATION)
                    142: #define     XTYP_EXECUTE            (0x0050 | XCLASS_FLAGS         )
                    143: #define     XTYP_CONNECT            (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
                    144: #define     XTYP_CONNECT_CONFIRM    (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
                    145: #define     XTYP_XACT_COMPLETE      (0x0080 | XCLASS_NOTIFICATION  )
                    146: #define     XTYP_POKE               (0x0090 | XCLASS_FLAGS         )
                    147: #define     XTYP_REGISTER           (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
                    148: #define     XTYP_REQUEST            (0x00B0 | XCLASS_DATA          )
                    149: #define     XTYP_DISCONNECT         (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
                    150: #define     XTYP_UNREGISTER         (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
                    151: #define     XTYP_WILDCONNECT        (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
                    152: 
                    153: #define     XTYP_MASK                0x00F0
                    154: #define     XTYP_SHIFT               4  /* shift to turn XTYP_ into an index */
                    155: 
                    156: /***** Timeout constants *****/
                    157: 
                    158: #define     TIMEOUT_ASYNC           0xFFFFFFFF
                    159: 
                    160: /***** Transaction ID constants *****/
                    161: 
                    162: #define     QID_SYNC                0xFFFFFFFF
                    163: 
                    164: /****** public strings used in DDE ******/
                    165: 
                    166: #define SZDDESYS_TOPIC          "System"
                    167: #define SZDDESYS_ITEM_TOPICS    "Topics"
                    168: #define SZDDESYS_ITEM_SYSITEMS  "SysItems"
                    169: #define SZDDESYS_ITEM_RTNMSG    "ReturnMessage"
                    170: #define SZDDESYS_ITEM_STATUS    "Status"
                    171: #define SZDDESYS_ITEM_FORMATS   "Formats"
                    172: #define SZDDESYS_ITEM_HELP      "Help"
                    173: #define SZDDE_ITEM_ITEMLIST     "TopicItemList"
                    174: 
                    175: 
                    176: /****** API entry points ******/
                    177: 
                    178: typedef HDDEDATA CALLBACK FNCALLBACK(UINT wType, UINT wFmt, HCONV hConv,
                    179:         HSZ hsz1, HSZ hsz2, HDDEDATA hData, DWORD dwData1, DWORD dwData2);
                    180: typedef FNCALLBACK *PFNCALLBACK;
                    181: 
                    182: #define     CBR_BLOCK                0xffffffffL
                    183: 
                    184: /* DLL registration functions */
                    185: 
                    186: UINT WINAPI DdeInitializeA(LPDWORD pidInst, PFNCALLBACK pfnCallback,
                    187:         DWORD afCmd, DWORD ulRes);
                    188: UINT WINAPI DdeInitializeW(LPDWORD pidInst, PFNCALLBACK pfnCallback,
                    189:         DWORD afCmd, DWORD ulRes);
                    190: #ifdef UNICODE
                    191: #define DdeInitialize DdeInitializeW
                    192: #else
                    193: #define DdeInitialize DdeInitializeA
                    194: #endif // !UNICODE
                    195: 
                    196: /*
                    197:  * Callback filter flags for use with standard apps.
                    198:  */
                    199: 
                    200: #define     CBF_FAIL_SELFCONNECTIONS     0x00001000
                    201: #define     CBF_FAIL_CONNECTIONS         0x00002000
                    202: #define     CBF_FAIL_ADVISES             0x00004000
                    203: #define     CBF_FAIL_EXECUTES            0x00008000
                    204: #define     CBF_FAIL_POKES               0x00010000
                    205: #define     CBF_FAIL_REQUESTS            0x00020000
                    206: #define     CBF_FAIL_ALLSVRXACTIONS      0x0003f000
                    207: 
                    208: #define     CBF_SKIP_CONNECT_CONFIRMS    0x00040000
                    209: #define     CBF_SKIP_REGISTRATIONS       0x00080000
                    210: #define     CBF_SKIP_UNREGISTRATIONS     0x00100000
                    211: #define     CBF_SKIP_DISCONNECTS         0x00200000
                    212: #define     CBF_SKIP_ALLNOTIFICATIONS    0x003c0000
                    213: 
                    214: /*
                    215:  * Application command flags
                    216:  */
                    217: #define     APPCMD_CLIENTONLY            0x00000010L
                    218: #define     APPCMD_FILTERINITS           0x00000020L
                    219: #define     APPCMD_MASK                  0x00000FF0L
                    220: 
                    221: /*
                    222:  * Application classification flags
                    223:  */
                    224: #define     APPCLASS_STANDARD            0x00000000L
                    225: #define     APPCLASS_MASK                0x0000000FL
                    226: 
                    227: 
                    228: 
                    229: BOOL WINAPI DdeUninitialize(DWORD idInst);
                    230: 
                    231: /* conversation enumeration functions */
                    232: 
                    233: HCONVLIST WINAPI DdeConnectList(DWORD idInst, HSZ hszService, HSZ hszTopic,
                    234:         HCONVLIST hConvList, PCONVCONTEXT pCC);
                    235: HCONV WINAPI DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
                    236: BOOL WINAPI DdeDisconnectList(HCONVLIST hConvList);
                    237: 
                    238: /* conversation control functions */
                    239: 
                    240: HCONV WINAPI DdeConnect(DWORD idInst, HSZ hszService, HSZ hszTopic,
                    241:         PCONVCONTEXT pCC);
                    242: BOOL WINAPI DdeDisconnect(HCONV hConv);
                    243: HCONV WINAPI DdeReconnect(HCONV hConv);
                    244: UINT WINAPI DdeQueryConvInfo(HCONV hConv, DWORD idTransaction, PCONVINFO pConvInfo);
                    245: BOOL WINAPI DdeSetUserHandle(HCONV hConv, DWORD id, DWORD hUser);
                    246: BOOL WINAPI DdeAbandonTransaction(DWORD idInst, HCONV hConv, DWORD idTransaction);
                    247: 
                    248: 
                    249: /* app server interface functions */
                    250: 
                    251: BOOL WINAPI DdePostAdvise(DWORD idInst, HSZ hszTopic, HSZ hszItem);
                    252: BOOL WINAPI DdeEnableCallback(DWORD idInst, HCONV hConv, UINT wCmd);
                    253: BOOL WINAPI DdeImpersonateClient(HCONV hCOnv);
                    254: 
                    255: #define EC_ENABLEALL            0
                    256: #define EC_ENABLEONE            ST_BLOCKNEXT
                    257: #define EC_DISABLE              ST_BLOCKED
                    258: #define EC_QUERYWAITING         2
                    259: 
                    260: 
                    261: HDDEDATA WINAPI DdeNameService(DWORD idInst, HSZ hsz1, HSZ hsz2, UINT afCmd);
                    262: 
                    263: #define DNS_REGISTER        0x0001
                    264: #define DNS_UNREGISTER      0x0002
                    265: #define DNS_FILTERON        0x0004
                    266: #define DNS_FILTEROFF       0x0008
                    267: 
                    268: /* app client interface functions */
                    269: 
                    270: HDDEDATA WINAPI DdeClientTransaction(LPBYTE pData, DWORD cbData,
                    271:         HCONV hConv, HSZ hszItem, UINT wFmt, UINT wType,
                    272:         DWORD dwTimeout, LPDWORD pdwResult);
                    273: 
                    274: /* data transfer functions */
                    275: 
                    276: HDDEDATA WINAPI DdeCreateDataHandle(DWORD idInst, LPBYTE pSrc, DWORD cb,
                    277:         DWORD cbOff, HSZ hszItem, UINT wFmt, UINT afCmd);
                    278: HDDEDATA WINAPI DdeAddData(HDDEDATA hData, LPBYTE pSrc, DWORD cb, DWORD cbOff);
                    279: DWORD WINAPI DdeGetData(HDDEDATA hData, LPBYTE pDst, DWORD cbMax, DWORD cbOff);
                    280: LPBYTE WINAPI DdeAccessData(HDDEDATA hData, LPDWORD pcbDataSize);
                    281: BOOL WINAPI DdeUnaccessData(HDDEDATA hData);
                    282: BOOL WINAPI DdeFreeDataHandle(HDDEDATA hData);
                    283: 
                    284: #define     HDATA_APPOWNED          0x0001
                    285: 
                    286: 
                    287: UINT WINAPI DdeGetLastError(DWORD idInst);
                    288: 
                    289: #define     DMLERR_NO_ERROR                    0       /* must be 0 */
                    290: 
                    291: #define     DMLERR_FIRST                       0x4000
                    292: 
                    293: #define     DMLERR_ADVACKTIMEOUT               0x4000
                    294: #define     DMLERR_BUSY                        0x4001
                    295: #define     DMLERR_DATAACKTIMEOUT              0x4002
                    296: #define     DMLERR_DLL_NOT_INITIALIZED         0x4003
                    297: #define     DMLERR_DLL_USAGE                   0x4004
                    298: #define     DMLERR_EXECACKTIMEOUT              0x4005
                    299: #define     DMLERR_INVALIDPARAMETER            0x4006
                    300: #define     DMLERR_LOW_MEMORY                  0x4007
                    301: #define     DMLERR_MEMORY_ERROR                0x4008
                    302: #define     DMLERR_NOTPROCESSED                0x4009
                    303: #define     DMLERR_NO_CONV_ESTABLISHED         0x400a
                    304: #define     DMLERR_POKEACKTIMEOUT              0x400b
                    305: #define     DMLERR_POSTMSG_FAILED              0x400c
                    306: #define     DMLERR_REENTRANCY                  0x400d
                    307: #define     DMLERR_SERVER_DIED                 0x400e
                    308: #define     DMLERR_SYS_ERROR                   0x400f
                    309: #define     DMLERR_UNADVACKTIMEOUT             0x4010
                    310: #define     DMLERR_UNFOUND_QUEUE_ID            0x4011
                    311: 
                    312: #define     DMLERR_LAST                        0x4011
                    313: 
                    314: HSZ  WINAPI DdeCreateStringHandleA(DWORD idInst, LPSTR psz, int iCodePage);
                    315: HSZ  WINAPI DdeCreateStringHandleW(DWORD idInst, LPWSTR psz, int iCodePage);
                    316: #ifdef UNICODE
                    317: #define DdeCreateStringHandle DdeCreateStringHandleW
                    318: #else
                    319: #define DdeCreateStringHandle DdeCreateStringHandleA
                    320: #endif // !UNICODE
                    321: DWORD WINAPI DdeQueryStringA(DWORD idInst, HSZ hsz, LPSTR psz, DWORD cchMax, int iCodePage);
                    322: DWORD WINAPI DdeQueryStringW(DWORD idInst, HSZ hsz, LPWSTR psz, DWORD cchMax, int iCodePage);
                    323: #ifdef UNICODE
                    324: #define DdeQueryString DdeQueryStringW
                    325: #else
                    326: #define DdeQueryString DdeQueryStringA
                    327: #endif // !UNICODE
                    328: BOOL WINAPI DdeFreeStringHandle(DWORD idInst, HSZ hsz);
                    329: BOOL WINAPI DdeKeepStringHandle(DWORD idInst, HSZ hsz);
                    330: int WINAPI DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
                    331: 
                    332: 
                    333: #ifndef NODDEMLSPY
                    334: /* */
                    335: /* DDEML public debugging header file info */
                    336: /* */
                    337: 
                    338: typedef struct tagDDEML_MSG_HOOK_DATA {    // new for NT
                    339:     UINT uiLo;      // unpacked lo and hi parts of lParam
                    340:     UINT uiHi;
                    341:     DWORD cbData;   // amount of data in message, if any. May be > than 32 bytes.
                    342:     DWORD Data[8];  // data peeking by DDESPY is limited to 32 bytes.
                    343: } DDEML_MSG_HOOK_DATA, *PDDEML_MSG_HOOK_DATA;
                    344: 
                    345: 
                    346: typedef struct tagMONMSGSTRUCT {
                    347:     UINT    cb;
                    348:     HWND    hwndTo;
                    349:     DWORD   dwTime;
                    350:     HANDLE  hTask;
                    351:     UINT    wMsg;
                    352:     WPARAM  wParam;
                    353:     LPARAM  lParam;
                    354:     DDEML_MSG_HOOK_DATA dmhd;       // new for NT
                    355: } MONMSGSTRUCT;
                    356: 
                    357: typedef struct tagMONCBSTRUCT {
                    358:     UINT   cb;
                    359:     DWORD  dwTime;
                    360:     HANDLE hTask;
                    361:     DWORD  dwRet;
                    362:     UINT   wType;
                    363:     UINT   wFmt;
                    364:     HCONV  hConv;
                    365:     HSZ    hsz1;
                    366:     HSZ    hsz2;
                    367:     HDDEDATA hData;
                    368:     DWORD  dwData1;
                    369:     DWORD  dwData2;
                    370:     CONVCONTEXT cc;                 // new for NT for XTYP_CONNECT callbacks
                    371:     DWORD  cbData;                  // new for NT for data peeking
                    372:     DWORD  Data[8];                 // new for NT for data peeking
                    373: } MONCBSTRUCT;
                    374: 
                    375: typedef struct tagMONHSZSTRUCT {
                    376:     UINT   cb;
                    377:     BOOL   fsAction;    /* MH_ value */
                    378:     DWORD  dwTime;
                    379:     HSZ    hsz;
                    380:     HANDLE hTask;
                    381:     char   str[1];
                    382: } MONHSZSTRUCT;
                    383: 
                    384: #define MH_CREATE   1
                    385: #define MH_KEEP     2
                    386: #define MH_DELETE   3
                    387: #define MH_CLEANUP  4
                    388: 
                    389: typedef struct tagMONERRSTRUCT {
                    390:     UINT    cb;
                    391:     UINT    wLastError;
                    392:     DWORD   dwTime;
                    393:     HANDLE  hTask;
                    394: } MONERRSTRUCT;
                    395: 
                    396: typedef struct tagMONLINKSTRUCT {
                    397:     UINT    cb;
                    398:     DWORD   dwTime;
                    399:     HANDLE  hTask;
                    400:     BOOL    fEstablished;
                    401:     BOOL    fNoData;
                    402:     HSZ     hszSvc;
                    403:     HSZ     hszTopic;
                    404:     HSZ     hszItem;
                    405:     UINT    wFmt;
                    406:     BOOL    fServer;
                    407:     HCONV   hConvServer;
                    408:     HCONV   hConvClient;
                    409: } MONLINKSTRUCT;
                    410: 
                    411: typedef struct tagMONCONVSTRUCT {
                    412:     UINT    cb;
                    413:     BOOL    fConnect;
                    414:     DWORD   dwTime;
                    415:     HANDLE  hTask;
                    416:     HSZ     hszSvc;
                    417:     HSZ     hszTopic;
                    418:     HCONV   hConvClient;        // Globally unique value != apps local hConv
                    419:     HCONV   hConvServer;        // Globally unique value != apps local hConv
                    420: } MONCONVSTRUCT;
                    421: 
                    422: #define     MAX_MONITORS            4
                    423: #define     APPCLASS_MONITOR        0x00000001L
                    424: #define     XTYP_MONITOR            (0x00F0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
                    425: 
                    426: /*
                    427:  * Callback filter flags for use with MONITOR apps - 0 implies no monitor
                    428:  * callbacks.
                    429:  */
                    430: #define     MF_HSZ_INFO                  0x01000000
                    431: #define     MF_SENDMSGS                  0x02000000
                    432: #define     MF_POSTMSGS                  0x04000000
                    433: #define     MF_CALLBACKS                 0x08000000
                    434: #define     MF_ERRORS                    0x10000000
                    435: #define     MF_LINKS                     0x20000000
                    436: #define     MF_CONV                      0x40000000
                    437: 
                    438: #define     MF_MASK                      0xFF000000
                    439: #endif /* NODDEMLSPY */
                    440: 
                    441: 
                    442: #endif /* _INC_DDEMLH */
                    443: 
                    444: 

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.