ReactOS 0.4.15-dev-8390-g075894b
msfs.c
Go to the documentation of this file.
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
21{
22 PMSFS_DEVICE_EXTENSION DeviceExtension;
26
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] =
35 DriverObject->MajorFunction[IRP_MJ_CLOSE] = MsfsClose;
36 DriverObject->MajorFunction[IRP_MJ_READ] = MsfsRead;
37 DriverObject->MajorFunction[IRP_MJ_WRITE] = MsfsWrite;
40 DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] =
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;
52
53 DriverObject->DriverUnload = NULL;
54
56 L"\\Device\\MailSlot");
61 0,
62 FALSE,
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 */
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
Status
Definition: gdiplustypes.h:25
DRIVER_DISPATCH MsfsRead
Definition: msfs.h:92
DRIVER_DISPATCH MsfsQueryInformation
Definition: msfs.h:86
DRIVER_DISPATCH MsfsClose
Definition: msfs.h:83
DRIVER_DISPATCH MsfsCreateMailslot
Definition: msfs.h:80
DRIVER_DISPATCH MsfsSetInformation
Definition: msfs.h:89
DRIVER_DISPATCH MsfsWrite
Definition: msfs.h:95
DRIVER_DISPATCH MsfsFileSystemControl
Definition: msfs.h:98
DRIVER_DISPATCH MsfsCreate
Definition: msfs.h:77
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
VOID NTAPI KeInitializeMutex(IN PKMUTEX Mutex, IN ULONG Level)
Definition: mutex.c:67
#define L(x)
Definition: ntvdm.h:50
#define FILE_DEVICE_MAILSLOT
Definition: winioctl.h:57
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
KMUTEX FcbListLock
Definition: msfs.h:20
LIST_ENTRY FcbListHead
Definition: msfs.h:19
#define NTAPI
Definition: typedefs.h:36
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3275
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define IRP_MJ_CREATE_MAILSLOT
#define IRP_MJ_FILE_SYSTEM_CONTROL