Update Indentation (tab->4spaces).
[reactos.git] / reactos / drivers / filesystems / ms / msfs.h
1 /*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * FILE: services/fs/ms/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 <ndk/ntndk.h>
14
15 /*
16 * FIXME: GCC doesn't have a working option for defaulting to a calling
17 * convention. It will always default to cdecl. The MS DDK was designed
18 * for compilers which support this option, and thus some of their headers
19 * do not specify STDCALL or NTAPI everywhere. As such, callbacks will be
20 * interpreted as cdecl on gcc, while they should be stdcall. Defining
21 * NTAPI manually won't work either, since msvc will realize that the
22 * two definitions are different. So we have to use something to close
23 * the compatibility gap, until someone fixes gcc.
24 */
25 #ifdef _MSC_VER
26 #define DEFAULTAPI
27 #else
28 #define DEFAULTAPI __stdcall
29 #endif
30
31 typedef struct _MSFS_DEVICE_EXTENSION
32 {
33 LIST_ENTRY FcbListHead;
34 KMUTEX FcbListLock;
35 } MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION;
36
37
38 typedef struct _MSFS_FCB
39 {
40 UNICODE_STRING Name;
41 LIST_ENTRY FcbListEntry;
42 KSPIN_LOCK CcbListLock;
43 LIST_ENTRY CcbListHead;
44 struct _MSFS_CCB *ServerCcb;
45 ULONG ReferenceCount;
46 LARGE_INTEGER TimeOut;
47 KEVENT MessageEvent;
48 ULONG MaxMessageSize;
49 ULONG MessageCount;
50 KSPIN_LOCK MessageListLock;
51 LIST_ENTRY MessageListHead;
52 } MSFS_FCB, *PMSFS_FCB;
53
54
55 typedef struct _MSFS_CCB
56 {
57 LIST_ENTRY CcbListEntry;
58 PMSFS_FCB Fcb;
59 } MSFS_CCB, *PMSFS_CCB;
60
61
62 typedef struct _MSFS_MESSAGE
63 {
64 LIST_ENTRY MessageListEntry;
65 ULONG Size;
66 UCHAR Buffer[1];
67 } MSFS_MESSAGE, *PMSFS_MESSAGE;
68
69
70 #define KeLockMutex(x) KeWaitForSingleObject(x, \
71 UserRequest, \
72 KernelMode, \
73 FALSE, \
74 NULL);
75
76 #define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
77
78 NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
79 NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
80 NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
81
82 NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
83 NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
84
85 NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
86 NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
87
88 NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
89
90 NTSTATUS NTAPI
91 DriverEntry(PDRIVER_OBJECT DriverObject,
92 PUNICODE_STRING RegistryPath);
93
94 #endif /* __DRIVERS_FS_MS_MSFS_H */