2013-10-11 15:19:46 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Named Pipe FileSystem
|
|
|
|
* LICENSE: BSD - See COPYING.ARM in the top level directory
|
|
|
|
* FILE: drivers/filesystems/npfs/npfs.h
|
|
|
|
* PURPOSE: Named Pipe FileSystem Header
|
|
|
|
* PROGRAMMERS: ReactOS Portable Systems Group
|
|
|
|
*/
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
#ifndef _NPFS_PCH_
|
|
|
|
#define _NPFS_PCH_
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* INCLUDES *******************************************************************/
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* System Headers */
|
2005-09-04 21:44:02 +00:00
|
|
|
#include <ntifs.h>
|
2014-02-06 19:08:00 +00:00
|
|
|
#include <ndk/obfuncs.h>
|
2011-01-01 12:40:24 +00:00
|
|
|
#include <pseh/pseh2.h>
|
2014-02-01 14:28:15 +00:00
|
|
|
//#define UNIMPLEMENTED
|
|
|
|
//#define DPRINT1 DbgPrint
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
#define TRACE(...) /* DPRINT1("%s: ", __FUNCTION__); DbgPrint(__VA_ARGS__) */
|
2013-10-11 15:19:46 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Allow Microsoft Extensions */
|
2013-10-11 15:19:46 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(disable:4201)
|
|
|
|
#pragma warning(disable:4214)
|
|
|
|
#pragma warning(disable:4100)
|
|
|
|
#endif
|
|
|
|
|
2014-02-01 14:28:15 +00:00
|
|
|
#define MIN_INDEXED_LENGTH 5
|
|
|
|
#define MAX_INDEXED_LENGTH 9
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* TYPEDEFS & DEFINES *********************************************************/
|
|
|
|
|
|
|
|
//
|
|
|
|
// Pool Tags for NPFS (from pooltag.txt)
|
|
|
|
//
|
|
|
|
// Npf* -npfs.sys - Npfs Allocations
|
|
|
|
// NpFc - npfs.sys - CCB, client control block
|
|
|
|
// NpFf - npfs.sys - FCB, file control block
|
|
|
|
// NpFC - npfs.sys - ROOT_DCB CCB
|
|
|
|
// NpFD - npfs.sys - DCB, directory block
|
|
|
|
// NpFg - npfs.sys - Global storage
|
|
|
|
// NpFi - npfs.sys - NPFS client info buffer.
|
|
|
|
// NpFn - npfs.sys - Name block
|
|
|
|
// NpFq - npfs.sys - Query template buffer used for directory query
|
|
|
|
// NpFr - npfs.sys - DATA_ENTRY records(read / write buffers)
|
|
|
|
// NpFs - npfs.sys - Client security context
|
|
|
|
// NpFw - npfs.sys - Write block
|
|
|
|
// NpFW - npfs.sys - Write block
|
2014-10-17 10:04:57 +00:00
|
|
|
#define NPFS_CCB_TAG 'cFpN'
|
|
|
|
#define NPFS_ROOT_DCB_CCB_TAG 'CFpN'
|
|
|
|
#define NPFS_DCB_TAG 'DFpN'
|
|
|
|
#define NPFS_FCB_TAG 'fFpN'
|
|
|
|
#define NPFS_GLOBAL_TAG 'gFpN'
|
|
|
|
#define NPFS_CLIENT_INFO_TAG 'iFpN'
|
|
|
|
#define NPFS_NAME_BLOCK_TAG 'nFpN'
|
|
|
|
#define NPFS_QUERY_TEMPLATE_TAG 'qFpN'
|
|
|
|
#define NPFS_DATA_ENTRY_TAG 'rFpN'
|
|
|
|
#define NPFS_CLIENT_SEC_CTX_TAG 'sFpN'
|
|
|
|
#define NPFS_WAIT_BLOCK_TAG 'tFpN'
|
|
|
|
#define NPFS_WRITE_BLOCK_TAG 'wFpN'
|
2013-10-11 15:19:46 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// NPFS bugchecking support
|
|
|
|
//
|
|
|
|
// We define the NpBugCheck macro which triggers a NPFS_FILE_SYSTEM bugcheck
|
|
|
|
// containing the source file ID number and the line where it was emitted, as
|
|
|
|
// described in the MSDN article "Bug Check 0x25: NPFS_FILE_SYSTEM".
|
|
|
|
//
|
|
|
|
// The bugcheck emits 4 ULONGs; the first one is made, in its high word, by
|
|
|
|
// the current source file ID and in its low word, by the line number; the
|
|
|
|
// three other ones are user-defined.
|
|
|
|
//
|
|
|
|
// In order to avoid redefinition of the same file ID in different source files,
|
|
|
|
// we gather all of them here, so that you will have to add (or remove) a new
|
|
|
|
// one as soon as you add (or remove) a source file from the NPFS driver code.
|
|
|
|
//
|
|
|
|
// To use the NpBugCheck macro in a source file, define at its beginning
|
|
|
|
// the constant NPFS_BUGCHECK_FILE_ID with one of the following file IDs,
|
|
|
|
// then use the bugcheck macro wherever you want.
|
|
|
|
//
|
|
|
|
#define NPFS_BUGCHECK_CLEANUP 0x0001
|
|
|
|
#define NPFS_BUGCHECK_CLOSE 0x0002
|
|
|
|
#define NPFS_BUGCHECK_CREATE 0x0003
|
|
|
|
#define NPFS_BUGCHECK_DATASUP 0x0004
|
|
|
|
#define NPFS_BUGCHECK_FILEINFO 0x0005
|
|
|
|
#define NPFS_BUGCHECK_FILEOBSUP 0x0006
|
|
|
|
#define NPFS_BUGCHECK_FLUSHBUF 0x0007
|
|
|
|
#define NPFS_BUGCHECK_FSCTRL 0x0008
|
|
|
|
#define NPFS_BUGCHECK_MAIN 0x0009
|
|
|
|
#define NPFS_BUGCHECK_PREFXSUP 0x000a
|
|
|
|
#define NPFS_BUGCHECK_READ 0x000b
|
|
|
|
#define NPFS_BUGCHECK_READSUP 0x000c
|
|
|
|
#define NPFS_BUGCHECK_SECURSUP 0x000d
|
|
|
|
#define NPFS_BUGCHECK_SEINFO 0x000e
|
|
|
|
#define NPFS_BUGCHECK_STATESUP 0x000f
|
|
|
|
#define NPFS_BUGCHECK_STRUCSUP 0x0010
|
|
|
|
#define NPFS_BUGCHECK_VOLINFO 0x0011
|
|
|
|
#define NPFS_BUGCHECK_WAITSUP 0x0012
|
|
|
|
#define NPFS_BUGCHECK_WRITE 0x0013
|
|
|
|
#define NPFS_BUGCHECK_WRITESUP 0x0014
|
|
|
|
|
|
|
|
#define NpBugCheck(p1, p2, p3) \
|
|
|
|
KeBugCheckEx(NPFS_FILE_SYSTEM, \
|
|
|
|
(NPFS_BUGCHECK_FILE_ID << 16) | __LINE__, \
|
|
|
|
(p1), (p2), (p3))
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Node Type Codes for NPFS */
|
2013-10-11 15:19:46 +00:00
|
|
|
#define NPFS_NTC_VCB 1
|
|
|
|
#define NPFS_NTC_ROOT_DCB 2
|
|
|
|
#define NPFS_NTC_FCB 4
|
|
|
|
#define NPFS_NTC_CCB 6
|
|
|
|
#define NPFS_NTC_NONPAGED_CCB 7
|
|
|
|
#define NPFS_NTC_ROOT_DCB_CCB 8
|
|
|
|
typedef USHORT NODE_TYPE_CODE, *PNODE_TYPE_CODE;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Data Queue States */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef enum _NP_DATA_QUEUE_STATE
|
2011-01-01 12:40:24 +00:00
|
|
|
{
|
2013-10-11 15:19:46 +00:00
|
|
|
ReadEntries = 0,
|
|
|
|
WriteEntries = 1,
|
|
|
|
Empty = 2
|
|
|
|
} NP_DATA_QUEUE_STATE;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Data Queue Entry Types */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef enum _NP_DATA_QUEUE_ENTRY_TYPE
|
|
|
|
{
|
|
|
|
Buffered = 0,
|
|
|
|
Unbuffered
|
|
|
|
} NP_DATA_QUEUE_ENTRY_TYPE;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* An Input or Output Data Queue. Each CCB has two of these. */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_DATA_QUEUE
|
|
|
|
{
|
|
|
|
LIST_ENTRY Queue;
|
|
|
|
ULONG QueueState;
|
|
|
|
ULONG BytesInQueue;
|
|
|
|
ULONG EntriesInQueue;
|
|
|
|
ULONG QuotaUsed;
|
|
|
|
ULONG ByteOffset;
|
|
|
|
ULONG Quota;
|
|
|
|
} NP_DATA_QUEUE, *PNP_DATA_QUEUE;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The Entries that go into the Queue */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_DATA_QUEUE_ENTRY
|
|
|
|
{
|
|
|
|
LIST_ENTRY QueueEntry;
|
|
|
|
ULONG DataEntryType;
|
|
|
|
PIRP Irp;
|
|
|
|
ULONG QuotaInEntry;
|
|
|
|
PSECURITY_CLIENT_CONTEXT ClientSecurityContext;
|
|
|
|
ULONG DataSize;
|
|
|
|
} NP_DATA_QUEUE_ENTRY, *PNP_DATA_QUEUE_ENTRY;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* A Wait Queue. Only the VCB has one of these. */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_WAIT_QUEUE
|
|
|
|
{
|
|
|
|
LIST_ENTRY WaitList;
|
|
|
|
KSPIN_LOCK WaitLock;
|
|
|
|
} NP_WAIT_QUEUE, *PNP_WAIT_QUEUE;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The Entries in the Queue above, one for each Waiter. */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_WAIT_QUEUE_ENTRY
|
1999-11-24 11:51:55 +00:00
|
|
|
{
|
2013-10-11 15:19:46 +00:00
|
|
|
PIRP Irp;
|
|
|
|
KDPC Dpc;
|
|
|
|
KTIMER Timer;
|
|
|
|
PNP_WAIT_QUEUE WaitQueue;
|
|
|
|
UNICODE_STRING AliasName;
|
2012-07-23 13:24:48 +00:00
|
|
|
PFILE_OBJECT FileObject;
|
2013-10-11 15:19:46 +00:00
|
|
|
} NP_WAIT_QUEUE_ENTRY, *PNP_WAIT_QUEUE_ENTRY;
|
2010-11-19 22:42:53 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The event buffer in the NonPaged CCB */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_EVENT_BUFFER
|
|
|
|
{
|
|
|
|
PKEVENT Event;
|
|
|
|
} NP_EVENT_BUFFER, *PNP_EVENT_BUFFER;
|
2009-02-08 09:04:42 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The CCB for the Root DCB */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_ROOT_DCB_CCB
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeType;
|
|
|
|
PVOID Unknown;
|
|
|
|
ULONG Unknown2;
|
|
|
|
} NP_ROOT_DCB_CCB, *PNP_ROOT_DCB_FCB;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The header that both FCB and DCB share */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_CB_HEADER
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeType;
|
|
|
|
LIST_ENTRY DcbEntry;
|
|
|
|
PVOID ParentDcb;
|
|
|
|
ULONG CurrentInstances;
|
|
|
|
ULONG ServerOpenCount;
|
|
|
|
PSECURITY_DESCRIPTOR SecurityDescriptor;
|
|
|
|
} NP_CB_HEADER, *PNP_CB_HEADER;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The footer that both FCB and DCB share */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_CB_FOOTER
|
|
|
|
{
|
|
|
|
UNICODE_STRING FullName;
|
|
|
|
UNICODE_STRING ShortName;
|
|
|
|
UNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry;
|
|
|
|
} NP_CB_FOOTER;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* A Directory Control Block (DCB) */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_DCB
|
|
|
|
{
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Common Header */
|
2013-10-11 15:19:46 +00:00
|
|
|
NP_CB_HEADER;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* DCB-specific data */
|
2013-10-11 15:19:46 +00:00
|
|
|
LIST_ENTRY NotifyList;
|
|
|
|
LIST_ENTRY NotifyList2;
|
|
|
|
LIST_ENTRY FcbList;
|
|
|
|
#ifndef _WIN64
|
|
|
|
ULONG Pad;
|
|
|
|
#endif
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Common Footer */
|
2013-10-11 15:19:46 +00:00
|
|
|
NP_CB_FOOTER;
|
|
|
|
} NP_DCB, *PNP_DCB;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* A File Control BLock (FCB) */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_FCB
|
|
|
|
{
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Common Header */
|
2013-10-11 15:19:46 +00:00
|
|
|
NP_CB_HEADER;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* FCB-specific fields */
|
2013-10-11 15:19:46 +00:00
|
|
|
ULONG MaximumInstances;
|
|
|
|
USHORT NamedPipeConfiguration;
|
|
|
|
USHORT NamedPipeType;
|
|
|
|
LARGE_INTEGER Timeout;
|
|
|
|
LIST_ENTRY CcbList;
|
|
|
|
#ifdef _WIN64
|
|
|
|
PVOID Pad[2];
|
|
|
|
#endif
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Common Footer */
|
2013-10-11 15:19:46 +00:00
|
|
|
NP_CB_FOOTER;
|
|
|
|
} NP_FCB, *PNP_FCB;
|
|
|
|
|
|
|
|
C_ASSERT(FIELD_OFFSET(NP_FCB, PrefixTableEntry) == FIELD_OFFSET(NP_DCB, PrefixTableEntry));
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* The nonpaged portion of the CCB */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_NONPAGED_CCB
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeType;
|
|
|
|
PNP_EVENT_BUFFER EventBuffer[2];
|
|
|
|
ERESOURCE Lock;
|
|
|
|
} NP_NONPAGED_CCB, *PNP_NONPAGED_CCB;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* A Client Control Block (CCB) */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_CCB
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeType;
|
|
|
|
UCHAR NamedPipeState;
|
|
|
|
UCHAR ReadMode[2];
|
|
|
|
UCHAR CompletionMode[2];
|
|
|
|
SECURITY_QUALITY_OF_SERVICE ClientQos;
|
|
|
|
LIST_ENTRY CcbEntry;
|
|
|
|
PNP_FCB Fcb;
|
|
|
|
PFILE_OBJECT FileObject[2];
|
|
|
|
PEPROCESS Process;
|
|
|
|
PVOID ClientSession;
|
|
|
|
PNP_NONPAGED_CCB NonPagedCcb;
|
|
|
|
NP_DATA_QUEUE DataQueue[2];
|
|
|
|
PSECURITY_CLIENT_CONTEXT ClientContext;
|
|
|
|
LIST_ENTRY IrpList;
|
|
|
|
} NP_CCB, *PNP_CCB;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* A Volume Control Block (VCB) */
|
2013-10-11 15:19:46 +00:00
|
|
|
typedef struct _NP_VCB
|
|
|
|
{
|
|
|
|
NODE_TYPE_CODE NodeType;
|
|
|
|
ULONG ReferenceCount;
|
|
|
|
PNP_DCB RootDcb;
|
|
|
|
UNICODE_PREFIX_TABLE PrefixTable;
|
|
|
|
ERESOURCE Lock;
|
|
|
|
RTL_GENERIC_TABLE EventTable;
|
|
|
|
NP_WAIT_QUEUE WaitQueue;
|
|
|
|
} NP_VCB, *PNP_VCB;
|
2009-02-08 09:04:42 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
extern PNP_VCB NpVcb;
|
2011-01-01 12:40:24 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Defines an alias */
|
2014-02-01 14:28:15 +00:00
|
|
|
typedef struct _NPFS_ALIAS
|
|
|
|
{
|
|
|
|
struct _NPFS_ALIAS *Next;
|
|
|
|
PUNICODE_STRING TargetName;
|
|
|
|
UNICODE_STRING Name;
|
|
|
|
} NPFS_ALIAS, *PNPFS_ALIAS;
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Private structure used to enumerate the alias values */
|
2014-02-01 14:28:15 +00:00
|
|
|
typedef struct _NPFS_QUERY_VALUE_CONTEXT
|
|
|
|
{
|
|
|
|
BOOLEAN SizeOnly;
|
|
|
|
SIZE_T FullSize;
|
|
|
|
ULONG NumberOfAliases;
|
|
|
|
ULONG NumberOfEntries;
|
|
|
|
PNPFS_ALIAS CurrentAlias;
|
|
|
|
PUNICODE_STRING CurrentTargetName;
|
|
|
|
PWCHAR CurrentStringPointer;
|
|
|
|
} NPFS_QUERY_VALUE_CONTEXT, *PNPFS_QUERY_VALUE_CONTEXT;
|
|
|
|
|
|
|
|
extern PNPFS_ALIAS NpAliasList;
|
|
|
|
extern PNPFS_ALIAS NpAliasListByLength[MAX_INDEXED_LENGTH + 1 - MIN_INDEXED_LENGTH];
|
2011-01-01 12:40:24 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* This structure is actually a user-mode structure and should go into a share header */
|
2014-02-01 20:41:16 +00:00
|
|
|
typedef struct _NP_CLIENT_PROCESS
|
|
|
|
{
|
|
|
|
PVOID Unknown;
|
|
|
|
PVOID Process;
|
|
|
|
USHORT DataLength;
|
|
|
|
WCHAR Buffer[17];
|
|
|
|
} NP_CLIENT_PROCESS, *PNP_CLIENT_PROCESS;
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* FUNCTIONS ******************************************************************/
|
2000-05-13 13:51:08 +00:00
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
/* Functions to lock/unlock the global VCB lock */
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
NpAcquireSharedVcb(VOID)
|
2005-03-23 22:11:20 +00:00
|
|
|
{
|
2013-10-11 15:19:46 +00:00
|
|
|
/* Acquire the lock in shared mode */
|
|
|
|
ExAcquireResourceSharedLite(&NpVcb->Lock, TRUE);
|
|
|
|
}
|
2005-03-23 22:11:20 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
NpAcquireExclusiveVcb(VOID)
|
2005-03-23 22:11:20 +00:00
|
|
|
{
|
2013-10-11 15:19:46 +00:00
|
|
|
/* Acquire the lock in exclusive mode */
|
|
|
|
ExAcquireResourceExclusiveLite(&NpVcb->Lock, TRUE);
|
|
|
|
}
|
2005-03-23 22:11:20 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
FORCEINLINE
|
|
|
|
VOID
|
|
|
|
NpReleaseVcb(VOID)
|
2005-03-05 12:08:50 +00:00
|
|
|
{
|
2013-10-11 15:19:46 +00:00
|
|
|
/* Release the lock */
|
|
|
|
ExReleaseResourceLite(&NpVcb->Lock);
|
|
|
|
}
|
2000-05-13 13:51:08 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
//
|
|
|
|
// Function to process deferred IRPs outside the VCB lock but still within the
|
|
|
|
// critical region
|
|
|
|
//
|
|
|
|
FORCEINLINE
|
2014-05-04 09:38:36 +00:00
|
|
|
VOID
|
2013-10-11 15:19:46 +00:00
|
|
|
NpCompleteDeferredIrps(IN PLIST_ENTRY DeferredList)
|
|
|
|
{
|
|
|
|
PLIST_ENTRY ThisEntry, NextEntry;
|
|
|
|
PIRP Irp;
|
2007-11-21 15:53:31 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* Loop the list */
|
|
|
|
ThisEntry = DeferredList->Flink;
|
|
|
|
while (ThisEntry != DeferredList)
|
|
|
|
{
|
|
|
|
/* Remember the next entry, but don't switch to it yet */
|
|
|
|
NextEntry = ThisEntry->Flink;
|
2007-11-21 15:53:31 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* Complete the IRP for this entry */
|
|
|
|
Irp = CONTAINING_RECORD(ThisEntry, IRP, Tail.Overlay.ListEntry);
|
|
|
|
IoCompleteRequest(Irp, IO_NAMED_PIPE_INCREMENT);
|
2001-05-01 11:09:01 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
/* And now switch to the next one */
|
|
|
|
ThisEntry = NextEntry;
|
|
|
|
}
|
|
|
|
}
|
2011-01-01 12:40:24 +00:00
|
|
|
|
2014-02-01 14:28:15 +00:00
|
|
|
LONG
|
|
|
|
NTAPI
|
|
|
|
NpCompareAliasNames(
|
|
|
|
_In_ PCUNICODE_STRING String1,
|
|
|
|
_In_ PCUNICODE_STRING String2);
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
NpDeleteEventTableEntry(IN PRTL_GENERIC_TABLE Table,
|
|
|
|
IN PVOID Buffer);
|
2007-11-21 15:53:31 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpInitializeWaitQueue(IN PNP_WAIT_QUEUE WaitQueue);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpUninitializeDataQueue(IN PNP_DATA_QUEUE DataQueue);
|
|
|
|
|
|
|
|
PLIST_ENTRY
|
|
|
|
NTAPI
|
|
|
|
NpGetNextRealDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
PIRP
|
|
|
|
NTAPI
|
|
|
|
NpRemoveDataQueueEntry(IN PNP_DATA_QUEUE DataQueue,
|
|
|
|
IN BOOLEAN Flag,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpAddDataQueueEntry(IN ULONG NamedPipeEnd,
|
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN PNP_DATA_QUEUE DataQueue,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN ULONG Who,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN ULONG Type,
|
|
|
|
IN ULONG DataSize,
|
|
|
|
IN PIRP Irp,
|
|
|
|
IN PVOID Buffer,
|
|
|
|
IN ULONG ByteOffset);
|
2001-05-01 11:09:01 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpCompleteStalledWrites(IN PNP_DATA_QUEUE DataQueue,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpInitializeDataQueue(IN PNP_DATA_QUEUE DataQueue,
|
|
|
|
IN ULONG Quota);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCreateCcb(IN PNP_FCB Fcb,
|
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN UCHAR State,
|
|
|
|
IN UCHAR ReadMode,
|
|
|
|
IN UCHAR CompletionMode,
|
|
|
|
IN ULONG InQuota,
|
|
|
|
IN ULONG OutQuota,
|
|
|
|
OUT PNP_CCB *NewCcb);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCreateFcb(IN PNP_DCB Dcb,
|
|
|
|
IN PUNICODE_STRING PipeName,
|
|
|
|
IN ULONG MaximumInstances,
|
|
|
|
IN LARGE_INTEGER Timeout,
|
|
|
|
IN USHORT NamedPipeConfiguration,
|
|
|
|
IN USHORT NamedPipeType,
|
|
|
|
OUT PNP_FCB *NewFcb);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCreateRootDcb(VOID);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCreateRootDcbCcb(IN PNP_ROOT_DCB_FCB *NewRootCcb);
|
2004-04-12 13:03:29 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpInitializeVcb(VOID);
|
2001-05-01 11:09:01 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpDeleteCcb(IN PNP_CCB Ccb,
|
|
|
|
IN PLIST_ENTRY ListEntry);
|
2007-11-21 15:53:31 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpDeleteFcb(IN PNP_FCB Fcb,
|
|
|
|
IN PLIST_ENTRY ListEntry);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdCreateNamedPipe(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdCreate(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdClose(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdCleanup(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdFileSystemControl(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpSetConnectedPipeState(IN PNP_CCB Ccb,
|
|
|
|
IN PFILE_OBJECT FileObject,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpSetListeningPipeState(IN PNP_CCB Ccb,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN PIRP Irp,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2014-02-01 14:28:15 +00:00
|
|
|
NpSetDisconnectedPipeState(IN PNP_CCB Ccb,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpSetClosingPipeState(IN PNP_CCB Ccb,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN PIRP Irp,
|
|
|
|
IN ULONG NamedPipeEnd,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PLIST_ENTRY List);
|
2001-06-12 12:35:42 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpFreeClientSecurityContext(IN PSECURITY_CLIENT_CONTEXT ClientContext);
|
2001-06-12 12:35:42 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpImpersonateClientContext(IN PNP_CCB Ccb);
|
2005-10-06 21:39:18 +00:00
|
|
|
|
2012-07-23 13:24:48 +00:00
|
|
|
VOID
|
2013-10-11 15:19:46 +00:00
|
|
|
NTAPI
|
|
|
|
NpCopyClientContext(IN PNP_CCB Ccb,
|
|
|
|
IN PNP_DATA_QUEUE_ENTRY DataQueueEntry);
|
2010-11-19 22:42:53 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpUninitializeSecurity(IN PNP_CCB Ccb);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpInitializeSecurity(IN PNP_CCB Ccb,
|
|
|
|
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos,
|
|
|
|
IN PETHREAD Thread);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpGetClientSecurityContext(IN ULONG NamedPipeEnd,
|
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN PETHREAD Thread,
|
|
|
|
IN PSECURITY_CLIENT_CONTEXT *Context);
|
2011-01-01 12:40:24 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpSetFileObject(IN PFILE_OBJECT FileObject,
|
|
|
|
IN PVOID PrimaryContext,
|
|
|
|
IN PVOID Ccb,
|
|
|
|
IN ULONG NamedPipeEnd);
|
|
|
|
|
|
|
|
NODE_TYPE_CODE
|
|
|
|
NTAPI
|
|
|
|
NpDecodeFileObject(IN PFILE_OBJECT FileObject,
|
|
|
|
OUT PVOID *PrimaryContext OPTIONAL,
|
|
|
|
OUT PNP_CCB *Ccb,
|
|
|
|
OUT PULONG NamedPipeEnd OPTIONAL);
|
|
|
|
|
|
|
|
PNP_FCB
|
|
|
|
NTAPI
|
|
|
|
NpFindPrefix(IN PUNICODE_STRING Name,
|
|
|
|
IN ULONG CaseInsensitiveIndex,
|
|
|
|
IN PUNICODE_STRING Prefix);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFindRelativePrefix(IN PNP_DCB Dcb,
|
|
|
|
IN PUNICODE_STRING Name,
|
|
|
|
IN ULONG CaseInsensitiveIndex,
|
|
|
|
IN PUNICODE_STRING Prefix,
|
|
|
|
OUT PNP_FCB *FoundFcb);
|
2010-11-19 22:42:53 +00:00
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
NpCheckForNotify(IN PNP_DCB Dcb,
|
|
|
|
IN BOOLEAN SecondList,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpAddWaiter(IN PNP_WAIT_QUEUE WaitQueue,
|
|
|
|
IN LARGE_INTEGER WaitTime,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN PIRP Irp,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PUNICODE_STRING AliasName);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpCancelWaiter(IN PNP_WAIT_QUEUE WaitQueue,
|
|
|
|
IN PUNICODE_STRING PipeName,
|
|
|
|
IN NTSTATUS Status,
|
|
|
|
IN PLIST_ENTRY ListEntry);
|
|
|
|
|
|
|
|
|
|
|
|
IO_STATUS_BLOCK
|
|
|
|
NTAPI
|
2014-02-01 14:28:15 +00:00
|
|
|
NpReadDataQueue(IN PNP_DATA_QUEUE DataQueue,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN BOOLEAN Peek,
|
|
|
|
IN BOOLEAN ReadOverflowOperation,
|
|
|
|
IN PVOID Buffer,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN ULONG BufferSize,
|
|
|
|
IN ULONG Mode,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
|
2014-02-01 14:28:15 +00:00
|
|
|
NTSTATUS
|
2013-10-11 15:19:46 +00:00
|
|
|
NTAPI
|
|
|
|
NpWriteDataQueue(IN PNP_DATA_QUEUE WriteQueue,
|
2014-02-01 14:28:15 +00:00
|
|
|
IN ULONG Mode,
|
|
|
|
IN PVOID OutBuffer,
|
|
|
|
IN ULONG OutBufferSize,
|
|
|
|
IN ULONG PipeType,
|
|
|
|
OUT PULONG BytesWritten,
|
|
|
|
IN PNP_CCB Ccb,
|
|
|
|
IN ULONG NamedPipeEnd,
|
|
|
|
IN PETHREAD Thread,
|
2013-10-11 15:19:46 +00:00
|
|
|
IN PLIST_ENTRY List);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdRead(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2014-02-01 20:41:16 +00:00
|
|
|
_Function_class_(FAST_IO_READ)
|
|
|
|
_IRQL_requires_same_
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
NpFastRead(
|
|
|
|
_In_ PFILE_OBJECT FileObject,
|
|
|
|
_In_ PLARGE_INTEGER FileOffset,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ BOOLEAN Wait,
|
|
|
|
_In_ ULONG LockKey,
|
|
|
|
_Out_ PVOID Buffer,
|
|
|
|
_Out_ PIO_STATUS_BLOCK IoStatus,
|
|
|
|
_In_ PDEVICE_OBJECT DeviceObject);
|
|
|
|
|
|
|
|
_Function_class_(FAST_IO_WRITE)
|
|
|
|
_IRQL_requires_same_
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
NpFastWrite(
|
|
|
|
_In_ PFILE_OBJECT FileObject,
|
|
|
|
_In_ PLARGE_INTEGER FileOffset,
|
|
|
|
_In_ ULONG Length,
|
|
|
|
_In_ BOOLEAN Wait,
|
|
|
|
_In_ ULONG LockKey,
|
|
|
|
_In_ PVOID Buffer,
|
|
|
|
_Out_ PIO_STATUS_BLOCK IoStatus,
|
|
|
|
_In_ PDEVICE_OBJECT DeviceObject);
|
|
|
|
|
2013-10-11 15:19:46 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdWrite(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdFlushBuffers(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdSetInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdQueryInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdQuerySecurityInfo(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdSetSecurityInfo(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NpFsdQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject,
|
|
|
|
IN PIRP Irp);
|
|
|
|
|
2014-02-06 19:08:00 +00:00
|
|
|
#endif /* _NPFS_PCH_ */
|