Problem with WdfIoTargetSendReadSynchronously

I try to use WdfIoTargetSendReadSynchronously to forward a Read request to an IO Target (PhysicalDriveX). According to the documentation at
http://msdn.microsoft.com/en-us/library/aa491528.aspx
I must specify both the Request and OutputBuffer. When I do that the function fails with STATUS_REQUEST_NOT_ACCEPTED. However, if I pass NULL instead of Request, the function reads in the data correctly. Can I assume it is safe to call the function this way?

// Return status checking is removed for readability
status = WdfIoQueueRetrieveNextRequest(pDevContext->ReadQueue, &Request);

WDF_REQUEST_PARAMETERS_INIT(&parameters);
WdfRequestGetParameters(Request, &parameters);
byteOffset = parameters.Parameters.Read.DeviceOffset;

status = WdfRequestRetrieveOutputMemory(Request, &hMemory);
WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(&memDescriptor, hMemory, NULL);

status = WdfIoTargetSendReadSynchronously(pDevContext->ioTarget, Request, &memDescriptor, &byteOffset, NULL, &information);

// OK, if pass in NULL instead of Request

Yes, null would be fine. !wdflogfump will tell you why it fails when you pass a valid wdfrequest. My guess is that your request does not have enough irp stack locations to satisfy the target’s StackCount

d

Sent from my phone with no t9, all spilling mistakes are not intentional.

-----Original Message-----
From: xxxxx@yahoo.com
Sent: Tuesday, December 02, 2008 5:26 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Problem with WdfIoTargetSendReadSynchronously

I try to use WdfIoTargetSendReadSynchronously to forward a Read request to an IO Target (PhysicalDriveX). According to the documentation at
http://msdn.microsoft.com/en-us/library/aa491528.aspx
I must specify both the Request and OutputBuffer. When I do that the function fails with STATUS_REQUEST_NOT_ACCEPTED. However, if I pass NULL instead of Request, the function reads in the data correctly. Can I assume it is safe to call the function this way?

// Return status checking is removed for readability
status = WdfIoQueueRetrieveNextRequest(pDevContext->ReadQueue, &Request);

WDF_REQUEST_PARAMETERS_INIT(&parameters);
WdfRequestGetParameters(Request, &parameters);
byteOffset = parameters.Parameters.Read.DeviceOffset;

status = WdfRequestRetrieveOutputMemory(Request, &hMemory);
WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(&memDescriptor, hMemory, NULL);

status = WdfIoTargetSendReadSynchronously(pDevContext->ioTarget, Request, &memDescriptor, &byteOffset, NULL, &information);

// OK, if pass in NULL instead of Request


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Thanks. I’ll try !wdflogfump to see what it says.