mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-10 20:46:24 +00:00
Improved Exception-handling in device providers
This commit is contained in:
1 parent
68c5990ccd
commit
b300ac8451
12 files changed
+31
-15
No files matched your search
@@ -38,6 +38,7 @@ namespace RGB.NET.Devices.Wooting.Native
|
||||
SetDllDirectory(Path.GetDirectoryName(Path.GetFullPath(dllPath))!);
|
||||
|
||||
_dllHandle = LoadLibrary(dllPath);
|
||||
if (_dllHandle == IntPtr.Zero) throw new RGBDeviceException($"Wooting LoadLibrary failed with error code {Marshal.GetLastWin32Error()}");
|
||||
|
||||
_getDeviceInfoPointer = (GetDeviceInfoPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_device_info"), typeof(GetDeviceInfoPointer));
|
||||
_keyboardConnectedPointer = (KeyboardConnectedPointer)Marshal.GetDelegateForFunctionPointer(GetProcAddress(_dllHandle, "wooting_rgb_kbd_connected"), typeof(KeyboardConnectedPointer));
|
||||
|
||||
Reference in new issue
Block a user