}
g_return_val_if_fail(FileObject->DeviceObject!=NULL,FALSE);
/* Is PAGE_SIZE aligned with 'FileObject->DeviceObject->SectorSize'?
- * 'SectorSize' may not yet be filled in.
+ * 'SectorSize' may not yet be initialized during mount operation
+ * and such state can be detected by missing 'FileObject->DeviceObject->Vpb'.
*/
- g_return_val_if_fail(!FileObject->DeviceObject->SectorSize
- || 0==CAPTIVE_ROUND_DOWN_EXCEEDING(PAGE_SIZE,FileObject->DeviceObject->SectorSize),FALSE);
+ g_return_val_if_fail(0
+ || !FileObject->DeviceObject->Vpb /* not yet much ready */
+ || (FileObject->DeviceObject->SectorSize>0 /* prevent division by 0 */
+ && 0==CAPTIVE_ROUND_DOWN_EXCEEDING(PAGE_SIZE,FileObject->DeviceObject->SectorSize)),
+ FALSE);
page_position_hash_init();
private_bcb_hash_init();