diff options
author | Pali Rohár <pali@kernel.org> | 2021-12-25 13:45:17 +0100 |
---|---|---|
committer | Martin Mareš <mj@ucw.cz> | 2021-12-26 22:32:18 +0100 |
commit | 8e6f2fcd2580894419c2807f8c1c5a8630a7d644 (patch) | |
tree | bebdf02f2eaa8eb4f1f38dad5dc158b857fc078c | |
parent | 02321cd3ad5d2ab157c833bf5f068fb7ac45b1d6 (diff) | |
download | pciutils-8e6f2fcd2580894419c2807f8c1c5a8630a7d644.tar.gz |
libpci: i386-io-windows.h: Skip I/O setup on 16/32-bit non-NT systems
16/32-bit non-NT systems allow applications to access PCI I/O ports without
any special setup.
-rw-r--r-- | lib/i386-io-windows.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index d5823ee..e2492df 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -36,6 +36,17 @@ intel_setup_io(struct pci_access *a) MYPROC InitializeWinIo; HMODULE lib; +#ifndef _WIN64 + /* 16/32-bit non-NT systems allow applications to access PCI I/O ports without any special setup. */ + OSVERSIONINFOA version; + version.dwOSVersionInfoSize = sizeof(version); + if (GetVersionExA(&version) && version.dwPlatformId < VER_PLATFORM_WIN32_NT) + { + a->debug("Detected 16/32-bit non-NT system, skipping NT setup..."); + return 1; + } +#endif + lib = LoadLibrary("WinIo.dll"); if (!lib) { |