' ########################################################################################
' Microsoft Windows
' File: RpcDceP.inc
' Contents: Private RPC runtime APIs for use by the stubs and by support libraries.
' Applications must not call these routines.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_RpcDceP_PBI)
#DEFINE PBX_RpcDceP_PBI
%EQUATE `RPCDCEP_INC = 1
' // Size = 4 bytes
TYPE RPC_VERSION WORD
 MajorVersion AS WORD ' unsigned short
 MinorVersion AS WORD ' unsigned short
END TYPE
' // Size = 20 bytes
TYPE RPC_SYNTAX_IDENTIFIER DWORD
 SyntaxGUID AS GUID
 SyntaxVersion AS RPC_VERSION
END TYPE
' // Size = 44 bytes
TYPE RPC_MESSAGE DWORD
 Handle AS DWORD ' RPC_BINDING_HANDLE
 DataRepresentation AS DWORD ' unsigned long
 Buffer AS DWORD ' void *
 BufferLength AS DWORD ' unsigned int
 ProcNum AS DWORD ' unsigned int
 TransferSyntax AS RPC_SYNTAX_IDENTIFIER PTR ' PRPC_SYNTAX_IDENTIFIER
 RpcInterfaceInformation AS DWORD ' void *
 ReservedForRuntime AS DWORD ' void *
 ManagerEpv AS DWORD ' RPC_MGR_EPV *
 ImportContext AS DWORD ' void *
 RpcFlags AS DWORD ' unsigned long
END TYPE
'typedef RPC_STATUS
'RPC_ENTRY RPC_FORWARD_FUNCTION(
' IN UUID * InterfaceId,
' IN RPC_VERSION * InterfaceVersion,
' IN UUID * ObjectId,
' IN unsigned char * Rpcpro,
' IN void * * ppDestEndpoint);
' RPC_ADDRESS_CHANGE_TYPE enum
%EQUATE `PROTOCOL_NOT_LOADED = 1
%EQUATE `PROTOCOL_LOADED = 2
%EQUATE `PROTOCOL_ADDRESS_CHANGE = 3
'typedef void
'RPC_ENTRY RPC_ADDRESS_CHANGE_FN(
' IN void * arg
' );
'/*
'* New context handle flavors.
'*/
'#define RPC_CONTEXT_HANDLE_DEFAULT_GUARD ((void *) -4083) /* FFFFF00D */
%EQUATE `RPC_CONTEXT_HANDLE_DEFAULT_GUARD = &HFFFFF00D
%EQUATE `RPC_CONTEXT_HANDLE_DEFAULT_FLAGS = &H00000000
%EQUATE `RPC_CONTEXT_HANDLE_FLAGS = &H30000000
%EQUATE `RPC_CONTEXT_HANDLE_SERIALIZE = &H10000000
%EQUATE `RPC_CONTEXT_HANDLE_DONT_SERIALIZE = &H20000000
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `RPC_TYPE_STRICT_CONTEXT_HANDLE = &H40000000
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
'/*
' * Types of function calls for datagram rpc
' */
%EQUATE `RPC_NCA_FLAGS_DEFAULT = &H00000000 ' /* 0b000...000 */
%EQUATE `RPC_NCA_FLAGS_IDEMPOTENT = &H00000001 ' /* 0b000...001 */
%EQUATE `RPC_NCA_FLAGS_BROADCAST = &H00000002 ' /* 0b000...010 */
%EQUATE `RPC_NCA_FLAGS_MAYBE = &H00000004 ' /* 0b000...100 */
'#if (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `RPCFLG_HAS_GUARANTEE = &H00000010
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `RPC_BUFFER_COMPLETE = &H00001000 ' /* used by pipes */
%EQUATE `RPC_BUFFER_PARTIAL = &H00002000 ' /* used by pipes */
%EQUATE `RPC_BUFFER_EXTRA = &H00004000 ' /* used by pipes */
%EQUATE `RPC_BUFFER_ASYNC = &H00008000 ' /* used by async rpc */
%EQUATE `RPC_BUFFER_NONOTIFY = &H00010000 ' /* used by async pipes */
%EQUATE `RPCFLG_MESSAGE = &H01000000
%EQUATE `RPCFLG_AUTO_COMPLETE = &H08000000
%EQUATE `RPCFLG_LOCAL_CALL = &H10000000
%EQUATE `RPCFLG_INPUT_SYNCHRONOUS = &H20000000
%EQUATE `RPCFLG_ASYNCHRONOUS = &H40000000
%EQUATE `RPCFLG_NON_NDR = &H80000000
'#if (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `RPCFLG_HAS_MULTI_SYNTAXES = &H02000000
%EQUATE `RPCFLG_HAS_CALLBACK = &H04000000
'#endif // (NTDDI_VERSION >= NTDDI_WXP)
'#if (NTDDI_VERSION >= NTDDI_VISTA)
'// These two bits will hold the combination of
'// anonymous/admin/authenticate/mixed mode
%EQUATE `RPCFLG_ACCESSIBILITY_BIT1 = &H00100000
%EQUATE `RPCFLG_ACCESSIBILITY_BIT2 = &H00200000
%EQUATE `RPCFLG_ACCESS_LOCAL = &H00400000
'// This goes to MIDL_STUB_DESC only
%EQUATE `NDR_CUSTOM_OR_DEFAULT_ALLOCATOR = &H10000000
%EQUATE `NDR_DEFAULT_ALLOCATOR = &H20000000
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `RPC_FLAGS_VALID_BIT = &H00008000
'typedef
'void
'(__RPC_STUB * RPC_DISPATCH_FUNCTION) (
' IN OUT PRPC_MESSAGE Message
' );
' // Size = 12 bytes
TYPE RPC_DISPATCH_TABLE DWORD
 DispatchTableCount AS DWORD ' unsigned int
 DispatchTable AS DWORD ' RPC_DISPATCH_FUNCTION *
 Reserved AS DWORD ' LONG_PTR
END TYPE
' // Size = 8 bytes
TYPE RPC_PROTSEQ_ENDPOINT DWORD
 RpcProtocolSequence AS DWORD ' unsigned char *
 Endpoint AS DWORD ' unsigned char *
END TYPE
'/*
'Both of these types MUST start with the InterfaceId and TransferSyntax.
'Look at RpcIfInqId and I_RpcIfInqTransferSyntaxes to see why.
'*/
%EQUATE `NT351_INTERFACE_SIZE = &H40
%EQUATE `RPC_INTERFACE_HAS_PIPES = &H0001
' // Size = 68 bytes
TYPE RPC_SERVER_INTERFACE DWORD
 Length AS DWORD ' unsigned int
 InterfaceId AS RPC_SYNTAX_IDENTIFIER
 TransferSyntax AS RPC_SYNTAX_IDENTIFIER
 DispatchTable AS DWORD ' PRPC_DISPATCH_TABLE
 RpcProtseqEndpointCount AS DWORD ' unsigned int
 RpcProtseqEndpoint AS RPC_PROTSEQ_ENDPOINT PTR ' PRPC_PROTSEQ_ENDPOINT
 DefaultManagerEpv AS DWORD ' RPC_MGR_EPV *
 InterpreterInfo AS DWORD ' void const *
 Flags AS DWORD ' unsigned int
END TYPE
' // Size = 68 bytes
TYPE RPC_CLIENT_INTERFACE DWORD
 Length AS DWORD ' unsigned int
 InterfaceId AS RPC_SYNTAX_IDENTIFIER
 TransferSyntax AS RPC_SYNTAX_IDENTIFIER
 DispatchTable AS DWORD ' PRPC_DISPATCH_TABLE
 RpcProtseqEndpointCount AS DWORD ' unsigned int
 RpcProtseqEndpoint AS RPC_PROTSEQ_ENDPOINT PTR ' PRPC_PROTSEQ_ENDPOINT
 Reserved AS DWORD ' ULONG_PTR
 InterpreterInfo AS DWORD ' void const *
 Flags AS DWORD ' unsigned int
END TYPE
'#if (NTDDI_VERSION >= NTDDI_WINXP)
DECLARE FUNCTION I_RpcNegotiateTransferSyntax LIB "rpcrt4.dll" ALIAS "I_RpcNegotiateTransferSyntax" ( BYREF Message AS RPC_MESSAGE ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
DECLARE FUNCTION I_RpcGetBuffer LIB "rpcrt4.dll" ALIAS "I_RpcGetBuffer" ( BYREF Message AS RPC_MESSAGE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcGetBufferWithObject LIB "rpcrt4.dll" ALIAS "I_RpcGetBufferWithObject" ( BYREF Message AS RPC_MESSAGE , BYREF ObjectUuid AS GUID ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcSendReceive LIB "rpcrt4.dll" ALIAS "I_RpcSendReceive" ( BYREF Message AS RPC_MESSAGE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcFreeBuffer LIB "rpcrt4.dll" ALIAS "I_RpcFreeBuffer" ( BYREF Message AS RPC_MESSAGE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcSend LIB "rpcrt4.dll" ALIAS "I_RpcSend" ( BYREF RPC_MESSAGE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcReceive LIB "rpcrt4.dll" ALIAS "I_RpcReceive" ( BYREF Message AS RPC_MESSAGE , BYVAL Size AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcFreePipeBuffer LIB "rpcrt4.dll" ALIAS "I_RpcFreePipeBuffer" ( BYREF Message AS RPC_MESSAGE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcReallocPipeBuffer LIB "rpcrt4.dll" ALIAS "I_RpcReallocPipeBuffer" ( BYREF Message AS RPC_MESSAGE , BYVAL NewSize AS QUAD ) AS LONG ' RPC_STATUS
'typedef void * I_RPC_MUTEX;
DECLARE SUB I_RpcRequestMutex LIB "rpcrt4.dll" ALIAS "I_RpcRequestMutex" ( BYREF Mutex AS QUAD ) ' void
DECLARE SUB I_RpcClearMutex LIB "rpcrt4.dll" ALIAS "I_RpcClearMutex" ( BYVAL Mutex AS QUAD ) ' void
DECLARE SUB I_RpcDeleteMutex LIB "rpcrt4.dll" ALIAS "I_RpcDeleteMutex" ( BYVAL Mutex AS QUAD ) ' void
DECLARE SUB I_RpcAllocate LIB "rpcrt4.dll" ALIAS "I_RpcAllocate" ( BYVAL Size AS QUAD ) ' void
DECLARE SUB I_RpcFree LIB "rpcrt4.dll" ALIAS "I_RpcFree" ( BYVAL Object AS QUAD ) ' void
DECLARE SUB I_RpcPauseExecution LIB "rpcrt4.dll" ALIAS "I_RpcPauseExecution" ( BYVAL Milliseconds AS QUAD ) ' void
DECLARE FUNCTION I_RpcGetExtendedError LIB "rpcrt4.dll" ALIAS "I_RpcGetExtendedError" ( ) AS LONG ' RPC_STATUS
'typedef
'void
'(__RPC_USER * PRPC_RUNDOWN) (
' void * AssociationContext
' );
' Not exported
'DECLARE SUB I_RpcMonitorAssociation LIB "rpcrt4.dll" ALIAS "I_RpcMonitorAssociation" ( ' BYVAL Handle AS DWORD
' , BYVAL RundownRoutine AS DWORD
' , BYVAL Context AS DWORD
' ) ' void
' Not exported
'DECLARE FUNCTION I_RpcStopMonitorAssociation LIB "rpcrt4.dll" ALIAS "I_RpcStopMonitorAssociation" ( ' BYVAL Handle AS DWORD
' ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcGetCurrentCallHandle LIB "rpcrt4.dll" ALIAS "I_RpcGetCurrentCallHandle" ( ) AS QUAD ' RPC_BINDING_HANDLE
' Not exported in Windows XP
DECLARE FUNCTION I_RpcGetAssociationContext LIB "rpcrt4.dll" ALIAS "I_RpcGetAssociationContext" ( BYVAL BindingHandle AS QUAD , BYREF AssociationContext AS QUAD ) AS LONG ' RPC_STATUS
' Not exported in Windows XP
DECLARE FUNCTION I_RpcGetServerContextList LIB "rpcrt4.dll" ALIAS "I_RpcGetServerContextList" ( BYVAL BindingHandle AS QUAD ) AS QUAD ' void *
' Not exported in Windows XP
DECLARE SUB I_RpcSetServerContextList LIB "rpcrt4.dll" ALIAS "I_RpcSetServerContextList" ( BYVAL BindingHandle AS QUAD , BYREF ServerContextList AS QUAD ) ' void
DECLARE FUNCTION I_RpcNsInterfaceExported LIB "rpcrt4.dll" ALIAS "I_RpcNsInterfaceExported" ( BYVAL EntryNameSyntax AS QUAD , BYREF EntryName AS WORD , BYREF RpcInterfaceInformation AS RPC_SERVER_INTERFACE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcNsInterfaceUnexported LIB "rpcrt4.dll" ALIAS "I_RpcNsInterfaceUnexported" ( BYVAL EntryNameSyntax AS QUAD , BYREF EntryName AS WORD , BYREF RpcInterfaceInformation AS RPC_SERVER_INTERFACE ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingToStaticStringBindingW LIB "rpcrt4.dll" ALIAS "I_RpcBindingToStaticStringBindingW" ( BYVAL Binding AS QUAD , BYREF StringBinding AS WORD ) AS LONG ' RPC_STATUS
MACRO I_RpcBindingToStaticStringBinding = I_RpcBindingToStaticStringBindingW
DECLARE FUNCTION I_RpcBindingInqSecurityContext LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqSecurityContext" ( BYVAL Binding AS QUAD , BYREF SecurityContextHandle AS QUAD ) AS LONG ' RPC_STATUS
'#if (NTDDI_VERSION >= NTDDI_VISTA)
DECLARE FUNCTION I_RpcBindingInqSecurityContextKeyInfo LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqSecurityContextKeyInfo" ( BYVAL Binding AS QUAD , BYREF KeyInfo AS ANY ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
DECLARE FUNCTION I_RpcBindingInqWireIdForSnego LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqWireIdForSnego" ( BYVAL Binding AS QUAD , BYREF WireId AS ASCIIZ ) AS LONG ' RPC_STATUS
'#if (NTDDI_VERSION >= NTDDI_WS03)
' Not exported in Windows XP
DECLARE FUNCTION I_RpcBindingInqMarshalledTargetInfo LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqMarshalledTargetInfo" ( BYVAL Binding AS QUAD , BYREF MarshalledTargetInfoLength AS QUAD , BYREF MarshalledTargetInfo AS ASCIIZ ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#if (NTDDI_VERSION >= WINXP)
DECLARE FUNCTION I_RpcBindingInqLocalClientPID LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqLocalClientPID" ( BYVAL Binding AS QUAD , BYREF Pid AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingHandleToAsyncHandle LIB "rpcrt4.dll" ALIAS "I_RpcBindingHandleToAsyncHandle" ( BYVAL Binding AS QUAD , BYREF AsyncHandle AS QUAD ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= WINXP)
DECLARE FUNCTION I_RpcNsBindingSetEntryNameA LIB "rpcrt4.dll" ALIAS "I_RpcNsBindingSetEntryNameA" ( BYVAL Binding AS QUAD , BYVAL EntryNameSyntax AS QUAD , BYREF EntryName AS ASCIIZ ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcNsBindingSetEntryNameW LIB "rpcrt4.dll" ALIAS "I_RpcNsBindingSetEntryNameW" ( BYVAL Binding AS QUAD , BYVAL EntryNameSyntax AS QUAD , BYREF EntryName AS WSTRINGZ ) AS LONG ' RPC_STATUS
#IF %DEF(%UNICODE)
 MACRO I_RpcNsBindingSetEntryName = I_RpcNsBindingSetEntryNameW
#ELSE
 MACRO I_RpcNsBindingSetEntryName = I_RpcNsBindingSetEntryNameA
#ENDIF
DECLARE FUNCTION I_RpcServerUseProtseqEp2A LIB "rpcrt4.dll" ALIAS "I_RpcServerUseProtseqEp2A" ( BYREF NetworkAddress AS ASCIIZ , BYREF Protseq AS ASCIIZ , BYVAL MaxCalls AS QUAD , BYREF Endpoint AS ASCIIZ , BYVAL SecurityDescriptor AS QUAD , BYVAL Policy AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcServerUseProtseqEp2W LIB "rpcrt4.dll" ALIAS "I_RpcServerUseProtseqEp2W" ( BYREF NetworkAddress AS WSTRINGZ , BYREF Protseq AS WSTRINGZ , BYVAL MaxCalls AS QUAD , BYREF Endpoint AS WSTRINGZ , BYVAL SecurityDescriptor AS QUAD , BYVAL Policy AS QUAD ) AS LONG ' RPC_STATUS
#IF %DEF(%UNICODE)
 MACRO I_RpcServerUseProtseqEp2 = I_RpcServerUseProtseqEp2W
#ELSE
 MACRO I_RpcServerUseProtseqEp2 = I_RpcServerUseProtseqEp2A
#ENDIF
DECLARE FUNCTION I_RpcServerUseProtseq2A LIB "rpcrt4.dll" ALIAS "I_RpcServerUseProtseq2A" ( BYREF NetworkAddress AS ASCIIZ , BYREF Protseq AS ASCIIZ , BYVAL MaxCalls AS QUAD , BYVAL SecurityDescriptor AS QUAD , BYVAL Policy AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcServerUseProtseq2W LIB "rpcrt4.dll" ALIAS "I_RpcServerUseProtseq2W" ( BYREF NetworkAddress AS WSTRINGZ , BYREF Protseq AS WSTRINGZ , BYVAL MaxCalls AS QUAD , BYVAL SecurityDescriptor AS QUAD , BYVAL Policy AS QUAD ) AS LONG ' RPC_STATUS
#IF %DEF(%UNICODE)
 MACRO I_RpcServerUseProtseq2 = I_RpcServerUseProtseq2W
#ELSE
 MACRO I_RpcServerUseProtseq2 = I_RpcServerUseProtseq2A
#ENDIF
DECLARE FUNCTION I_RpcServerStartService LIB "rpcrt4.dll" ALIAS "I_RpcServerStartService" ( BYREF Protseq AS WSTRINGZ , BYREF Endpoint AS WSTRINGZ , BYVAL IfSpec AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingInqDynamicEndpointA LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqDynamicEndpointA" ( BYVAL Binding AS QUAD , BYREF DynamicEndpoint AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingInqDynamicEndpointW LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqDynamicEndpointW" ( BYVAL Binding AS QUAD , BYREF DynamicEndpoint AS QUAD ) AS LONG ' RPC_STATUS
#IF %DEF(%UNICODE)
 MACRO I_RpcBindingInqDynamicEndpoint = I_RpcBindingInqDynamicEndpointW
#ELSE
 MACRO I_RpcBindingInqDynamicEndpoint = I_RpcBindingInqDynamicEndpointA
#ENDIF
'#if (NTDDI_VERSION >= NTDDI_WINXP)
DECLARE FUNCTION I_RpcServerCheckClientRestriction LIB "rpcrt4.dll" ALIAS "I_RpcServerCheckClientRestriction" ( BYVAL Context AS QUAD ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
%EQUATE `TRANSPORT_TYPE_CN = &H01
%EQUATE `TRANSPORT_TYPE_DG = &H02
%EQUATE `TRANSPORT_TYPE_LPC = &H04
%EQUATE `TRANSPORT_TYPE_WMSG = &H08
DECLARE FUNCTION I_RpcBindingInqTransportType LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqTransportType" ( BYVAL Binding AS QUAD , BYREF Type AS QUAD ) AS LONG ' RPC_STATUS
' // Size = 20 bytes
TYPE RPC_TRANSFER_SYNTAX WORD
 Uuid AS GUID ' UUID
 VersMajor AS WORD ' unsigned short
 VersMinor AS WORD ' unsigned short
END TYPE
DECLARE FUNCTION I_RpcIfInqTransferSyntaxes LIB "rpcrt4.dll" ALIAS "I_RpcIfInqTransferSyntaxes" ( BYVAL RpcIfHandle AS QUAD , BYREF TransferSyntaxes AS RPC_TRANSFER_SYNTAX , BYVAL TransferSyntaxSize AS QUAD , BYREF TransferSyntaxCount AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_UuidCreate LIB "rpcrt4.dll" ALIAS "I_UuidCreate" ( BYREF Uuid AS GUID ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingCopy LIB "rpcrt4.dll" ALIAS "I_RpcBindingCopy" ( BYVAL SourceBinding AS QUAD , BYREF DestinationBinding AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingIsClientLocal LIB "rpcrt4.dll" ALIAS "I_RpcBindingIsClientLocal" ( BYVAL BindingHandle AS QUAD , BYREF ClientLocalFlag AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingInqConnId LIB "rpcrt4.dll" ALIAS "I_RpcBindingInqConnId" ( BYVAL Binding AS QUAD , BYREF ConnId AS QUAD , BYREF pfFirstCall AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcBindingCreateNP LIB "rpcrt4.dll" ALIAS "I_RpcBindingCreateNP" ( BYREF ServerName AS WSTRINGZ , BYREF ServiceName AS WSTRINGZ , BYREF NetworkOptions AS WSTRINGZ , BYREF Binding AS QUAD ) AS LONG ' RPC_STATUS
' Not exported in Windows XP
DECLARE SUB I_RpcSsDontSerializeContext LIB "rpcrt4.dll" ALIAS "I_RpcSsDontSerializeContext" () ' void
' Not exported in Windows XP
DECLARE FUNCTION I_RpcLaunchDatagramReceiveThread LIB "rpcrt4.dll" ALIAS "I_RpcLaunchDatagramReceiveThread" ( BYVAL pAddress AS QUAD ' void * pAddress ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcServerRegisterForwardFunction LIB "rpcrt4.dll" ALIAS "I_RpcServerRegisterForwardFunction" ( BYVAL pForwardFunction AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcServerInqAddressChangeFn LIB "rpcrt4.dll" ALIAS "I_RpcServerInqAddressChangeFn" ( ) AS QUAD ' RPC_ADDRESS_CHANGE_FN *
DECLARE FUNCTION I_RpcServerSetAddressChangeFn LIB "rpcrt4.dll" ALIAS "I_RpcServerSetAddressChangeFn" ( BYVAL pAddressChangeFn AS QUAD ) AS LONG ' RPC_STATUS
'#if (NTDDI_VERSION >= WINXP)
'/* The return buffer will contain SOCKADDR_IN for IPv4 */
%EQUATE `RPC_P_ADDR_FORMAT_TCP_IPV4 = 1
'/* The return buffer will contain SOCKADDR_STORAGE for IPv6 */
%EQUATE `RPC_P_ADDR_FORMAT_TCP_IPV6 = 2
DECLARE FUNCTION I_RpcServerInqLocalConnAddress LIB "rpcrt4.dll" ALIAS "I_RpcServerInqLocalConnAddress" ( BYVAL Binding AS QUAD , BYREF Buffer AS ANY , BYREF BufferSize AS QUAD , BYREF AddressFormat AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcServerInqRemoteConnAddress LIB "rpcrt4.dll" ALIAS "I_RpcServerInqRemoteConnAddress" ( BYVAL Binding AS QUAD , BYREF Buffer AS ANY , BYREF BufferSize AS QUAD , BYREF AddressFormat AS QUAD ) AS LONG ' RPC_STATUS
DECLARE SUB I_RpcSessionStrictContextHandle LIB "rpcrt4.dll" ALIAS "I_RpcSessionStrictContextHandle" () ' void
DECLARE FUNCTION I_RpcTurnOnEEInfoPropagation LIB "rpcrt4.dll" ALIAS "I_RpcTurnOnEEInfoPropagation" ( ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
DECLARE FUNCTION I_RpcConnectionInqSockBuffSize LIB "rpcrt4.dll" ALIAS "I_RpcConnectionInqSockBuffSize" ( BYREF RecvBuffSize AS QUAD , BYREF SendBuffSize AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcConnectionSetSockBuffSize LIB "rpcrt4.dll" ALIAS "I_RpcConnectionSetSockBuffSize" ( BYVAL RecvBuffSize AS QUAD , BYVAL SendBuffSize AS QUAD ) AS LONG ' RPC_STATUS
'typedef
'void
'(*RPCLT_PDU_FILTER_FUNC) (
' IN void *Buffer,
' IN unsigned int BufferLength,
' IN int fDatagram
' );
'typedef
'void
'(__cdecl *RPC_SETFILTER_FUNC) (
' IN RPCLT_PDU_FILTER_FUNC pfnFilter
' );
'#ifndef WINNT
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcServerStartListening(
' void * hWnd
' ) ;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcServerStopListening(
' ) ;
'typedef RPC_STATUS (*RPC_BLOCKING_FN) (
' IN void * hWnd,
' IN void * Context,
' IN OPTIONAL void * hSyncEvent
' ) ;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcBindingSetAsync(
' IN RPC_BINDING_HANDLE Binding,
' IN RPC_BLOCKING_FN BlockingFn,
' IN unsigned long ServerTid
' ) ;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcSetThreadParams(
' IN int fClientFree,
' IN OPTIONAL void *Context,
' IN OPTIONAL void * hWndClient
' );
'RPCRTAPI
'unsigned int
'RPC_ENTRY
'I_RpcWindowProc(
' IN void * hWnd,
' IN unsigned int Message,
' IN unsigned int wParam,
' IN unsigned long lParam
' ) ;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcServerUnregisterEndpointA (
' );
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcServerUnregisterEndpointW (
' );
'#endif // WINNT
DECLARE FUNCTION I_RpcServerInqTransportType LIB "rpcrt4.dll" ALIAS "I_RpcServerInqTransportType" ( BYREF Type AS QUAD ) AS LONG ' RPC_STATUS
DECLARE FUNCTION I_RpcMapWin32Status LIB "rpcrt4.dll" ALIAS "I_RpcMapWin32Status" ( BYVAL Status AS QUAD ) AS LONG ' long
'#if (NTDDI_VERSION >= NTDDI_WS03)
%EQUATE `RPC_C_OPT_SESSION_ID = 6
%EQUATE `RPC_C_OPT_COOKIE_AUTH = 7
%EQUATE `RPC_C_OPT_RESOURCE_TYPE_UUID = 8
' // Size = 8 bytes
TYPE RPC_C_OPT_COOKIE_AUTH_DESCRIPTOR DWORD
 BufferSize AS DWORD ' unsigned long // Length of the buffer in bytes
 Buffer AS ASCIIZ PTR ' char *// Zero-terminated string
