845b6ba66994dd8436a372388620ef34d7cf29b7
[reactos.git] / reactos / drivers / filesystems / mup / mup.c
1 /*
2 * ReactOS kernel
3 * Copyright (C) 2002 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 /* $Id$
20 *
21 * COPYRIGHT: See COPYING in the top level directory
22 * PROJECT: ReactOS kernel
23 * FILE: drivers/fs/mup/mup.c
24 * PURPOSE: Multi UNC Provider
25 * PROGRAMMER: Eric Kohl
26 */
27
28 /* INCLUDES *****************************************************************/
29
30 #include "mup.h"
31
32 //#define NDEBUG
33 #include <debug.h>
34
35 /* GLOBALS *****************************************************************/
36
37
38 /* FUNCTIONS ****************************************************************/
39
40 /*
41 * FUNCTION: Called by the system to initalize the driver
42 * ARGUMENTS:
43 * DriverObject = object describing this driver
44 * RegistryPath = path to our configuration entries
45 * RETURNS: Success or failure
46 */
47 NTSTATUS NTAPI
48 DriverEntry(PDRIVER_OBJECT DriverObject,
49 PUNICODE_STRING RegistryPath)
50 {
51 PDEVICE_OBJECT DeviceObject;
52 NTSTATUS Status;
53 UNICODE_STRING DeviceName;
54
55 DPRINT("MUP 0.0.1\n");
56
57 RtlInitUnicodeString(&DeviceName,
58 L"\\Device\\Mup");
59 Status = IoCreateDevice(DriverObject,
60 sizeof(DEVICE_EXTENSION),
61 &DeviceName,
62 FILE_DEVICE_MULTI_UNC_PROVIDER,
63 0,
64 FALSE,
65 &DeviceObject);
66 if (!NT_SUCCESS(Status))
67 {
68 return Status;
69 }
70
71 /* Initialize driver data */
72 DeviceObject->Flags |= DO_DIRECT_IO;
73 // DriverObject->MajorFunction[IRP_MJ_CLOSE] = NtfsClose;
74 DriverObject->MajorFunction[IRP_MJ_CREATE] = MupCreate;
75 DriverObject->MajorFunction[IRP_MJ_CREATE_NAMED_PIPE] = MupCreate;
76 DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] = MupCreate;
77 // DriverObject->MajorFunction[IRP_MJ_READ] = NtfsRead;
78 // DriverObject->MajorFunction[IRP_MJ_WRITE] = NtfsWrite;
79 // DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] =
80 // NtfsFileSystemControl;
81 // DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] =
82 // NtfsDirectoryControl;
83 // DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] =
84 // NtfsQueryInformation;
85 // DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] =
86 // NtfsQueryVolumeInformation;
87 // DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] =
88 // NtfsSetVolumeInformation;
89
90 DriverObject->DriverUnload = NULL;
91
92
93 /* Initialize global data */
94 // DeviceExtensionNtfsGlobalData = DeviceObject->DeviceExtension;
95 // RtlZeroMemory(NtfsGlobalData,
96 // sizeof(NTFS_GLOBAL_DATA));
97 // NtfsGlobalData->DriverObject = DriverObject;
98 // NtfsGlobalData->DeviceObject = DeviceObject;
99
100 return STATUS_SUCCESS;
101 }
102