ReactOS 0.4.15-dev-8102-g108db8f
cleanup.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Named Pipe FileSystem
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/filesystems/npfs/cleanup.c
5 * PURPOSE: Pipes Cleanup
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include "npfs.h"
12
13// File ID number for NPFS bugchecking support
14#define NPFS_BUGCHECK_FILE_ID (NPFS_BUGCHECK_CLEANUP)
15
16/* FUNCTIONS ******************************************************************/
17
21 IN PIRP Irp)
22{
23 PIO_STACK_LOCATION IoStack;
24 NODE_TYPE_CODE NodeTypeCode;
25 LIST_ENTRY DeferredList;
28 ULONG NamedPipeEnd;
29 PAGED_CODE();
30
32 InitializeListHead(&DeferredList);
33
35 NodeTypeCode = NpDecodeFileObject(IoStack->FileObject,
36 (PVOID*)&Fcb,
37 &Ccb,
38 &NamedPipeEnd);
39 if (NodeTypeCode == NPFS_NTC_CCB)
40 {
41 if (NamedPipeEnd == FILE_PIPE_SERVER_END)
42 {
43 ASSERT(Ccb->Fcb->ServerOpenCount != 0);
44 --Ccb->Fcb->ServerOpenCount;
45 }
46
47 NpSetClosingPipeState(Ccb, Irp, NamedPipeEnd, &DeferredList);
48 }
49
51 NpCompleteDeferredIrps(&DeferredList);
52
53 return STATUS_SUCCESS;
54}
55
59 IN PIRP Irp)
60{
62 PAGED_CODE();
63
65
67
69
71 {
72 Irp->IoStatus.Status = Status;
74 }
75
76 return Status;
77}
78
79/* EOF */
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
_In_ PFCB Fcb
Definition: cdprocs.h:159
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:592
_In_ PIRP Irp
Definition: csq.h:116
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
NTSTATUS NTAPI NpFsdCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: cleanup.c:58
NTSTATUS NTAPI NpCommonCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: cleanup.c:20
FORCEINLINE VOID NpAcquireExclusiveVcb(VOID)
Definition: npfs.h:336
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
NTSTATUS NTAPI NpSetClosingPipeState(IN PNP_CCB Ccb, IN PIRP Irp, IN ULONG NamedPipeEnd, IN PLIST_ENTRY List)
Definition: statesup.c:245
FORCEINLINE VOID NpCompleteDeferredIrps(IN PLIST_ENTRY DeferredList)
Definition: npfs.h:356
#define NPFS_NTC_CCB
Definition: npfs.h:115
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
NODE_TYPE_CODE NTAPI NpDecodeFileObject(IN PFILE_OBJECT FileObject, OUT PVOID *PrimaryContext OPTIONAL, OUT PNP_CCB *Ccb, OUT PULONG NamedPipeEnd OPTIONAL)
Definition: fileobsup.c:20
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
#define FILE_PIPE_SERVER_END
Definition: iotypes.h:85
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define STATUS_SUCCESS
Definition: shellext.h:65
struct _FCB::@723::@726 Fcb
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
Definition: typedefs.h:120
Definition: npfs.h:259
Definition: npfs.h:229
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:604