The functions DetectCheckPortUsage and DetectCheckMemoryUsage check to see if a port/memory range is in use by some device in the system other than the current NIC driver. If the port or memory is available, the return value is STATUS_SUCCESS. Otherwise, either of the functions return an error code. The function prototypes are as follows:
NTSTATUS DetectCheckPortUsage(
IN INTERFACE_TYPE InterfaceType,
IN ULONG BusNumber,
IN ULONG Port,
IN ULONG Length
);
NTSTATUS DetectCheckMemoryUsage(
IN INTERFACE_TYPE InterfaceType,
N ULONG BusNumber,
IN ULONG BaseAddress,
IN ULONG Length
);
A successful return implies the I/O port or memory range is available for use.