Added 'Multi UNC Provider' driver stub.

svn path=/trunk/; revision=3145
This commit is contained in:
Eric Kohl 2002-06-25 22:21:41 +00:00
parent 0892a6b53a
commit ef401a1081
6 changed files with 265 additions and 0 deletions

View file

@ -0,0 +1,6 @@
base.tmp
junk.tmp
temp.exp
mup.coff
mup.sys.unstripped
*.d

View file

@ -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 <ddk/ntddk.h>
//#define NDEBUG
#include <debug.h>
#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 */

View file

@ -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

View file

@ -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 <ddk/ntddk.h>
//#define NDEBUG
#include <debug.h>
#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);
}

View file

@ -0,0 +1,29 @@
#ifndef MUP_H
#define MUP_H
#include <ddk/ntifs.h>
#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 */

View file

@ -0,0 +1,39 @@
#include <defines.h>
#include <reactos/resource.h>
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