ReactOS  0.4.15-dev-1070-ge1a01de
flushbuf.c File Reference
#include "npfs.h"
Include dependency graph for flushbuf.c:

Go to the source code of this file.

Macros

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_FLUSHBUF)
 

Functions

NTSTATUS NTAPI NpCommonFlushBuffers (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI NpFsdFlushBuffers (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NPFS_BUGCHECK_FILE_ID

#define NPFS_BUGCHECK_FILE_ID   (NPFS_BUGCHECK_FLUSHBUF)

Definition at line 14 of file flushbuf.c.

Function Documentation

◆ NpCommonFlushBuffers()

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

Definition at line 20 of file flushbuf.c.

22 {
23  NODE_TYPE_CODE NodeTypeCode;
24  PNP_CCB Ccb;
25  ULONG NamedPipeEnd;
27  PNP_DATA_QUEUE FlushQueue;
28  PAGED_CODE();
29 
31  NULL,
32  &Ccb,
33  &NamedPipeEnd);
34  if (NodeTypeCode != NPFS_NTC_CCB) return STATUS_PIPE_DISCONNECTED;
35 
36  ExAcquireResourceExclusiveLite(&Ccb->NonPagedCcb->Lock, TRUE);
37 
38  if (NamedPipeEnd == FILE_PIPE_SERVER_END)
39  {
40  FlushQueue = &Ccb->DataQueue[FILE_PIPE_OUTBOUND];
41  }
42  else
43  {
44  FlushQueue = &Ccb->DataQueue[FILE_PIPE_INBOUND];
45  }
46 
47  if (FlushQueue->QueueState == WriteEntries)
48  {
49  Status = NpAddDataQueueEntry(NamedPipeEnd,
50  Ccb,
51  FlushQueue,
53  2,
54  0,
55  Irp,
56  NULL,
57  0);
58  }
59  else
60  {
62  }
63 
64  ExReleaseResourceLite(&Ccb->NonPagedCcb->Lock);
65  return Status;
66 }
#define STATUS_PIPE_DISCONNECTED
Definition: ntstatus.h:412
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define NPFS_NTC_CCB
Definition: npfs.h:115
BOOLEAN NTAPI ExAcquireResourceExclusiveLite(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:770
Definition: npfs.h:258
smooth NULL
Definition: ftsmooth.c:416
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:588
ULONG QueueState
Definition: npfs.h:139
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1817
#define FILE_PIPE_SERVER_END
Definition: iotypes.h:85
Status
Definition: gdiplustypes.h:24
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:588
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
#define FILE_PIPE_OUTBOUND
Definition: iotypes.h:82
NTSTATUS NTAPI NpAddDataQueueEntry(IN ULONG NamedPipeEnd, IN PNP_CCB Ccb, IN PNP_DATA_QUEUE DataQueue, IN ULONG Who, IN ULONG Type, IN ULONG DataSize, IN PIRP Irp, IN PVOID Buffer, IN ULONG ByteOffset)
Definition: datasup.c:295
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
#define FILE_PIPE_INBOUND
Definition: iotypes.h:81
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define PAGED_CODE()

Referenced by NpFsdFlushBuffers().

◆ NpFsdFlushBuffers()

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

Definition at line 70 of file flushbuf.c.

72 {
74  PAGED_CODE();
75 
78 
80 
81  NpReleaseVcb();
83 
84  if (Status != STATUS_PENDING)
85  {
86  Irp->IoStatus.Status = Status;
88  }
89 
90  return Status;
91 }
FORCEINLINE VOID NpAcquireSharedVcb(VOID)
Definition: npfs.h:328
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI NpCommonFlushBuffers(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: flushbuf.c:20
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:587
Status
Definition: gdiplustypes.h:24
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
_In_ PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2464
#define PAGED_CODE()

Referenced by DriverEntry().