87ff4a7d4c8280d5c0e352e1b174c4492c4f86b1
[reactos.git] / reactos / drivers / filesystems / ms / msfs.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: services/fs/ms/msfs.c
6 * PURPOSE: Mailslot filesystem
7 * PROGRAMMER: Eric Kohl <ekohl@rz-online.de>
8 */
9
10 /* INCLUDES ******************************************************************/
11
12 #include "msfs.h"
13
14 #define NDEBUG
15 #include <debug.h>
16
17
18 /* FUNCTIONS *****************************************************************/
19
20 NTSTATUS NTAPI
21 DriverEntry(PDRIVER_OBJECT DriverObject,
22 PUNICODE_STRING RegistryPath)
23 {
24 PMSFS_DEVICE_EXTENSION DeviceExtension;
25 PDEVICE_OBJECT DeviceObject;
26 UNICODE_STRING DeviceName;
27 NTSTATUS Status;
28
29 DPRINT("Mailslot FSD 0.0.1\n");
30
31 DriverObject->Flags = 0;
32 DriverObject->MajorFunction[IRP_MJ_CREATE] = MsfsCreate;
33 DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] =
34 MsfsCreateMailslot;
35 DriverObject->MajorFunction[IRP_MJ_CLOSE] = MsfsClose;
36 DriverObject->MajorFunction[IRP_MJ_READ] = MsfsRead;
37 DriverObject->MajorFunction[IRP_MJ_WRITE] = MsfsWrite;
38 DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
39 MsfsQueryInformation;
40 DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] =
41 MsfsSetInformation;
42 // DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
43 // MsfsDirectoryControl;
44 // DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = MsfsFlushBuffers;
45 // DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = MsfsShutdown;
46 // DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] =
47 // MsfsQuerySecurity;
48 // DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] =
49 // MsfsSetSecurity;
50 DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] =
51 MsfsFileSystemControl;
52
53 DriverObject->DriverUnload = NULL;
54
55 RtlInitUnicodeString(&DeviceName,
56 L"\\Device\\MailSlot");
57 Status = IoCreateDevice(DriverObject,
58 sizeof(MSFS_DEVICE_EXTENSION),
59 &DeviceName,
60 FILE_DEVICE_MAILSLOT,
61 0,
62 FALSE,
63 &DeviceObject);
64 if (!NT_SUCCESS(Status))
65 {
66 return(Status);
67 }
68
69 /* initialize the device object */
70 DeviceObject->Flags = DO_DIRECT_IO;
71
72 /* initialize device extension */
73 DeviceExtension = DeviceObject->DeviceExtension;
74 InitializeListHead(&DeviceExtension->FcbListHead);
75 KeInitializeMutex(&DeviceExtension->FcbListLock,
76 0);
77
78 return(STATUS_SUCCESS);
79 }
80
81 /* EOF */