Reactos
at master 210 lines 6.1 kB view raw
1/* 2 * Copyright (C) 2007 Francois Gouget 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 2.1 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this library; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 17 */ 18#ifndef __WINE_RPCASYNC_H 19#define __WINE_RPCASYNC_H 20 21#ifdef _MSC_VER 22#pragma warning(push) 23#pragma warning(disable:4820) 24#endif 25 26#ifdef RPC_NO_WINDOWS_H 27# include <windef.h> 28#endif 29 30#ifdef __RPC_WIN64__ 31# include <pshpack8.h> 32#endif 33 34typedef struct tagRPC_ERROR_ENUM_HANDLE 35{ 36 ULONG Signature; 37 void* CurrentPos; 38 void* Head; 39} RPC_ERROR_ENUM_HANDLE; 40 41typedef enum tagExtendedErrorParamTypes 42{ 43 eeptAnsiString = 1, 44 eeptUnicodeString, 45 eeptLongVal, 46 eeptShortVal, 47 eeptPointerVal, 48 eeptNone, 49 eeptBinary 50} ExtendedErrorParamTypes; 51 52#define MaxNumberOfEEInfoParams 4 53#define RPC_EEINFO_VERSION 1 54 55typedef struct tagBinaryParam 56{ 57 void *Buffer; 58 short Size; 59} BinaryParam; 60 61typedef struct tagRPC_EE_INFO_PARAM 62{ 63 ExtendedErrorParamTypes ParameterType; 64 union 65 { 66 LPSTR AnsiString; 67 LPWSTR UnicodeString; 68 LONG LVal; 69 short SVal; 70 ULONGLONG PVal; 71 BinaryParam BVal; 72 } u; 73} RPC_EE_INFO_PARAM; 74 75#define EEInfoPreviousRecordsMissing 0x1 76#define EEInfoNextRecordsMissing 0x2 77#define EEInfoUseFileTime 0x4 78 79#define EEInfoGCCOM 11 80#define EEInfoGCFRS 12 81 82typedef struct tagRPC_EXTENDED_ERROR_INFO 83{ 84 ULONG Version; 85 LPWSTR ComputerName; 86 ULONG ProcessID; 87 union 88 { 89 SYSTEMTIME SystemTime; 90 FILETIME FileTime; 91 } u; 92 ULONG GeneratingComponent; 93 ULONG Status; 94 USHORT DetectionLocation; 95 USHORT Flags; 96 int NumberOfParameters; 97 RPC_EE_INFO_PARAM Parameters[MaxNumberOfEEInfoParams]; 98} RPC_EXTENDED_ERROR_INFO; 99 100#define RPC_ASYNC_VERSION_1_0 sizeof(RPC_ASYNC_STATE) 101 102typedef enum _RPC_NOTIFICATION_TYPES 103{ 104 RpcNotificationTypeNone, 105 RpcNotificationTypeEvent, 106 RpcNotificationTypeApc, 107 RpcNotificationTypeIoc, 108 RpcNotificationTypeHwnd, 109 RpcNotificationTypeCallback, 110} RPC_NOTIFICATION_TYPES; 111 112typedef enum _RPC_ASYNC_EVENT 113{ 114 RpcCallComplete, 115 RpcSendComplete, 116 RpcReceiveComplete, 117 RpcClientDisconnect, 118 RpcClientCancel, 119} RPC_ASYNC_EVENT; 120 121struct _RPC_ASYNC_STATE; 122 123typedef void RPC_ENTRY RPCNOTIFICATION_ROUTINE(struct _RPC_ASYNC_STATE *,void *,RPC_ASYNC_EVENT); 124typedef RPCNOTIFICATION_ROUTINE *PFN_RPCNOTIFICATION_ROUTINE; 125 126typedef union _RPC_ASYNC_NOTIFICATION_INFO 127{ 128 struct 129 { 130 PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; 131 HANDLE hThread; 132 } APC; 133 struct 134 { 135 HANDLE hIOPort; 136 DWORD dwNumberOfBytesTransferred; 137 DWORD_PTR dwCompletionKey; 138 LPOVERLAPPED lpOverlapped; 139 } IOC; 140 struct 141 { 142 HWND hWnd; 143 UINT Msg; 144 } HWND; 145 HANDLE hEvent; 146 PFN_RPCNOTIFICATION_ROUTINE NotificationRoutine; 147} RPC_ASYNC_NOTIFICATION_INFO, *PRPC_ASYNC_NOTIFICATION_INFO; 148 149#define RPC_C_NOTIFY_ON_SEND_COMPLETE 0x1 150#define RPC_C_INFINITE_TIMEOUT INFINITE 151 152typedef struct _RPC_ASYNC_STATE 153{ 154 unsigned int Size; 155 ULONG Signature; 156 LONG Lock; 157 ULONG Flags; 158 void *StubInfo; 159 void *UserInfo; 160 void *RuntimeInfo; 161 RPC_ASYNC_EVENT Event; 162 RPC_NOTIFICATION_TYPES NotificationType; 163 RPC_ASYNC_NOTIFICATION_INFO u; 164 LONG_PTR Reserved[4]; 165} RPC_ASYNC_STATE, *PRPC_ASYNC_STATE; 166 167#define RpcAsyncGetCallHandle(async) (((PRPC_ASYNC_STATE)async)->RuntimeInfo) 168 169#ifdef __RPC_WIN64__ 170# include <poppack.h> 171#endif 172 173#ifdef __cplusplus 174extern "C" { 175#endif 176 177RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncInitializeHandle(PRPC_ASYNC_STATE,unsigned int); 178RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncRegisterInfo(PRPC_ASYNC_STATE); 179RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncGetCallStatus(PRPC_ASYNC_STATE); 180RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCompleteCall(PRPC_ASYNC_STATE,void *); 181RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncAbortCall(PRPC_ASYNC_STATE,ULONG); 182RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCancelCall(PRPC_ASYNC_STATE,BOOL); 183RPCRTAPI RPC_STATUS RPC_ENTRY RpcAsyncCleanupThread(DWORD); 184RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorStartEnumeration(RPC_ERROR_ENUM_HANDLE*); 185RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorGetNextRecord(RPC_ERROR_ENUM_HANDLE*,BOOL,RPC_EXTENDED_ERROR_INFO*); 186RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorEndEnumeration(RPC_ERROR_ENUM_HANDLE*); 187RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorResetEnumeration(RPC_ERROR_ENUM_HANDLE*); 188RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorGetNumberOfRecords(RPC_ERROR_ENUM_HANDLE*,int*); 189RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorSaveErrorInfo(RPC_ERROR_ENUM_HANDLE*,PVOID*,SIZE_T*); 190RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorLoadErrorInfo(PVOID,SIZE_T,RPC_ERROR_ENUM_HANDLE*); 191RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorAddRecord(RPC_EXTENDED_ERROR_INFO*); 192RPCRTAPI RPC_STATUS RPC_ENTRY RpcErrorClearInformation(void); 193RPCRTAPI RPC_STATUS RPC_ENTRY RpcGetAuthorizationContextForClient(RPC_BINDING_HANDLE,BOOL,LPVOID,PLARGE_INTEGER,LUID,DWORD,PVOID,PVOID*); 194RPCRTAPI RPC_STATUS RPC_ENTRY RpcFreeAuthorizationContext(PVOID*); 195RPCRTAPI RPC_STATUS RPC_ENTRY RpcSsContextLockExclusive(RPC_BINDING_HANDLE,PVOID); 196RPCRTAPI RPC_STATUS RPC_ENTRY RpcSsContextLockShared(RPC_BINDING_HANDLE,PVOID); 197 198RPCRTAPI RPC_STATUS RPC_ENTRY I_RpcAsyncSetHandle(PRPC_MESSAGE,PRPC_ASYNC_STATE); 199RPCRTAPI RPC_STATUS RPC_ENTRY I_RpcAsyncAbortCall(PRPC_ASYNC_STATE,ULONG); 200RPCRTAPI int RPC_ENTRY I_RpcExceptionFilter(ULONG); 201 202#ifdef __cplusplus 203} 204#endif 205 206#ifdef _MSC_VER 207#pragma warning(pop) 208#endif 209 210#endif