Click or drag to resize

LocalHookGetProcDelegateTDelegate Method

Will return a delegate for a given DLL export symbol. The specified module has to be loaded into the current process space and also export the given method.

Namespace:  EasyHook
Assembly:  EasyHook (in EasyHook.dll) Version: 2.7.6684.0 (2.7.6684.0)
Syntax
public static TDelegate GetProcDelegate<TDelegate>(
	string InModule,
	string InSymbolName
)

Parameters

InModule
Type: SystemString
A system DLL name like "kernel32.dll" or a full qualified path to any DLL.
InSymbolName
Type: SystemString
An exported symbol name like "CreateFileW".

Type Parameters

TDelegate
A delegate using the UnmanagedFunctionPointerAttribute and exposing the same method signature as the specified native symbol.

Return Value

Type: TDelegate
The managed delegate wrapping around the given native symbol.
Exceptions
ExceptionCondition
DllNotFoundException The given module is not loaded into the current process.
MissingMethodException The given module does not export the given method.
Remarks

This method is usually not useful to hook something but it allows you to dynamically load native API methods into your managed environment instead of using the static P-Invoke approach provided by DllImportAttribute.

See Also