NativeLibrary
Description
- Derived from
-
Disposable abstract
- Extended by
Wraps a native library.
When trying to use a native library that has not been loaded, a FailedAssertionException will be thrown (see AssertLoaded).
- See also
Public / Methods
AddSearchPath
Extends the search path of the calling process for finding native dynamic link libraries, if allowed by TinmanCorePrivileges.EnvironmentVariableGet and TinmanCorePrivileges.EnvironmentVariableSet.
The search path is augmented by appending the following directories (only if they exist):
-
'{path in}'
-
'{path in}/x32' (only if LowLevel.Is64Bit returns
false
and platform opt istrue
) -
'{path in}/x64' (only if LowLevel.Is64Bit returns
true
and platform opt istrue
)
Native libraries should be put into the x32
resp. x64
subdirectories only if they have the same name.
- IOException
-
If an I/O error has occurred while validating path in.
Initialize
Initializes the object, if necessary.
During initialization, function pointers are retrieved from the loaded native library.
- See also
Reload
Reloads the function pointers from the loaded native library.
For some native libraries, the result of function pointer loading may depend on some state outside of the scope of this NativeLibrary object (for example, the current OpenGL render context of the calling thread). In these cases, the Reload method may be used to reload all function pointers.
Public / Attributes
IsLibraryLoaded
Has the native library been loaded successfully?
The native library is loaded when the Initialize method is called.
Protected / Methods
GetFunctionName
Returns the mangled function name for lookup in the native library (only for stdcall
on 32-bit).
- See also
GetFunctionPointer
Returns the pointer to an exported library function.
This method calls LookupFunctionPointer to find the pointer of the function in the loaded native library.
- See also
InitializeFunctionPointers
Initializes all function pointers that are required by the native library wrapper, by calling the GetFunctionPointer method.
NotLoaded
Marks this NativeLibrary instance as not loaded, i.e. the IsLibraryLoaded will return false
.