END TYPE
'typedef struct _RDR_CALLOUT_STATE
'{
' // LastError is used for debugging only - don't use it for processing
' RPC_STATUS LastError;
' void *LastEEInfo;
' RPC_HTTP_REDIRECTOR_STAGE LastCalledStage;
' // the information accumulated throughout the stages
' unsigned short *ServerName; // Allocated with MemAllocate
' unsigned short *ServerPort; // Allocated with MemAllocate
' unsigned short *RemoteUser; // Allocated with MemAllocate
' unsigned short *AuthType; // Allocated with MemAllocate
' unsigned char ResourceTypePresent;
' unsigned char SessionIdPresent;
' unsigned char InterfacePresent;
' UUID ResourceType;
' UUID SessionId;
' RPC_SYNTAX_IDENTIFIER Interface;
' void *CertContext; // Contains PCCERT_CONTEXT if cert is used for authentication.
' // NULL otherwise. If allocated, CertFreeCertificateContext
' // needs to be called on it when done
'} RDR_CALLOUT_STATE;
' // Size = 88 bytes
TYPE RDR_CALLOUT_STATE DWORD FILL
 LastError AS DWORD ' RPC_STATUS
 LastEEInfo AS DWORD ' void *
 LastCalledStage AS LONG ' RPC_HTTP_REDIRECTOR_STAGE enum
 ServerName AS WSTRINGZ PTR ' unsigned short * // Allocated with MemAllocate
 ServerPort AS WSTRINGZ PTR ' unsigned short * // Allocated with MemAllocate
 RemoteUser AS WSTRINGZ PTR ' unsigned short * // Allocated with MemAllocate
 AuthType AS WSTRINGZ PTR ' unsigned short * // Allocated with MemAllocate
 ResourceTypePresent AS BYTE ' unsigned char
 SessionIdPresent AS BYTE ' unsigned char
 InterfacePresent AS BYTE ' unsigned char
 ResourceType AS GUID ' UUID
 SessionId AS GUID ' UUID
 Interface AS RPC_SYNTAX_IDENTIFIER
 CertContext AS DWORD ' void * // Contains PCCERT_CONTEXT if cert is used for authentication.
