ReactOS 0.4.15-dev-8102-g108db8f
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;
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}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define PAGED_CODE()
LONG NTSTATUS
Definition: precomp.h:26
_Inout_ PFILE_OBJECT _In_ TYPE_OF_OPEN PFCB _In_opt_ PCCB Ccb
Definition: cdprocs.h:592
_In_ PIRP Irp
Definition: csq.h:116
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
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
USHORT NODE_TYPE_CODE
Definition: nodetype.h:22
@ WriteEntries
Definition: npfs.h:124
#define NPFS_NTC_CCB
Definition: npfs.h:115
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615
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
Status
Definition: gdiplustypes.h:25
#define FILE_PIPE_OUTBOUND
Definition: iotypes.h:82
#define FILE_PIPE_INBOUND
Definition: iotypes.h:81
#define FILE_PIPE_SERVER_END
Definition: iotypes.h:85
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
#define STATUS_PIPE_DISCONNECTED
Definition: ntstatus.h:412
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: npfs.h:259
ULONG QueueState
Definition: npfs.h:139
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550

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
83
85 {
86 Irp->IoStatus.Status = Status;
88 }
89
90 return Status;
91}
FORCEINLINE VOID NpReleaseVcb(VOID)
Definition: npfs.h:344
FORCEINLINE VOID NpAcquireSharedVcb(VOID)
Definition: npfs.h:328
NTSTATUS NTAPI NpCommonFlushBuffers(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: flushbuf.c:20
#define FsRtlEnterFileSystem
#define FsRtlExitFileSystem
#define IoCompleteRequest
Definition: irp.c:1240
#define STATUS_PENDING
Definition: ntstatus.h:82
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define IO_NAMED_PIPE_INCREMENT
Definition: iotypes.h:604

Referenced by DriverEntry().