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