RemoteHookingIpcCreateServerTRemoteObject Method (String, WellKnownObjectMode, TRemoteObject, 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,
TRemoteObject ipcInterface,
params WellKnownSidType[] InAllowedClientSIDs
)
where TRemoteObject : MarshalByRefObject
Public Shared Function IpcCreateServer(Of TRemoteObject As MarshalByRefObject) (
ByRef RefChannelName As String,
InObjectMode As WellKnownObjectMode,
ipcInterface As TRemoteObject,
ParamArray InAllowedClientSIDs As WellKnownSidType()
) As IpcServerChannel
public:
generic<typename TRemoteObject>
where TRemoteObject : MarshalByRefObject
static IpcServerChannel^ IpcCreateServer(
String^% RefChannelName,
WellKnownObjectMode InObjectMode,
TRemoteObject ipcInterface,
... array<WellKnownSidType>^ InAllowedClientSIDs
)
static member IpcCreateServer :
RefChannelName : string byref *
InObjectMode : WellKnownObjectMode *
ipcInterface : 'TRemoteObject *
InAllowedClientSIDs : WellKnownSidType[] -> IpcServerChannel when '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.
- ipcInterface
- Type: TRemoteObject
Provide a TRemoteObject object to be made available as a well known type on the server end of the channel. - 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 Exception | Condition |
---|
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