We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Your DLL Imports use SetLastError = true but then after for example SetupDiGetClassDevs() returned INVALID_HANDLE_VALUE you write:
throw new Exception("SetupDiGetClassDevs() function failed.");
This will hide the cause of the failure from the user. Why ?
Replace all your error handling like:
throw new Win32Exception(Marshal.GetLastWin32Error());
and the user will get a message with the cause of the failure
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Your DLL Imports use SetLastError = true
but then after for example SetupDiGetClassDevs() returned INVALID_HANDLE_VALUE you write:
throw new Exception("SetupDiGetClassDevs() function failed.");
This will hide the cause of the failure from the user.
Why ?
Replace all your error handling like:
throw new Win32Exception(Marshal.GetLastWin32Error());
and the user will get a message with the cause of the failure
The text was updated successfully, but these errors were encountered: