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