INPW / OUTPW equivalents for Windows 10 kernel mode drivers

I am attempting to port a Windows 7 driver for a PC104 module that uses memory mapped I?/o. The existing driver uses INPW etc to directly acces the on-board registers e.g. unsigned short registerValue = INPW(REG_PARAM); What are the evquivalent methods for directly reading / writing registers in a Windows 10 Kernel Mode driver ?

INPW is not now, and has never been, a Windows driver function. So… it’s some sort of macro or function that’s defined by the driver.

Assuming INPW is “In Port Word” (just a guess) the equivalent Windows driver function is READ_PORT_USHORT.

But you need to find the definition of that macro/function.

Peter

Hi Peter

Thank you for your prompt reply. I expect that you are correct that it is a macro that was wrapping inpw (https://docs.microsoft.com/en-us/cpp/c-runtime-library/inp-inpw?view=vs-2017). Your guess is correct and READ_PORT_USHORT is a suitable replacement