After formatting my volume on XP, Explorer will not display the new volume
label.
Steps:
- Lock volume exclusive.
- Write logical format to disc.
- Unlock volume exclusive.
- On Close I free the VPB. (Similar to CDFS example code. see
following)
//
// Make sure to remove the last reference on the Vpb.
//
OldVpb->ReferenceCount -= 1;
OldVpb->DeviceObject = NULL;
ClearFlag( Vcb->Vpb->Flags, VPB_MOUNTED );
ClearFlag( Vcb->Vpb->Flags, VPB_LOCKED );
//
// Clear the Vpb flag so we know not to delete it.
//
Vcb->Vpb = NULL;
IoReleaseVpbSpinLock( SavedIrql );
CdUnlockVcb( IrpContext, Vcb );
CdDeleteVcb( IrpContext, Vcb );
VcbPresent = FALSE;
-
IOManager calls back to my file system to mount the volume (note, it
uses the same VPB that I just released in code above…I assume that’s
good news). So, I update VPB with my new VolDevice object and call
FsRtlNotifyVolumeEvent(FSRTL_VOLUME_MOUNT) and return SUCCESS. -
Explorer still shows the old volume label (pre format); so does the
volume property page. But, running label.exe from a cmd session will show
the correct label. Note, all FS requests are correctly sent to my file
system. The only issue is that dang volume label. Note, ejecting and
reinserting the media will refresh the label correctly.
Any ideas? Could this have to do with re-mounting media in a CD device
when there is no physical “new media” notification from the device?
thanks!