Urgent: XP and CreateFile

I’ve created a service (running using System account) on XP that calls
CreateFile on a partition like that below:

CreateFile(“\\.\C:”, GENERIC_READ|GENERIC_WRITE, FILE_SHARE|FILE_WRITE,
NULL, OPEN_EXISTING, 0, NULL)

But the call fails with the error “File not found” type.

If I try the call from a Win32 application using the same call also on XP,
the call succeed. Alternatively the call made from the service on NT/2K
also works. Strange.

Anyone has any idea whats wrong or have faced this too?? Thanks.


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

Maybe “C:” symlink is not assigned for this service under XP.
It has some improvements in DosDevices directory, so, this can be true.

Max

----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Monday, November 12, 2001 4:10 AM
Subject: [ntdev] Urgent: XP and CreateFile

> I’ve created a service (running using System account) on XP that calls
> CreateFile on a partition like that below:
>
> CreateFile(“\\.\C:”, GENERIC_READ|GENERIC_WRITE, FILE_SHARE|FILE_WRITE,
> NULL, OPEN_EXISTING, 0, NULL)
>
> But the call fails with the error “File not found” type.
>
> If I try the call from a Win32 application using the same call also on XP,
> the call succeed. Alternatively the call made from the service on NT/2K
> also works. Strange.
>
> Anyone has any idea whats wrong or have faced this too?? Thanks.
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


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