// wdfdevice.h
NTSTATUS WdfDeviceRetrieveDeviceName(
[in] WDFDEVICE Device,
[in] WDFSTRING String
);
View the official Windows Driver Kit DDI reference
No description available.
[Applies to KMDF only]
The WdfDeviceRetrieveDeviceName method returns the device name for a specified device.
Device
[in]A handle to a framework device object.
String
[in]A handle to a framework string object that receives the device name.
If the operation succeeds, WdfDeviceRetrieveDeviceName returns STATUS_SUCCESS. Additional return values include:
Return code | Description |
---|---|
STATUS_INVALID_PARAMETER | An invalid parameter was detected. |
The method might return other NTSTATUS values.
A bug check occurs if the driver supplies an invalid object handle.
The WdfDeviceRetrieveDeviceName method returns the device name that the driver specified in a previous call to WdfDeviceInitAssignName.
To obtain the device name string from the string object, the driver can call WdfStringGetUnicodeString.
The following code example creates a string object and then retrieves a specified device's name.
NTSTATUS status;
WDFSTRING string;
status = WdfStringCreate(
NULL,
WDF_NO_OBJECT_ATTRIBUTES,
&string
);
if (NT_SUCCESS(status)) {
status = WdfDeviceRetrieveDeviceName(
Device,
string
);
if (!NT_SUCCESS(status)) {
return status;
}
}