52d2619ae0f58d2291a1b1bd3bfdb7ad92bed741
[reactos.git] / reactos / drivers / fs / ms / msfs.h
1 #ifndef __SERVICES_FS_MS_MSFS_H
2 #define __SERVICES_FS_MS_MSFS_H
3
4 #include <ntifs.h>
5 #include <ndk/iotypes.h>
6
7 typedef struct _MSFS_DEVICE_EXTENSION
8 {
9 LIST_ENTRY MailslotListHead;
10 KMUTEX MailslotListLock;
11 } MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION;
12
13 typedef struct _MSFS_MAILSLOT
14 {
15 UNICODE_STRING Name;
16 LIST_ENTRY MailslotListEntry;
17 KSPIN_LOCK FcbListLock;
18 LIST_ENTRY FcbListHead;
19 struct _MSFS_FCB *ServerFcb;
20 ULONG ReferenceCount;
21 LARGE_INTEGER TimeOut;
22 KEVENT MessageEvent;
23 ULONG MaxMessageSize;
24 ULONG MessageCount;
25 KSPIN_LOCK MessageListLock;
26 LIST_ENTRY MessageListHead;
27 } MSFS_MAILSLOT, *PMSFS_MAILSLOT;
28
29 typedef struct _MSFS_FCB
30 {
31 LIST_ENTRY FcbListEntry;
32 PMSFS_MAILSLOT Mailslot;
33 } MSFS_FCB, *PMSFS_FCB;
34
35 typedef struct _MSFS_MESSAGE
36 {
37 LIST_ENTRY MessageListEntry;
38 ULONG Size;
39 UCHAR Buffer[1];
40 } MSFS_MESSAGE, *PMSFS_MESSAGE;
41
42
43 #define KeLockMutex(x) KeWaitForSingleObject(x, \
44 UserRequest, \
45 KernelMode, \
46 FALSE, \
47 NULL);
48
49 #define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
50
51 NTSTATUS STDCALL MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
52 NTSTATUS STDCALL MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
53 NTSTATUS STDCALL MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
54
55 NTSTATUS STDCALL MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
56 NTSTATUS STDCALL MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
57
58 NTSTATUS STDCALL MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
59 NTSTATUS STDCALL MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
60
61 NTSTATUS STDCALL MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
62
63 #endif /* __SERVICES_FS_NP_NPFS_H */