2009-12-10 20:26:58 +00:00
|
|
|
/*
|
2001-05-05 15:21:05 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
2009-12-10 20:26:58 +00:00
|
|
|
* FILE: drivers/filesystems/msfs/msfs.c
|
2001-05-05 15:21:05 +00:00
|
|
|
* PURPOSE: Mailslot filesystem
|
2006-05-07 11:14:41 +00:00
|
|
|
* PROGRAMMER: Eric Kohl
|
2001-05-05 15:21:05 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
|
|
|
#include "msfs.h"
|
|
|
|
|
|
|
|
#define NDEBUG
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
/* FUNCTIONS *****************************************************************/
|
|
|
|
|
2005-09-04 23:18:34 +00:00
|
|
|
NTSTATUS NTAPI
|
2001-05-05 15:21:05 +00:00
|
|
|
DriverEntry(PDRIVER_OBJECT DriverObject,
|
2006-05-07 11:14:41 +00:00
|
|
|
PUNICODE_STRING RegistryPath)
|
2001-05-05 15:21:05 +00:00
|
|
|
{
|
2006-05-07 11:14:41 +00:00
|
|
|
PMSFS_DEVICE_EXTENSION DeviceExtension;
|
|
|
|
PDEVICE_OBJECT DeviceObject;
|
|
|
|
UNICODE_STRING DeviceName;
|
|
|
|
NTSTATUS Status;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
2013-07-24 14:18:40 +00:00
|
|
|
UNREFERENCED_PARAMETER(RegistryPath);
|
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
DPRINT("Mailslot FSD 0.0.1\n");
|
2005-05-08 02:16:32 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
DriverObject->Flags = 0;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_CREATE] = MsfsCreate;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] =
|
|
|
|
MsfsCreateMailslot;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_CLOSE] = MsfsClose;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_READ] = MsfsRead;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_WRITE] = MsfsWrite;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
|
|
|
|
MsfsQueryInformation;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] =
|
|
|
|
MsfsSetInformation;
|
|
|
|
// DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
|
|
|
|
// MsfsDirectoryControl;
|
|
|
|
// DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = MsfsFlushBuffers;
|
|
|
|
// DriverObject->MajorFunction[IRP_MJ_SHUTDOWN] = MsfsShutdown;
|
|
|
|
// DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] =
|
|
|
|
// MsfsQuerySecurity;
|
|
|
|
// DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] =
|
|
|
|
// MsfsSetSecurity;
|
|
|
|
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] =
|
|
|
|
MsfsFileSystemControl;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
DriverObject->DriverUnload = NULL;
|
2005-05-08 02:16:32 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
RtlInitUnicodeString(&DeviceName,
|
|
|
|
L"\\Device\\MailSlot");
|
|
|
|
Status = IoCreateDevice(DriverObject,
|
|
|
|
sizeof(MSFS_DEVICE_EXTENSION),
|
|
|
|
&DeviceName,
|
|
|
|
FILE_DEVICE_MAILSLOT,
|
|
|
|
0,
|
|
|
|
FALSE,
|
|
|
|
&DeviceObject);
|
|
|
|
if (!NT_SUCCESS(Status))
|
|
|
|
{
|
|
|
|
return Status;
|
|
|
|
}
|
2002-07-17 22:56:11 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
/* initialize the device object */
|
2007-11-21 17:11:49 +00:00
|
|
|
DeviceObject->Flags |= DO_DIRECT_IO;
|
2006-05-06 15:39:42 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
/* initialize device extension */
|
|
|
|
DeviceExtension = DeviceObject->DeviceExtension;
|
|
|
|
InitializeListHead(&DeviceExtension->FcbListHead);
|
|
|
|
KeInitializeMutex(&DeviceExtension->FcbListLock,
|
|
|
|
0);
|
2005-05-08 02:16:32 +00:00
|
|
|
|
2006-05-07 11:14:41 +00:00
|
|
|
return STATUS_SUCCESS;
|
2001-05-05 15:21:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* EOF */
|