ReactOS  0.4.15-dev-439-g292f67a
cleanup.c File Reference
#include "npfs.h"
Include dependency graph for cleanup.c:

Go to the source code of this file.

Macros

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_CLEANUP)
 

Functions

NTSTATUS NTAPI NpCommonCleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI NpFsdCleanup (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NPFS_BUGCHECK_FILE_ID

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_CLEANUP)

Definition at line 14 of file cleanup.c.

Function Documentation

◆ NpCommonCleanup()

NTSTATUS NTAPI NpCommonCleanup ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 20 of file cleanup.c.

22 {
23  PIO_STACK_LOCATION IoStack;
24  NODE_TYPE_CODE NodeTypeCode;
25  LIST_ENTRY DeferredList;
26  PNP_FCB Fcb;
27  PNP_CCB Ccb;
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 
50  NpReleaseVcb();
51  NpCompleteDeferredIrps(&DeferredList);
52 
53  return STATUS_SUCCESS;
54 }
_In_ PIRP Irp
Definition: csq.h:116
#define NPFS_NTC_CCB
Definition: npfs.h:115
struct _FCB::@711::@714 Fcb
Definition: npfs.h:228
Definition: npfs.h:258
#define FILE_PIPE_SERVER_END
Definition: iotypes.h:85
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:593
Definition: typedefs.h:118
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
NTSTATUS NTAPI NpSetClosingPipeState(IN PNP_CCB Ccb, IN PIRP Irp, IN ULONG NamedPipeEnd, IN PLIST_ENTRY List)
Definition: statesup.c:245
unsigned int ULONG
Definition: retypes.h:1
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
FORCEINLINE VOID NpAcquireExclusiveVcb(VOID)
Definition: npfs.h:336
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:3014
FORCEINLINE VOID NpCompleteDeferredIrps(IN PLIST_ENTRY DeferredList)
Definition: npfs.h:356
#define PAGED_CODE()

Referenced by NpFsdCleanup().

◆ NpFsdCleanup()

NTSTATUS NTAPI NpFsdCleanup ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 58 of file cleanup.c.

60 {
62  PAGED_CODE();
63 
65 
67 
69 
70  if (Status != STATUS_PENDING)
71  {
72  Irp->IoStatus.Status = Status;
74  }
75 
76  return Status;
77 }
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI NpCommonCleanup(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: cleanup.c:20
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:572
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define PAGED_CODE()

Referenced by DriverEntry().