#include <winapifamily.h>
#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
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#if defined(_KRPCENV_)
#include <ntddk.h>
#endif // _KRPCENV_
#if defined(RPC_NO_WINDOWS_H) || defined(_KRPCENV_)
// We've gotta have windef.h--can't live without it.
#include <windef.h>
#endif // RPC_NO_WINDOWS_H || _KRPCENV_
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#define RPC_ASYNC_VERSION_1_0 sizeof(RPC_ASYNC_STATE)
typedef
enum
{
,
,
#if !defined(_KRPCENV_)
,
,
,
#endif
RpcNotificationTypeCallback
}
;
#if (NTDDI_VERSION >= NTDDI_VISTA)
typedef
enum
{
,
,
,
,
}
;
#else // (NTDDI_VERSION >= NTDDI_VISTA)
typedef
enum _RPC_ASYNC_EVENT {
RpcCallComplete,
RpcSendComplete,
RpcReceiveComplete,
RpcClientDisconnect
} RPC_ASYNC_EVENT;
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
struct
;
(
struct
*pAsync,
void
*Context,
Event);
typedef
*
PFN_RPCNOTIFICATION_ROUTINE
;
typedef
union
_RPC_ASYNC_NOTIFICATION_INFO
{
#if !defined(_KRPCENV_)
struct
{
PFN_RPCNOTIFICATION_ROUTINE
;
;
}
;
#if !defined(RPC_NO_WINDOWS_H) || defined (_WINBASE_)
struct
{
;
dwNumberOfBytesTransferred
;
;
;
}
;
#endif // !RPC_NO_WINDOWS_H || _WINBASE_
#if !defined(RPC_NO_WINDOWS_H)
struct
{
;
;
}
;
#endif // RPC_NO_WINDOWS_H
#endif // _KRPCENV_
#if !defined(_KRPCENV_)
;
#else // _KRPCENV_
//
// Notification by event
//
PKEVENT Event;
#endif // _KRPCENV_
PFN_RPCNOTIFICATION_ROUTINE
;
}
RPC_ASYNC_NOTIFICATION_INFO
, *
PRPC_ASYNC_NOTIFICATION_INFO
;
typedef
struct
{
unsigned
int
;
unsigned
long
;
long
;
unsigned
long
;
void
*
;
void
*
;
void
*
;
;
;
RPC_ASYNC_NOTIFICATION_INFO
;
[
4
];
}
, *
;
#define RPC_C_NOTIFY_ON_SEND_COMPLETE 0x1
#define RPC_C_INFINITE_TIMEOUT INFINITE
#define RpcAsyncGetCallHandle(pAsync) (((PRPC_ASYNC_STATE) pAsync)->RuntimeInfo)
#if !defined(_KRPCENV_)
_Must_inspect_result_
(
_In_ PRPC_ASYNC_STATE pAsync
) ;
#endif
_Must_inspect_result_
(
_Out_writes_bytes_(Size) PRPC_ASYNC_STATE pAsync,
);
_Must_inspect_result_
(
_In_ PRPC_ASYNC_STATE pAsync
) ;
_Must_inspect_result_
(
_Inout_ PRPC_ASYNC_STATE pAsync,
) ;
_Must_inspect_result_
(
_Inout_ PRPC_ASYNC_STATE pAsync,
_In_ unsigned long ExceptionCode
) ;
_Must_inspect_result_
(
_Inout_ PRPC_ASYNC_STATE pAsync,
) ;
#if (NTDDI_VERSION >= NTDDI_WINXP)
#if !defined(RPC_NO_WINDOWS_H) || defined(_KRPCENV_) || defined(_WINBASE_)
typedef
enum
tagExtendedErrorParamTypes
{
=
1
,
,
,
,
,
,
}
;
#define MaxNumberOfEEInfoParams 4
#define RPC_EEINFO_VERSION 1
typedef
struct
{
void
*
;
short
;
}
;
typedef
struct
{
;
union
{
;
;
long
;
short
;
;
;
}
;
}
;
#define EEInfoPreviousRecordsMissing 1
#define EEInfoNextRecordsMissing 2
#define EEInfoUseFileTime 4
#define EEInfoGCCOM 11
#if (NTDDI_VERSION >= NTDDI_WS03)
#define EEInfoGCFRS 12
#endif // (NTDDI_VERSION >= NTDDI_WS03)
typedef
struct
tagRPC_EXTENDED_ERROR_INFO
{
;
;
;
union
{
#if !defined(_KRPCENV_)
;
;
#else // _KRPCENV_
LARGE_INTEGER KernelTime;
#endif // _KRPCENV_
}
;
;
;
;
;
int
;
RPC_EE_INFO_PARAM Parameters[MaxNumberOfEEInfoParams];
}
;
typedef
struct
{
;
void
*
;
void
*
;
}
;
(
_Out_ RPC_ERROR_ENUM_HANDLE *EnumHandle
);
(
_In_ RPC_ERROR_ENUM_HANDLE *EnumHandle,
_Out_ RPC_EXTENDED_ERROR_INFO *ErrorInfo
);
(
_Inout_ RPC_ERROR_ENUM_HANDLE *EnumHandle
);
(
_Inout_ RPC_ERROR_ENUM_HANDLE *EnumHandle
);
RpcErrorGetNumberOfRecords
(
_In_ RPC_ERROR_ENUM_HANDLE *EnumHandle,
);
(
_In_ RPC_ERROR_ENUM_HANDLE *EnumHandle,
_Outptr_result_bytebuffer_(*BlobSize) PVOID *ErrorBlob,
);
(
_In_reads_bytes_(BlobSize) PVOID ErrorBlob,
_Out_ RPC_ERROR_ENUM_HANDLE *EnumHandle
);
(
_In_ RPC_EXTENDED_ERROR_INFO *ErrorInfo
);
void
(
void
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#endif // !RPC_NO_WINDOWS_H || _KRPCENV_ || _WINBASE_
#if !defined(_KRPCENV_)
(
);
RpcGetAuthorizationContextForClient
(
_In_opt_ RPC_BINDING_HANDLE ClientBinding,
_In_ BOOL ImpersonateOnReturn,
_In_opt_ PVOID Reserved1,
_In_opt_ PLARGE_INTEGER pExpirationTime,
_In_opt_ PVOID Reserved4,
_Out_ PVOID *pAuthzClientContext
);
RpcFreeAuthorizationContext
(
_Inout_ PVOID *pAuthzClientContext
);
RpcSsContextLockExclusive
(
_In_opt_ RPC_BINDING_HANDLE ServerBindingHandle,
);
(
_In_ RPC_BINDING_HANDLE ServerBindingHandle,
);
#if (NTDDI_VERSION >= NTDDI_VISTA)
typedef
enum
{
=
0
,
,
}
;
typedef
struct
_RPC_CALL_LOCAL_ADDRESS_V1
{
unsigned
int
;
void
*
;
unsigned
long
;
;
}
RPC_CALL_LOCAL_ADDRESS_V1
, *
PRPC_CALL_LOCAL_ADDRESS_V1
;
#if ( (NTDDI_VERSION >= NTDDI_VISTA) && (NTDDI_VERSION < NTDDI_WIN8) )
#define RPC_CALL_ATTRIBUTES_VERSION (2)
#endif // ( (NTDDI_VERSION >= NTDDI_VISTA) && (NTDDI_VERSION < NTDDI_WIN8) )
#define RPC_QUERY_SERVER_PRINCIPAL_NAME (0x02)
#define RPC_QUERY_CLIENT_PRINCIPAL_NAME (0x04)
#define RPC_QUERY_CALL_LOCAL_ADDRESS (0x08)
#define RPC_QUERY_CLIENT_PID (0x10)
#define RPC_QUERY_IS_CLIENT_LOCAL (0x20)
#define RPC_QUERY_NO_AUTH_REQUIRED (0x40)
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define RPC_CALL_ATTRIBUTES_VERSION (3)
#define RPC_QUERY_CLIENT_ID (0x80)
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
#if ( (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA) )
#define RPC_CALL_ATTRIBUTES_VERSION (1)
#define RPC_QUERY_SERVER_PRINCIPAL_NAME (2)
#define RPC_QUERY_CLIENT_PRINCIPAL_NAME (4)
#endif // ( (NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA) )
typedef
struct
tagRPC_CALL_ATTRIBUTES_V1_W
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
;
unsigned
long
;
;
}
;
typedef
struct
tagRPC_CALL_ATTRIBUTES_V1_A
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
;
unsigned
long
;
;
}
;
#if (NTDDI_VERSION >= NTDDI_VISTA)
#define RPC_CALL_STATUS_CANCELLED 0x01
#define RPC_CALL_STATUS_DISCONNECTED 0x02
typedef
enum
{
=
0
,
,
,
}
;
typedef
enum
{
=
0
,
,
,
rcclClientUnknownLocality
}
;
typedef
struct
tagRPC_CALL_ATTRIBUTES_V2_W
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
;
unsigned
long
;
;
;
unsigned
long
;
;
;
unsigned
long
;
;
RPC_CALL_LOCAL_ADDRESS_V1
*
;
unsigned
short
;
;
}
;
typedef
struct
tagRPC_CALL_ATTRIBUTES_V2_A
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
;
unsigned
long
;
;
;
unsigned
long
;
unsigned
long
;
;
unsigned
long
;
;
RPC_CALL_LOCAL_ADDRESS_V1
*
;
unsigned
short
;
;
}
;
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
struct
tagRPC_CALL_ATTRIBUTES_V3_W
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
short
*
;
unsigned
long
;
unsigned
long
;
;
;
unsigned
long
;
;
;
unsigned
long
;
;
RPC_CALL_LOCAL_ADDRESS_V1
*
;
unsigned
short
;
;
unsigned
long
ClientIdentifierBufferLength
;
unsigned
char
*
;
}
;
typedef
struct
tagRPC_CALL_ATTRIBUTES_V3_A
{
unsigned
int
;
unsigned
long
;
unsigned
long
ServerPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
ClientPrincipalNameBufferLength
;
unsigned
char
*
;
unsigned
long
;
unsigned
long
;
;
;
unsigned
long
;
unsigned
long
;
;
unsigned
long
;
;
RPC_CALL_LOCAL_ADDRESS_V1
*
;
unsigned
short
;
;
unsigned
long
ClientIdentifierBufferLength
;
unsigned
char
*
;
}
;
#endif // (NTDDI_VERSION >= NTDDI_WIN8)
RpcServerInqCallAttributesW
(
_In_opt_ RPC_BINDING_HANDLE ClientBinding,
_Inout_ void *RpcCallAttributes
);
RpcServerInqCallAttributesA
(
_In_opt_ RPC_BINDING_HANDLE ClientBinding,
_Inout_ void *RpcCallAttributes
);
#ifdef UNICODE
# define RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES_V1_W
#if (NTDDI_VERSION >= NTDDI_VISTA)
# define RPC_CALL_ATTRIBUTES_V2 RPC_CALL_ATTRIBUTES_V2_W
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WIN8)
# define RPC_CALL_ATTRIBUTES_V3 RPC_CALL_ATTRIBUTES_V3_W
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
# define RpcServerInqCallAttributes RpcServerInqCallAttributesW
#else
# define RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES_V1_A
#if (NTDDI_VERSION >= NTDDI_VISTA)
# define RPC_CALL_ATTRIBUTES_V2 RPC_CALL_ATTRIBUTES_V2_A
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_WIN8)
# define RPC_CALL_ATTRIBUTES_V3 RPC_CALL_ATTRIBUTES_V3_A
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
# define RpcServerInqCallAttributes RpcServerInqCallAttributesA
#endif // !UNICODE
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef RPC_CALL_ATTRIBUTES_V3 RPC_CALL_ATTRIBUTES;
#elif (NTDDI_VERSION >= NTDDI_VISTA)
typedef RPC_CALL_ATTRIBUTES_V2 RPC_CALL_ATTRIBUTES;
#else
typedef RPC_CALL_ATTRIBUTES_V1 RPC_CALL_ATTRIBUTES;
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#if (NTDDI_VERSION >= NTDDI_VISTA)
typedef
enum
{
=
0
,
RpcNotificationClientDisconnect
=
1
,
RpcNotificationCallCancel
=
2
}
;
#define RpcNotificationCallStatusChange RpcNotificationClientDisconnect
RpcServerSubscribeForNotification
(
_In_opt_ RPC_BINDING_HANDLE Binding,
_In_ RPC_NOTIFICATIONS Notification,
_In_ RPC_NOTIFICATION_TYPES NotificationType,
_In_ RPC_ASYNC_NOTIFICATION_INFO *NotificationInfo
RPC_ASYNC_NOTIFICATION_INFO
*
);
RpcServerUnsubscribeForNotification
(
_In_opt_ RPC_BINDING_HANDLE Binding,
_In_ RPC_NOTIFICATIONS Notification,
_Out_ unsigned long *NotificationsQueued
);
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#endif // _KRPCENV_
#if (NTDDI_VERSION >= NTDDI_VISTA)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
(
_In_opt_ PRPC_ASYNC_STATE pAsync,
_In_ RPC_BINDING_HANDLE Binding,
_In_ RPC_IF_HANDLE IfSpec
);
(
_In_ RPC_BINDING_HANDLE Binding
);
#endif // (NTDDI_VERSION >= NTDDI_VISTA)
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#endif // (NTDDI_VERSION >= NTDDI_WINXP)
_Must_inspect_result_
(
_In_ PRPC_MESSAGE Message,
_In_ PRPC_ASYNC_STATE pAsync
);
_Must_inspect_result_
(
_In_ PRPC_ASYNC_STATE pAsync,
_In_ unsigned long ExceptionCode
) ;
#if (NTDDI_VERSION >= NTDDI_WINXP)
int
(
_In_ unsigned long ExceptionCode
);
#endif // (NTDDI_VERSION >= NTDDI_WINXP)
#if (NTDDI_VERSION >= NTDDI_WIN7)
I_RpcBindingInqClientTokenAttributes
(
_In_ RPC_BINDING_HANDLE Binding,
_Out_opt_ LUID * TokenId,
_Out_opt_ LUID * AuthenticationId,
_Out_opt_ LUID * ModifiedId
);
#endif // (NTDDI_VERSION >= NTDDI_WIN7)
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#ifdef __cplusplus
}
#endif
#if defined(__RPC_WIN64__)
#include <poppack.h>
#endif
#endif /* __RPCASYNC_H__ */