How can I determine the Physical Sector Size (e.g. if i have an Advanced Format drive with 4,096 byte sectors rather than the legacy 512 byte sectors) in Wi
If you really want to have it programmatically, you need to send IOCTL_STORAGE_QUERY_PROPERTY providing STORAGE_PROPERTY_QUERY with PropertyId set to StorageAccessAlignmentProperty. This gives both physical and logical sector sizes.
Note: this only works on Windows Vista and higher.