ReactOS  0.4.13-dev-92-gf251225
ctx.h File Reference
#include "rpc.h"
#include "rpcndr.h"
Include dependency graph for ctx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __REQUIRED_RPCNDR_H_VERSION__   440
 
#define __hello_INTERFACE_DEFINED__
 

Typedefs

typedef long CTXTYPE
 
typedef CTXTYPE __RPC_FARPCTXTYPE
 

Functions

void __RPC_FAR *__RPC_USER MIDL_user_allocate (size_t)
 
void __RPC_USER MIDL_user_free (void __RPC_FAR *)
 
void CtxOpen (PCTXTYPE __RPC_FAR *pphContext, long Value)
 
void CtxHello (PCTXTYPE phContext)
 
void CtxClose (PCTXTYPE __RPC_FAR *pphContext)
 
void __RPC_USER PCTXTYPE_rundown (PCTXTYPE)
 

Variables

handle_t hBinding
 
RPC_IF_HANDLE hello_v1_0_c_ifspec
 
RPC_IF_HANDLE hello_v1_0_s_ifspec
 

Macro Definition Documentation

◆ __hello_INTERFACE_DEFINED__

#define __hello_INTERFACE_DEFINED__

Definition at line 41 of file ctx.h.

◆ __REQUIRED_RPCNDR_H_VERSION__

#define __REQUIRED_RPCNDR_H_VERSION__   440

Definition at line 22 of file ctx.h.

Typedef Documentation

◆ CTXTYPE

typedef long CTXTYPE

Definition at line 46 of file ctx.h.

◆ PCTXTYPE

Definition at line 48 of file ctx.h.

Function Documentation

◆ CtxClose()

void CtxClose ( PCTXTYPE __RPC_FAR pphContext)

Definition at line 179 of file ctx_c.c.

181 {
182 
183  RPC_BINDING_HANDLE _Handle = 0;
184 
185  RPC_MESSAGE _RpcMessage;
186 
187  MIDL_STUB_MESSAGE _StubMsg;
188 
189  if(!pphContext)
190  {
192  }
194  {
196  ( PRPC_MESSAGE )&_RpcMessage,
197  ( PMIDL_STUB_MESSAGE )&_StubMsg,
199  2);
200 
201 
202  if(*pphContext != 0)
203  {
204  _Handle = NDRCContextBinding(( NDR_CCONTEXT )*pphContext);;
205 
206  }
207 
208  _StubMsg.BufferLength = 20U;
209  NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
210 
212  ( PMIDL_STUB_MESSAGE )&_StubMsg,
213  ( NDR_CCONTEXT )*pphContext,
214  0);
215  NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
216 
217  if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
219 
221  ( PMIDL_STUB_MESSAGE )&_StubMsg,
222  ( NDR_CCONTEXT __RPC_FAR * )pphContext,
223  _Handle);
224 
225  }
226  RpcFinally
227  {
228  NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
229 
230  }
232 
233 }
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:189
#define U(x)
Definition: wordpad.c:44
unsigned char * Buffer
Definition: rpcndr.h:203
void WINAPI NdrConvert(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define RpcFinally
Definition: rpc.h:130
#define RpcTryFinally
Definition: rpc.h:129
RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext)
#define RpcEndFinally
Definition: rpc.h:131
#define __RPC_FAR
Definition: rpc.h:56
void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck)
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
ULONG BufferLength
Definition: rpcndr.h:207
const MIDL_STUB_DESC hello_StubDesc
Definition: ctx_c.c:236
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
void WINAPI NdrFreeBuffer(PMIDL_STUB_MESSAGE pStubMsg)
unsigned char *WINAPI NdrGetBuffer(PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle)
unsigned char *WINAPI NdrSendReceive(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer)
void WINAPI NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum)
ULONG DataRepresentation
Definition: rpcdcep.h:39
void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT *pContextHandle, RPC_BINDING_HANDLE BindHandle)
unsigned char Format[PROC_FORMAT_STRING_SIZE]
Definition: client.c:20
const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString
Definition: ctx_c.c:264

Referenced by hello_CtxClose().

◆ CtxHello()

void CtxHello ( PCTXTYPE  phContext)

Definition at line 130 of file ctx_c.c.

