From 4875f5476e4d7a0ea68d090ddf7bf5b611c529a5 Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sun, 14 May 2017 10:15:43 +0000 Subject: [PATCH] [MUP] Split MUP into two parts; MUP on one side, DFS on the second side. This will allow using headers in other parts svn path=/trunk/; revision=74544 --- .../drivers/filesystems/mup/CMakeLists.txt | 2 + reactos/drivers/filesystems/mup/dfs.c | 96 +++++++++++++++++++ reactos/drivers/filesystems/mup/dfs.h | 58 +++++++++++ reactos/drivers/filesystems/mup/mup.c | 64 ------------- reactos/drivers/filesystems/mup/mup.h | 7 +- 5 files changed, 158 insertions(+), 69 deletions(-) create mode 100644 reactos/drivers/filesystems/mup/dfs.c create mode 100644 reactos/drivers/filesystems/mup/dfs.h diff --git a/reactos/drivers/filesystems/mup/CMakeLists.txt b/reactos/drivers/filesystems/mup/CMakeLists.txt index 1700f19a747..f47a0663023 100644 --- a/reactos/drivers/filesystems/mup/CMakeLists.txt +++ b/reactos/drivers/filesystems/mup/CMakeLists.txt @@ -1,6 +1,8 @@ list(APPEND SOURCE + dfs.c mup.c + dfs.h mup.h) add_library(mup SHARED ${SOURCE} mup.rc) diff --git a/reactos/drivers/filesystems/mup/dfs.c b/reactos/drivers/filesystems/mup/dfs.c new file mode 100644 index 00000000000..56d1a7a14e8 --- /dev/null +++ b/reactos/drivers/filesystems/mup/dfs.c @@ -0,0 +1,96 @@ +/* + * 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., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +/* + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * FILE: drivers/filesystems/mup/dfs.c + * PURPOSE: Multi UNC Provider + * PROGRAMMER: Pierre Schweitzer (pierre@reactos.org) + */ + +/* INCLUDES *****************************************************************/ + +#include "mup.h" + +#define NDEBUG +#include + +#if defined(ALLOC_PRAGMA) +#pragma alloc_text(INIT, DfsDriverEntry) +#endif + +/* FUNCTIONS ****************************************************************/ + +NTSTATUS +NTAPI +DfsVolumePassThrough(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +DfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +DfsFsdCreate(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +DfsFsdCleanup(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +NTSTATUS +DfsFsdClose(PDEVICE_OBJECT DeviceObject, + PIRP Irp) +{ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + +VOID +DfsUnload(PDRIVER_OBJECT DriverObject) +{ + UNIMPLEMENTED; +} + +INIT_SECTION +NTSTATUS +DfsDriverEntry(PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath) +{ + /* We don't support DFS yet, so + * fail to make sure it remains disabled + */ + UNIMPLEMENTED; + return STATUS_NOT_IMPLEMENTED; +} + diff --git a/reactos/drivers/filesystems/mup/dfs.h b/reactos/drivers/filesystems/mup/dfs.h new file mode 100644 index 00000000000..107cb16be57 --- /dev/null +++ b/reactos/drivers/filesystems/mup/dfs.h @@ -0,0 +1,58 @@ +#ifndef _DFS_PCH_ +#define _DFS_PCH_ + +#define DFS_OPEN_CONTEXT 0xFF444653 +#define DFS_DOWNLEVEL_OPEN_CONTEXT 0x11444653 +#define DFS_CSCAGENT_NAME_CONTEXT 0xAAAAAAAA +#define DFS_USER_NAME_CONTEXT 0xBBBBBBBB + +typedef struct _DFS_NAME_CONTEXT_ +{ + UNICODE_STRING UNCFileName; + LONG NameContextType; + ULONG Flags; +} DFS_NAME_CONTEXT, *PDFS_NAME_CONTEXT; + +NTSTATUS +NTAPI +DfsVolumePassThrough( + PDEVICE_OBJECT DeviceObject, + PIRP Irp +); + +NTSTATUS +DfsFsdFileSystemControl( + PDEVICE_OBJECT DeviceObject, + PIRP Irp +); + +NTSTATUS +DfsFsdCreate( + PDEVICE_OBJECT DeviceObject, + PIRP Irp +); + +NTSTATUS +DfsFsdCleanup( + PDEVICE_OBJECT DeviceObject, + PIRP Irp +); + +NTSTATUS +DfsFsdClose( + PDEVICE_OBJECT DeviceObject, + PIRP Irp +); + +VOID +DfsUnload( + PDRIVER_OBJECT DriverObject +); + +NTSTATUS +DfsDriverEntry( + PDRIVER_OBJECT DriverObject, + PUNICODE_STRING RegistryPath +); + +#endif diff --git a/reactos/drivers/filesystems/mup/mup.c b/reactos/drivers/filesystems/mup/mup.c index 09a63f422e8..84f318af47b 100644 --- a/reactos/drivers/filesystems/mup/mup.c +++ b/reactos/drivers/filesystems/mup/mup.c @@ -39,12 +39,6 @@ DriverEntry( PUNICODE_STRING RegistryPath ); -NTSTATUS -DfsDriverEntry( - PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath -); - VOID MupInitializeData( VOID @@ -57,7 +51,6 @@ MupInitializeVcb( #if defined(ALLOC_PRAGMA) #pragma alloc_text(INIT, DriverEntry) -#pragma alloc_text(INIT, DfsDriverEntry) #pragma alloc_text(INIT, MupInitializeData) #pragma alloc_text(INIT, MupInitializeVcb) #endif @@ -786,14 +779,6 @@ Cleanup: return Status; } -NTSTATUS -NTAPI -DfsVolumePassThrough(PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI MupForwardIoRequest(PDEVICE_OBJECT DeviceObject, @@ -1275,13 +1260,6 @@ RegisterUncProvider(PDEVICE_OBJECT DeviceObject, return Status; } -NTSTATUS -DfsFsdFileSystemControl(PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI MupFsControl(PDEVICE_OBJECT DeviceObject, @@ -1912,14 +1890,6 @@ Cleanup: return STATUS_MORE_PROCESSING_REQUIRED; } -NTSTATUS -DfsFsdCreate(PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS CreateRedirectedFile(PIRP Irp, PFILE_OBJECT FileObject, @@ -2322,14 +2292,6 @@ MupCloseUncProvider(PMUP_UNC UncProvider) } } -NTSTATUS -DfsFsdCleanup(PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI MupCleanup(PDEVICE_OBJECT DeviceObject, @@ -2453,14 +2415,6 @@ MupCloseFcb(PDEVICE_OBJECT DeviceObject, return STATUS_SUCCESS; } -NTSTATUS -DfsFsdClose(PDEVICE_OBJECT DeviceObject, - PIRP Irp) -{ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - NTSTATUS NTAPI MupClose(PDEVICE_OBJECT DeviceObject, @@ -2532,12 +2486,6 @@ MupClose(PDEVICE_OBJECT DeviceObject, return Status; } -VOID -DfsUnload(PDRIVER_OBJECT DriverObject) -{ - UNIMPLEMENTED; -} - VOID NTAPI MupUnload(PDRIVER_OBJECT DriverObject) @@ -2552,18 +2500,6 @@ MupUnload(PDRIVER_OBJECT DriverObject) MupUninitializeData(); } -INIT_SECTION -NTSTATUS -DfsDriverEntry(PDRIVER_OBJECT DriverObject, - PUNICODE_STRING RegistryPath) -{ - /* We don't support DFS yet, so - * fail to make sure it remains disabled - */ - UNIMPLEMENTED; - return STATUS_NOT_IMPLEMENTED; -} - /* * FUNCTION: Called by the system to initialize the driver * ARGUMENTS: diff --git a/reactos/drivers/filesystems/mup/mup.h b/reactos/drivers/filesystems/mup/mup.h index d7d43bb634f..810ddc6ec51 100644 --- a/reactos/drivers/filesystems/mup/mup.h +++ b/reactos/drivers/filesystems/mup/mup.h @@ -19,11 +19,6 @@ #define FILE_SIMPLE_RIGHTS_MASK (FILE_ALL_ACCESS & ~STANDARD_RIGHTS_REQUIRED &~ SYNCHRONIZE) -#define DFS_OPEN_CONTEXT 0xFF444653 -#define DFS_DOWNLEVEL_OPEN_CONTEXT 0x11444653 -#define DFS_CSCAGENT_NAME_CONTEXT 0xAAAAAAAA -#define DFS_USER_NAME_CONTEXT 0xBBBBBBBB - #define NODE_TYPE_VCB 0x1 #define NODE_TYPE_UNC 0x2 #define NODE_TYPE_PFX 0x3 @@ -146,4 +141,6 @@ typedef struct _QUERY_PATH_CONTEXT PIRP Irp; } QUERY_PATH_CONTEXT, *PQUERY_PATH_CONTEXT; +#include "dfs.h" + #endif /* _MUP_PCH_ */