How to open a file over LAN?ZwCreateFile failed!

Hi
I try to open a file loacated on a computer in a LAN.
I use ZwCreateFile for file “\\server\directory\file” with flags

(GENERIC_READ | SYNCHRONIZE),
FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ,
FILE_OPEN ,
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE,
NULL, // eabuffer
0 // ealength

and my system hangs or resets itself.
Please help
Thanks


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

It depends on several thing:

  • \Mup\Server\share\path\file.ext
  • If you are running in the system process, you can not access network
    resources from kernel-mode, The solution is to write a service (very simple
    service), start a system thread in your driver using the services process;
    system thread should run in oricess of service. Next, you must give the
    service a logon that has access to the network resource you want to access.

Jamey

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Monday, January 22, 2001 1:00 PM
Subject: [ntfsd] How to open a file over LAN?ZwCreateFile failed!

> Hi
> I try to open a file loacated on a computer in a LAN.
> I use ZwCreateFile for file “\\server\directory\file” with flags
>
> (GENERIC_READ | SYNCHRONIZE),
> FILE_ATTRIBUTE_NORMAL,
> FILE_SHARE_READ,
> FILE_OPEN ,
> FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE,
> NULL, // eabuffer
> 0 // ealength
>
> and my system hangs or resets itself.
> Please help
> Thanks
>
> —
> 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

sorry…

\Device\Mup\…

----- Original Message -----
From: “Jamey Kirby”
To: “File Systems Developers”
Sent: Monday, January 22, 2001 11:03 AM
Subject: [ntfsd] Re: How to open a file over LAN?ZwCreateFile failed!

> It depends on several thing:
>
> - \Mup\Server\share\path\file.ext
> - If you are running in the system process, you can not access network
> resources from kernel-mode, The solution is to write a service (very
simple
> service), start a system thread in your driver using the services process;
> system thread should run in oricess of service. Next, you must give the
> service a logon that has access to the network resource you want to
access.
>
> Jamey
>
> ----- Original Message -----
> From:
> To: “File Systems Developers”
> Sent: Monday, January 22, 2001 1:00 PM
> Subject: [ntfsd] How to open a file over LAN?ZwCreateFile failed!
>
>
> > Hi
> > I try to open a file loacated on a computer in a LAN.
> > I use ZwCreateFile for file “\\server\directory\file” with flags
> >
> > (GENERIC_READ | SYNCHRONIZE),
> > FILE_ATTRIBUTE_NORMAL,
> > FILE_SHARE_READ,
> > FILE_OPEN ,
> > FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE,
> > NULL, // eabuffer
> > 0 // ealength
> >
> > and my system hangs or resets itself.
> > Please help
> > Thanks
> >
> > —
> > 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: 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

> I try to open a file loacated on a computer in a LAN.

I use ZwCreateFile for file “\\server\directory\file” with flags

The correct way is
??\UNC\Server\Share\Path
or
\Device\Mup\Server\Share\Path

I prefer the first way because this is what the Win32 code does.

Max


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