Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > mapping from one mdl to another with extra data

Reply
Thread Tools Display Modes

mapping from one mdl to another with extra data

 
 
mudehuai
Guest
Posts: n/a

 
      11-08-2009
Hi:

I am new to driver and want to modify the bulkusb example to talk to our
device.

The problem is that when the driver receives the raw data from the user
space, I need to add a header to it before sending the data to the device.

In BulkUsb_DispatchReadWrite(), it calls the IoBuildPartialMdl to map the
user mdl directly to the URB mdl allocated by the driver. In my case, i want
the new URB mdl to include a header and then the data described by the user
mdl.

I cannot figure out how to do this with MDL manipulation.

I thought about allocate a buffer in the driver and fill it with the header
and the data described by the user mdl. Then create the new URB mdl from this
buffer.

However, it would be great if I can avoid this extra copy with MDL
manipulation.

Thanks in advance.

cheers,
 
Reply With Quote
 
 
 
 
Tim Roberts
Guest
Posts: n/a

 
      11-10-2009
mudehuai <> wrote:
>
>I am new to driver and want to modify the bulkusb example to talk to our
>device.
>
>The problem is that when the driver receives the raw data from the user
>space, I need to add a header to it before sending the data to the device.
>
>In BulkUsb_DispatchReadWrite(), it calls the IoBuildPartialMdl to map the
>user mdl directly to the URB mdl allocated by the driver. In my case, i want
>the new URB mdl to include a header and then the data described by the user
>mdl.


Does it have to be part of the same transfer? Can you create a new URB
with just the header, and then forward the original URB unchanged?

>I cannot figure out how to do this with MDL manipulation.


You can't do it with MDL manipulation.

>I thought about allocate a buffer in the driver and fill it with the header
>and the data described by the user mdl. Then create the new URB mdl from this
>buffer.
>
>However, it would be great if I can avoid this extra copy with MDL
>manipulation.


Nope. If you can't send it as two transfers, then you'll need to copy.
--
Tim Roberts,
Providenza & Boekelheide, Inc.
 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple closed (private) networks with UDP messages. TomChapman Server Networking 3 10-29-2009 03:40 PM
Problems with ActiveSync and older Windows CE Michael Gross ActiveSync 5 08-05-2009 08:06 PM
Exchange ActiveSync Issues - Some Data Not Synchronizing Correctly Marc B. ActiveSync 1 11-20-2008 10:00 PM
how to sync Outlook data correctly with ActiveSync after XP reinst Jamel Irief ActiveSync 1 12-18-2007 02:39 AM
Re: Activsync lost data Raj Pillai ActiveSync 0 07-22-2004 07:38 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59