9.1.11 Resource Claiming Functions for msncdet.dll

The functions listed next are only available in the NIC-detection DLL, msncdet.dll. These functions report the availability of and control the allocation of bus-related and hardware platform-related resources, such as IRQs and I/O space addresses.

Claiming a Resource

NcDetectResourceClaim allows the calling function to attempt to claim system hardware resources that are in use by a NIC. This is necessary to verify that NIC configuration parameters are actually available for use in the current system configuration. For example, msncdet.dll keeps a record of resources claimed by the process to which it is attached. When asked to claim or report resources later, msncdet.dll considers newly claimed resources and reports them accordingly. In other words, the information is used to augment the data extracted from the registry hardware hive.

The function prototype is as follows:

LONG NcDetectResourceClaim(
INTERFACE_TYPE ifType,
LONG
lBusNumber,
LONG
lType,
LONG
lValue,
LONG
lRange,
LONG
lFlags,
BOOL
fClaim
);

Parameters

ifType

Indicates the type of bus (for example, ISA, EISA, MCA, PCI).

lBusNumber

Indicates the zero-based number of the bus being addressed.

lType

Indicates the system-level resource being claimed as one of the following:

NETDTECT_IRQ_RESOURCE

Claim an interrupt vector or level.

NETDTECT_MEMORY_RESOURCE

Claim a memory-mapped range.

NETDTECT_PORT_RESOURCE

Claim an I/O port range.

NETDTECT_DMA_RESOURCE

Claim a channel in the system DMA controller.

lValue

Specifies the value of the resource type being claimed.

lRange

Specifies the size of the area being claimed, in address units. This applies only to certain parameters, such as memory windows. For example, only the lValue parameter would be meaningful for an IRQ parameter, while the lRange parameter would be ignored. Both values are required for an IOADDR (port) parameter.

lFlags

Specifies either of the following if IType is set to NETDTECT_IRQ_RESOURCE:

CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE

Interrupt occurs when signal is asserted.

CM_RESOURCE_INTERRUPT_LATCHED

Interrupt is edge-triggered.

fClaim

Allows the calling function to verify whether a resource can be claimed, without actually claiming it. If the parameter is TRUE, the resource is claimed. If the parameterer is FALSE, the resource is not claimed. The result is the same in either case.

Freeing a Resource

NcDetectResourceFree allows the calling function to release resources previously claimed through the use of NcDetectResourceClaim. The function prototype is as follows:

LONG NcDetectResourceFree(
INTERFACE_TYPE ifType,
LONG
lBusNumber,
LONG
lType,
LONG
lValue,
LONG
lRange,
LONG
lFlags
);

The name of a resource (parameter) and its values must exactly match a previously claimed value, or ERROR_INVALID_PARAMETER is returned.