- Update to r53061
[reactos.git] / 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 #include <iotypes.h>
14
15 #define DEFAULTAPI NTAPI
16
17 typedef struct _MSFS_DEVICE_EXTENSION
18 {
19 LIST_ENTRY FcbListHead;
20 KMUTEX FcbListLock;
21 } MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION;
22
23
24 typedef struct _MSFS_FCB
25 {
26 FSRTL_COMMON_FCB_HEADER RFCB;
27 UNICODE_STRING Name;
28 LIST_ENTRY FcbListEntry;
29 KSPIN_LOCK CcbListLock;
30 LIST_ENTRY CcbListHead;
31 struct _MSFS_CCB *ServerCcb;
32 ULONG ReferenceCount;
33 LARGE_INTEGER TimeOut;
34 KEVENT MessageEvent;
35 ULONG MaxMessageSize;
36 ULONG MessageCount;
37 KSPIN_LOCK MessageListLock;
38 LIST_ENTRY MessageListHead;
39 } MSFS_FCB, *PMSFS_FCB;
40
41
42 typedef struct _MSFS_CCB
43 {
44 LIST_ENTRY CcbListEntry;
45 PMSFS_FCB Fcb;
46 } MSFS_CCB, *PMSFS_CCB;
47
48
49 typedef struct _MSFS_MESSAGE
50 {
51 LIST_ENTRY MessageListEntry;
52 ULONG Size;
53 UCHAR Buffer[1];
54 } MSFS_MESSAGE, *PMSFS_MESSAGE;
55
56
57 #define KeLockMutex(x) KeWaitForSingleObject(x, \
58 UserRequest, \
59 KernelMode, \
60 FALSE, \
61 NULL);
62
63 #define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
64
65 DRIVER_DISPATCH MsfsCreate;
66 NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
67
68 DRIVER_DISPATCH MsfsCreateMailslot;
69 NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
70
71 DRIVER_DISPATCH MsfsClose;
72 NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
73
74 DRIVER_DISPATCH MsfsQueryInformation;
75 NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
76
77 DRIVER_DISPATCH MsfsSetInformation;
78 NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
79
80 DRIVER_DISPATCH MsfsRead;
81 NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
82
83 DRIVER_DISPATCH MsfsWrite;
84 NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
85
86 DRIVER_DISPATCH MsfsFileSystemControl;
87 NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
88
89 NTSTATUS NTAPI
90 DriverEntry(PDRIVER_OBJECT DriverObject,
91 PUNICODE_STRING RegistryPath);
92
93 #endif /* __DRIVERS_FS_MS_MSFS_H */