132 {
133 
134  RPC_BINDING_HANDLE _Handle = 0;
135 
136  RPC_MESSAGE _RpcMessage;
137 
138  MIDL_STUB_MESSAGE _StubMsg;
139 
141  {
143  ( PRPC_MESSAGE )&_RpcMessage,
144  ( PMIDL_STUB_MESSAGE )&_StubMsg,
146  1);
147 
148 
149  if(phContext != 0)
150  {
151  _Handle = NDRCContextBinding(( NDR_CCONTEXT )phContext);;
152 
153  }
154  else
155  {
157  }
158 
159  _StubMsg.BufferLength = 20U;
160  NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
161 
163  ( PMIDL_STUB_MESSAGE )&_StubMsg,
164  ( NDR_CCONTEXT )phContext,
165  1);
166  NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
167 
168  }
169  RpcFinally
170  {
171  NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
172 
173  }
175 
176 }
#define RPC_X_SS_IN_NULL_CONTEXT
Definition: winerror.h:1083
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:189
#define U(x)
Definition: wordpad.c:44
unsigned char * Buffer
Definition: rpcndr.h:203
#define RpcFinally
Definition: rpc.h:130
#define RpcTryFinally
Definition: rpc.h:129
RPC_BINDING_HANDLE WINAPI NDRCContextBinding(NDR_CCONTEXT CContext)
#define RpcEndFinally
Definition: rpc.h:131
#define __RPC_FAR
Definition: rpc.h:56
void WINAPI NdrClientContextMarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT ContextHandle, int fCheck)
ULONG BufferLength
Definition: rpcndr.h:207
const MIDL_STUB_DESC hello_StubDesc
Definition: ctx_c.c:236
void WINAPI NdrFreeBuffer(PMIDL_STUB_MESSAGE pStubMsg)
unsigned char *WINAPI NdrGetBuffer(PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle)
unsigned char *WINAPI NdrSendReceive(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer)
void WINAPI NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum)

Referenced by hello_CtxHello().

◆ CtxOpen()

void CtxOpen ( PCTXTYPE __RPC_FAR pphContext,
long  Value 
)

Definition at line 76 of file ctx_c.c.

79 {
80 
81  RPC_BINDING_HANDLE _Handle = 0;
82 
83  RPC_MESSAGE _RpcMessage;
84 
85  MIDL_STUB_MESSAGE _StubMsg;
86 
87  if(!pphContext)
88  {
90  }
92  {
94  ( PRPC_MESSAGE )&_RpcMessage,
95  ( PMIDL_STUB_MESSAGE )&_StubMsg,
97  0);
98 
99 
100  _Handle = hBinding;
101 
102 
103  _StubMsg.BufferLength = 4U;
104  NdrGetBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg, _StubMsg.BufferLength, _Handle );
105 
106  *(( long __RPC_FAR * )_StubMsg.Buffer)++ = Value;
107 
108  NdrSendReceive( (PMIDL_STUB_MESSAGE) &_StubMsg, (unsigned char __RPC_FAR *) _StubMsg.Buffer );
109 
110  if ( (_RpcMessage.DataRepresentation & 0X0000FFFFUL) != NDR_LOCAL_DATA_REPRESENTATION )
112 
113  *pphContext = (void *)0;
115  ( PMIDL_STUB_MESSAGE )&_StubMsg,
116  ( NDR_CCONTEXT __RPC_FAR * )pphContext,
117  _Handle);
118 
119  }
120  RpcFinally
121  {
122  NdrFreeBuffer( (PMIDL_STUB_MESSAGE) &_StubMsg );
123 
124  }
126 
127 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2327
#define RPC_X_NULL_REF_POINTER
Definition: winerror.h:1087
void DECLSPEC_NORETURN WINAPI RpcRaiseException(RPC_STATUS exception)
Definition: rpcrt4_main.c:189
#define U(x)
Definition: wordpad.c:44
unsigned char * Buffer
Definition: rpcndr.h:203
void WINAPI NdrConvert(PMIDL_STUB_MESSAGE pStubMsg, PFORMAT_STRING pFormat)
#define RpcFinally
Definition: rpc.h:130
#define RpcTryFinally
Definition: rpc.h:129
#define RpcEndFinally
Definition: rpc.h:131
#define __RPC_FAR
Definition: rpc.h:56
const unsigned char * PFORMAT_STRING
Definition: rpcndr.h:176
ULONG BufferLength
Definition: rpcndr.h:207
const MIDL_STUB_DESC hello_StubDesc
Definition: ctx_c.c:236
#define NDR_LOCAL_DATA_REPRESENTATION
Definition: rpcndr.h:107
void WINAPI NdrFreeBuffer(PMIDL_STUB_MESSAGE pStubMsg)
unsigned char *WINAPI NdrGetBuffer(PMIDL_STUB_MESSAGE stubmsg, ULONG buflen, RPC_BINDING_HANDLE handle)
handle_t hBinding
Definition: ctx_c.c:54
unsigned char *WINAPI NdrSendReceive(PMIDL_STUB_MESSAGE stubmsg, unsigned char *buffer)
void WINAPI NdrClientInitializeNew(PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE pStubMsg, PMIDL_STUB_DESC pStubDesc, unsigned int ProcNum)
ULONG DataRepresentation
Definition: rpcdcep.h:39
void WINAPI NdrClientContextUnmarshall(PMIDL_STUB_MESSAGE pStubMsg, NDR_CCONTEXT *pContextHandle, RPC_BINDING_HANDLE BindHandle)
unsigned char Format[PROC_FORMAT_STRING_SIZE]
Definition: client.c:20
const MIDL_PROC_FORMAT_STRING __MIDL_ProcFormatString
Definition: ctx_c.c:264

