]> git.ipfire.org Git - thirdparty/pciutils.git/commit
libpci: win32-kldbg: Implement registration driver from non-native process
authorPali Rohár <pali@kernel.org>
Sat, 18 Jan 2025 18:05:50 +0000 (19:05 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Jun 2025 15:19:58 +0000 (17:19 +0200)
commit8eee6d9732e26a089c0749346441fd141ebea9c3
tree1f0ac447d26d8a66c7ac0b99edcfa04ae13f38f5
parente15e684006c480d6d9403e7f2496d5afe0245cca
libpci: win32-kldbg: Implement registration driver from non-native process

It is common that 32-bit application is running on 64-bit host system, or
nowadays also that 64-bit AMD64 application is running on ARM64 system.

For all these cases the win32-kldbg.c code horrible fails with just generic
error message when trying to register kldbgdrv.sys driver.

Add code which detects machine type of running process, machine type of
kldbgdrv.sys driver and machine type of the host system. If machine type of
driver and system machines then allow to register driver. Otherwise print
debug verbose message why it is not possible to use kldbgdrv.sys driver
from kd.exe/windbg.exe binary. This could allow to debug issues via command
lspci -G why win32-kldbg refused to load driver from windbg.exe binary.

At the same time relax checks in win32_check_driver() to not depend on the
constants related to process type as process architecture is not relevant
here. Important is always only driver and native system architecture,
process may be running under WoW64 (e.g. i386 process or AMD64 system).
lib/win32-helpers.c
lib/win32-helpers.h
lib/win32-kldbg.c