From: Pali Rohár Date: Sat, 5 Mar 2022 23:25:02 +0000 (+0100) Subject: libpci: i386-io-windows.h: Improve ProcessUserModeIOPL error message X-Git-Tag: v3.9.0~10^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=fffda29af8cb15e77fd77a72295c2ff9cef09e3c;p=pciutils.git 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. --- 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; }