📄 mq.h
字号:
//
// MessageId: MQ_ERROR_CANNOT_GRANT_ADD_GUID
//
// MessageText:
//
// Failed to grant the "Add Guid" permission to current user.
//
#define MQ_ERROR_CANNOT_GRANT_ADD_GUID 0xC00E0072L
//
//
// MessageId: MQ_ERROR_CANNOT_LOAD_MSMQOCM
//
// MessageText:
//
// Can't load the MSMQOCM.DLL library.
//
#define MQ_ERROR_CANNOT_LOAD_MSMQOCM 0xC00E0073L
//
//
// MessageId: MQ_ERROR_NO_ENTRY_POINT_MSMQOCM
//
// MessageText:
//
// Cannot locate an entry point in the MSMQOCM.DLL library.
//
#define MQ_ERROR_NO_ENTRY_POINT_MSMQOCM 0xC00E0074L
//
//
// MessageId: MQ_ERROR_NO_MSMQ_SERVERS_ON_DC
//
// MessageText:
//
// Failed to find Message Queuing servers on domain controllers.
//
#define MQ_ERROR_NO_MSMQ_SERVERS_ON_DC 0xC00E0075L
//
//
// MessageId: MQ_ERROR_CANNOT_JOIN_DOMAIN
//
// MessageText:
//
// Failed to join MSMQ enterprise on Windows 2000 domain.
//
#define MQ_ERROR_CANNOT_JOIN_DOMAIN 0xC00E0076L
//
//
// MessageId: MQ_ERROR_CANNOT_CREATE_ON_GC
//
// MessageText:
//
// Failed to create an object on a specified GC server.
//
#define MQ_ERROR_CANNOT_CREATE_ON_GC 0xC00E0077L
//
//
// MessageId: MQ_ERROR_GUID_NOT_MATCHING
//
// MessageText:
//
// Failed to create msmqConfiguration object with GUID that match machine installation. You must uninstall MSMQ and then reinstall it.
//
#define MQ_ERROR_GUID_NOT_MATCHING 0xC00E0078L
//
// MessageId: MQ_ERROR_PUBLIC_KEY_NOT_FOUND
//
// MessageText:
//
// Unable to find the public key for computer %1
//
#define MQ_ERROR_PUBLIC_KEY_NOT_FOUND 0xC00E0079L
//
// MessageId: MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST
//
// MessageText:
//
// The public key for computer %1 does not exist
//
#define MQ_ERROR_PUBLIC_KEY_DOES_NOT_EXIST 0xC00E007AL
//
//
// MessageId: MQ_ERROR_ILLEGAL_MQPRIVATEPROPS
//
// MessageText:
//
// The MQPRIVATEPROPS parameter value is invalid. This may be because it has a null value or has zero properties specified.
//
#define MQ_ERROR_ILLEGAL_MQPRIVATEPROPS 0xC00E007BL
//
//
// MessageId: MQ_ERROR_NO_GC_IN_DOMAIN
//
// MessageText:
//
// Unable to find Global Catalog servers in the specified domain.
//
#define MQ_ERROR_NO_GC_IN_DOMAIN 0xC00E007CL
//
//
// MessageId: MQ_ERROR_NO_MSMQ_SERVERS_ON_GC
//
// MessageText:
//
// Failed to find Message Queuing servers on Global Catalog domain controllers.
//
#define MQ_ERROR_NO_MSMQ_SERVERS_ON_GC 0xC00E007DL
//
//
// MessageId: MQ_ERROR_CANNOT_GET_DN
//
// MessageText:
//
// Failed to retrieve the distinguished name of local computer.
//
#define MQ_ERROR_CANNOT_GET_DN 0xC00E007EL
//
// Informational
//
//
// MessageId: MQ_INFORMATION_PROPERTY
//
// MessageText:
//
// One or more of the passed properties resulted in a warning but the
// function completed.
//
#define MQ_INFORMATION_PROPERTY 0x400E0001L
//
// MessageId: MQ_INFORMATION_ILLEGAL_PROPERTY
//
// MessageText:
//
// Invalid property ID.
//
#define MQ_INFORMATION_ILLEGAL_PROPERTY 0x400E0002L
//
// MessageId: MQ_INFORMATION_PROPERTY_IGNORED
//
// MessageText:
//
// The specified property has been ignored for this operation
// (for example:, PROPID_M_SENDERID in SendMessage()).
//
#define MQ_INFORMATION_PROPERTY_IGNORED 0x400E0003L
//
// MessageId: MQ_INFORMATION_UNSUPPORTED_PROPERTY
//
// MessageText:
//
// The specified property is not supported and has been ignored for this operation.
//
#define MQ_INFORMATION_UNSUPPORTED_PROPERTY 0x400E0004L
//
// MessageId: MQ_INFORMATION_DUPLICATE_PROPERTY
//
// MessageText:
//
// The specified property is already in the PROPID array, and has been
// ignored for this operation.
//
#define MQ_INFORMATION_DUPLICATE_PROPERTY 0x400E0005L
//
// MessageId: MQ_INFORMATION_OPERATION_PENDING
//
// MessageText:
//
// An asynchronous operation is currently pending.
//
#define MQ_INFORMATION_OPERATION_PENDING 0x400E0006L
//
// MessageId: MQ_INFORMATION_FORMATNAME_BUFFER_TOO_SMALL
//
// MessageText:
//
// The format name buffer supplied to MQCreateQueue was too small
// to hold the format name, however the queue was created successfully.
//
#define MQ_INFORMATION_FORMATNAME_BUFFER_TOO_SMALL 0x400E0009L
//
// MessageId: MQ_INFORMATION_INTERNAL_USER_CERT_EXIST
//
// MessageText:
//
// An internal Message Queuing certificate already exists for this user.
//
#define MQ_INFORMATION_INTERNAL_USER_CERT_EXIST 0x400E000AL
//
// MessageId: MQ_INFORMATION_OWNER_IGNORED
//
// MessageText:
//
// Owner of queue was not set while processing this call to MQSetQueueSecurity().
//
#define MQ_INFORMATION_OWNER_IGNORED 0x400E000BL
//+-----------------------------------------
//
// Flags for MQRegisterCertificate()
//
//+-----------------------------------------
#define MQCERT_REGISTER_ALWAYS 0x01
#define MQCERT_REGISTER_IF_NOT_EXIST 0x02
//********************************************************************
// SECURITY Flags (Queue access control)
//********************************************************************
#define MQSEC_DELETE_MESSAGE 0x1
#define MQSEC_PEEK_MESSAGE 0x2
#define MQSEC_WRITE_MESSAGE 0x4
#define MQSEC_DELETE_JOURNAL_MESSAGE 0x8
#define MQSEC_SET_QUEUE_PROPERTIES 0x10
#define MQSEC_GET_QUEUE_PROPERTIES 0x20
#define MQSEC_DELETE_QUEUE DELETE
#define MQSEC_GET_QUEUE_PERMISSIONS READ_CONTROL
#define MQSEC_CHANGE_QUEUE_PERMISSIONS WRITE_DAC
#define MQSEC_TAKE_QUEUE_OWNERSHIP WRITE_OWNER
#define MQSEC_RECEIVE_MESSAGE (MQSEC_DELETE_MESSAGE | \
MQSEC_PEEK_MESSAGE)
#define MQSEC_RECEIVE_JOURNAL_MESSAGE (MQSEC_DELETE_JOURNAL_MESSAGE | \
MQSEC_PEEK_MESSAGE)
#define MQSEC_QUEUE_GENERIC_READ (MQSEC_GET_QUEUE_PROPERTIES | \
MQSEC_GET_QUEUE_PERMISSIONS | \
MQSEC_RECEIVE_MESSAGE | \
MQSEC_RECEIVE_JOURNAL_MESSAGE)
#define MQSEC_QUEUE_GENERIC_WRITE (MQSEC_GET_QUEUE_PROPERTIES | \
MQSEC_GET_QUEUE_PERMISSIONS | \
MQSEC_WRITE_MESSAGE)
#define MQSEC_QUEUE_GENERIC_EXECUTE 0
#define MQSEC_QUEUE_GENERIC_ALL (MQSEC_RECEIVE_MESSAGE | \
MQSEC_RECEIVE_JOURNAL_MESSAGE | \
MQSEC_WRITE_MESSAGE | \
MQSEC_SET_QUEUE_PROPERTIES | \
MQSEC_GET_QUEUE_PROPERTIES | \
MQSEC_DELETE_QUEUE | \
MQSEC_GET_QUEUE_PERMISSIONS | \
MQSEC_CHANGE_QUEUE_PERMISSIONS | \
MQSEC_TAKE_QUEUE_OWNERSHIP)
#ifdef __cplusplus
extern "C"
{
#endif
//********************************************************************
// RECEIVE CALLBACK
//********************************************************************
typedef
VOID
(APIENTRY *PMQRECEIVECALLBACK)(
HRESULT hrStatus,
QUEUEHANDLE hSource,
DWORD dwTimeout,
DWORD dwAction,
MQMSGPROPS* pMessageProps,
LPOVERLAPPED lpOverlapped,
HANDLE hCursor
);
//********************************************************************
// MSMQ API
//********************************************************************
HRESULT
APIENTRY
MQCreateQueue(
IN PSECURITY_DESCRIPTOR pSecurityDescriptor,
IN OUT MQQUEUEPROPS* pQueueProps,
OUT LPWSTR lpwcsFormatName,
IN OUT LPDWORD lpdwFormatNameLength
);
HRESULT
APIENTRY
MQDeleteQueue(
IN LPCWSTR lpwcsFormatName
);
HRESULT
APIENTRY
MQLocateBegin(
IN LPCWSTR lpwcsContext,
IN MQRESTRICTION* pRestriction,
IN MQCOLUMNSET* pColumns,
IN MQSORTSET* pSort,
OUT PHANDLE phEnum
);
HRESULT
APIENTRY
MQLocateNext(
IN HANDLE hEnum,
IN OUT DWORD* pcProps,
OUT MQPROPVARIANT aPropVar[]
);
HRESULT
APIENTRY
MQLocateEnd(
IN HANDLE hEnum
);
HRESULT
APIENTRY
MQOpenQueue(
IN LPCWSTR lpwcsFormatName,
IN DWORD dwAccess,
IN DWORD dwShareMode,
OUT QUEUEHANDLE* phQueue
);
HRESULT
APIENTRY
MQSendMessage(
IN QUEUEHANDLE hDestinationQueue,
IN MQMSGPROPS* pMessageProps,
IN ITransaction *pTransaction
);
HRESULT
APIENTRY
MQReceiveMessage(
IN QUEUEHANDLE hSource,
IN DWORD dwTimeout,
IN DWORD dwAction,
IN OUT MQMSGPROPS* pMessageProps,
IN OUT LPOVERLAPPED lpOverlapped,
IN PMQRECEIVECALLBACK fnReceiveCallback,
IN HANDLE hCursor,
IN ITransaction* pTransaction
);
HRESULT
APIENTRY
MQCreateCursor(
IN QUEUEHANDLE hQueue,
OUT PHANDLE phCursor
);
HRESULT
APIENTRY
MQCloseCursor(
IN HANDLE hCursor
);
HRESULT
APIENTRY
MQCloseQueue(
IN HANDLE hQueue
);
HRESULT
APIENTRY
MQSetQueueProperties(
IN LPCWSTR lpwcsFormatName,
IN MQQUEUEPROPS* pQueueProps
);
HRESULT
APIENTRY
MQGetQueueProperties(
IN LPCWSTR lpwcsFormatName,
OUT MQQUEUEPROPS* pQueueProps
);
HRESULT
APIENTRY
MQGetQueueSecurity(
IN LPCWSTR lpwcsFormatName,
IN SECURITY_INFORMATION RequestedInformation,
OUT PSECURITY_DESCRIPTOR pSecurityDescriptor,
IN DWORD nLength,
OUT LPDWORD lpnLengthNeeded
);
HRESULT
APIENTRY
MQSetQueueSecurity(
IN LPCWSTR lpwcsFormatName,
IN SECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR pSecurityDescriptor
);
HRESULT
APIENTRY
MQPathNameToFormatName(
IN LPCWSTR lpwcsPathName,
OUT LPWSTR lpwcsFormatName,
IN OUT LPDWORD lpdwFormatNameLength
);
HRESULT
APIENTRY
MQHandleToFormatName(
IN QUEUEHANDLE hQueue,
OUT LPWSTR lpwcsFormatName,
IN OUT LPDWORD lpdwFormatNameLength
);
HRESULT
APIENTRY
MQInstanceToFormatName(
IN GUID* pGuid,
OUT LPWSTR lpwcsFormatName,
IN OUT LPDWORD lpdwFormatNameLength
);
void
APIENTRY
MQFreeMemory(
IN PVOID pvMemory
);
HRESULT
APIENTRY
MQGetMachineProperties(
IN LPCWSTR lpwcsMachineName,
IN const GUID* pguidMachineId,
IN OUT MQQMPROPS* pQMProps
);
HRESULT
APIENTRY
MQGetSecurityContext(
IN PVOID lpCertBuffer,
IN DWORD dwCertBufferLength,
OUT HANDLE* hSecurityContext
);
void
APIENTRY
MQFreeSecurityContext(
IN HANDLE hSecurityContext
);
HRESULT
APIENTRY
MQRegisterCertificate(
IN DWORD dwFlags,
IN PVOID lpCertBuffer,
IN DWORD dwCertBufferLength
);
typedef HRESULT (APIENTRY *MQRegisterCertificate_ROUTINE) (DWORD, PVOID, DWORD);
HRESULT
APIENTRY
MQBeginTransaction(
OUT ITransaction **ppTransaction
);
HRESULT
APIENTRY
MQGetOverlappedResult(
IN LPOVERLAPPED lpOverlapped
);
HRESULT
APIENTRY
MQGetPrivateComputerInformation(
IN LPCWSTR lpwcsComputerName,
IN OUT MQPRIVATEPROPS* pPrivateProps
);
#ifdef __cplusplus
}
#endif
#pragma option pop /*P_O_Pop*/
#endif // __MQ_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -