Driver Problems? Questions? Issues?
Put OSR's experience to work for you! Contact us for assistance with:
  • Creating the right design for your requirements
  • Reviewing your existing driver code
  • Analyzing driver reliability/performance issues
  • Custom training mixed with consulting and focused directly on your specific areas of interest/concern.
Check us out. OSR, the Windows driver experts.

Monthly Seminars at OSR Headquarters

East Coast USA
Windows Internals and SW Drivers, Dulles (Sterling) VA, 9 April 2018

Writing WDF Drivers I: Core Concepts, Manchester, NH, 7 May 2018

Kernel Debugging & Crash Analysis for Windows, Manchester, NH, 21 May 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 3  
27 Dec 17 05:00
ntdev member 175977
xxxxxx@gmail.com
Join Date:
Posts To This List: 4
Initiate DMA without scatter gather list

Hello, In my device driver, upon IOCTL request I have to start DMA from hardware into RAM. The RAM address passed in the request is a physical address of a continuous buffer allocated by another device driver. This is a customer requirement. I'm aware it's not by the book. The "EvtProgramReadDma" routine passed to WdfDmaTransactionInitializeusingRequest get the paramater: PSCATTER_GATHER_LIST SgList But in my case, there is no SG list created by the framework. Should I use any WdfDma calls at all ? Thank you, Zvika
  Message 2 of 3  
27 Dec 17 13:18
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11891
Initiate DMA without scatter gather list

xxxxx@gmail.com wrote: > In my device driver, upon IOCTL request I have to start DMA from hardware into RAM. > The RAM address passed in the request is a physical address of a continuous buffer allocated by another device driver. There is NO WAY you should allow this information to be passed in from user-mode.  There's nothing wrong with using a common buffer allocated by another driver (with appropriate synchronization), but you need to get the address from the driver directly.  User-mode code is untrusted code.  It is an enormous security hole to accept and use a physical address from user mode. > This is a customer requirement. I'm aware it's not by the book. The concept of using a physical address from another driver is fine.  The concept of passing that information through user-mode is absolutely no go, and as a professional driver writer, you have a responsibility to tell your client that it is not acceptable.  There are other ways to accomplish this, securely and reliably. > The "EvtProgramReadDma" routine passed to WdfDmaTransactionInitializeusingRequest get the paramater: > PSCATTER_GATHER_LIST SgList > > But in my case, there is no SG list created by the framework. > > Should I use any WdfDma calls at all ? Not in this case, no.  I don't think it gains you anything.  I have one driver that has both common buffer DMA for a circular buffer, and one-shot DMA for user requests.  The one-shot stuff goes through the WdfDma abstraction, but the common buffer transactions are handled directly. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 3  
29 Dec 17 15:07
ntdev member 175977
xxxxxx@gmail.com
Join Date:
Posts To This List: 4
Initiate DMA without scatter gather list

Hi Tim, Thank you very much for the detailed answer. Best regards, Zvika
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 13:04.


Copyright ©2015, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license