Named Pipes in KernelMode...

Can I use named pipes from my file system filter driver?
Are there any problems doing that?

I know there is a Nt routine:

NtCreateNamedPipeFile, may be there is Zw routine too, but I can’t find
information about it and other pipe functions :

CallNamedPipe
ConnectNamedPipe
CreatePipe
DisconnectNamedPipe
GetNamedPipeHandleState
GetNamedPipeInfo
PeekNamedPipe
SetNamedPipeHandleState
TransactNamedPipe
WaitNamedPipe

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

On Wed, 16 May 2001 xxxxx@atia.com wrote:

Can I use named pipes from my file system filter driver?

NtCreateNamedPipeFile, may be there is Zw routine too, but I can’t find

Check the mailing list archive for 1997-08. Someone posted an example
driver and app that uses named pipes to comunicate.

/Bo Branten


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

NtCreateNamedPipeFile is not exported to kernel as Zw function. However,
this does not mean that it is impossible to call it. But I would not advise
doing this.

Regards, Vadim.
----- Original Message -----
From:
To: “File Systems Developers”
Sent: Wednesday, May 16, 2001 6:53 AM
Subject: [ntfsd] Named Pipes in KernelMode…

> Can I use named pipes from my file system filter driver?
> Are there any problems doing that?
>
> I know there is a Nt routine:
>
> NtCreateNamedPipeFile, may be there is Zw routine too, but I can’t find
> information about it and other pipe functions :
>
> CallNamedPipe
> ConnectNamedPipe
> CreatePipe
> DisconnectNamedPipe
> GetNamedPipeHandleState
> GetNamedPipeInfo
> PeekNamedPipe
> SetNamedPipeHandleState
> TransactNamedPipe
> WaitNamedPipe
>
>
> Kristian
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@ntkernel.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

Thanks for fast replies,

Check the mailing list archive for 1997-08. Someone posted an example
driver and app that uses named pipes to comunicate.

I can’t search in mailing list archive. There is a message on OSR’s site :

“Messages are available from 02/23/00 to 05/16/01” :frowning:

NtCreateNamedPipeFile is not exported to kernel as Zw function. However,
this does not mean that it is impossible to call it. But I would not
advise doing this

Ok, but is there other solution? May be I have to build my own irps and
send them to NPFS?


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

Hello,

Well there’s the ZwCreateNamedPipeFile. if you require more info let me
know.

Regards Robin.

----- Original Message -----
From:
To: “File Systems Developers”
Sent: Wednesday, May 16, 2001 6:53 AM
Subject: [ntfsd] Named Pipes in KernelMode…

> Can I use named pipes from my file system filter driver?
> Are there any problems doing that?
>
> I know there is a Nt routine:
>
> NtCreateNamedPipeFile, may be there is Zw routine too, but I can’t find
> information about it and other pipe functions :
>
> CallNamedPipe
> ConnectNamedPipe
> CreatePipe
> DisconnectNamedPipe
> GetNamedPipeHandleState
> GetNamedPipeInfo
> PeekNamedPipe
> SetNamedPipeHandleState
> TransactNamedPipe
> WaitNamedPipe
>
>
> Kristian
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@hillum.freeserve.co.uk
> 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

You can use the IoCreateFile directly - because the
NeCreateNamedPipeFile inetrnally uses it.
Needed prototypes follows:

NTSYSAPI
NTSTATUS
NTAPI
NtCreateNamedPipeFile(
OUT PHANDLE FileHandle,
IN ULONG DesiredAccess,
IN POBJECT_ATTRIBUTES ObjectAttributes,
OUT PIO_STATUS_BLOCK IoStatusBlock,
IN ULONG ShareAccess,
IN ULONG CreateDisposition,
IN ULONG CreateOptions,
IN ULONG NamedPipeType,
IN ULONG ReadMode,
IN ULONG CompletionMode,
IN ULONG MaximumInstances,
IN ULONG InboundQuota,
IN ULONG OutboundQuota,
IN PLARGE_INTEGER DefaultTimeout OPTIONAL
);

//
// Pointer to the following structure is in irp stack location
// ->Parameters.Create.EaLength (for IRP_MJ_CREATE_NAMED_PIPE)
//

typedef struct _NAMED_PIPE_CREATE_PARAMETERS {
ULONG NamedPipeType;
ULONG ReadMode;
ULONG CompletionMode;
ULONG MaximumInstances;
ULONG InboundQuota;
ULONG OutboundQuota;
LARGE_INTEGER DefaultTimeout;
BOOLEAN TimeoutSpecified;
} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;

So you have to call IoCreateFile with the following parameters:
FileHandle, // from NtCreateNamedPipeFile
DesiredAccess, // from NtCreateNamedPipeFile
ObjectAttributes, // from NtCreateNamedPipeFile
IoStatusBlock, // from NtCreateNamedPipeFile
NULL,
0,
ShareAccess, // from NtCreateNamedPipeFile
CreateDisposition, // from NtCreateNamedPipeFile
CreateOptions, // from NtCreateNamedPipeFile
NULL,
0,
CreateFileTypeNamedPipe,
NamedPipeCreateParameters,
0

when:
CreateFileTypeNamedPipe comes from enum _CREATE_FILE_TYPE
and the NamedPipeCreateParameters is a pointer to a structure of type
NAMED_PIPE_CREATE_PARAMETERS filled as in the smaple below:
->NamedPipeType = NamedPipeType; // from
NtCreateNamedPipeFile
->ReadMode = ReadMode; // from NtCreateNamedPipeFile
->CompletionMode = CompletionMode; // from
NtCreateNamedPipeFile
->MaximumInstances = MaximumInstances; // from NtCreateNamedPipeFile
->InboundQuota = InboundQuota; // from NtCreateNamedPipeFile
->OutboundQuota = OutboundQuota; // from
NtCreateNamedPipeFile
if (DefaultTimeout != NULL) // from
NtCreateNamedPipeFile
{
->DefaultTimeout = *DefaultTimeout; // from
NtCreateNamedPipeFile
->TimeoutSpecified = TRUE;
}
else
{
->TimeoutSpecified = FALSE;
}

As far as those other functions are concerned you should note this:
Every such a function is implemented in kernel32.dll so you are able
to find out how to do its functionality in your driver.
Please let me know if you need some help with any of them.

Hope this helps
Paul

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Vadim Smirnov
Sent: Wednesday, May 16, 2001 1:34 PM
To: File Systems Developers
Subject: [ntfsd] Re: Named Pipes in KernelMode…

NtCreateNamedPipeFile is not exported to kernel as Zw function. However,
this does not mean that it is impossible to call it. But I would not
advise
doing this.

Regards, Vadim.
----- Original Message -----
From:
To: “File Systems Developers”
Sent: Wednesday, May 16, 2001 6:53 AM
Subject: [ntfsd] Named Pipes in KernelMode…

> Can I use named pipes from my file system filter driver?
> Are there any problems doing that?
>
> I know there is a Nt routine:
>
> NtCreateNamedPipeFile, may be there is Zw routine too, but I can’t
find
> information about it and other pipe functions :
>
> CallNamedPipe
> ConnectNamedPipe
> CreatePipe
> DisconnectNamedPipe
> GetNamedPipeHandleState
> GetNamedPipeInfo
> PeekNamedPipe
> SetNamedPipeHandleState
> TransactNamedPipe
> WaitNamedPipe
>
>
> Kristian
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@ntkernel.com
> To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>


You are currently subscribed to ntfsd as: xxxxx@compelson.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