Hello All,
I just have a simple question.
======================
WDF_MEMORY_DESCRIPTOR MemoryDescriptor;
WDFMEMORY MemoryHandle = NULL;
ULONG_PTR bytesRead = NULL;
status = WdfMemoryCreate(
NULL,
NonPagedPool,
POOL_TAG,
MY_BUFFER_SIZE,
&MemoryHandle,
NULL
);
WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(
&MemoryDescriptor,
MemoryHandle,
NULL
);
status = WdfIoTargetSendReadSynchronously(
ioTarget,
NULL,
&MemoryDescriptor,
NULL,
NULL,
&bytesRead
);
==============================
In the above example code, where to specify length(bytestoread) for
the Read request? If I were to reuse the same MemoryHandle, how do I
change the length for different read request?
Thanks in advance!
-Raj.
A wdfmemory is self descriptive, so by passing null to the third parameter of WDF_MEMORY_DESCRIPTOR_INIT_HANDLE, the length of the operation is the size of the wdfmemory at offset zero, see http://msdn.microsoft.com/en-us/library/windows/hardware/ff552395(v=vs.85).aspx for more info on how a wdfmemory_offset lets you override the offset and length. Offset here refers to the offset into the buffer, not the offset in the read irp.
d
dent from pjone
From: Rajinikanth Panduranganmailto:xxxxx
Sent: ?12/?3/?2012 5:31 PM
To: Windows System Software Devs Interest Listmailto:xxxxx
Subject: [ntdev] Length to WdfIoTargetSendReadSynchronously
Hello All,
I just have a simple question.
======================
WDF_MEMORY_DESCRIPTOR MemoryDescriptor;
WDFMEMORY MemoryHandle = NULL;
ULONG_PTR bytesRead = NULL;
status = WdfMemoryCreate(
NULL,
NonPagedPool,
POOL_TAG,
MY_BUFFER_SIZE,
&MemoryHandle,
NULL
);
WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(
&MemoryDescriptor,
MemoryHandle,
NULL
);
status = WdfIoTargetSendReadSynchronously(
ioTarget,
NULL,
&MemoryDescriptor,
NULL,
NULL,
&bytesRead
);
==============================
In the above example code, where to specify length(bytestoread) for the Read request? If I were to reuse the same MemoryHandle, how do I change the length for different read request?
Thanks in advance!
-Raj.
— 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</mailto:xxxxx></mailto:xxxxx>