IoVolumeDeviceToDosName Problem

am having problems with IoVolumeDeviceToDosName(?) API.

Test machine:

WinXP Pro SP2 English.

Test Driver : Filespy with minor modifications.

Objective: To get the DOS name for a volume automatically when a mount
completes.

The scenario is:

  1. I dismount a volume. Delete a partition. Do a repartition. And
    format it. All these are from Windows ComputerManagement->DiskManagement
  2. In the post mount completion routine SpyFsControlMountVolumeComplete(?)
    I set a flag (called nRegister ) in my device extension that signifies
    that the mount operation for that volume has been completed. Ofcourse it is
    done only in cases where the mount request seceeded.
  3. In the passthrough routine of filespy I have added the code

if((0 == pDevExt->UserNames.Length)&&(pDevExt->pDiskDeviceObject)&&(
pDevExt->nRegister)){

#if WINVER >= 0x0501

IoVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
&dosname);

#else

RtlVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
&dosname);

#endif

if(NT_SUCCESS(status) && dosname.Length){

SpyStoreUserName( pDevExt,&dosname);

RtlFreeUnicodeString(&dosname);

}

  1. }
  2. Thus this code only gets invoked when nRegister is true. Which I
    set in the Complete routine of mount volume.
  3. What I observe is that for all IRPs after the mount has completed
    the routine IoVolumeDeviceToDosName(?) doesn’t return, thus stalling the
    threads!!! As a result the machine hangs.

Can someone explain what is going wrong. I tried tweaking the logic of the
call for this API with a further check for IRP_MJ_CREATE, but the scenario
remains the same.

  • amitr0

I believe this scenario has previously been described - you can’t query
the name during the mount as I recall.

Of course, hangs are easy to debug and if you want to work in file
systems I suggest building up skills in this area - deadlocks are a
reality of life.

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com http:</http:>


From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of amitr0
Sent: Thursday, 24 August 2006 5:37 PM
To: ntfsd redirect
Subject: [ntfsd] IoVolumeDeviceToDosName Problem

am having problems with IoVolumeDeviceToDosName(…) API.

Test machine:

WinXP Pro SP2 English.

Test Driver : Filespy with minor modifications.

Objective: To get the DOS name for a volume automatically when a mount
completes.

The scenario is:

  1. I dismount a volume. Delete a partition. Do a repartition. And
    format it. All these are from Windows ComputerManagement->DiskManagement

  2. In the post mount completion routine
    SpyFsControlMountVolumeComplete(…) I set a flag (called nRegister ) in
    my device extension that signifies that the mount operation for that
    volume has been completed. Ofcourse it is done only in cases where the
    mount request seceeded.

  3. In the passthrough routine of filespy I have added the code

if((0 == pDevExt->UserNames.Length)&&(pDevExt->pDiskDeviceObject)&&(
pDevExt->nRegister)){

#if WINVER >= 0x0501

IoVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
&dosname);

#else

RtlVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
&dosname);

#endif

if(NT_SUCCESS(status) && dosname.Length){

SpyStoreUserName( pDevExt,&dosname);

RtlFreeUnicodeString(&dosname);

}

  1. }
  2. Thus this code only gets invoked when nRegister is true. Which I
    set in the Complete routine of mount volume.
  3. What I observe is that for all IRPs after the mount has
    completed the routine IoVolumeDeviceToDosName(…) doesn’t return, thus
    stalling the threads!!! As a result the machine hangs.

Can someone explain what is going wrong. I tried tweaking the logic of
the call for this API with a further check for IRP_MJ_CREATE, but the
scenario remains the same.

Tony,

Yes, this scenario has been described, and I have rad that thread by Neil.
But I am not doing it with Mount. I am doing it for the first IRP (Create)
that comes for that volume.

In the Mount completion what I do is set a flag that tells me ‘OK, now the
next create that comes your way, should invoke this call’.

amitr0

On 8/24/06, Tony Mason wrote:
>
> I believe this scenario has previously been described ? you can’t query
> the name during the mount as I recall.
>
>
>
> Of course, hangs are easy to debug and if you want to work in file systems
> I suggest building up skills in this area ? deadlocks are a reality of life.
>
>
>
> Tony Mason
>
> Consulting Partner
>
> OSR Open Systems Resources, Inc.
>
> http://www.osr.com
>
>
>
>
> ------------------------------
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *amitr0
> Sent: Thursday, 24 August 2006 5:37 PM
> To: ntfsd redirect
> Subject: [ntfsd] IoVolumeDeviceToDosName Problem
>
>
>
> am having problems with IoVolumeDeviceToDosName(?) API.
>
>
>
> Test machine:
>
> WinXP Pro SP2 English.
>
> Test Driver : Filespy with minor modifications.
>
>
>
> Objective: To get the DOS name for a volume automatically when a mount
> completes.
>
>
>
> The scenario is:
>
>
>
> 1. I dismount a volume. Delete a partition. Do a repartition. And
> format it. All these are from Windows ComputerManagement->DiskManagement
> 2. In the post mount completion routine SpyFsControlMountVolumeComplete(?)
> I set a flag (called nRegister ) in my device extension that
> signifies that the mount operation for that volume has been completed.
> Ofcourse it is done only in cases where the mount request seceeded.
> 3. In the passthrough routine of filespy I have added the code
>
>
> if((0 == pDevExt->UserNames.Length)&&(pDevExt->pDiskDeviceObject)&&(
> pDevExt->nRegister)){
>
> #if WINVER >= 0x0501
>
> IoVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
> &dosname);
>
> #else
>
> RtlVolumeDeviceToDosName(pDevExt->pDiskDeviceObject,
> &dosname);
>
> #endif
>
>
>
> if(NT_SUCCESS(status) && dosname.Length){
>
> SpyStoreUserName( pDevExt,&dosname);
>
> RtlFreeUnicodeString(&dosname);
>
> }
>
> 1. }
> 2. Thus this code only gets invoked when nRegister is true. Which I
> set in the Complete routine of mount volume.
> 3. What I observe is that for all IRPs after the mount has completed
> the routine IoVolumeDeviceToDosName(?) doesn’t return, thus stalling the
> threads!!! As a result the machine hangs.
>
>
>
> Can someone explain what is going wrong. I tried tweaking the logic of the
> call for this API with a further check for IRP_MJ_CREATE, but the scenario
> remains the same.
>
>
>
> –
>
> - amitr0 — Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17 You are currently subscribed
> to ntfsd as: unknown lmsubst tag argument: ‘’ To unsubscribe send a blank
> email to xxxxx@lists.osr.com
>
> —
> Questions? First check the IFS FAQ at
> https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
>
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>



- amitr0