Hi
I have the following code:
pIrp = IoBuildDeviceIoControlRequest(
IOCTL_GENERIC,
PhysicalDeviceObject,
buffer,
in_len,
buffer,
out_len,
IRP_MJ_INTERNAL_DEVICE_CONTROL,
pEvent,
&IoStatus);
status = IoCallDriver(commonExt->PhysicalDeviceObject,pIrp);
if( status == STATUS_PENDING ){
status =
KeWaitForSingleObject(pEvent,Executive,KernelMode,FALSE,&Timeout);
if( status == STATUS_TIMEOUT ){
if( IoCancelIrp(pIrp) ){
status =
KeWaitForSingleObject(pEvent,Executive,KernelMode,FALSE,&Timeout);
if( status != STATUS_SUCCESS )
DebugPrint((“Timeout waiting cancel Irp\n”));
}
else
DebugPrint((“CancelIrp failed\n”));
status = STATUS_TIMEOUT;
out_len = 0;
}
}
Irp->IoStatus.Status = status;
Irp->IoStatus.Information = IoStatus.Information;
In the below driver (PhysicalDeviceObject) I make some work and then :
Irp->IoStatus.Status = status;
Irp->IoStatus.Information = 10;
IoCompleteRequest(Irp,IO_NO_INCREMENT);
and I have the following behaviour which I don’t understand:
In the PhysicalDriver I set the IoStatus.Status and IoStatus.Information.
if the returned status is STATUS_SUCCESS on return the both IoStatus.Status
and IoStatus.Information have same values like set on the below driver. If
the status is not successfull then the values from IoStatus are changed.
I’ve checked this on Win2K and WinXP. Is this the way it should be ?
thanks
horatiu