diff options
author | Pali Rohár <pali@kernel.org> | 2022-03-06 00:25:02 +0100 |
---|---|---|
committer | Pali Rohár <pali@kernel.org> | 2022-10-30 16:31:52 +0100 |
commit | fffda29af8cb15e77fd77a72295c2ff9cef09e3c (patch) | |
tree | d539ab7c308fdfd70c1315641cf70fd0b0cc9718 | |
parent | de53aa4fd7777a2602882bb7d4304e0b2ad6bc6f (diff) | |
download | pciutils-fffda29af8cb15e77fd77a72295c2ff9cef09e3c.tar.gz |
libpci: i386-io-windows.h: Improve ProcessUserModeIOPL error message
Show error message from intel_setup_io() function into debug area instead
of error area. This is what other backends do as intel_setup_io() is called
during quite detect phase, which may fail.
Also show human readable failure instead of magic code number.
-rw-r--r-- | lib/i386-io-windows.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index 1509d7d..6bb578c 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -1343,7 +1343,8 @@ intel_setup_io(struct pci_access *a) /* On NT-based systems issue ProcessUserModeIOPL syscall which changes IOPL to 3. */ if (!SetProcessUserModeIOPL()) { - a->warning("NT ProcessUserModeIOPL call failed with error: %lu.", (unsigned long int)GetLastError()); + DWORD error = GetLastError(); + a->debug("NT ProcessUserModeIOPL call failed: %s.", error == ERROR_INVALID_FUNCTION ? "Not Implemented" : error == ERROR_PRIVILEGE_NOT_HELD ? "Access Denied" : "Operation Failed"); return 0; } |