Daniel's XL Toolbox NG
Bovender.Unmanaged.DllManager Class Reference

Manages unmanaged DLLs. Unloads any loaded DLLs upon disposal. More...

Inheritance diagram for Bovender.Unmanaged.DllManager:
Collaboration diagram for Bovender.Unmanaged.DllManager:

Public Member Functions

void LoadDll (string dllName)
 Loads the given DLL from the appropriate subdirectory, depending on the current bitness. More...
 
void LoadDll (string dllName, string expectedSha1Hash)
 Loads the given DLL from the appropriate subdirectory if its Sha1 hash matches the provided hash. More...
 
void UnloadDll (string dllName)
 Unloads a previously loaded DLL. Does nothing if the DLL was not loaded. More...
 
void Dispose ()
 
void LoadDll (string dllName)
 Loads the given DLL from the appropriate subdirectory, depending on the current bitness. More...
 
void LoadDll (string dllName, string expectedSha1Hash)
 Loads the given DLL from the appropriate subdirectory if its Sha1 hash matches the provided hash. More...
 
void UnloadDll (string dllName)
 Unloads a previously loaded DLL. Does nothing if the DLL was not loaded. More...
 
void Dispose ()
 

Protected Member Functions

virtual void Dispose (bool calledFromDispose)
 
virtual void Dispose (bool calledFromDispose)
 

Detailed Description

Manages unmanaged DLLs. Unloads any loaded DLLs upon disposal.

Member Function Documentation

◆ Dispose() [1/4]

void Bovender.Unmanaged.DllManager.Dispose ( )
inline

◆ Dispose() [2/4]

void Bovender.Unmanaged.DllManager.Dispose ( )
inline

◆ Dispose() [3/4]

virtual void Bovender.Unmanaged.DllManager.Dispose ( bool  calledFromDispose)
inlineprotectedvirtual

◆ Dispose() [4/4]

virtual void Bovender.Unmanaged.DllManager.Dispose ( bool  calledFromDispose)
inlineprotectedvirtual

◆ LoadDll() [1/4]

void Bovender.Unmanaged.DllManager.LoadDll ( string  dllName)
inline

Loads the given DLL from the appropriate subdirectory, depending on the current bitness.

The DLL is expected to reside in a subdirectory of the entry point assembly's directory, in "bin/lib/$(Platform)", where can be "Win32" or "x64", for example.

Exceptions
DllNotFoundExceptionif the file is not found in the path.
DllLoadingFailedExceptionif the file is not found in the path.
Parameters
dllNameName of the DLL to load (without path).

◆ LoadDll() [2/4]

void Bovender.Unmanaged.DllManager.LoadDll ( string  dllName)
inline

Loads the given DLL from the appropriate subdirectory, depending on the current bitness.

The DLL is expected to reside in a subdirectory of the entry point assembly's directory, in "bin/lib/$(Platform)", where can be "Win32" or "x64", for example.

Exceptions
DllNotFoundExceptionif the file is not found in the path.
DllLoadingFailedExceptionif the file is not found in the path.
Parameters
dllNameName of the DLL to load (without path).

◆ LoadDll() [3/4]

void Bovender.Unmanaged.DllManager.LoadDll ( string  dllName,
string  expectedSha1Hash 
)
inline

Loads the given DLL from the appropriate subdirectory if its Sha1 hash matches the provided hash.

Parameters
dllNameName of the DLL to load (without path).
expectedSha1HashExpected Sha1 hash of the DLL.
Exceptions
DllNotFoundExceptionif the file is not found in the path.
DllLoadingFailedExceptionif the file is not found in the path.
DllSha1MismatchExceptionif the file's Sha1 is unexpected.

◆ LoadDll() [4/4]

void Bovender.Unmanaged.DllManager.LoadDll ( string  dllName,
string  expectedSha1Hash 
)
inline

Loads the given DLL from the appropriate subdirectory if its Sha1 hash matches the provided hash.

Parameters
dllNameName of the DLL to load (without path).
expectedSha1HashExpected Sha1 hash of the DLL.
Exceptions
DllNotFoundExceptionif the file is not found in the path.
DllLoadingFailedExceptionif the file is not found in the path.
DllSha1MismatchExceptionif the file's Sha1 is unexpected.

◆ UnloadDll() [1/2]

void Bovender.Unmanaged.DllManager.UnloadDll ( string  dllName)
inline

Unloads a previously loaded DLL. Does nothing if the DLL was not loaded.

Parameters
dllNameName of the DLL to unload.

◆ UnloadDll() [2/2]

void Bovender.Unmanaged.DllManager.UnloadDll ( string  dllName)
inline

Unloads a previously loaded DLL. Does nothing if the DLL was not loaded.

Parameters
dllNameName of the DLL to unload.

The documentation for this class was generated from the following file: