home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / MQ.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  43.3 KB  |  1,708 lines

  1. /*++
  2.  
  3. Copyright (c) 1996 Microsoft Corporation
  4.  
  5. Module Name:
  6.  
  7.     mq.h
  8.  
  9. Abstract:
  10.  
  11.     Master include file for Message Queue applications
  12.  
  13. --*/
  14.  
  15. #ifndef __MQ_H__
  16. #pragma option push -b -a8 -pc -A- /*P_O_Push_S*/
  17. #define __MQ_H__
  18.  
  19. //
  20. //  Clients that need transactions should include transact.h before mq.h
  21. //  For the clients not needing transactions - ITransaction is  opaque
  22. //
  23. #ifndef __transact_h__
  24. typedef void ITransaction;
  25. #endif
  26.  
  27. //
  28. //    Support version older than VC4.2
  29. //
  30. #if defined(_MSC_VER) && (_MSC_VER < 1020)
  31.  
  32. typedef struct tagMQPROPVARIANT MQPROPVARIANT;
  33.  
  34. #define TYPEDEF_CA(type, name) \
  35.     typedef struct tag##name {\
  36.         ULONG cElems;\
  37.         type * pElems;\
  38.     } name
  39.  
  40. #ifndef _tagCAUB_DEFINED
  41. #define _tagCAUB_DEFINED
  42. TYPEDEF_CA(unsigned char, CAUB);
  43. #endif
  44.  
  45. #ifndef _tagCAI_DEFINED
  46. #define _tagCAI_DEFINED
  47. TYPEDEF_CA(short, CAI);
  48. #endif
  49.  
  50. #ifndef _tagCAUI_DEFINED
  51. #define _tagCAUI_DEFINED
  52. TYPEDEF_CA(USHORT, CAUI);
  53. #endif
  54.  
  55. #ifndef _tagCAL_DEFINED
  56. #define _tagCAL_DEFINED
  57. TYPEDEF_CA(long, CAL);
  58. #endif
  59.  
  60. #ifndef _tagCAUL_DEFINED
  61. #define _tagCAUL_DEFINED
  62. TYPEDEF_CA(ULONG, CAUL);
  63. #endif
  64.  
  65. #ifndef _tagCACLSID_DEFINED
  66. #define _tagCACLSID_DEFINED
  67. TYPEDEF_CA(CLSID, CACLSID);
  68. #endif
  69.  
  70. #ifndef _tagCABSTR_DEFINED
  71. #define _tagCABSTR_DEFINED
  72. TYPEDEF_CA(LPOLESTR, CABSTR);
  73. #endif
  74.  
  75. #ifndef _tagCALPWSTR_DEFINED
  76. #define _tagCALPWSTR_DEFINED
  77. TYPEDEF_CA(LPWSTR, CALPWSTR);
  78. #endif
  79.  
  80. #ifndef _tagCAMQPROPVARIANT_DEFINED
  81. #define _tagCAMQPROPVARIANT_DEFINED
  82. TYPEDEF_CA(MQPROPVARIANT, CAMQPROPVARIANT);
  83. #endif
  84.  
  85. struct tagMQPROPVARIANT {
  86.     VARTYPE vt;
  87.     WORD wReserved1;
  88.     WORD wReserved2;
  89.     WORD wReserved3;
  90.     /*[switch_is((unsigned short)vt)]*/ union {
  91.       /*[case(VT_EMPTY, VT_NULL)];*/
  92.       /*[case(VT_UI1)]*/               UCHAR bVal;
  93.       /*[case(VT_I2)]*/                short iVal;
  94.       /*[case(VT_UI2)]*/               USHORT uiVal;
  95.       /*[case(VT_BOOL)]*/              VARIANT_BOOL boolVal;
  96.       /*[case(VT_I4)]*/                long lVal;
  97.       /*[case(VT_UI4)]*/               ULONG ulVal;
  98.       /*[case(VT_HRESULT)]*/           SCODE scode;
  99.       /*[case(VT_DATE)]*/              DATE date;
  100.       /*[case(VT_CLSID)]*/             CLSID  *puuid;
  101.       /*[case(VT_BLOB)]*/              BLOB blob;
  102.       /*[case(VT_BSTR)]*/              LPOLESTR bstrVal;
  103.       /*[case(VT_LPSTR)]*/             LPSTR pszVal;
  104.       /*[case(VT_LPWSTR)]*/            LPWSTR pwszVal;
  105.       /*[case(VT_VECTOR | VT_UI1)]*/   CAUB caub;
  106.       /*[case(VT_VECTOR | VT_I2)]*/    CAI cai;
  107.       /*[case(VT_VECTOR | VT_UI2)]*/   CAUI caui;
  108.       /*[case(VT_VECTOR | VT_I4)]*/    CAL cal;
  109.       /*[case(VT_VECTOR | VT_UI4)]*/   CAUL caul;
  110.       /*[case(VT_VECTOR | VT_CLSID)]*/ CACLSID cauuid;
  111.       /*[case(VT_VECTOR | VT_BSTR)]*/  CABSTR cabstr;
  112.       /*[case(VT_VECTOR | VT_LPWSTR)]*/CALPWSTR calpwstr;
  113.       /*[case(VT_VARIANT)]*/           CAMQPROPVARIANT capropvar;
  114.     };
  115. };
  116.  
  117. #else // defined(_MSC_VER) && (_MSC_VER < 1020)
  118.  
  119. typedef struct tagPROPVARIANT tagMQPROPVARIANT;
  120.  
  121. typedef tagMQPROPVARIANT MQPROPVARIANT;
  122.  
  123. #endif // defined(_MSC_VER) && (_MSC_VER < 1020)
  124.  
  125. #define    PRLT    ( 0 )
  126.  
  127. #define    PRLE    ( 1 )
  128.  
  129. #define    PRGT    ( 2 )
  130.  
  131. #define    PRGE    ( 3 )
  132.  
  133. #define    PREQ    ( 4 )
  134.  
  135. #define    PRNE    ( 5 )
  136.  
  137. typedef struct  tagMQPROPERTYRESTRICTION
  138.     {
  139.     ULONG rel;
  140.     PROPID prop;
  141.     MQPROPVARIANT prval;
  142.     }    MQPROPERTYRESTRICTION;
  143.  
  144. typedef struct  tagMQRESTRICTION
  145.     {
  146.     ULONG cRes;
  147.     /* [size_is] */ MQPROPERTYRESTRICTION __RPC_FAR *paPropRes;
  148.     }    MQRESTRICTION;
  149.  
  150. typedef struct  tagMQCOLUMNSET
  151.     {
  152.     ULONG cCol;
  153.     /* [size_is] */ PROPID __RPC_FAR *aCol;
  154.     }    MQCOLUMNSET;
  155.  
  156. #define    QUERY_SORTASCEND    ( 0 )
  157.  
  158. #define    QUERY_SORTDESCEND    ( 1 )
  159.  
  160. typedef struct  tagMQSORTKEY
  161.     {
  162.     PROPID propColumn;
  163.     ULONG dwOrder;
  164.     }    MQSORTKEY;
  165.  
  166. typedef struct  tagMQSORTSET
  167.     {
  168.     ULONG cCol;
  169.     /* [size_is] */ MQSORTKEY __RPC_FAR *aCol;
  170.     }    MQSORTSET;
  171.  
  172.  
  173. #define MQ_MAX_Q_NAME_LEN      124   // Maximal WCHAR length of a queue name.
  174. #define MQ_MAX_Q_LABEL_LEN     124
  175. #define MQ_MAX_MSG_LABEL_LEN   250
  176.  
  177. typedef HANDLE QUEUEHANDLE;
  178.  
  179.  
  180. typedef PROPID          MSGPROPID;
  181. typedef PROPID          QUEUEPROPID;
  182. typedef PROPID          QMPROPID;
  183.  
  184. typedef struct tagMQMSGPROPS
  185. {
  186.     DWORD           cProp;
  187.     MSGPROPID*      aPropID;
  188.     MQPROPVARIANT*  aPropVar;
  189.     HRESULT*        aStatus;
  190. } MQMSGPROPS;
  191.  
  192. typedef struct tagMQQUEUEPROPS
  193. {
  194.     DWORD           cProp;
  195.     QUEUEPROPID*    aPropID;
  196.     MQPROPVARIANT*  aPropVar;
  197.     HRESULT*        aStatus;
  198. } MQQUEUEPROPS;
  199.  
  200. typedef struct tagMQQMPROPS
  201. {
  202.     DWORD           cProp;
  203.     QMPROPID*       aPropID;
  204.     MQPROPVARIANT*  aPropVar;
  205.     HRESULT*        aStatus;
  206. } MQQMPROPS;
  207.  
  208.  
  209.  
  210. //********************************************************************
  211. //  API FLAGS
  212. //********************************************************************
  213.  
  214. //
  215. //  MQOpenQueue - Access values
  216. //
  217. #define MQ_RECEIVE_ACCESS       0x00000001
  218. #define MQ_SEND_ACCESS          0x00000002
  219. #define MQ_PEEK_ACCESS          0x00000020
  220.  
  221. //
  222. //  MQOpenQueue - Share values
  223. //
  224. #define MQ_DENY_NONE            0x00000000
  225. #define MQ_DENY_RECEIVE_SHARE   0x00000001
  226.  
  227. //
  228. //  MQReceiveMessage - Action values
  229. //
  230. #define MQ_ACTION_RECEIVE       0x00000000
  231. #define MQ_ACTION_PEEK_CURRENT  0x80000000
  232. #define MQ_ACTION_PEEK_NEXT     0x80000001
  233.  
  234. //
  235. // MQSendMessage,  MQReceiveMessage:  special cases for the transaction parameter
  236. //
  237. #define MQ_NO_TRANSACTION             NULL
  238. #define MQ_MTS_TRANSACTION            (ITransaction *)1
  239. #define MQ_XA_TRANSACTION             (ITransaction *)2
  240. #define MQ_SINGLE_MESSAGE             (ITransaction *)3
  241.  
  242. //********************************************************************
  243. //  PRIORITY LIMITS
  244. //********************************************************************
  245.  
  246. //
  247. //  Message priorities
  248. //
  249. #define MQ_MIN_PRIORITY          0    // Minimal message priority
  250. #define MQ_MAX_PRIORITY          7    // Maximal message priority
  251.  
  252.  
  253. //********************************************************************
  254. //  MESSAGE PROPERTIES
  255. //********************************************************************
  256. #define PROPID_M_BASE                0
  257. #define PROPID_M_CLASS               (PROPID_M_BASE + 1)     /* VT_UI2           */
  258. #define PROPID_M_MSGID               (PROPID_M_BASE + 2)     /* VT_UI1|VT_VECTOR */
  259. #define PROPID_M_CORRELATIONID       (PROPID_M_BASE + 3)     /* VT_UI1|VT_VECTOR */
  260. #define PROPID_M_PRIORITY            (PROPID_M_BASE + 4)     /* VT_UI1           */
  261. #define PROPID_M_DELIVERY            (PROPID_M_BASE + 5)     /* VT_UI1           */
  262. #define PROPID_M_ACKNOWLEDGE         (PROPID_M_BASE + 6)     /* VT_UI1           */
  263. #define PROPID_M_JOURNAL             (PROPID_M_BASE + 7)     /* VT_UI1           */
  264. #define PROPID_M_APPSPECIFIC         (PROPID_M_BASE + 8)     /* VT_UI4           */
  265. #define PROPID_M_BODY                (PROPID_M_BASE + 9)     /* VT_UI1|VT_VECTOR */
  266. #define PROPID_M_BODY_SIZE           (PROPID_M_BASE + 10)    /* VT_UI4           */
  267. #define PROPID_M_LABEL               (PROPID_M_BASE + 11)    /* VT_LPWSTR        */
  268. #define PROPID_M_LABEL_LEN           (PROPID_M_BASE + 12)    /* VT_UI4           */
  269. #define PROPID_M_TIME_TO_REACH_QUEUE (PROPID_M_BASE + 13)    /* VT_UI4           */
  270. #define PROPID_M_TIME_TO_BE_RECEIVED (PROPID_M_BASE + 14)    /* VT_UI4           */
  271. #define PROPID_M_RESP_QUEUE          (PROPID_M_BASE + 15)    /* VT_LPWSTR        */
  272. #define PROPID_M_RESP_QUEUE_LEN      (PROPID_M_BASE + 16)    /* VT_UI4           */
  273. #define PROPID_M_ADMIN_QUEUE         (PROPID_M_BASE + 17)    /* VT_LPWSTR        */
  274. #define PROPID_M_ADMIN_QUEUE_LEN     (PROPID_M_BASE + 18)    /* VT_UI4           */
  275. #define PROPID_M_VERSION             (PROPID_M_BASE + 19)    /* VT_UI4           */
  276. #define PROPID_M_SENDERID            (PROPID_M_BASE + 20)    /* VT_UI1|VT_VECTOR */
  277. #define PROPID_M_SENDERID_LEN        (PROPID_M_BASE + 21)    /* VT_UI4           */
  278. #define PROPID_M_SENDERID_TYPE       (PROPID_M_BASE + 22)    /* VT_UI4           */
  279. #define PROPID_M_PRIV_LEVEL          (PROPID_M_BASE + 23)    /* VT_UI4           */
  280. #define PROPID_M_AUTH_LEVEL          (PROPID_M_BASE + 24)    /* VT_UI4           */
  281. #define PROPID_M_AUTHENTICATED       (PROPID_M_BASE + 25)    /* VT_UI1           */
  282. #define PROPID_M_HASH_ALG            (PROPID_M_BASE + 26)    /* VT_UI4           */
  283. #define PROPID_M_ENCRYPTION_ALG      (PROPID_M_BASE + 27)    /* VT_UI4           */
  284. #define PROPID_M_SENDER_CERT         (PROPID_M_BASE + 28)    /* VT_UI1|VT_VECTOR */
  285. #define PROPID_M_SENDER_CERT_LEN     (PROPID_M_BASE + 29)    /* VT_UI4           */
  286. #define PROPID_M_SRC_MACHINE_ID      (PROPID_M_BASE + 30)    /* VT_CLSID         */
  287. #define PROPID_M_SENTTIME            (PROPID_M_BASE + 31)    /* VT_UI4           */
  288. #define PROPID_M_ARRIVEDTIME         (PROPID_M_BASE + 32)    /* VT_UI4           */
  289. #define PROPID_M_DEST_QUEUE          (PROPID_M_BASE + 33)    /* VT_LPWSTR        */
  290. #define PROPID_M_DEST_QUEUE_LEN      (PROPID_M_BASE + 34)    /* VT_UI4           */
  291. #define PROPID_M_EXTENSION           (PROPID_M_BASE + 35)    /* VT_UI1|VT_VECTOR */
  292. #define PROPID_M_EXTENSION_LEN       (PROPID_M_BASE + 36)    /* VT_UI4           */
  293. #define PROPID_M_SECURITY_CONTEXT    (PROPID_M_BASE + 37)    /* VT_UI4           */
  294. #define PROPID_M_CONNECTOR_TYPE      (PROPID_M_BASE + 38)    /* VT_CLSID         */
  295. #define PROPID_M_XACT_STATUS_QUEUE   (PROPID_M_BASE + 39)    /* VT_LPWSTR        */
  296. #define PROPID_M_XACT_STATUS_QUEUE_LEN (PROPID_M_BASE + 40)  /* VT_UI4           */
  297. #define PROPID_M_TRACE               (PROPID_M_BASE + 41)    /* VT_UI1           */
  298. #define PROPID_M_BODY_TYPE           (PROPID_M_BASE + 42)    /* VT_UI4           */
  299. #define PROPID_M_DEST_SYMM_KEY       (PROPID_M_BASE + 43)    /* VT_UI1|VT_VECTOR */
  300. #define PROPID_M_DEST_SYMM_KEY_LEN   (PROPID_M_BASE + 44)    /* VT_UI4           */
  301. #define PROPID_M_SIGNATURE           (PROPID_M_BASE + 45)    /* VT_UI1|VT_VECTOR */
  302. #define PROPID_M_SIGNATURE_LEN       (PROPID_M_BASE + 46)    /* VT_UI4           */
  303. #define PROPID_M_PROV_TYPE           (PROPID_M_BASE + 47)    /* VT_UI4           */
  304. #define PROPID_M_PROV_NAME           (PROPID_M_BASE + 48)    /* VT_LPWSTR        */
  305. #define PROPID_M_PROV_NAME_LEN       (PROPID_M_BASE + 49)    /* VT_UI4           */
  306.  
  307.  
  308. //
  309. // Message Property Size
  310. //
  311. #define PROPID_M_MSGID_SIZE         20
  312. #define PROPID_M_CORRELATIONID_SIZE 20
  313.  
  314.  
  315. //********************************************************************
  316. //  MESSAGE CLASS VALUES
  317. //********************************************************************
  318. //
  319. //  Message Class Values are 16 bits layed out as follows:
  320. //
  321. //   1 1 1 1 1 1
  322. //   5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  323. //  +-+-+-----------+---------------+
  324. //  |S|R| Reserved  |  Class code   |
  325. //  +-+-+-----------+---------------+
  326. //
  327. //  where
  328. //
  329. //      S - is the severity flag
  330. //          0 - Normal Message/Positive Acknowledgment (ACK)
  331. //          1 - Negative Acknowledgment (NACK)
  332. //
  333. //      R - is the receive flag
  334. //          0 - Arrival ACK/NACK
  335. //          1 - Receive ACK/NACK
  336. //
  337. #define MQCLASS_CODE(s, r, code) ((USHORT)(((s) << 15) | ((r) << 14) | (code)))
  338. #define MQCLASS_NACK(c)     ((c) & 0x8000)
  339. #define MQCLASS_RECEIVE(c)  ((c) & 0x4000)
  340.  
  341. //
  342. //  Normal message
  343. //
  344. #define MQMSG_CLASS_NORMAL                      MQCLASS_CODE(0, 0, 0x00)
  345.  
  346. //
  347. //  Report message
  348. //
  349. #define MQMSG_CLASS_REPORT                      MQCLASS_CODE(0, 0, 0x01)
  350.  
  351. //
  352. //  Arrival acknowledgment. The message has reached the destination queue
  353. //
  354. #define MQMSG_CLASS_ACK_REACH_QUEUE             MQCLASS_CODE(0, 0, 0x02)
  355.  
  356. //
  357. //  Receive acknowledgment. The message has been received by the application
  358. //
  359. #define MQMSG_CLASS_ACK_RECEIVE                 MQCLASS_CODE(0, 1, 0x00)
  360.  
  361.  
  362. //-----------------------------------------------
  363. //
  364. //  Negative arrival acknowledgments
  365. //
  366.  
  367. //
  368. //  Destination queue can not be reached, the queue may have been deleted
  369. //
  370. #define MQMSG_CLASS_NACK_BAD_DST_Q              MQCLASS_CODE(1, 0, 0x00)
  371.  
  372. //
  373. //  The message was purged before reaching the destination queue
  374. //
  375. #define MQMSG_CLASS_NACK_PURGED                 MQCLASS_CODE(1, 0, 0x01)
  376.  
  377. //
  378. //  Time to reach queue has expired
  379. //
  380. #define MQMSG_CLASS_NACK_REACH_QUEUE_TIMEOUT    MQCLASS_CODE(1, 0, 0x02)
  381.  
  382. //
  383. //  The message has exceeded the queue quota
  384. //
  385. #define MQMSG_CLASS_NACK_Q_EXCEED_QUOTA         MQCLASS_CODE(1, 0, 0x03)
  386.  
  387. //
  388. //  The sender does not have send access rights on the queue.
  389. //
  390. #define MQMSG_CLASS_NACK_ACCESS_DENIED          MQCLASS_CODE(1, 0, 0x04)
  391.  
  392. //
  393. //  The message hop count exceeded
  394. //
  395. #define MQMSG_CLASS_NACK_HOP_COUNT_EXCEEDED     MQCLASS_CODE(1, 0, 0x05)
  396.  
  397. //
  398. //  The message signature is bad. The message could not be authenticated.
  399. //
  400. #define MQMSG_CLASS_NACK_BAD_SIGNATURE          MQCLASS_CODE(1, 0, 0x06)
  401.  
  402. //
  403. //  The message could not be decrypted.
  404. //
  405. #define MQMSG_CLASS_NACK_BAD_ENCRYPTION         MQCLASS_CODE(1, 0, 0x07)
  406.  
  407. //
  408. //  The message could not be encrypted for the destination.
  409. //
  410. #define MQMSG_CLASS_NACK_COULD_NOT_ENCRYPT      MQCLASS_CODE(1, 0, 0x08)
  411.  
  412. //
  413. //  The message was sent to a non-transactional queue within a transaction.
  414. //
  415. #define MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_Q    MQCLASS_CODE(1, 0, 0x09)
  416.  
  417. //
  418. //  The message was sent to a transactional queue not within a transaction.
  419. //
  420. #define MQMSG_CLASS_NACK_NOT_TRANSACTIONAL_MSG  MQCLASS_CODE(1, 0, 0x0A)
  421.  
  422.  
  423. //-----------------------------------------------
  424. //
  425. //  Negative receive acknowledgments
  426. //
  427.  
  428. //
  429. //  The queue was deleted, after the message has arrived
  430. //
  431. #define MQMSG_CLASS_NACK_Q_DELETED              MQCLASS_CODE(1, 1, 0x00)
  432.  
  433. //
  434. //  The message was purged at the destination queue
  435. //
  436. #define MQMSG_CLASS_NACK_Q_PURGED               MQCLASS_CODE(1, 1, 0x01)
  437.  
  438. //
  439. //  Time to receive has expired, while the message is in the queue
  440. //
  441. #define MQMSG_CLASS_NACK_RECEIVE_TIMEOUT        MQCLASS_CODE(1, 1, 0x02)
  442.  
  443.  
  444. //------ PROPID_M_ACKNOWLEDGE ---------------
  445. #define MQMSG_ACKNOWLEDGMENT_NONE           0x00
  446.  
  447. #define MQMSG_ACKNOWLEDGMENT_POS_ARRIVAL    0x01
  448. #define MQMSG_ACKNOWLEDGMENT_POS_RECEIVE    0x02
  449. #define MQMSG_ACKNOWLEDGMENT_NEG_ARRIVAL    0x04
  450. #define MQMSG_ACKNOWLEDGMENT_NEG_RECEIVE    0x08
  451.  
  452. #define MQMSG_ACKNOWLEDGMENT_NACK_REACH_QUEUE ((UCHAR)( \
  453.             MQMSG_ACKNOWLEDGMENT_NEG_ARRIVAL ))
  454.  
  455. #define MQMSG_ACKNOWLEDGMENT_FULL_REACH_QUEUE ((UCHAR)( \
  456.             MQMSG_ACKNOWLEDGMENT_NEG_ARRIVAL |  \
  457.             MQMSG_ACKNOWLEDGMENT_POS_ARRIVAL ))
  458.  
  459. #define MQMSG_ACKNOWLEDGMENT_NACK_RECEIVE ((UCHAR)( \
  460.             MQMSG_ACKNOWLEDGMENT_NEG_ARRIVAL |  \
  461.             MQMSG_ACKNOWLEDGMENT_NEG_RECEIVE ))
  462.  
  463. #define MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE ((UCHAR)( \
  464.             MQMSG_ACKNOWLEDGMENT_NEG_ARRIVAL |  \
  465.             MQMSG_ACKNOWLEDGMENT_NEG_RECEIVE |  \
  466.             MQMSG_ACKNOWLEDGMENT_POS_RECEIVE ))
  467.  
  468. //------ PROPID_M_DELIVERY ------------------
  469. #define MQMSG_DELIVERY_EXPRESS              0
  470. #define MQMSG_DELIVERY_RECOVERABLE          1
  471.  
  472. //----- PROPID_M_JOURNAL --------------------
  473. #define MQMSG_JOURNAL_NONE                  0
  474. #define MQMSG_DEADLETTER                    1
  475. #define MQMSG_JOURNAL                       2
  476.  
  477. //----- PROPID_M_TRACE ----------------------
  478. #define MQMSG_TRACE_NONE                    0
  479. #define MQMSG_SEND_ROUTE_TO_REPORT_QUEUE    1
  480.  
  481. //----- PROPID_M_SENDERID_TYPE --------------
  482. #define MQMSG_SENDERID_TYPE_NONE            0
  483. #define MQMSG_SENDERID_TYPE_SID             1
  484.  
  485. //----- PROPID_M_PRIV_LEVEL -----------------
  486. #define MQMSG_PRIV_LEVEL_NONE               0
  487. #define MQMSG_PRIV_LEVEL_BODY               1
  488.  
  489. //----- PROPID_M_AUTH_LEVEL -----------------
  490. #define MQMSG_AUTH_LEVEL_NONE               0
  491. #define MQMSG_AUTH_LEVEL_ALWAYS             1
  492.  
  493.  
  494. //********************************************************************
  495. //  QUEUE PROPERTIES
  496. //********************************************************************
  497. #define PROPID_Q_BASE           100
  498. #define PROPID_Q_INSTANCE       (PROPID_Q_BASE +  1)  /* VT_CLSID     */
  499. #define PROPID_Q_TYPE           (PROPID_Q_BASE +  2)  /* VT_CLSID     */
  500. #define PROPID_Q_PATHNAME       (PROPID_Q_BASE +  3)  /* VT_LPWSTR    */
  501. #define PROPID_Q_JOURNAL        (PROPID_Q_BASE +  4)  /* VT_UI1       */
  502. #define PROPID_Q_QUOTA          (PROPID_Q_BASE +  5)  /* VT_UI4       */
  503. #define PROPID_Q_BASEPRIORITY   (PROPID_Q_BASE +  6)  /* VT_I2        */
  504. #define PROPID_Q_JOURNAL_QUOTA  (PROPID_Q_BASE +  7)  /* VT_UI4       */
  505. #define PROPID_Q_LABEL          (PROPID_Q_BASE +  8)  /* VT_LPWSTR    */
  506. #define PROPID_Q_CREATE_TIME    (PROPID_Q_BASE +  9)  /* VT_I4        */
  507. #define PROPID_Q_MODIFY_TIME    (PROPID_Q_BASE + 10)  /* VT_I4        */
  508. #define PROPID_Q_AUTHENTICATE   (PROPID_Q_BASE + 11)  /* VT_UI1       */
  509. #define PROPID_Q_PRIV_LEVEL     (PROPID_Q_BASE + 12)  /* VT_UI4       */
  510. #define PROPID_Q_TRANSACTION    (PROPID_Q_BASE + 13)  /* VT_UI1       */
  511.  
  512. //----- PROPID_Q_JOURNAL ------------------
  513. #define MQ_JOURNAL_NONE     (unsigned char)0
  514. #define MQ_JOURNAL          (unsigned char)1
  515.  
  516. //----- PROPID_Q_TYPE ------------------
  517. //  {55EE8F32-CCE9-11cf-B108-0020AFD61CE9}
  518. #define MQ_QTYPE_REPORT {0x55ee8f32, 0xcce9, 0x11cf, \
  519.                         {0xb1, 0x8, 0x0, 0x20, 0xaf, 0xd6, 0x1c, 0xe9}}
  520.  
  521. //  {55EE8F33-CCE9-11cf-B108-0020AFD61CE9}
  522. #define MQ_QTYPE_TEST   {0x55ee8f33, 0xcce9, 0x11cf, \
  523.                         {0xb1, 0x8, 0x0, 0x20, 0xaf, 0xd6, 0x1c, 0xe9}}
  524.  
  525. //----- PROPID_Q_TRANSACTION ------------------
  526. #define MQ_TRANSACTIONAL_NONE     (unsigned char)0
  527. #define MQ_TRANSACTIONAL          (unsigned char)1
  528.  
  529. //----- PROPID_Q_AUTHENTICATE ------------------
  530. #define MQ_AUTHENTICATE_NONE      (unsigned char)0
  531. #define MQ_AUTHENTICATE           (unsigned char)1
  532.  
  533. //----- PROPID_Q_PRIV_LEVEL ------------------
  534. #define MQ_PRIV_LEVEL_NONE        (unsigned long)0
  535. #define MQ_PRIV_LEVEL_OPTIONAL    (unsigned long)1
  536. #define MQ_PRIV_LEVEL_BODY        (unsigned long)2
  537.  
  538.  
  539. //********************************************************************
  540. //  MACHINE PROPERTIES
  541. //********************************************************************
  542. #define PROPID_QM_BASE 200
  543.  
  544. #define PROPID_QM_SITE_ID       (PROPID_QM_BASE + 1)  /* VT_CLSID            */
  545. #define PROPID_QM_MACHINE_ID    (PROPID_QM_BASE + 2)  /* VT_CLSID            */
  546. #define PROPID_QM_PATHNAME      (PROPID_QM_BASE + 3)  /* VT_LPWSTR           */
  547. #define PROPID_QM_CONNECTION    (PROPID_QM_BASE + 4)  /* VT_LPWSTR|VT_VECTOR */
  548. #define PROPID_QM_ENCRYPTION_PK (PROPID_QM_BASE + 5)  /* VT_BLOB             */
  549.  
  550. //
  551. // LONG_LIVED is the default for PROPID_M_TIME_TO_REACH_QUEUE. If call
  552. // to MQSendMessage() specify this value, or not give this property at
  553. // all, then the actual timeout is taken from MQIS database.
  554. //
  555. #define LONG_LIVED    0xfffffffe
  556.  
  557. //
  558. // Success
  559. //
  560. #define MQ_OK                       0L
  561.  
  562.  
  563. #ifndef FACILITY_MSMQ
  564. #define FACILITY_MSMQ               0x0E
  565. #endif
  566.  
  567.  
  568. //
  569. //  Error
  570. //
  571.  
  572. //
  573. //  Values are 32 bit values layed out as follows:
  574. //
  575. //   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
  576. //   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
  577. //  +---+-+-+-----------------------+-------------------------------+
  578. //  |Sev|C|R|     Facility          |               Code            |
  579. //  +---+-+-+-----------------------+-------------------------------+
  580. //
  581. //  where
  582. //
  583. //      Sev - is the severity code
  584. //
  585. //          00 - Success
  586. //          01 - Informational
  587. //          10 - Warning
  588. //          11 - Error
  589. //
  590. //      C - is the Customer code flag
  591. //
  592. //      R - is a reserved bit
  593. //
  594. //      Facility - is the facility code
  595. //
  596. //      Code - is the facility's status code
  597. //
  598. //
  599. // Define the facility codes
  600. //
  601.  
  602.  
  603. //
  604. // Define the severity codes
  605. //
  606.  
  607.  
  608. //
  609. // MessageId: MQ_ERROR
  610. //
  611. // MessageText:
  612. //
  613. //  GenericError
  614. //
  615. #define MQ_ERROR                         0xC00E0001L
  616.  
  617. //
  618. // MessageId: MQ_ERROR_PROPERTY
  619. //
  620. // MessageText:
  621. //
  622. //  One or more of the passed properties are invalid.
  623. //
  624. #define MQ_ERROR_PROPERTY                0xC00E0002L
  625.  
  626. //
  627. // MessageId: MQ_ERROR_QUEUE_NOT_FOUND
  628. //
  629. // MessageText:
  630. //
  631. //  The queue is not registered in the DS
  632. //
  633. #define MQ_ERROR_QUEUE_NOT_FOUND         0xC00E0003L
  634.  
  635. //
  636. // MessageId: MQ_ERROR_QUEUE_EXISTS
  637. //
  638. // MessageText:
  639. //
  640. //  A queue with the same pathname is already registered
  641. //
  642. #define MQ_ERROR_QUEUE_EXISTS            0xC00E0005L
  643.  
  644. //
  645. // MessageId: MQ_ERROR_INVALID_PARAMETER
  646. //
  647. // MessageText:
  648. //
  649. //  An invalid parameter passed to a function.
  650. //
  651. #define MQ_ERROR_INVALID_PARAMETER       0xC00E0006L
  652.  
  653. //
  654. // MessageId: MQ_ERROR_INVALID_HANDLE
  655. //
  656. // MessageText:
  657. //
  658. //  An invalid handle passed to a function.
  659. //
  660. #define MQ_ERROR_INVALID_HANDLE          0xC00E0007L
  661.  
  662. //
  663. // MessageId: MQ_ERROR_OPERATION_CANCELLED
  664. //
  665. // MessageText:
  666. //
  667. //  The operation was cancelled before it could be completed.
  668. //
  669. #define MQ_ERROR_OPERATION_CANCELLED     0xC00E0008L
  670.  
  671. //
  672. // MessageId: MQ_ERROR_SHARING_VIOLATION
  673. //
  674. // MessageText:
  675. //
  676. //  Sharing violation. The queue is already opened for exclusive receive.
  677. //
  678. #define MQ_ERROR_SHARING_VIOLATION       0xC00E0009L
  679.  
  680. //
  681. // MessageId: MQ_ERROR_SERVICE_NOT_AVAILABLE
  682. //
  683. // MessageText:
  684. //
  685. //  The Message Queues service is not available
  686. //
  687. #define MQ_ERROR_SERVICE_NOT_AVAILABLE   0xC00E000BL
  688.  
  689. //
  690. // MessageId: MQ_ERROR_MACHINE_NOT_FOUND
  691. //
  692. // MessageText:
  693. //
  694. //  The specified machine could not be found.
  695. //
  696. #define MQ_ERROR_MACHINE_NOT_FOUND       0xC00E000DL
  697.  
  698. //
  699. // MessageId: MQ_ERROR_ILLEGAL_SORT
  700. //
  701. // MessageText:
  702. //
  703. //  Illegal sort specified in MQLocateBegin (e.g., duplicate columns).
  704. //
  705. #define MQ_ERROR_ILLEGAL_SORT            0xC00E0010L
  706.  
  707. //
  708. // MessageId: MQ_ERROR_ILLEGAL_USER
  709. //
  710. // MessageText:
  711. //
  712. //  The user is an illegal user.
  713. //
  714. #define MQ_ERROR_ILLEGAL_USER            0xC00E0011L
  715.  
  716. //
  717. // MessageId: MQ_ERROR_NO_DS
  718. //
  719. // MessageText:
  720. //
  721. //  No connection with this site's controller(s).
  722. //
  723. #define MQ_ERROR_NO_DS                   0xC00E0013L
  724.  
  725. //
  726. // MessageId: MQ_ERROR_ILLEGAL_QUEUE_PATHNAME
  727. //
  728. // MessageText:
  729. //
  730. //  Illegal queue path name.
  731. //
  732. #define MQ_ERROR_ILLEGAL_QUEUE_PATHNAME  0xC00E0014L
  733.  
  734. //
  735. // MessageId: MQ_ERROR_ILLEGAL_PROPERTY_VALUE
  736. //
  737. // MessageText:
  738. //
  739. //  Illegal property value.
  740. //
  741. #define MQ_ERROR_ILLEGAL_PROPERTY_VALUE  0xC00E0018L
  742.  
  743. //
  744. // MessageId: MQ_ERROR_ILLEGAL_PROPERTY_VT
  745. //
  746. // MessageText:
  747. //
  748. //  Invalid VARTYPE value.
  749. //
  750. #define MQ_ERROR_ILLEGAL_PROPERTY_VT     0xC00E0019L
  751.  
  752. //
  753. // MessageId: MQ_ERROR_BUFFER_OVERFLOW
  754. //
  755. // MessageText:
  756. //
  757. //  The buffer supplied to MQReceiveMessage for message body retrieval
  758. //  was too small. The message is not removed from the queue and part
  759. //  of the message body that fits in the buffer was copied.
  760. //
  761. #define MQ_ERROR_BUFFER_OVERFLOW         0xC00E001AL
  762.  
  763. //
  764. // MessageId: MQ_ERROR_IO_TIMEOUT
  765. //
  766. // MessageText:
  767. //
  768. //  The MQReceiveMessage timeout has expired
  769. //
  770. #define MQ_ERROR_IO_TIMEOUT              0xC00E001BL
  771.  
  772. //
  773. // MessageId: MQ_ERROR_ILLEGAL_CURSOR_ACTION
  774. //
  775. // MessageText:
  776. //
  777. //  MQ_ACTION_PEEK_NEXT specified to MQReceiveMessage can not be used with
  778. //  the current cursor position.
  779. //
  780. #define MQ_ERROR_ILLEGAL_CURSOR_ACTION   0xC00E001CL
  781.  
  782. //
  783. // MessageId: MQ_ERROR_MESSAGE_ALREADY_RECEIVED
  784. //
  785. // MessageText:
  786. //
  787. //  A message that is currently pointed at by the cursor has been removed from
  788. //  the queue by another process or by another call to MQReceiveMessage
  789. //  without the use of this cursor.
  790. //
  791. #define MQ_ERROR_MESSAGE_ALREADY_RECEIVED 0xC00E001DL
  792.  
  793. //
  794. // MessageId: MQ_ERROR_ILLEGAL_FORMATNAME
  795. //
  796. // MessageText:
  797. //
  798. //  The given format name is invalid.
  799. //
  800. #define MQ_ERROR_ILLEGAL_FORMATNAME      0xC00E001EL
  801.  
  802. //
  803. // MessageId: MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL
  804. //
  805. // MessageText:
  806. //
  807. //  The format name buffer supplied to the API was too small
  808. //  to fit the format name
  809. //
  810. #define MQ_ERROR_FORMATNAME_BUFFER_TOO_SMALL 0xC00E001FL
  811.  
  812. //
  813. // MessageId: MQ_ERROR_UNSUPPORTED_FORMATNAME_OPERATION
  814. //
  815. // MessageText:
  816. //
  817. //  The requested operation for the specified format name is not
  818. //  supported (e.g., delete a direct queue format name).
  819. //
  820. #define MQ_ERROR_UNSUPPORTED_FORMATNAME_OPERATION 0xC00E0020L
  821.  
  822. //
  823. // MessageId: MQ_ERROR_ILLEGAL_SECURITY_DESCRIPTOR
  824. //
  825. // MessageText:
  826. //
  827. //  The specified security descriptor is not a valid security descriptor.
  828. //
  829. #define MQ_ERROR_ILLEGAL_SECURITY_DESCRIPTOR 0xC00E0021L
  830.  
  831. //
  832. // MessageId: MQ_ERROR_SENDERID_BUFFER_TOO_SMALL
  833. //
  834. // MessageText:
  835. //
  836. //  The passed buffer for the user ID property is too small.
  837. //
  838. #define MQ_ERROR_SENDERID_BUFFER_TOO_SMALL 0xC00E0022L
  839.  
  840. //
  841. // MessageId: MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL
  842. //
  843. // MessageText:
  844. //
  845. //  The size of the buffer passed to MQGetQueueSecurity is too small.
  846. //
  847. #define MQ_ERROR_SECURITY_DESCRIPTOR_TOO_SMALL 0xC00E0023L
  848.  
  849. //
  850. // MessageId: MQ_ERROR_CANNOT_IMPERSONATE_CLIENT
  851. //
  852. // MessageText:
  853. //
  854. //  The RPC server can not impersonate the client application, hence security
  855. //  credentials could not be verified.
  856. //
  857. #define MQ_ERROR_CANNOT_IMPERSONATE_CLIENT 0xC00E0024L
  858.  
  859. //
  860. // MessageId: MQ_ERROR_ACCESS_DENIED
  861. //
  862. // MessageText:
  863. //
  864. //  Access is denied.
  865. //
  866. #define MQ_ERROR_ACCESS_DENIED           0xC00E0025L
  867.  
  868. //
  869. // MessageId: MQ_ERROR_PRIVILEGE_NOT_HELD
  870. //
  871. // MessageText:
  872. //
  873. //  Client does not have the required privileges to perform the operation.
  874. //
  875. #define MQ_ERROR_PRIVILEGE_NOT_HELD      0xC00E0026L
  876.  
  877. //
  878. // MessageId: MQ_ERROR_INSUFFICIENT_RESOURCES
  879. //
  880. // MessageText:
  881. //
  882. //  Insufficient resources to perform operation.
  883. //
  884. #define MQ_ERROR_INSUFFICIENT_RESOURCES  0xC00E0027L
  885.  
  886. //
  887. // MessageId: MQ_ERROR_USER_BUFFER_TOO_SMALL
  888. //
  889. // MessageText:
  890. //
  891. //  Request failed because user buffer is too small to hold the returned information
  892. //
  893. #define MQ_ERROR_USER_BUFFER_TOO_SMALL   0xC00E0028L
  894.  
  895. //
  896. // MessageId: MQ_ERROR_MESSAGE_STORAGE_FAILED
  897. //
  898. // MessageText:
  899. //
  900. //  Could not store a recoverable or journal message. Message was not sent
  901. //
  902. #define MQ_ERROR_MESSAGE_STORAGE_FAILED  0xC00E002AL
  903.  
  904. //
  905. // MessageId: MQ_ERROR_SENDER_CERT_BUFFER_TOO_SMALL
  906. //
  907. // MessageText:
  908. //
  909. //  The passed buffer for the user certificate property is too small.
  910. //
  911. #define MQ_ERROR_SENDER_CERT_BUFFER_TOO_SMALL 0xC00E002BL
  912.  
  913. //
  914. // MessageId: MQ_ERROR_INVALID_CERTIFICATE
  915. //
  916. // MessageText:
  917. //
  918. //  The user certificate is not valid.
  919. //
  920. #define MQ_ERROR_INVALID_CERTIFICATE     0xC00E002CL
  921.  
  922. //
  923. // MessageId: MQ_ERROR_CORRUPTED_INTERNAL_CERTIFICATE
  924. //
  925. // MessageText:
  926. //
  927. //  The internal MSMQ certificate is corrupted.
  928. //
  929. #define MQ_ERROR_CORRUPTED_INTERNAL_CERTIFICATE 0xC00E002DL
  930.  
  931.  
  932. //
  933. // MessageId: MQ_ERROR_NO_INTERNAL_USER_CERT
  934. //
  935. // MessageText:
  936. //
  937. //  The internal MSMQ certificate for the user does not exist.
  938. //
  939. #define MQ_ERROR_NO_INTERNAL_USER_CERT   0xC00E002FL
  940.  
  941. //
  942. // MessageId: MQ_ERROR_CORRUPTED_SECURITY_DATA
  943. //
  944. // MessageText:
  945. //
  946. //  A cryptogrphic function has failed.
  947. //
  948. #define MQ_ERROR_CORRUPTED_SECURITY_DATA 0xC00E0030L
  949.  
  950. //
  951. // MessageId: MQ_ERROR_CORRUPTED_PERSONAL_CERT_STORE
  952. //
  953. // MessageText:
  954. //
  955. //  The personal certificate store is corrupted.
  956. //
  957. #define MQ_ERROR_CORRUPTED_PERSONAL_CERT_STORE 0xC00E0031L
  958.  
  959. //
  960. // MessageId: MQ_ERROR_COMPUTER_DOES_NOT_SUPPORT_ENCRYPTION
  961. //
  962. // MessageText:
  963. //
  964. //  The computer does not support encryption operations.
  965. //
  966. #define MQ_ERROR_COMPUTER_DOES_NOT_SUPPORT_ENCRYPTION 0xC00E0033L
  967.  
  968. //
  969. // MessageId: MQ_ERROR_BAD_SECURITY_CONTEXT
  970. //
  971. // MessageText:
  972. //
  973. //  Bad security context.
  974. //
  975. #define MQ_ERROR_BAD_SECURITY_CONTEXT    0xC00E0035L
  976.  
  977. //
  978. // MessageId: MQ_ERROR_COULD_NOT_GET_USER_SID
  979. //
  980. // MessageText:
  981. //
  982. //  Could not get the SID information out of the thread token.
  983. //
  984. #define MQ_ERROR_COULD_NOT_GET_USER_SID  0xC00E0036L
  985.  
  986. //
  987. // MessageId: MQ_ERROR_COULD_NOT_GET_ACCOUNT_INFO
  988. //
  989. // MessageText:
  990. //
  991. //  Could not get the account information for the user.
  992. //
  993. #define MQ_ERROR_COULD_NOT_GET_ACCOUNT_INFO 0xC00E0037L
  994.  
  995. //
  996. // MessageId: MQ_ERROR_ILLEGAL_MQCOLUMNS
  997. //
  998. // MessageText:
  999. //
  1000. //  Invalid MQCOLUMNS parameter
  1001. //
  1002. #define MQ_ERROR_ILLEGAL_MQCOLUMNS       0xC00E0038L
  1003.  
  1004. //
  1005. // MessageId: MQ_ERROR_ILLEGAL_PROPID
  1006. //
  1007. // MessageText:
  1008. //
  1009. //  Invalid propid value
  1010. //
  1011. #define MQ_ERROR_ILLEGAL_PROPID          0xC00E0039L
  1012.  
  1013. //
  1014. // MessageId: MQ_ERROR_ILLEGAL_RELATION
  1015. //
  1016. // MessageText:
  1017. //
  1018. //  Invalid relation value in restriction
  1019. //
  1020. #define MQ_ERROR_ILLEGAL_RELATION        0xC00E003AL
  1021.  
  1022. //
  1023. // MessageId: MQ_ERROR_ILLEGAL_PROPERTY_SIZE
  1024. //
  1025. // MessageText:
  1026. //
  1027. //  Illegal property buffer size
  1028. //
  1029. #define MQ_ERROR_ILLEGAL_PROPERTY_SIZE   0xC00E003BL
  1030.  
  1031. //
  1032. // MessageId: MQ_ERROR_ILLEGAL_RESTRICTION_PROPID
  1033. //
  1034. // MessageText:
  1035. //
  1036. //  Invalid propid value in MQRESTRICTION parameter
  1037. //
  1038. #define MQ_ERROR_ILLEGAL_RESTRICTION_PROPID 0xC00E003CL
  1039.  
  1040. //
  1041. // MessageId: MQ_ERROR_ILLEGAL_MQQUEUEPROPS
  1042. //
  1043. // MessageText:
  1044. //
  1045. //  Illegal MQQUEUEPROPS parameter, either null or with zero properties
  1046. //
  1047. #define MQ_ERROR_ILLEGAL_MQQUEUEPROPS    0xC00E003DL
  1048.  
  1049. //
  1050. // MessageId: MQ_ERROR_PROPERTY_NOTALLOWED
  1051. //
  1052. // MessageText:
  1053. //
  1054. //  Invalid propid for the requested operation (e.g. PROPID_Q_INSTANCE
  1055. //  in MQSetQueueProperties)
  1056. //
  1057. #define MQ_ERROR_PROPERTY_NOTALLOWED     0xC00E003EL
  1058.  
  1059. //
  1060. // MessageId: MQ_ERROR_INSUFFICIENT_PROPERTIES
  1061. //
  1062. // MessageText:
  1063. //
  1064. //  Not all the required properties for the operation were specified
  1065. //  in the input parameters
  1066. //
  1067. #define MQ_ERROR_INSUFFICIENT_PROPERTIES 0xC00E003FL
  1068.  
  1069. //
  1070. // MessageId: MQ_ERROR_MACHINE_EXISTS
  1071. //
  1072. // MessageText:
  1073. //
  1074. //  Computer with the same name already exists in the site.
  1075. //
  1076. #define MQ_ERROR_MACHINE_EXISTS          0xC00E0040L
  1077.  
  1078. //
  1079. // MessageId: MQ_ERROR_ILLEGAL_MQQMPROPS
  1080. //
  1081. // MessageText:
  1082. //
  1083. //  Illegal MQQMPROPS parameter, either null or with zero properties
  1084. //
  1085. #define MQ_ERROR_ILLEGAL_MQQMPROPS       0xC00E0041L
  1086.  
  1087. //
  1088. // MessageId: MQ_ERROR_DS_IS_FULL
  1089. //
  1090. // MessageText:
  1091. //
  1092. //  DS is full
  1093. //
  1094. #define MQ_ERROR_DS_IS_FULL              0xC00E0042L
  1095.  
  1096. //
  1097. // MessageId: MQ_ERROR_DS_ERROR
  1098. //
  1099. // MessageText:
  1100. //
  1101. //  Internal DS error.
  1102. //
  1103. #define MQ_ERROR_DS_ERROR                0xC00E0043L
  1104.  
  1105. //
  1106. // MessageId: MQ_ERROR_INVALID_OWNER
  1107. //
  1108. // MessageText:
  1109. //
  1110. //  Invalid object owner. For example MQCreateQueue failed because the QM
  1111. //  object is invalid
  1112. //
  1113. #define MQ_ERROR_INVALID_OWNER           0xC00E0044L
  1114.  
  1115. //
  1116. // MessageId: MQ_ERROR_UNSUPPORTED_ACCESS_MODE
  1117. //
  1118. // MessageText:
  1119. //
  1120. //  The specified access mode is not supported.
  1121. //
  1122. #define MQ_ERROR_UNSUPPORTED_ACCESS_MODE 0xC00E0045L
  1123.  
  1124. //
  1125. // MessageId: MQ_ERROR_RESULT_BUFFER_TOO_SMALL
  1126. //
  1127. // MessageText:
  1128. //
  1129. //  The supplied result buffer is too small
  1130. //
  1131. #define MQ_ERROR_RESULT_BUFFER_TOO_SMALL 0xC00E0046L
  1132.  
  1133. //
  1134. // MessageId: MQ_ERROR_DELETE_CN_IN_USE
  1135. //
  1136. // MessageText:
  1137. //
  1138. //  The Connected Network can not be deleted, it is in use.
  1139. //
  1140. #define MQ_ERROR_DELETE_CN_IN_USE        0xC00E0048L
  1141.  
  1142. //
  1143. // MessageId: MQ_ERROR_NO_RESPONSE_FROM_OBJECT_SERVER
  1144. //
  1145. // MessageText:
  1146. //
  1147. //  No response from object owner.
  1148. //
  1149. #define MQ_ERROR_NO_RESPONSE_FROM_OBJECT_SERVER 0xC00E0049L
  1150.  
  1151. //
  1152. // MessageId: MQ_ERROR_OBJECT_SERVER_NOT_AVAILABLE
  1153. //
  1154. // MessageText:
  1155. //
  1156. //  Object owner is not reachable.
  1157. //
  1158. #define MQ_ERROR_OBJECT_SERVER_NOT_AVAILABLE 0xC00E004AL
  1159.  
  1160. //
  1161. // MessageId: MQ_ERROR_QUEUE_NOT_AVAILABLE
  1162. //
  1163. // MessageText:
  1164. //
  1165. //  Error while reading from a queue residing on a remote computer
  1166. //
  1167. #define MQ_ERROR_QUEUE_NOT_AVAILABLE     0xC00E004BL
  1168.  
  1169. //
  1170. // MessageId: MQ_ERROR_DTC_CONNECT
  1171. //
  1172. // MessageText:
  1173. //
  1174. //  Cannot connect to MS DTC
  1175. //
  1176. #define MQ_ERROR_DTC_CONNECT             0xC00E004CL
  1177.  
  1178. //
  1179. // MessageId: MQ_ERROR_TRANSACTION_IMPORT
  1180. //
  1181. // MessageText:
  1182. //
  1183. //  Cannot import the transaction
  1184. //
  1185. #define MQ_ERROR_TRANSACTION_IMPORT      0xC00E004EL
  1186.  
  1187. //
  1188. // MessageId: MQ_ERROR_TRANSACTION_USAGE
  1189. //
  1190. // MessageText:
  1191. //
  1192. //  Wrong transaction usage
  1193. //
  1194. #define MQ_ERROR_TRANSACTION_USAGE       0xC00E0050L
  1195.  
  1196. //
  1197. // MessageId: MQ_ERROR_TRANSACTION_SEQUENCE
  1198. //
  1199. // MessageText:
  1200. //
  1201. //  Wrong transaction operations sequence
  1202. //
  1203. #define MQ_ERROR_TRANSACTION_SEQUENCE    0xC00E0051L
  1204.  
  1205. //
  1206. // MessageId: MQ_ERROR_MISSING_CONNECTOR_TYPE
  1207. //
  1208. // MessageText:
  1209. //
  1210. //  Connector Type is mandatory when sending Acknowledgment or secure message
  1211. //
  1212. #define MQ_ERROR_MISSING_CONNECTOR_TYPE  0xC00E0055L
  1213.  
  1214. //
  1215. // MessageId: MQ_ERROR_STALE_HANDLE
  1216. //
  1217. // MessageText:
  1218. //
  1219. //  The Queue manager service has been restarted. The queue handle
  1220. //  is stale, and should be closed.
  1221. //
  1222. #define MQ_ERROR_STALE_HANDLE            0xC00E0056L
  1223.  
  1224. //
  1225. // MessageId: MQ_ERROR_TRANSACTION_ENLIST
  1226. //
  1227. // MessageText:
  1228. //
  1229. //  Cannot enlist the transaction
  1230. //
  1231. #define MQ_ERROR_TRANSACTION_ENLIST      0xC00E0058L
  1232.  
  1233. //
  1234. // MessageId: MQ_ERROR_QUEUE_DELETED
  1235. //
  1236. // MessageText:
  1237. //
  1238. //  The queue was deleted. Messages can not be received anymore using this
  1239. //  queue handle. The handle should be closed
  1240. //
  1241. #define MQ_ERROR_QUEUE_DELETED           0xC00E005AL
  1242.  
  1243. //
  1244. // MessageId: MQ_ERROR_ILLEGAL_CONTEXT
  1245. //
  1246. // MessageText:
  1247. //
  1248. //  Invalid context parameter (MQLocateBegin).
  1249. //
  1250. #define MQ_ERROR_ILLEGAL_CONTEXT         0xC00E005BL
  1251.  
  1252. //
  1253. // MessageId: MQ_ERROR_ILLEGAL_SORT_PROPID
  1254. //
  1255. // MessageText:
  1256. //
  1257. //  Invalid propid value in MQSORTSET
  1258. //
  1259. #define MQ_ERROR_ILLEGAL_SORT_PROPID     0xC00E005CL
  1260.  
  1261. //
  1262. // MessageId: MQ_ERROR_LABEL_TOO_LONG
  1263. //
  1264. // MessageText:
  1265. //
  1266. //  The passed label is too long. It should be less or equal to MQ_MAX_MSG_LABEL_LEN
  1267. //
  1268. #define MQ_ERROR_LABEL_TOO_LONG          0xC00E005DL
  1269.  
  1270. //
  1271. // MessageId: MQ_ERROR_LABEL_BUFFER_TOO_SMALL
  1272. //
  1273. // MessageText:
  1274. //
  1275. //  The label buffer supplied to the API was too small
  1276. //
  1277. #define MQ_ERROR_LABEL_BUFFER_TOO_SMALL  0xC00E005EL
  1278.  
  1279. //
  1280. // MessageId: MQ_ERROR_MQIS_SERVER_EMPTY
  1281. //
  1282. // MessageText:
  1283. //
  1284. //  The list of MQIS servers (in registry) is empty.
  1285. //
  1286. #define MQ_ERROR_MQIS_SERVER_EMPTY       0xC00E005FL
  1287.  
  1288. //
  1289. // MessageId: MQ_ERROR_MQIS_READONLY_MODE
  1290. //
  1291. // MessageText:
  1292. //
  1293. //  MQIS database is in read-only mode.
  1294. //
  1295. #define MQ_ERROR_MQIS_READONLY_MODE      0xC00E0060L
  1296.  
  1297. //
  1298. // MessageId: MQ_ERROR_SYMM_KEY_BUFFER_TOO_SMALL
  1299. //
  1300. // MessageText:
  1301. //
  1302. //  The passed buffer for the Symmetric key property is too small.
  1303. //
  1304. #define MQ_ERROR_SYMM_KEY_BUFFER_TOO_SMALL 0xC00E0061L
  1305.  
  1306. //
  1307. // MessageId: MQ_ERROR_SIGNATURE_BUFFER_TOO_SMALL
  1308. //
  1309. // MessageText:
  1310. //
  1311. //  The passed buffer for the Signature property is too small.
  1312. //
  1313. #define MQ_ERROR_SIGNATURE_BUFFER_TOO_SMALL 0xC00E0062L
  1314.  
  1315. //
  1316. // MessageId: MQ_ERROR_PROV_NAME_BUFFER_TOO_SMALL
  1317. //
  1318. // MessageText:
  1319. //
  1320. //  The passed buffer for the Provider name property is too small.
  1321. //
  1322. #define MQ_ERROR_PROV_NAME_BUFFER_TOO_SMALL 0xC00E0063L
  1323.  
  1324. //
  1325. // MessageId: MQ_ERROR_ILLEGAL_OPERATION
  1326. //
  1327. // MessageText:
  1328. //
  1329. //  The operation is illegal on foreign message queuing system
  1330. //
  1331. #define MQ_ERROR_ILLEGAL_OPERATION       0xC00E0064L
  1332.  
  1333. //
  1334. // MessageId: MQ_ERROR_WRITE_NOT_ALLOWED
  1335. //
  1336. // MessageText:
  1337. //
  1338. //  Another MQIS server is being installed, write operations to the
  1339. //  database are not allowed at this stage.
  1340. //
  1341. #define MQ_ERROR_WRITE_NOT_ALLOWED       0xC00E0065L
  1342.  
  1343. //
  1344. // MessageId: MQ_ERROR_WKS_CANT_SERVE_CLIENT
  1345. //
  1346. // MessageText:
  1347. //
  1348. //  MSMQ independent clients cannot serve MSMQ dependent clients.
  1349. //
  1350. #define MQ_ERROR_WKS_CANT_SERVE_CLIENT   0xC00E0066L
  1351.  
  1352. //
  1353. //
  1354. // MessageId: MQ_ERROR_DEPEND_WKS_LICENSE_OVERFLOW
  1355. //
  1356. // MessageText:
  1357. //
  1358. //  The number of dependent clients served by this MSMQ server reached
  1359. //  its upper limit.
  1360. //
  1361. #define MQ_ERROR_DEPEND_WKS_LICENSE_OVERFLOW 0xC00E0067L
  1362.  
  1363. //
  1364. //
  1365. // MessageId: MQ_CORRUPTED_QUEUE_WAS_DELETED
  1366. //
  1367. // MessageText:
  1368. //
  1369. //  Ini file for queue %1 in LQS was deleted because it was corrupted.
  1370. //
  1371. #define MQ_CORRUPTED_QUEUE_WAS_DELETED   0xC00E0068L
  1372.  
  1373. //
  1374. //
  1375. // MessageId: MQ_ERROR_REMOTE_MACHINE_NOT_AVAILABLE
  1376. //
  1377. // MessageText:
  1378. //
  1379. //  The remote machine is not available.
  1380. //
  1381. #define MQ_ERROR_REMOTE_MACHINE_NOT_AVAILABLE 0xC00E0069L
  1382.  
  1383. //
  1384. // Informational
  1385. //
  1386. //
  1387. // MessageId: MQ_INFORMATION_PROPERTY
  1388. //
  1389. // MessageText:
  1390. //
  1391. //  One or more of the passed properties resulted in warning but the
  1392. //  function completed.
  1393. //
  1394. #define MQ_INFORMATION_PROPERTY          0x400E0001L
  1395.  
  1396. //
  1397. // MessageId: MQ_INFORMATION_ILLEGAL_PROPERTY
  1398. //
  1399. // MessageText:
  1400. //
  1401. //  Invalid property id.
  1402. //
  1403. #define MQ_INFORMATION_ILLEGAL_PROPERTY  0x400E0002L
  1404.  
  1405. //
  1406. // MessageId: MQ_INFORMATION_PROPERTY_IGNORED
  1407. //
  1408. // MessageText:
  1409. //
  1410. //  The specified property is ignored in this operation
  1411. //  (e.g., PROPID_M_SENDERID in SendMessage().
  1412. //
  1413. #define MQ_INFORMATION_PROPERTY_IGNORED  0x400E0003L
  1414.  
  1415. //
  1416. // MessageId: MQ_INFORMATION_UNSUPPORTED_PROPERTY
  1417. //
  1418. // MessageText:
  1419. //
  1420. //  The specified property is not supported and is ignored in this operation
  1421. //
  1422. #define MQ_INFORMATION_UNSUPPORTED_PROPERTY 0x400E0004L
  1423.  
  1424. //
  1425. // MessageId: MQ_INFORMATION_DUPLICATE_PROPERTY
  1426. //
  1427. // MessageText:
  1428. //
  1429. //  The specified property already appeared in the propid array, and is
  1430. //  ignored in this operation
  1431. //
  1432. #define MQ_INFORMATION_DUPLICATE_PROPERTY 0x400E0005L
  1433.  
  1434. //
  1435. // MessageId: MQ_INFORMATION_OPERATION_PENDING
  1436. //
  1437. // MessageText:
  1438. //
  1439. //  Asynchronous operation is currently pending.
  1440. //
  1441. #define MQ_INFORMATION_OPERATION_PENDING 0x400E0006L
  1442.  
  1443. //
  1444. // MessageId: MQ_INFORMATION_FORMATNAME_BUFFER_TOO_SMALL
  1445. //
  1446. // MessageText:
  1447. //
  1448. //  The format name buffer supplied to MQCreateQueue was too small
  1449. //  to fit the format name. Queue was created successfully
  1450. //
  1451. #define MQ_INFORMATION_FORMATNAME_BUFFER_TOO_SMALL 0x400E0009L
  1452.  
  1453.  
  1454.  
  1455. //********************************************************************
  1456. //  SECURITY FLAGS
  1457. //********************************************************************
  1458. #define MQSEC_DELETE_MESSAGE                0x1
  1459. #define MQSEC_PEEK_MESSAGE                  0x2
  1460. #define MQSEC_WRITE_MESSAGE                 0x4
  1461. #define MQSEC_DELETE_JOURNAL_MESSAGE        0x8
  1462. #define MQSEC_SET_QUEUE_PROPERTIES          0x10
  1463. #define MQSEC_GET_QUEUE_PROPERTIES          0x20
  1464. #define MQSEC_DELETE_QUEUE                  DELETE
  1465. #define MQSEC_GET_QUEUE_PERMISSIONS         READ_CONTROL
  1466. #define MQSEC_CHANGE_QUEUE_PERMISSIONS      WRITE_DAC
  1467. #define MQSEC_TAKE_QUEUE_OWNERSHIP          WRITE_OWNER
  1468.  
  1469. #define MQSEC_RECEIVE_MESSAGE               (MQSEC_DELETE_MESSAGE | \
  1470.                                              MQSEC_PEEK_MESSAGE)
  1471.  
  1472. #define MQSEC_RECEIVE_JOURNAL_MESSAGE       (MQSEC_DELETE_JOURNAL_MESSAGE | \
  1473.                                              MQSEC_PEEK_MESSAGE)
  1474.  
  1475. #define MQSEC_QUEUE_GENERIC_READ            (MQSEC_GET_QUEUE_PROPERTIES | \
  1476.                                              MQSEC_GET_QUEUE_PERMISSIONS | \
  1477.                                              MQSEC_RECEIVE_MESSAGE | \
  1478.                                              MQSEC_RECEIVE_JOURNAL_MESSAGE)
  1479.  
  1480. #define MQSEC_QUEUE_GENERIC_WRITE           (MQSEC_GET_QUEUE_PROPERTIES | \
  1481.                                              MQSEC_GET_QUEUE_PERMISSIONS | \
  1482.                                              MQSEC_WRITE_MESSAGE)
  1483.  
  1484. #define MQSEC_QUEUE_GENERIC_EXECUTE         0
  1485.  
  1486. #define MQSEC_QUEUE_GENERIC_ALL             (MQSEC_RECEIVE_MESSAGE | \
  1487.                                              MQSEC_RECEIVE_JOURNAL_MESSAGE | \
  1488.                                              MQSEC_WRITE_MESSAGE | \
  1489.                                              MQSEC_SET_QUEUE_PROPERTIES | \
  1490.                                              MQSEC_GET_QUEUE_PROPERTIES | \
  1491.                                              MQSEC_DELETE_QUEUE | \
  1492.                                              MQSEC_GET_QUEUE_PERMISSIONS | \
  1493.                                              MQSEC_CHANGE_QUEUE_PERMISSIONS | \
  1494.                                              MQSEC_TAKE_QUEUE_OWNERSHIP)
  1495.  
  1496. #ifdef __cplusplus
  1497. extern "C"
  1498. {
  1499. #endif
  1500.  
  1501. //********************************************************************
  1502. //  RECEIVE CALLBACK
  1503. //********************************************************************
  1504.  
  1505. typedef
  1506. VOID
  1507. (APIENTRY *PMQRECEIVECALLBACK)(
  1508.     HRESULT hrStatus,
  1509.     QUEUEHANDLE hSource,
  1510.     DWORD dwTimeout,
  1511.     DWORD dwAction,
  1512.     MQMSGPROPS* pMessageProps,
  1513.     LPOVERLAPPED lpOverlapped,
  1514.     HANDLE hCursor
  1515.     );
  1516.  
  1517.  
  1518. //********************************************************************
  1519. // MSMQ API
  1520. //********************************************************************
  1521.  
  1522. HRESULT
  1523. APIENTRY
  1524. MQCreateQueue(
  1525.     IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1526.     IN OUT MQQUEUEPROPS* pQueueProps,
  1527.     OUT LPWSTR lpwcsFormatName,
  1528.     IN OUT LPDWORD lpdwFormatNameLength
  1529.     );
  1530.  
  1531. HRESULT
  1532. APIENTRY
  1533. MQDeleteQueue(
  1534.     IN LPCWSTR lpwcsFormatName
  1535.     );
  1536.  
  1537. HRESULT
  1538. APIENTRY
  1539. MQLocateBegin(
  1540.     IN LPCWSTR lpwcsContext,
  1541.     IN MQRESTRICTION* pRestriction,
  1542.     IN MQCOLUMNSET* pColumns,
  1543.     IN MQSORTSET* pSort,
  1544.     OUT PHANDLE phEnum
  1545.     );
  1546.  
  1547. HRESULT
  1548. APIENTRY
  1549. MQLocateNext(
  1550.     IN HANDLE hEnum,
  1551.     IN OUT DWORD* pcProps,
  1552.     OUT MQPROPVARIANT aPropVar[]
  1553.     );
  1554.  
  1555. HRESULT
  1556. APIENTRY
  1557. MQLocateEnd(
  1558.     IN HANDLE hEnum
  1559.     );
  1560.  
  1561. HRESULT
  1562. APIENTRY
  1563. MQOpenQueue(
  1564.     IN LPCWSTR lpwcsFormatName,
  1565.     IN DWORD dwAccess,
  1566.     IN DWORD dwShareMode,
  1567.     OUT QUEUEHANDLE* phQueue
  1568.     );
  1569.  
  1570. HRESULT
  1571. APIENTRY
  1572. MQSendMessage(
  1573.     IN QUEUEHANDLE hDestinationQueue,
  1574.     IN MQMSGPROPS* pMessageProps,
  1575.     IN ITransaction *pTransaction
  1576.     );
  1577.  
  1578. HRESULT
  1579. APIENTRY
  1580. MQReceiveMessage(
  1581.     IN QUEUEHANDLE hSource,
  1582.     IN DWORD dwTimeout,
  1583.     IN DWORD dwAction,
  1584.     IN OUT MQMSGPROPS* pMessageProps,
  1585.     IN OUT LPOVERLAPPED lpOverlapped,
  1586.     IN PMQRECEIVECALLBACK fnReceiveCallback,
  1587.     IN HANDLE hCursor,
  1588.     IN ITransaction* pTransaction
  1589.     );
  1590.  
  1591. HRESULT
  1592. APIENTRY
  1593. MQCreateCursor(
  1594.     IN QUEUEHANDLE hQueue,
  1595.     OUT PHANDLE phCursor
  1596.     );
  1597.  
  1598. HRESULT
  1599. APIENTRY
  1600. MQCloseCursor(
  1601.     IN HANDLE hCursor
  1602.     );
  1603.  
  1604. HRESULT
  1605. APIENTRY
  1606. MQCloseQueue(
  1607.     IN HANDLE hQueue
  1608.     );
  1609.  
  1610. HRESULT
  1611. APIENTRY
  1612. MQSetQueueProperties(
  1613.     IN LPCWSTR lpwcsFormatName,
  1614.     IN MQQUEUEPROPS* pQueueProps
  1615.     );
  1616.  
  1617. HRESULT
  1618. APIENTRY
  1619. MQGetQueueProperties(
  1620.     IN LPCWSTR lpwcsFormatName,
  1621.     OUT MQQUEUEPROPS* pQueueProps
  1622.     );
  1623.  
  1624. HRESULT
  1625. APIENTRY
  1626. MQGetQueueSecurity(
  1627.     IN LPCWSTR lpwcsFormatName,
  1628.     IN SECURITY_INFORMATION RequestedInformation,
  1629.     OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
  1630.     IN DWORD nLength,
  1631.     OUT LPDWORD lpnLengthNeeded
  1632.     );
  1633.  
  1634. HRESULT
  1635. APIENTRY
  1636. MQSetQueueSecurity(
  1637.     IN LPCWSTR lpwcsFormatName,
  1638.     IN SECURITY_INFORMATION SecurityInformation,
  1639.     IN PSECURITY_DESCRIPTOR pSecurityDescriptor
  1640.     );
  1641.  
  1642. HRESULT
  1643. APIENTRY
  1644. MQPathNameToFormatName(
  1645.     IN LPCWSTR lpwcsPathName,
  1646.     OUT LPWSTR lpwcsFormatName,
  1647.     IN OUT LPDWORD lpdwFormatNameLength
  1648.     );
  1649.  
  1650. HRESULT
  1651. APIENTRY
  1652. MQHandleToFormatName(
  1653.     IN QUEUEHANDLE hQueue,
  1654.     OUT LPWSTR lpwcsFormatName,
  1655.     IN OUT LPDWORD lpdwFormatNameLength
  1656.     );
  1657.  
  1658. HRESULT
  1659. APIENTRY
  1660. MQInstanceToFormatName(
  1661.     IN GUID* pGuid,
  1662.     OUT LPWSTR lpwcsFormatName,
  1663.     IN OUT LPDWORD lpdwFormatNameLength
  1664.     );
  1665.  
  1666. void
  1667. APIENTRY
  1668. MQFreeMemory(
  1669.     IN PVOID pvMemory
  1670.     );
  1671.  
  1672. HRESULT
  1673. APIENTRY
  1674. MQGetMachineProperties(
  1675.     IN LPCWSTR lpwcsMachineName,
  1676.     IN const GUID* pguidMachineId,
  1677.     IN OUT MQQMPROPS* pQMProps
  1678.     );
  1679.  
  1680. HRESULT
  1681. APIENTRY
  1682. MQGetSecurityContext(
  1683.     IN PVOID lpCertBuffer,
  1684.     IN DWORD dwCertBufferLength,
  1685.     OUT HANDLE* hSecurityContext
  1686.     );
  1687.  
  1688. void
  1689. APIENTRY
  1690. MQFreeSecurityContext(
  1691.     IN HANDLE hSecurityContext
  1692.     );
  1693.  
  1694. HRESULT
  1695. APIENTRY
  1696. MQBeginTransaction(
  1697.     OUT ITransaction **ppTransaction
  1698.     );
  1699.  
  1700.  
  1701. #ifdef __cplusplus
  1702. }
  1703. #endif
  1704.  
  1705. #pragma option pop /*P_O_Pop*/
  1706. #endif // __MQ_H__
  1707.  
  1708.