65,210
社区成员
发帖
与我相关
我的任务
分享
#ifndef __RPCASYNC_H__
#define __RPCASYNC_H__
#if _MSC_VER > 1000
#pragma once
#endif
#if defined(__RPC_WIN64__)
#include <pshpack8.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#define RPC_ASYNC_VERSION_1_0 sizeof(RPC_ASYNC_STATE)
typedef
enum _RPC_NOTIFICATION_TYPES
{
RpcNotificationTypeNone,
RpcNotificationTypeEvent,
RpcNotificationTypeApc,
RpcNotificationTypeIoc,
RpcNotificationTypeHwnd,
RpcNotificationTypeCallback
} RPC_NOTIFICATION_TYPES;
typedef
enum _RPC_ASYNC_EVENT {
RpcCallComplete,
RpcSendComplete,
RpcReceiveComplete
} RPC_ASYNC_EVENT;
struct _RPC_ASYNC_STATE;
typedef void RPC_ENTRY
RPCNOTIFICATION_ROUTINE (
struct _RPC_ASYNC_STATE *pAsync,
void *Context,
RPC_ASYNC_EVENT Event);
typedef RPCNOTIFICATION_ROUTINE *PFN_RPCNOTIFICATION_ROUTINE;
typedef struct _RPC_ASYNC_STATE {
unsigned int Size; // size of this structure
unsigned long Signature;
long Lock;
unsigned long Flags;
void *StubInfo;
void *UserInfo;
void *RuntimeInfo;
RPC_ASYNC_EVENT Event;
RPC_NOTIFICATION_TYPES NotificationType;
union {
//
// Notification by APC
//
struct {
PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine;
HANDLE hThread;
} APC;
//
// Notification by IO completion port
//
struct {
HANDLE hIOPort;
DWORD dwNumberOfBytesTransferred;
DWORD_PTR dwCompletionKey;
LPOVERLAPPED lpOverlapped;
} IOC;
//
// Notification by window message
//
struct {
HWND hWnd;
UINT Msg;
} HWND;
//
// Notification by event
//
HANDLE hEvent;