NdisRegisterDeviceEx function (ndis.h)
The NdisRegisterDeviceEx function creates a device object that is based upon the specified attributes.
Syntax
NDIS_STATUS NdisRegisterDeviceEx(
[in] NDIS_HANDLE NdisHandle,
[in] PNDIS_DEVICE_OBJECT_ATTRIBUTES DeviceObjectAttributes,
[out] PDEVICE_OBJECT *pDeviceObject,
[out] PNDIS_HANDLE NdisDeviceHandle
);
Parameters
[in] NdisHandle
A miniport driver handle or filter driver handle that the caller obtained by calling the NdisMRegisterMiniportDriver function or the NdisFRegisterFilterDriver function respectively.
[in] DeviceObjectAttributes
A pointer to an NDIS_DEVICE_OBJECT_ATTRIBUTES structure that contains the attributes for the new device.
[out] pDeviceObject
A pointer that points to a pointer to a newly created DEVICE_OBJECT structure, if the call succeeds. If the call fails, pDeviceObject is set to point to NULL.
[out] NdisDeviceHandle
A pointer to a caller-supplied variable in which this function, if it succeeds, returns a handle to the device object. This handle is a required parameter to the NdisDeregisterDeviceEx function that the driver calls subsequently.
Return value
NdisRegisterDeviceEx returns one of the following status values:
Return code | Description |
---|---|
|
NdisRegisterDeviceEx successfully registered the device. |
|
The caller is not an NDIS driver. |
|
The driver's attempt to register the device failed. Usually, such an error status is propagated from an NdisXxx function or a kernel-mode support routine. |
Remarks
Miniport drivers and filter drivers can call NdisRegisterDeviceEx to register a virtual device.
The driver must subsequently call the NdisDeregisterDeviceEx function when the device is no longer needed. If NdisRegisterDeviceEx allocated an extension, NdisDeregisterDeviceEx frees the extension.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Supported in NDIS 6.0 and later. |
Target Platform | Universal |
Header | ndis.h (include Ndis.h) |
Library | Ndis.lib |
IRQL | PASSIVE_LEVEL |
DDI compliance rules | Irql_Miscellaneous_Function(ndis) |