[FS_REC]
[reactos.git] / reactos / drivers / filesystems / msfs / msfs.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: drivers/filesystems/msfs/msfs.h
5 * PURPOSE: Mailslot filesystem
6 * PROGRAMMER: Eric Kohl
7 */
8
9 #ifndef __DRIVERS_FS_MS_MSFS_H
10 #define __DRIVERS_FS_MS_MSFS_H
11
12 #include <ntifs.h>
13
14 #define DEFAULTAPI NTAPI
15
16 typedef struct _MSFS_DEVICE_EXTENSION
17 {
18 LIST_ENTRY FcbListHead;
19 KMUTEX FcbListLock;
20 } MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION;
21
22
23 typedef struct _MSFS_FCB
24 {
25 FSRTL_COMMON_FCB_HEADER RFCB;
26 UNICODE_STRING Name;
27 LIST_ENTRY FcbListEntry;
28 KSPIN_LOCK CcbListLock;
29 LIST_ENTRY CcbListHead;
30 struct _MSFS_CCB *ServerCcb;
31 ULONG ReferenceCount;
32 LARGE_INTEGER TimeOut;
33 KEVENT MessageEvent;
34 ULONG MaxMessageSize;
35 ULONG MessageCount;
36 KSPIN_LOCK MessageListLock;
37 LIST_ENTRY MessageListHead;
38 } MSFS_FCB, *PMSFS_FCB;
39
40
41 typedef struct _MSFS_CCB
42 {
43 LIST_ENTRY CcbListEntry;
44 PMSFS_FCB Fcb;
45 } MSFS_CCB, *PMSFS_CCB;
46
47
48 typedef struct _MSFS_MESSAGE
49 {
50 LIST_ENTRY MessageListEntry;
51 ULONG Size;
52 UCHAR Buffer[1];
53 } MSFS_MESSAGE, *PMSFS_MESSAGE;
54
55
56 #define KeLockMutex(x) KeWaitForSingleObject(x, \
57 UserRequest, \
58 KernelMode, \
59 FALSE, \
60 NULL);
61
62 #define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
63
64 DRIVER_DISPATCH MsfsCreate;
65 NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
66
67 DRIVER_DISPATCH MsfsCreateMailslot;
68 NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
69
70 DRIVER_DISPATCH MsfsClose;
71 NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
72
73 DRIVER_DISPATCH MsfsQueryInformation;
74 NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
75
76 DRIVER_DISPATCH MsfsSetInformation;
77 NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
78
79 DRIVER_DISPATCH MsfsRead;
80 NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
81
82 DRIVER_DISPATCH MsfsWrite;
83 NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
84
85 DRIVER_DISPATCH MsfsFileSystemControl;
86 NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
87
88 NTSTATUS NTAPI
89 DriverEntry(PDRIVER_OBJECT DriverObject,
90 PUNICODE_STRING RegistryPath);
91
92 #endif /* __DRIVERS_FS_MS_MSFS_H */