Re: Length to WdfIoTargetSendReadSynchronously

Hi,

I want to override the length of the Read Operation.

MemOffset.BufferOffset = 0;
MemOffset.BufferLength = req_size;

WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(
&MemoryDescriptor,
MemoryHandle,
&MemOffset
);

My WdfIOTargetSendReadSynchronously() fails if Bufferlength is not aligned
with sector size.

Is it mandatory to provide the BufferLength in aligned with sector size,
provided my IO Target is Disk Drive?

Thanks in advance,
-Raj P

On Mon, Dec 3, 2012 at 7:35 PM, Doron Holan wrote:

> 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).aspxfor 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 Pandurangan
> Sent: 12/3/2012 5:31 PM
> To: Windows System Software Devs Interest List
> 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
>
> —
> 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
>

Yes, you have to be sector aligned for raw disk access

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth Pandurangan
Sent: Friday, January 25, 2013 11:40 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Length to WdfIoTargetSendReadSynchronously

Hi,

I want to override the length of the Read Operation.

MemOffset.BufferOffset = 0;
MemOffset.BufferLength = req_size;

WDF_MEMORY_DESCRIPTOR_INIT_HANDLE(
&MemoryDescriptor,
MemoryHandle,
&MemOffset
);

My WdfIOTargetSendReadSynchronously() fails if Bufferlength is not aligned with sector size.

Is it mandatory to provide the BufferLength in aligned with sector size, provided my IO Target is Disk Drive?

Thanks in advance,
-Raj P
On Mon, Dec 3, 2012 at 7:35 PM, Doron Holan > wrote:
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


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

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers 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>