Using I/O Ports

After sndblst.sys acquires an I/O port address range by calling SoundReportResourceUsage, it calls SoundMapPortAddress to map the physical address range to a virtual range. The virtual addresses can be used as input to HAL functions, such as READ_PORT_UCHAR, and WRITE_PORT_UCHAR, as described in the Kernel-Mode Drivers Reference.

Drivers call also access an address by first calling HalTranslateBusAddress (or a related function) to map the address, and then calling READ_REGISTER_UCHAR, WRITE_REGISTER_UCHAR and related functions.

Drivers must not access port addresses directly, or they will not be portable.