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, 13 November 2017

Kernel Debugging & Crash Analysis for Windows, Nashua (Amherst) NH, 4 December 2017

Writing WDF Drivers I: Core Concepts, Nashua (Amherst) NH, 8 January 2018

WDF Drivers II: Advanced Implementation Techniques, Nashua (Amherst) NH, 15 January 2018


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 8  
01 Aug 17 03:36
Muthazhagan Arulbalasubramani
xxxxxx@gmail.com
Join Date: 23 Jan 2017
Posts To This List: 11
Buffered IO to Direct IO

Hi All, I am using DeviceIoControl with IOCTL_SCSI_MINIPORT to call NVMe driver. I could see IOCTL_SCSI_MINIPORT is a Buffered_IO. Is it possible to change it to Direct_IO, If so what needs to be modified in application and NVMe driver? Kindly help me out. Thanks In advance, Muthu
  Message 2 of 8  
01 Aug 17 13:16
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11622
Buffered IO to Direct IO

xxxxx@gmail.com xxxxx@lists.osr.com wrote: > I am using DeviceIoControl with IOCTL_SCSI_MINIPORT to call NVMe driver. I could see IOCTL_SCSI_MINIPORT is a Buffered_IO. Is it possible to change it to Direct_IO, If so what needs to be modified in application and NVMe driver? Nope, that's impossible. The buffering is built in to the ioctl code. If you change the ioctl code, then it's no longer IOCTL_SCSI_MINIPORT. Any reason why you can't define your own code? -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 3 of 8  
07 Aug 17 13:29
Mark Roddy
xxxxxx@gmail.com
Join Date: 25 Feb 2000
Posts To This List: 4014
Buffered IO to Direct IO

You can use scsi pass through direct operations to get custom direct io data you your miniport. You may have to go through some gyrations, such as creating a custom scsi device, to avoid have the class driver above you refuse to pass the request down. Mark Roddy On Tue, Aug 1, 2017 at 1:16 PM, Tim Roberts <xxxxx@probo.com> < xxxxx@lists.osr.com> wrote: > xxxxx@gmail.com xxxxx@lists.osr.com wrote: > > I am using DeviceIoControl with IOCTL_SCSI_MINIPORT to call NVMe driver. > I could see IOCTL_SCSI_MINIPORT is a Buffered_IO. Is it possible to change > it to Direct_IO, If so what needs to be modified in application and NVMe > driver? > > Nope, that's impossible. The buffering is built in to the ioctl code. > If you change the ioctl code, then it's no longer IOCTL_SCSI_MINIPORT. > > Any reason why you can't define your own code? <...excess quoted lines suppressed...> --
  Message 4 of 8  
10 Aug 17 03:09
Muthazhagan Arulbalasubramani
xxxxxx@gmail.com
Join Date: 23 Jan 2017
Posts To This List: 11
Buffered IO to Direct IO

Sorry for the late reply, and Thanks for your reply. Actually I am doing performance profiling with IOCTL_SCSI_MINIPORT path, and found that Result was very low. Hence we doubted on buffered IO, So I modified the IOCTL_SCSI_MINIPORT If DirectIO is not possible by IOCTL_SCSI_MINIPORT then I will try with Custom Control Code. Regards, Muthu
  Message 5 of 8  
10 Aug 17 03:11
Muthazhagan Arulbalasubramani
xxxxxx@gmail.com
Join Date: 23 Jan 2017
Posts To This List: 11
Buffered IO to Direct IO

I modified the IOCTL_SCSI_MINIPORT in Application like below. #define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_SCSI_MINIPORT_IN CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_IN_DIRECT, FILE_READ_ACCESS | FILE_WRITE_ACCESS) #define IOCTL_SCSI_MINIPORT_OUT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_OUT_DIRECT,FILE_READ_ACCESS | FILE_WRITE_ACCESS)
  Message 6 of 8  
10 Aug 17 06:12
Mark Roddy
xxxxxx@gmail.com
Join Date: 25 Feb 2000
Posts To This List: 4014
Buffered IO to Direct IO

You need to re-read the earlier replies that noted that you cannot do this. The control code is now not understood by the port driver. Mark Roddy On Thu, Aug 10, 2017 at 3:10 AM, xxxxx@gmail.com <xxxxx@lists.osr.com > wrote: > I modified the IOCTL_SCSI_MINIPORT in Application like below. > > #define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, > METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) > > #define IOCTL_SCSI_MINIPORT_IN CTL_CODE(IOCTL_SCSI_BASE, 0x0402, > METHOD_IN_DIRECT, FILE_READ_ACCESS | FILE_WRITE_ACCESS) > #define IOCTL_SCSI_MINIPORT_OUT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, > METHOD_OUT_DIRECT,FILE_READ_ACCESS | FILE_WRITE_ACCESS) <...excess quoted lines suppressed...> --
  Message 7 of 8  
10 Aug 17 13:59
Tim Roberts
xxxxxx@probo.com
Join Date: 28 Jan 2005
Posts To This List: 11622
Buffered IO to Direct IO

xxxxx@gmail.com xxxxx@lists.osr.com wrote: > I modified the IOCTL_SCSI_MINIPORT in Application like below. > > #define IOCTL_SCSI_MINIPORT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) > > #define IOCTL_SCSI_MINIPORT_IN CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_IN_DIRECT, FILE_READ_ACCESS | FILE_WRITE_ACCESS) > #define IOCTL_SCSI_MINIPORT_OUT CTL_CODE(IOCTL_SCSI_BASE, 0x0402, METHOD_OUT_DIRECT,FILE_READ_ACCESS | FILE_WRITE_ACCESS) Those ARE custom ioctl codes. Even though the fields have meaning, the code is the entire 32-bit value. If you're sending this to a custom driver, that's fine, but no standard driver will respond to this. And in the port/miniport case, I doubt the port driver will pass through codes it doesn't know. -- Tim Roberts, xxxxx@probo.com Providenza & Boekelheide, Inc.
  Message 8 of 8  
10 Aug 17 16:32
anton bassov
xxxxxx@hotmail.com
Join Date: 16 Jul 2006
Posts To This List: 4384
Buffered IO to Direct IO

> I modified the IOCTL_SCSI_MINIPORT in Application ...... Great!!!! The only thing left now is to modify the target driver accordingly ( I make a, probably, too bold assumption that you actually DO realise that in order for a modified protocol to work identical modifications have to be applied to both sides of the communication channel). Therefore, modify the system-provided port driver accordingly, replace the old version of this driver with the new one on every computer where your app may possibly run, and the whole thing will work just fine...... Anton Bassov
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 07:14.


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