kobi n
2008-12-03 12:59:03 UTC
Hi.
i'm working with a wdm driver which is working for few years now. lately,
while installing my software, including the driver, on a specific machine,
the device related to the driver cannot be installed.
after debugging i found out that there's a call to IoGetDeviceProperty which
fails.
fail status - STATUS_INVALID_DEVICE_REQUEST. i understand from that that i
have a problem with the PDO i'm giving as a parameter to the routine.
basically my flow goes like this :
in the AddDevice PnP callback i create the device using IoCreateDevice.
later i use the IoAttachDeviceToDeviceStack with the device object i created
as the source parameter and as a target i send the Device Object that was
given at the AddDevice PnP call back.
later, when a StartDevice PnP callback is called i try to call the
IoGetDeviceProperty with the PDEVICE_OBJECT i stored from the
IoAttachDeviceToDeviceStack result
the call fails with the status described.
a bit of a code snapshot :
NTSTATUS NLOG_PnP_AddDevice(IN PDRIVER_OBJECT DriverObject,
IN
PDEVICE_OBJECT DeviceObject)
{
PDEVICE_OBJECT LocalDeviceObject;
... doing somthing ...
Status = IoCreateDevice( DriverObject, sizeof(NLOG_GeneralDeviceExtension),
NULL,
FILE_DEVICE_NLOG_PHYSICAL, 0, FALSE, LocalDeviceObject);
// Now storing the attched device object in a data structure for later use
DeviceExtensionDataStructure->LowerDevice =
IoAttachDeviceToDeviceStack(*DeviceObject, ParentDeviceObject);
}
Later a PnP call back for my device will be called - StartDevice.
and in my start device routine the call that fails will be :
Status = IoGetDeviceProperty(DeviceExtensionDataStructure->LowerDevice,
DevicePropertyAddress,
sizeof(ULONG), &PropertyAddr, &ResultLength );
This one fails with the described error.
NOTE : the result i get from IoAttachDeviceToDeviceStack is a DEVICE_OBJECT
with a device type ACPI which is not what i expected to find. it also not
enumerated device (i see this in the 'flags' member of the DEVICE_OBJECT
structure).
any ideas ?
i'm working with a wdm driver which is working for few years now. lately,
while installing my software, including the driver, on a specific machine,
the device related to the driver cannot be installed.
after debugging i found out that there's a call to IoGetDeviceProperty which
fails.
fail status - STATUS_INVALID_DEVICE_REQUEST. i understand from that that i
have a problem with the PDO i'm giving as a parameter to the routine.
basically my flow goes like this :
in the AddDevice PnP callback i create the device using IoCreateDevice.
later i use the IoAttachDeviceToDeviceStack with the device object i created
as the source parameter and as a target i send the Device Object that was
given at the AddDevice PnP call back.
later, when a StartDevice PnP callback is called i try to call the
IoGetDeviceProperty with the PDEVICE_OBJECT i stored from the
IoAttachDeviceToDeviceStack result
the call fails with the status described.
a bit of a code snapshot :
NTSTATUS NLOG_PnP_AddDevice(IN PDRIVER_OBJECT DriverObject,
IN
PDEVICE_OBJECT DeviceObject)
{
PDEVICE_OBJECT LocalDeviceObject;
... doing somthing ...
Status = IoCreateDevice( DriverObject, sizeof(NLOG_GeneralDeviceExtension),
NULL,
FILE_DEVICE_NLOG_PHYSICAL, 0, FALSE, LocalDeviceObject);
// Now storing the attched device object in a data structure for later use
DeviceExtensionDataStructure->LowerDevice =
IoAttachDeviceToDeviceStack(*DeviceObject, ParentDeviceObject);
}
Later a PnP call back for my device will be called - StartDevice.
and in my start device routine the call that fails will be :
Status = IoGetDeviceProperty(DeviceExtensionDataStructure->LowerDevice,
DevicePropertyAddress,
sizeof(ULONG), &PropertyAddr, &ResultLength );
This one fails with the described error.
NOTE : the result i get from IoAttachDeviceToDeviceStack is a DEVICE_OBJECT
with a device type ACPI which is not what i expected to find. it also not
enumerated device (i see this in the 'flags' member of the DEVICE_OBJECT
structure).
any ideas ?