Hi,
I’d appreciate any help on the following problem.
I’ve created a shadow device which works with ZwCreateFile from kernel
mode.
Now, I’m trying to use CreateFile from a user mode application to open a
file through the shadow device and get ERROR_PATH_NOT_FOUND. I’ve tried
specifing the path a number of ways but keep getting the same error.
Can someone please tell me how to specify the path?
The sample app I’m using to test is below.
Much Thanks,
Mark
int main(int argc, char* argv)
{
HANDLE h;
DWORD dwError;
h = CreateFile(“\Device\PassThrough_C\temp\test.txt”, GENERIC_READ,
0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
NULL);
if(h != INVALID_HANDLE_VALUE)
{
CloseHandle(h);
}
else
{
dwError = GetLastError();
}
return 0;
}
You need to create a symbolic link for the shadow device. Then use the
symbolic link to open the file.
Pete
Peter Scott
xxxxx@KernelDrivers.com
http://www.KernelDrivers.com
>-----Original Message-----
>From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
>xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
>Sent: Tuesday, May 14, 2002 10:45 AM
>To: File Systems Developers
>Subject: [ntfsd] Opening a file through a shadow device from user
mode.
>
>Hi,
>
>I’d appreciate any help on the following problem.
>
>I’ve created a shadow device which works with ZwCreateFile from kernel
>mode.
>
>Now, I’m trying to use CreateFile from a user mode application to open
a
>file through the shadow device and get ERROR_PATH_NOT_FOUND. I’ve
tried
>specifing the path a number of ways but keep getting the same error.
>
>Can someone please tell me how to specify the path?
>
>The sample app I’m using to test is below.
>
>Much Thanks,
>Mark
>
>int main(int argc, char* argv)
>{
> HANDLE h;
> DWORD dwError;
>
> h = CreateFile(“\Device\PassThrough_C\temp\test.txt”,
>GENERIC_READ,
>0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
>NULL);
> if(h != INVALID_HANDLE_VALUE)
> {
> CloseHandle(h);
> }
> else
> {
> dwError = GetLastError();
> }
> return 0;
>}
>
>—
>You are currently subscribed to ntfsd as: xxxxx@KernelDrivers.com
>To unsubscribe send a blank email to %%email.unsub%%
In kernel mode, create a symlink to your device in ?? directory.
In user mode, use CreateFile(\.\SymLinkName)
Max
----- Original Message -----
From:
To: “File Systems Developers”
Sent: Tuesday, May 14, 2002 8:45 PM
Subject: [ntfsd] Opening a file through a shadow device from user mode.
> Hi,
>
> I’d appreciate any help on the following problem.
>
> I’ve created a shadow device which works with ZwCreateFile from kernel
> mode.
>
> Now, I’m trying to use CreateFile from a user mode application to open a
> file through the shadow device and get ERROR_PATH_NOT_FOUND. I’ve tried
> specifing the path a number of ways but keep getting the same error.
>
> Can someone please tell me how to specify the path?
>
> The sample app I’m using to test is below.
>
> Much Thanks,
> Mark
>
> int main(int argc, char* argv)
> {
> HANDLE h;
> DWORD dwError;
>
> h = CreateFile(“\Device\PassThrough_C\temp\test.txt”, GENERIC_READ,
> 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_NO_BUFFERING,
> NULL);
> if(h != INVALID_HANDLE_VALUE)
> {
> CloseHandle(h);
> }
> else
> {
> dwError = GetLastError();
> }
> return 0;
> }
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to %%email.unsub%%
>
Thanks Everyone,
Creating the SybolicLink and then accessing it
with the \.\SybolicLinkName\temp\text.txt worked.
Thanks Again,
Mark