Referenced by hello_CtxOpen(), and main().

◆ MIDL_user_allocate()

void __RPC_FAR* __RPC_USER MIDL_user_allocate ( size_t  )

Definition at line 371 of file irotp.c.

372 {
373  return HeapAlloc(GetProcessHeap(), 0, size);
374 }
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)

◆ MIDL_user_free()

void __RPC_USER MIDL_user_free ( void __RPC_FAR )

Definition at line 62 of file rpcserver.c.

63 {
65 }
static PVOID ptr
Definition: dispmode.c:27
#define GetProcessHeap()
Definition: compat.h:395
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ PCTXTYPE_rundown()

void __RPC_USER PCTXTYPE_rundown ( PCTXTYPE  )

Definition at line 62 of file server.c.

64 {
65  PCTXTYPE pCtx = (PCTXTYPE)hContext;
66  printf("Context rundown: Value=%d \n", *pCtx);
67  midl_user_free(hContext);
68 }
CTXTYPE __RPC_FAR * PCTXTYPE
Definition: ctx.h:48
#define printf
Definition: config.h:203
void __RPC_USER midl_user_free(void __RPC_FAR *ptr)
Definition: server.c:75

Referenced by hello_CtxClose(), and hello_CtxOpen().

Variable Documentation

◆ hBinding

handle_t hBinding

Definition at line 54 of file ctx_c.c.

Referenced by ATSVC_HANDLE_bind(), ATSVC_HANDLE_unbind(), BROWSER_IDENTIFY_HANDLE_bind(), BROWSER_IDENTIFY_HANDLE_unbind(), client_free_handle(), CtxOpen(), DsRoleGetPrimaryDomainInformation(), DsRolerGetPrimaryDomainInformation(), DsSetupBind(), DsSetupUnbind(), EVENTLOG_HANDLE_A_bind(), EVENTLOG_HANDLE_A_unbind(), EVENTLOG_HANDLE_W_bind(), EVENTLOG_HANDLE_W_unbind(), LOGONSRV_HANDLE_bind(), LOGONSRV_HANDLE_unbind(), m_CtxOpen(), m_CtxOpen2(), main(), ndr_client_call(), ndr_update_context_handle(), NDRCContextUnmarshall(), NDRSContextMarshall2(), NDRSContextMarshallEx(), NDRSContextUnmarshall2(), NDRSContextUnmarshallEx(), PLSAPR_SERVER_NAME_bind(), PLSAPR_SERVER_NAME_unbind(), PNP_AddID(), PNP_Connect(), PNP_DeleteClassKey(), PNP_DeviceInstanceAction(), PNP_Disconnect(), PNP_EnumerateSubKeys(), PNP_GetClassCount(), PNP_GetClassName(), PNP_GetClassRegProp(), PNP_GetCustomDevProp(), PNP_GetDepth(), PNP_GetDeviceListSize(), PNP_GetDeviceRegProp(), PNP_GetDeviceStatus(), PNP_GetGlobalState(), PNP_GetHwProfInfo(), PNP_GetInterfaceDeviceList(), PNP_GetInterfaceDeviceListSize(), PNP_GetRelatedDeviceInstance(), PNP_GetRootDeviceInstance(), PNP_GetServerSideDeviceInstallFlags(), PNP_GetVersion(), PNP_GetVersionInternal(), PNP_HwProfFlags(), PNP_InitDetection(), PNP_IsDockStationPresent(), PNP_RegisterNotification(), PNP_ReportLogOn(), PNP_SetClassRegProp(), PNP_SetDeviceRegProp(), PNP_UnregisterNotification(), PNP_ValidateDeviceInstance(), PREGISTRY_SERVER_NAME_bind(), PREGISTRY_SERVER_NAME_unbind(), PSAMPR_SERVER_NAME_bind(), PSAMPR_SERVER_NAME_unbind(), SRVSVC_HANDLE_bind(), SRVSVC_HANDLE_unbind(), SVCCTL_HANDLEA_bind(), SVCCTL_HANDLEA_unbind(), SVCCTL_HANDLEW_bind(), SVCCTL_HANDLEW_unbind(), WINSPOOL_HANDLE_bind(), WINSPOOL_HANDLE_unbind(), WKSSVC_IDENTIFY_HANDLE_bind(), WKSSVC_IDENTIFY_HANDLE_unbind(), WKSSVC_IMPERSONATE_HANDLE_bind(), WKSSVC_IMPERSONATE_HANDLE_unbind(), WLANSVC_HANDLE_bind(), and WLANSVC_HANDLE_unbind().

◆ hello_v1_0_c_ifspec

RPC_IF_HANDLE hello_v1_0_c_ifspec

Definition at line 69 of file ctx_c.c.

◆ hello_v1_0_s_ifspec

RPC_IF_HANDLE hello_v1_0_s_ifspec

Definition at line 61 of file ctx_s.c.

Referenced by main().