From ef401a108151b1d27347da527875458906051c73 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Tue, 25 Jun 2002 22:21:41 +0000 Subject: [PATCH] Added 'Multi UNC Provider' driver stub. svn path=/trunk/; revision=3145 --- reactos/drivers/fs/mup/.cvsignore | 6 ++ reactos/drivers/fs/mup/create.c | 71 ++++++++++++++++++++ reactos/drivers/fs/mup/makefile | 15 +++++ reactos/drivers/fs/mup/mup.c | 105 ++++++++++++++++++++++++++++++ reactos/drivers/fs/mup/mup.h | 29 +++++++++ reactos/drivers/fs/mup/mup.rc | 39 +++++++++++ 6 files changed, 265 insertions(+) create mode 100644 reactos/drivers/fs/mup/.cvsignore create mode 100644 reactos/drivers/fs/mup/create.c create mode 100644 reactos/drivers/fs/mup/makefile create mode 100644 reactos/drivers/fs/mup/mup.c create mode 100644 reactos/drivers/fs/mup/mup.h create mode 100644 reactos/drivers/fs/mup/mup.rc diff --git a/reactos/drivers/fs/mup/.cvsignore b/reactos/drivers/fs/mup/.cvsignore new file mode 100644 index 00000000000..6f7e8c96a47 --- /dev/null +++ b/reactos/drivers/fs/mup/.cvsignore @@ -0,0 +1,6 @@ +base.tmp +junk.tmp +temp.exp +mup.coff +mup.sys.unstripped +*.d \ No newline at end of file diff --git a/reactos/drivers/fs/mup/create.c b/reactos/drivers/fs/mup/create.c new file mode 100644 index 00000000000..26a70f6c821 --- /dev/null +++ b/reactos/drivers/fs/mup/create.c @@ -0,0 +1,71 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: create.c,v 1.1 2002/06/25 22:21:41 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/fs/mup/create.c + * PURPOSE: Multi UNC Provider + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include + +//#define NDEBUG +#include + +#include "mup.h" + + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS STDCALL +MupCreate(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + PDEVICE_EXTENSION DeviceExt; + PIO_STACK_LOCATION Stack; + PFILE_OBJECT FileObject; + NTSTATUS Status; + + DPRINT("MupCreate() called\n"); + + DeviceExt = DeviceObject->DeviceExtension; + assert (DeviceExt); + Stack = IoGetCurrentIrpStackLocation (Irp); + assert (Stack); + + FileObject = Stack->FileObject; + + DPRINT("FileName: '%wZ'\n", &FileObject->FileName); + + Status = STATUS_ACCESS_DENIED; + + Irp->IoStatus.Information = (NT_SUCCESS(Status)) ? FILE_OPENED : 0; + Irp->IoStatus.Status = Status; + + IoCompleteRequest(Irp, + IO_NO_INCREMENT); + + return(Status); +} + +/* EOF */ diff --git a/reactos/drivers/fs/mup/makefile b/reactos/drivers/fs/mup/makefile new file mode 100644 index 00000000000..4b84d1871b2 --- /dev/null +++ b/reactos/drivers/fs/mup/makefile @@ -0,0 +1,15 @@ +# $Id: makefile,v 1.1 2002/06/25 22:21:41 ekohl Exp $ + +PATH_TO_TOP = ../../.. + +TARGET_TYPE = driver + +TARGET_NAME = mup + +TARGET_OBJECTS = $(TARGET_NAME).o create.o + +include $(PATH_TO_TOP)/rules.mak + +include $(TOOLS_PATH)/helper.mk + +# EOF diff --git a/reactos/drivers/fs/mup/mup.c b/reactos/drivers/fs/mup/mup.c new file mode 100644 index 00000000000..4ce95eea6e0 --- /dev/null +++ b/reactos/drivers/fs/mup/mup.c @@ -0,0 +1,105 @@ +/* + * ReactOS kernel + * Copyright (C) 2002 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: mup.c,v 1.1 2002/06/25 22:21:41 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/fs/mup/mup.c + * PURPOSE: Multi UNC Provider + * PROGRAMMER: Eric Kohl + */ + +/* INCLUDES *****************************************************************/ + +#include + +//#define NDEBUG +#include + +#include "mup.h" + + +/* GLOBALS *****************************************************************/ + + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS STDCALL +DriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) +/* + * FUNCTION: Called by the system to initalize the driver + * ARGUMENTS: + * DriverObject = object describing this driver + * RegistryPath = path to our configuration entries + * RETURNS: Success or failure + */ +{ + PDEVICE_OBJECT DeviceObject; + NTSTATUS Status; + UNICODE_STRING DeviceName; + + DPRINT("MUP 0.0.1\n"); + + RtlInitUnicodeString(&DeviceName, + L"\\Device\\Mup"); + Status = IoCreateDevice(DriverObject, + sizeof(DEVICE_EXTENSION), + &DeviceName, + FILE_DEVICE_MULTI_UNC_PROVIDER, + 0, + FALSE, + &DeviceObject); + if (!NT_SUCCESS(Status)) + { + return(Status); + } + + /* Initialize driver data */ + DeviceObject->Flags = DO_DIRECT_IO; +// DriverObject->MajorFunction[IRP_MJ_CLOSE] = NtfsClose; + DriverObject->MajorFunction[IRP_MJ_CREATE] = MupCreate; + DriverObject->MajorFunction[IRP_MJ_CREATE_NAMED_PIPE] = MupCreate; + DriverObject->MajorFunction[IRP_MJ_CREATE_MAILSLOT] = MupCreate; +// DriverObject->MajorFunction[IRP_MJ_READ] = NtfsRead; +// DriverObject->MajorFunction[IRP_MJ_WRITE] = NtfsWrite; +// DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = +// NtfsFileSystemControl; +// DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = +// NtfsDirectoryControl; +// DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = +// NtfsQueryInformation; +// DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = +// NtfsQueryVolumeInformation; +// DriverObject->MajorFunction[IRP_MJ_SET_VOLUME_INFORMATION] = +// NtfsSetVolumeInformation; + + DriverObject->DriverUnload = NULL; + + + /* Initialize global data */ +// DeviceExtensionNtfsGlobalData = DeviceObject->DeviceExtension; +// RtlZeroMemory(NtfsGlobalData, +// sizeof(NTFS_GLOBAL_DATA)); +// NtfsGlobalData->DriverObject = DriverObject; +// NtfsGlobalData->DeviceObject = DeviceObject; + + return(STATUS_SUCCESS); +} + diff --git a/reactos/drivers/fs/mup/mup.h b/reactos/drivers/fs/mup/mup.h new file mode 100644 index 00000000000..6178b47e1a8 --- /dev/null +++ b/reactos/drivers/fs/mup/mup.h @@ -0,0 +1,29 @@ +#ifndef MUP_H +#define MUP_H + +#include + + +#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24)) + +#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S)) + + + +typedef struct +{ + ULONG Dummy; + +} DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB; + + + +/* create.c */ + +NTSTATUS STDCALL +MupCreate(PDEVICE_OBJECT DeviceObject, + PIRP Irp); + + + +#endif /* MUP_H */ diff --git a/reactos/drivers/fs/mup/mup.rc b/reactos/drivers/fs/mup/mup.rc new file mode 100644 index 00000000000..28189c8f4c4 --- /dev/null +++ b/reactos/drivers/fs/mup/mup.rc @@ -0,0 +1,39 @@ + +#include +#include + +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US + +VS_VERSION_INFO VERSIONINFO + FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD + PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", RES_STR_COMPANY_NAME + VALUE "FileDescription", "Multi UNC Provider\0" + VALUE "FileVersion", "0.0.1\0" + VALUE "InternalName", "mup\0" + VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "mup.sys\0" + VALUE "ProductName", RES_STR_PRODUCT_NAME + VALUE "ProductVersion", RES_STR_PRODUCT_VERSION + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END +