mirror of
https://github.com/reactos/reactos.git
synced 2025-06-10 04:14:53 +00:00
[MUP]
Implement the MUP driver for ReactOS. It only supports Multiple UNC Providers so far Stub support for DFS svn path=/trunk/; revision=68757
This commit is contained in:
parent
2127a98b5d
commit
5bc6e68872
4 changed files with 2654 additions and 120 deletions
|
@ -1,11 +1,11 @@
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
create.c
|
mup.c
|
||||||
mup.c
|
mup.h)
|
||||||
mup.h)
|
|
||||||
|
|
||||||
add_library(mup SHARED ${SOURCE} mup.rc)
|
add_library(mup SHARED ${SOURCE} mup.rc)
|
||||||
set_module_type(mup kernelmodedriver)
|
set_module_type(mup kernelmodedriver)
|
||||||
|
target_link_libraries(mup ${PSEH_LIB})
|
||||||
add_importlibs(mup ntoskrnl hal)
|
add_importlibs(mup ntoskrnl hal)
|
||||||
add_pch(mup mup.h SOURCE)
|
add_pch(mup mup.h SOURCE)
|
||||||
add_cd_file(TARGET mup DESTINATION reactos/system32/drivers FOR all)
|
add_cd_file(TARGET mup DESTINATION reactos/system32/drivers FOR all)
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
/*
|
|
||||||
* 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/fs/mup/create.c
|
|
||||||
* PURPOSE: Multi UNC Provider
|
|
||||||
* PROGRAMMER: Eric Kohl
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
|
||||||
|
|
||||||
#include "mup.h"
|
|
||||||
|
|
||||||
#define NDEBUG
|
|
||||||
#include <debug.h>
|
|
||||||
|
|
||||||
/* FUNCTIONS ****************************************************************/
|
|
||||||
|
|
||||||
NTSTATUS NTAPI
|
|
||||||
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;
|
|
||||||
|
|
||||||
DPRINT1("MUP - Unimplemented (FileName: '%wZ')\n", &FileObject->FileName);
|
|
||||||
Status = STATUS_OBJECT_NAME_INVALID; // STATUS_BAD_NETWORK_PATH;
|
|
||||||
|
|
||||||
Irp->IoStatus.Information = (NT_SUCCESS(Status)) ? FILE_OPENED : 0;
|
|
||||||
Irp->IoStatus.Status = Status;
|
|
||||||
|
|
||||||
IoCompleteRequest(Irp,
|
|
||||||
IO_NO_INCREMENT);
|
|
||||||
|
|
||||||
return Status;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* EOF */
|
|
File diff suppressed because it is too large
Load diff
|
@ -2,24 +2,138 @@
|
||||||
#define _MUP_PCH_
|
#define _MUP_PCH_
|
||||||
|
|
||||||
#include <wdm.h>
|
#include <wdm.h>
|
||||||
|
#include <ntifs.h>
|
||||||
|
#include <pseh/pseh2.h>
|
||||||
|
#include <ndk/muptypes.h>
|
||||||
|
|
||||||
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
|
||||||
|
#define IO_METHOD_FROM_CTL_CODE(C) (C & 0x00000003)
|
||||||
|
|
||||||
typedef struct
|
#define TAG_MUP ' puM'
|
||||||
|
|
||||||
|
#define DFS_MAGIC_CCB (PVOID)0x11444653
|
||||||
|
#define FILE_SIMPLE_RIGHTS_MASK (FILE_ALL_ACCESS & ~STANDARD_RIGHTS_REQUIRED &~ SYNCHRONIZE)
|
||||||
|
|
||||||
|
#define NODE_TYPE_VCB 0x1
|
||||||
|
#define NODE_TYPE_UNC 0x2
|
||||||
|
#define NODE_TYPE_PFX 0x3
|
||||||
|
#define NODE_TYPE_FCB 0x4
|
||||||
|
#define NODE_TYPE_CCB 0x5
|
||||||
|
#define NODE_TYPE_MIC 0x6
|
||||||
|
#define NODE_TYPE_MQC 0x8
|
||||||
|
|
||||||
|
#define NODE_STATUS_HEALTHY 0x1
|
||||||
|
#define NODE_STATUS_CLEANUP 0x2
|
||||||
|
|
||||||
|
typedef struct _MUP_VCB
|
||||||
{
|
{
|
||||||
ULONG Dummy;
|
ULONG NodeType;
|
||||||
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
SHARE_ACCESS ShareAccess;
|
||||||
|
} MUP_VCB, *PMUP_VCB;
|
||||||
|
|
||||||
} DEVICE_EXTENSION, *PDEVICE_EXTENSION, VCB, *PVCB;
|
typedef struct _MUP_FCB
|
||||||
|
{
|
||||||
|
ULONG NodeType;
|
||||||
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
PFILE_OBJECT FileObject;
|
||||||
|
LIST_ENTRY CcbList;
|
||||||
|
} MUP_FCB, *PMUP_FCB;
|
||||||
|
|
||||||
/* create.c */
|
typedef struct _MUP_CCB
|
||||||
DRIVER_DISPATCH MupCreate;
|
{
|
||||||
NTSTATUS NTAPI
|
ULONG NodeType;
|
||||||
MupCreate(PDEVICE_OBJECT DeviceObject,
|
ULONG NodeStatus;
|
||||||
PIRP Irp);
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
PMUP_FCB Fcb;
|
||||||
|
LIST_ENTRY CcbListEntry;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PFILE_OBJECT FileObject;
|
||||||
|
} MUP_CCB, *PMUP_CCB;
|
||||||
|
|
||||||
/* mup.c */
|
typedef struct _MUP_MIC
|
||||||
NTSTATUS NTAPI
|
{
|
||||||
DriverEntry(PDRIVER_OBJECT DriverObject,
|
ULONG NodeType;
|
||||||
PUNICODE_STRING RegistryPath);
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
PIRP Irp;
|
||||||
|
NTSTATUS LastSuccess;
|
||||||
|
NTSTATUS LastFailed;
|
||||||
|
PMUP_FCB Fcb;
|
||||||
|
} MUP_MIC, *PMUP_MIC;
|
||||||
|
|
||||||
|
typedef struct _MUP_UNC
|
||||||
|
{
|
||||||
|
ULONG NodeType;
|
||||||
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
LIST_ENTRY ProviderListEntry;
|
||||||
|
UNICODE_STRING DeviceName;
|
||||||
|
HANDLE DeviceHandle;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PFILE_OBJECT FileObject;
|
||||||
|
ULONG ProviderOrder;
|
||||||
|
BOOLEAN MailslotsSupported;
|
||||||
|
BOOLEAN Registered;
|
||||||
|
} MUP_UNC, *PMUP_UNC;
|
||||||
|
|
||||||
|
typedef struct _MUP_PFX
|
||||||
|
{
|
||||||
|
ULONG NodeType;
|
||||||
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
UNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry;
|
||||||
|
UNICODE_STRING AcceptedPrefix;
|
||||||
|
ULONG Reserved;
|
||||||
|
LARGE_INTEGER ValidityTimeout;
|
||||||
|
PMUP_UNC UncProvider;
|
||||||
|
BOOLEAN ExternalAlloc;
|
||||||
|
BOOLEAN InTable;
|
||||||
|
BOOLEAN KeepExtraRef;
|
||||||
|
BOOLEAN Padding;
|
||||||
|
LIST_ENTRY PrefixListEntry;
|
||||||
|
} MUP_PFX, *PMUP_PFX;
|
||||||
|
|
||||||
|
typedef struct _MUP_MQC
|
||||||
|
{
|
||||||
|
ULONG NodeType;
|
||||||
|
ULONG NodeStatus;
|
||||||
|
LONG NodeReferences;
|
||||||
|
ULONG NodeSize;
|
||||||
|
PIRP Irp;
|
||||||
|
PFILE_OBJECT FileObject;
|
||||||
|
PMUP_UNC LatestProvider;
|
||||||
|
ERESOURCE QueryPathListLock;
|
||||||
|
PMUP_PFX Prefix;
|
||||||
|
NTSTATUS LatestStatus;
|
||||||
|
LIST_ENTRY QueryPathList;
|
||||||
|
LIST_ENTRY MQCListEntry;
|
||||||
|
} MUP_MQC, *PMUP_MQC;
|
||||||
|
|
||||||
|
typedef struct _FORWARDED_IO_CONTEXT
|
||||||
|
{
|
||||||
|
PMUP_CCB Ccb;
|
||||||
|
PMUP_MIC MasterIoContext;
|
||||||
|
WORK_QUEUE_ITEM WorkQueueItem;
|
||||||
|
PDEVICE_OBJECT DeviceObject;
|
||||||
|
PIRP Irp;
|
||||||
|
} FORWARDED_IO_CONTEXT, *PFORWARDED_IO_CONTEXT;
|
||||||
|
|
||||||
|
typedef struct _QUERY_PATH_CONTEXT
|
||||||
|
{
|
||||||
|
PMUP_MQC MasterQueryContext;
|
||||||
|
PMUP_UNC UncProvider;
|
||||||
|
PQUERY_PATH_REQUEST QueryPathRequest;
|
||||||
|
LIST_ENTRY QueryPathListEntry;
|
||||||
|
PIRP Irp;
|
||||||
|
} QUERY_PATH_CONTEXT, *PQUERY_PATH_CONTEXT;
|
||||||
|
|
||||||
#endif /* _MUP_PCH_ */
|
#endif /* _MUP_PCH_ */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue