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.

OSR Seminars


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 7  
06 Jun 18 16:00
Jason T.
xxxxxx@gmail.com
Join Date: 01 Oct 2007
Posts To This List: 37
Server 2019, volume sector size is 0

I'm playing with the latest Insider Preview of Server 2019 and when I attach a volume filter both the PDO and FDO have their SectorSize field set to 0. The docs indicate that SectorSize will be zero for non-volume DOs, but this is a volume (HarddiskVolume2 in this particular case). This is a vanilla install of Server 2019 with no other products installed. Has anybody else hit this? Any suggested workarounds?
  Message 2 of 7  
06 Jun 18 16:37
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 301
Server 2019, volume sector size is 0

I do not believe it is safe to rely on the SectorSize value in the device object; esp. in a volume device object. I don't. On Wed, Jun 6, 2018 at 4:01 PM xxxxx@gmail.com <xxxxx@lists.osr.com> wrote: > I'm playing with the latest Insider Preview of Server 2019 and when I > attach a volume filter both the PDO and FDO have their SectorSize field set > to 0. The docs indicate that SectorSize will be zero for non-volume DOs, > but this is a volume (HarddiskVolume2 in this particular case). This is a > vanilla install of Server 2019 with no other products installed. > > Has anybody else hit this? Any suggested workarounds? > > --- > NTDEV is sponsored by OSR <...excess quoted lines suppressed...> -- Jamey Kirby Disrupting the establishment since 1964 *This is a personal email account and as such, emails are not subject to archiving. Nothing else really matters.* --
  Message 3 of 7  
06 Jun 18 17:06
Jason T.
xxxxxx@gmail.com
Join Date: 01 Oct 2007
Posts To This List: 37
Server 2019, volume sector size is 0

Thanks for the reply. The docs say this about DEVICE_OBJECT's SectorSize field: "If the device object does not represent a volume, this member is set to zero. If the device object represents a volume, this member specifies the volume's sector size, in bytes." and on any OS prior to Server 2019 I have always found non-zero values in these fields. Do you have a link to something that made you think this was invalid/unsafe? ref: https://msdn.microsoft.com/en-us/library/windows/hardware/ff543147(v=vs.85).aspx
  Message 4 of 7  
06 Jun 18 18:01
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 301
Server 2019, volume sector size is 0

I've seen instances where it was zero, so in my code I avoid it all together. How soon are you checking the value after adding the device? On Wed, Jun 6, 2018 at 5:07 PM xxxxx@gmail.com <xxxxx@lists.osr.com> wrote: > Thanks for the reply. The docs say this about DEVICE_OBJECT's SectorSize > field: > > "If the device object does not represent a volume, this member is set to > zero. If the device object represents a volume, this member specifies the > volume's sector size, in bytes." > > and on any OS prior to Server 2019 I have always found non-zero values in > these fields. Do you have a link to something that made you think this was > invalid/unsafe? <...excess quoted lines suppressed...> -- Jamey Kirby Disrupting the establishment since 1964 *This is a personal email account and as such, emails are not subject to archiving. Nothing else really matters.* --
  Message 5 of 7  
06 Jun 18 18:25
Jason T.
xxxxxx@gmail.com
Join Date: 01 Oct 2007
Posts To This List: 37
Server 2019, volume sector size is 0

All along I have been grabbing it from the underlying DO in my AddDevice and never had a problem. Now, as a workaround, I am now sending an IOCTL_DISK_GET_DRIVE_GEOMETRY to the DO on the completion side of IRP_MN_START_DEVICE and that seems to be retrieving sane values.
  Message 6 of 7  
07 Jun 18 11:19
Jamey Kirby
xxxxxx@gmail.com
Join Date: 31 Dec 2014
Posts To This List: 301
Server 2019, volume sector size is 0

I just tested some of my code on 2019 and everything works. When you say underlying DO, are you referring to the target or the base DO? In my case, I delay needing to know the sector size until a file system has been mounted. I then make an FSCTL to get the file system size information. From there I get the sector size the file system is using. Advanced format disk drives can perform both 512 byte sector and 4096 byte sector operations. In my case, I care about which one the file system is using. On Wed, Jun 6, 2018 at 6:26 PM xxxxx@gmail.com <xxxxx@lists.osr.com> wrote: > All along I have been grabbing it from the underlying DO in my AddDevice > and never had a problem. Now, as a workaround, I am now sending an > IOCTL_DISK_GET_DRIVE_GEOMETRY to the DO on the completion side of > IRP_MN_START_DEVICE and that seems to be retrieving sane values. > > --- > NTDEV is sponsored by OSR > > Visit the list online at: < > http://www.osronline.com/showlists.cfm?list=ntdev> <...excess quoted lines suppressed...> -- Jamey Kirby Disrupting the establishment since 1964 *This is a personal email account and as such, emails are not subject to archiving. Nothing else really matters.* --
  Message 7 of 7  
07 Jun 18 12:19
Jason T.
xxxxxx@gmail.com
Join Date: 01 Oct 2007
Posts To This List: 37
Server 2019, volume sector size is 0

Both the volume PDO passed into my AddDevice and the target DO (the one returned by IoAttachDeviceToDeviceStack) have their SectorSize fields set to 0 when I am in my filter's AddDevice routine. This is when I save off that field in my devext and it has always been non-zero prior to Server 2019. It may be getting changed shortly after which allows your flow to work. If you see non-zero values in these fields during AddDevice that would be very curious.
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 11:16.


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