private static void ServerRegisterInterface(RpcHandle handle, Guid iid, RpcExecute fnExec, int maxCalls, int maxRequestBytes, bool allowAnonTcp) { const int RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH = 0x0010; int flags = 0; IntPtr fnAuth = IntPtr.Zero; if (allowAnonTcp) { flags = RPC_IF_ALLOW_CALLBACKS_WITH_NO_AUTH; fnAuth = hAuthCall.Handle; } Ptr <RPC_SERVER_INTERFACE> sIf = MIDL_SERVER_INFO.Create(handle, iid, RpcApi.TYPE_FORMAT, RpcApi.FUNC_FORMAT, fnExec); if (!allowAnonTcp && maxRequestBytes < 0) { RpcException.Assert(RpcServerRegisterIf(sIf.Handle, IntPtr.Zero, IntPtr.Zero)); } else { RpcException.Assert(RpcServerRegisterIf2(sIf.Handle, IntPtr.Zero, IntPtr.Zero, flags, maxCalls <= 0 ? MAX_CALL_LIMIT : maxCalls, maxRequestBytes <= 0 ? 80 * 1024 : maxRequestBytes, fnAuth)); } handle.Handle = sIf.Handle; }
private static void ServerRegisterInterface(RpcHandle handle, Guid iid, RpcExecute fnExec) { Log.Verbose("ServerRegisterInterface({0})", iid); Ptr <RPC_SERVER_INTERFACE> sIf = MIDL_SERVER_INFO.Create(handle, iid, RpcApi.TYPE_FORMAT, RpcApi.FUNC_FORMAT, fnExec); RpcException.Assert(RpcServerRegisterIf(sIf.Handle, IntPtr.Zero, IntPtr.Zero)); handle.Handle = sIf.Handle; }