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
)
Public Shared Function GetProcDelegate(Of TDelegate) (
InModule As String,
InSymbolName As String
) As TDelegate
public:
generic<typename TDelegate>
static TDelegate GetProcDelegate(
String^ InModule,
String^ InSymbolName
)
static member GetProcDelegate :
InModule : string *
InSymbolName : string -> 'TDelegate
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:
TDelegateThe managed delegate wrapping around the given native symbol.
Exceptions 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