libpci: win32-kldbg: Fix calling IOCTL_KLDBG from 32-bit process on 64-bit system
32-bit process on 64-bit system needs to pass all pointers in 64-bit format
for IOCTL_KLDBG call.
So for 32-bit builds (determined by not defined _WIN64 macro) define new
SYSDBG_BUS_DATA64 and KLDBG64 structures with u64 type for pointer members.
Compiler will automatically align all structure members and inserts padding
between members as needed, in the same way as for 64-bit builds. Due to
alignment restrictions, adding just one dummy 32-bit member after each
pointer member does not work.
32-bit code then needs to figure out if the host system is 32-bit or 64-bit
and choose which structure (process native or 64-bit) needs to be passed to
the IOCTL_KLDBG call for successful execution. This is determined by the
win32_is_32bit_on_64bit_system() helper function.
With this change 32-bit i386 lspci.exe binary is working fine on 64-bit
AMD64 system and via win32-kldbg can access PCIe config space if the
AMD64 kldbgdrv.sys driver is registered in the host system.