W2K - open device interface -> ERROR_SHARING_VIOLATION

In my disk class filter driver I call IoRegisterDeviceInterface() for each
filtered PDO.
The problem is when I try to open one of these interfaces from UserMode
application.

If the filtered disk has NOT been mounted by the system and then I try to
open my device interface - everything is ok, BUT
if the disk has been mounted - CreateFile() returns with error
ERROR_SHARING_VIOLATION…
My current CreateFile call is:

file = CreateFile ( deviceInterfaceDetailData->DevicePath,
GENERIC_READ | GENERIC_WRITE,
0,
NULL, // no SECURITY_ATTRIBUTES structure
OPEN_EXISTING, // No special create flags
0, // No special attributes
NULL);

I’ve tried to use different share mode but it doesn’t work.
What’s wrong? Any idea?

/ May be someone has opened exclusively the device interface and doesn’t
close it… /

Thanks in advance,
Kristian


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Surely it is not possible to open the mounted disk bypassing the filesystem.
This would violate the cache/on-disk data coherency.
Any sector-level IO to a mounted disk must go via the FSD’s DASD path.
So, open \.\C: instead.

Max

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Monday, January 28, 2002 12:00 AM
Subject: [ntfsd] W2K - open device interface -> ERROR_SHARING_VIOLATION

> In my disk class filter driver I call IoRegisterDeviceInterface() for each
> filtered PDO.
> The problem is when I try to open one of these interfaces from UserMode
> application.
>
>
> If the filtered disk has NOT been mounted by the system and then I try to
> open my device interface - everything is ok, BUT
> if the disk has been mounted - CreateFile() returns with error
> ERROR_SHARING_VIOLATION…
> My current CreateFile call is:
>
> file = CreateFile ( deviceInterfaceDetailData->DevicePath,
> GENERIC_READ | GENERIC_WRITE,
> 0,
> NULL, // no SECURITY_ATTRIBUTES structure
> OPEN_EXISTING, // No special create flags
> 0, // No special attributes
> NULL);
>
> I’ve tried to use different share mode but it doesn’t work.
> What’s wrong? Any idea?
>
> / May be someone has opened exclusively the device interface and doesn’t
> close it… /
>
> Thanks in advance,
> Kristian
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com