ReactOS  0.4.15-dev-3308-g9455def
msfs.c File Reference
#include "msfs.h"
#include <debug.h>
Include dependency graph for msfs.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI DriverEntry (PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file msfs.c.

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( PDRIVER_OBJECT  DriverObject,
PUNICODE_STRING  RegistryPath 
)

Definition at line 19 of file msfs.c.

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;
38  DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
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");
58  sizeof(MSFS_DEVICE_EXTENSION),
59  &DeviceName,
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 }
DRIVER_DISPATCH MsfsCreateMailslot
Definition: msfs.h:80
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
DRIVER_DISPATCH MsfsClose
Definition: msfs.h:83
#define IRP_MJ_CREATE_MAILSLOT
KMUTEX FcbListLock
Definition: msfs.h:20
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
DRIVER_DISPATCH MsfsRead
Definition: msfs.h:92
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
DRIVER_DISPATCH MsfsFileSystemControl
Definition: msfs.h:98
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
Definition: wdfdevice.h:3272
#define FALSE
Definition: types.h:117
LIST_ENTRY FcbListHead
Definition: msfs.h:19
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MJ_FILE_SYSTEM_CONTROL
DRIVER_DISPATCH MsfsCreate
Definition: msfs.h:77
VOID NTAPI KeInitializeMutex(IN PKMUTEX Mutex, IN ULONG Level)
Definition: mutex.c:67
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
static const WCHAR L[]
Definition: oid.c:1250
DRIVER_DISPATCH MsfsQueryInformation
Definition: msfs.h:86
#define FILE_DEVICE_MAILSLOT
Definition: winioctl.h:118
DRIVER_DISPATCH MsfsSetInformation
Definition: msfs.h:89
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
#define IRP_MJ_READ
Definition: rdpdr.c:46
DRIVER_DISPATCH MsfsWrite
Definition: msfs.h:95
#define IRP_MJ_SET_INFORMATION
Definition: rdpdr.c:49
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
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_QUERY_INFORMATION
Definition: rdpdr.c:48
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:71