END TYPE
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#if (NTDDI_VERSION >= NTDDI_WINXP)
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcProxyIsValidMachineFn)
' (
' );
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcProxyGetClientAddressFn)
' (
' IN void *Context,
' OUT char *Buffer,
' OUT unsigned long *BufferLength
' );
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcProxyGetConnectionTimeoutFn)
' (
' OUT unsigned long *ConnectionTimeout
' );
'#if (NTDDI_VERSION >= NTDDI_WS03)
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcPerformCalloutFn)
' (
' IN void *Context,
' IN RDR_CALLOUT_STATE *CallOutState,
' IN RPC_HTTP_REDIRECTOR_STAGE Stage
' );
'typedef void
'(RPC_ENTRY *I_RpcFreeCalloutStateFn)
' (
' IN RDR_CALLOUT_STATE *CallOutState
' );
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcProxyGetClientSessionAndResourceUUID)
' (
' );
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#if (NTDDI_VERSION >= NTDDI_VISTA)
'typedef RPC_STATUS
'(RPC_ENTRY *I_RpcProxyFilterIfFn)
' (
' );
' enum RpcPerfCounters alias RpcProxyPerfCounters
%EQUATE `RpcCurrentUniqueUser = 1 ' //Current Number of Unique Users
%EQUATE `RpcBackEndConnectionAttempts = 2 ' // Number of Back-End Connection Attempts per Second
%EQUATE `RpcBackEndConnectionFailed = 3 ' // Number of Failed Back-End Connection Attempts per Second
%EQUATE `RpcRequestsPerSecond = 4 ' // RPC/HTTP Requests per Second
%EQUATE `RpcIncomingConnections = 5 ' // Current Number of Incoming RPC over HTTP Connections
%EQUATE `RpcIncomingBandwidth = 6 ' // Total Incoming Bandwidth from Back-End Servers
%EQUATE `RpcOutgoingBandwidth = 7 ' // Total Outgoing Bandwidth to Back-End Servers
%EQUATE `RpcAttemptedLbsDecisions = 8 ' // Attempted RPC Load Balancing Decisions per Second
%EQUATE `RpcFailedLbsDecisions = 9 ' // Failed RPC Load Balancing Decisions per Second
%EQUATE `RpcAttemptedLbsMessages = 10 ' // Attempted RPC Load Balancing Broker Requests per Second
%EQUATE `RpcFailedLbsMessages = 11 ' // Failed RPC Load Balancing Broker Requests per Second
%EQUATE `RpcLastCounter = 12
'typedef void
'(RPC_ENTRY *I_RpcProxyUpdatePerfCounterFn)
' (
' );
' typedef void
'(RPC_ENTRY *I_RpcProxyUpdatePerfCounterBackendServerFn)
' (
' );
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
%EQUATE `RPC_PROXY_CONNECTION_TYPE_IN_PROXY = 0
%EQUATE `RPC_PROXY_CONNECTION_TYPE_OUT_PROXY = 1
'#if (NTDDI_VERSION >= NTDDI_WS03)
'typedef struct tagI_RpcProxyCallbackInterface
'{
' I_RpcProxyIsValidMachineFn IsValidMachineFn;
' I_RpcProxyGetClientAddressFn GetClientAddressFn;
' I_RpcProxyGetConnectionTimeoutFn GetConnectionTimeoutFn;
' I_RpcPerformCalloutFn PerformCalloutFn;
' I_RpcFreeCalloutStateFn FreeCalloutStateFn;
' I_RpcProxyGetClientSessionAndResourceUUID GetClientSessionAndResourceUUIDFn;
'#if (NTDDI_VERSION >= NTDDI_VISTA)
' I_RpcProxyFilterIfFn ProxyFilterIfFn;
' I_RpcProxyUpdatePerfCounterFn RpcProxyUpdatePerfCounterFn;
' I_RpcProxyUpdatePerfCounterBackendServerFn RpcProxyUpdatePerfCounterBackendServerFn;
'#endif // (NTDDI_VERSION >= NTDDI_VISTA)
'} I_RpcProxyCallbackInterface;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcProxyNewConnection (
' IN unsigned long ConnectionType,
' IN unsigned short *ServerAddress,
' IN unsigned short *ServerPort,
' IN unsigned short *MinConnTimeout,
' IN void *ConnectionParameter,
' IN OPTIONAL RDR_CALLOUT_STATE *CallOutState,
' IN I_RpcProxyCallbackInterface *ProxyCallbackInterface
' );
'#else
'typedef struct tagI_RpcProxyCallbackInterface
'{
' I_RpcProxyIsValidMachineFn IsValidMachineFn;
' I_RpcProxyGetClientAddressFn GetClientAddressFn;
' I_RpcProxyGetConnectionTimeoutFn GetConnectionTimeoutFn;
'} I_RpcProxyCallbackInterface;
'RPCRTAPI
'RPC_STATUS
'RPC_ENTRY
'I_RpcProxyNewConnection (
' IN unsigned long ConnectionType,
' IN unsigned short *ServerAddress,
' IN unsigned short *ServerPort,
' IN void *ConnectionParameter,
' IN I_RpcProxyCallbackInterface *ProxyCallbackInterface
' );
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#endif // (NTDDI_VERSION >= NTDDI_WINXP)
'#if (NTDDI_VERSION >= NTDDI_WS03)
' Not exported in Windows XP
DECLARE FUNCTION I_RpcReplyToClientWithStatus LIB "rpcrt4.dll" ALIAS "I_RpcReplyToClientWithStatus" ( BYVAL ConnectionParameter AS QUAD , BYVAL RpcStatus AS QUAD ) AS LONG ' RPC_STATUS
' Not exported in Windows XP
DECLARE FUNCTION I_RpcRecordCalloutFailure LIB "rpcrt4.dll" ALIAS "I_RpcRecordCalloutFailure" ( BYVAL RpcStatus AS QUAD , BYREF CallOutState AS RDR_CALLOUT_STATE , BYVAL DllName AS QUAD ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WS03)
'#if (NTDDI_VERSION >= NTDDI_WIN7)
DECLARE FUNCTION I_RpcMgmtEnableDedicatedThreadPool LIB "rpcrt4.dll" ALIAS "I_RpcMgmtEnableDedicatedThreadPool" ( ) AS LONG ' RPC_STATUS
'#endif // (NTDDI_VERSION >= NTDDI_WIN7)
#ENDIF
