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?

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 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
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


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.
</http:>

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

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 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?
>
> ref:
> https://msdn.microsoft.com/en-us/library/windows/hardware/ff543147(v=vs.85).aspx
>
> —
> NTDEV is sponsored by OSR
>
> Visit the list online at: <
> http://www.osronline.com/showlists.cfm?list=ntdev&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


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.
</http:>

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.

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 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&gt;
>
> MONTHLY seminars on crash dump analysis, WDF, Windows internals and
> software drivers!
> Details at http:
>
> To unsubscribe, visit the List Server section of OSR Online at <
> http://www.osronline.com/page.cfm?name=ListServer&gt;
>


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.
</http:>

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.