[NTFS] - After creating a new file, update creation disposition before calling NtfsCr...
[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 /* FUNCTIONS *****************************************************************/
17
18 NTSTATUS NTAPI
19 DriverEntry(PDRIVER_OBJECT DriverObject,
20 PUNICODE_STRING RegistryPath)
21 {
22 PMSFS_DEVICE_EXTENSION DeviceExtension;
23 PDEVICE_OBJECT DeviceObject;
24 UNICODE_STRING DeviceName;
25 NTSTATUS Status;
26
27 UNREFERENCED_PARAMETER(RegistryPath);
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 */