Click or drag to resize

RemoteHookingIpcCreateServerTRemoteObject Method (String, WellKnownObjectMode, WellKnownSidType)

Creates a globally reachable, managed IPC-Port.

Namespace:  EasyHook
Assembly:  EasyHook (in EasyHook.dll) Version: 2.7.6684.0 (2.7.6684.0)
Syntax
public static IpcServerChannel IpcCreateServer<TRemoteObject>(
	ref string RefChannelName,
	WellKnownObjectMode InObjectMode,
	params WellKnownSidType[] InAllowedClientSIDs
)
where TRemoteObject : MarshalByRefObject

Parameters

RefChannelName
Type: SystemString
Either null to let the method generate a random channel name to be passed to IpcConnectClientTRemoteObject(String) or a predefined one. If you pass a value unequal to null, you shall also specify all SIDs that are allowed to connect to your channel!
InObjectMode
Type: System.Runtime.RemotingWellKnownObjectMode
SingleCall if you want to handle each call in an new object instance, Singleton otherwise. The latter will implicitly allow you to use "static" remote variables.
InAllowedClientSIDs
Type: System.Security.PrincipalWellKnownSidType
If no SID is specified, all authenticated users will be allowed to access the server channel by default. You must specify an SID if RefChannelName is unequal to null.

Type Parameters

TRemoteObject
A class derived from MarshalByRefObject which provides the method implementations this server should expose.

Return Value

Type: IpcServerChannel
An IpcChannel that shall be keept alive until the server is not needed anymore.
Exceptions
ExceptionCondition
HostProtectionException If a predefined channel name is being used, you are required to specify a list of well known SIDs which are allowed to access the newly created server.
RemotingException The given channel name is already in use.
Remarks
Because it is something tricky to get a port working for any constellation of target processes, I decided to write a proper wrapper method. Just keep the returned IpcChannel alive, by adding it to a global list or static variable, as long as you want to have the IPC port open.
See Also