mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 00:50:23 +00:00
- Delete npfs_new skeleton. One rewrite less.
svn path=/trunk/; revision=38776
This commit is contained in:
parent
936851e20d
commit
a3c29b9686
9 changed files with 0 additions and 535 deletions
|
@ -1,55 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/create.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsCreate(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "IRP_MJ_CREATE\n");
|
||||
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsCreateNamedPipe(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "IRP_MJ_CREATE Named Pipe\n");
|
||||
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsCleanup(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "Cleanup\n");
|
||||
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsClose(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "IRP_MJ_CLOSE\n");
|
||||
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/finfo.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsQueryInformation(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsQueryInformation()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsSetInformation(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsSetInformation()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/fsctrl.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsDirectoryControl(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsDirectoryControl()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsFileSystemControl(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsFileSystemControl()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,96 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/npfs.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static VOID
|
||||
NpfsInitializeVcb(OUT PNPFS_VCB Vcb)
|
||||
{
|
||||
/* Initialize Volume Control Block, it's one per whole named pipe
|
||||
file system. */
|
||||
|
||||
TRACE_(NPFS, "NpfsInitializeVcb(), Vcb = %p\n", Vcb);
|
||||
|
||||
/* Zero-init whole VCB */
|
||||
RtlZeroMemory(Vcb, sizeof(NPFS_VCB));
|
||||
|
||||
/* Initialize the common header */
|
||||
Vcb->NodeTypeCode = NPFS_NODETYPE_VCB;
|
||||
Vcb->NodeByteSize = sizeof(NPFS_VCB);
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
DriverEntry(IN PDRIVER_OBJECT DriverObject,
|
||||
IN PUNICODE_STRING RegistryPath)
|
||||
{
|
||||
PNPFS_DEVICE_EXTENSION DeviceExtension;
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\NamedPipe");
|
||||
NTSTATUS Status;
|
||||
|
||||
TRACE_(NPFS, "DriverEntry(%p, %wZ)", DriverObject, RegistryPath);
|
||||
|
||||
ASSERT (sizeof(NPFS_CONTEXT) <= FIELD_OFFSET(IRP, Tail.Overlay.DriverContext));
|
||||
ASSERT (sizeof(NPFS_WAITER_ENTRY) <= FIELD_OFFSET(IRP, Tail.Overlay.DriverContext));
|
||||
|
||||
DriverObject->MajorFunction[IRP_MJ_CREATE] = NpfsCreate;
|
||||
DriverObject->MajorFunction[IRP_MJ_CREATE_NAMED_PIPE] = NpfsCreateNamedPipe;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLOSE] = NpfsClose;
|
||||
DriverObject->MajorFunction[IRP_MJ_READ] = NpfsRead;
|
||||
DriverObject->MajorFunction[IRP_MJ_WRITE] = NpfsWrite;
|
||||
DriverObject->MajorFunction[IRP_MJ_QUERY_INFORMATION] = NpfsQueryInformation;
|
||||
DriverObject->MajorFunction[IRP_MJ_SET_INFORMATION] = NpfsSetInformation;
|
||||
DriverObject->MajorFunction[IRP_MJ_QUERY_VOLUME_INFORMATION] = NpfsQueryVolumeInformation;
|
||||
DriverObject->MajorFunction[IRP_MJ_CLEANUP] = NpfsCleanup;
|
||||
DriverObject->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = NpfsFlushBuffers;
|
||||
DriverObject->MajorFunction[IRP_MJ_DIRECTORY_CONTROL] = NpfsDirectoryControl;
|
||||
DriverObject->MajorFunction[IRP_MJ_FILE_SYSTEM_CONTROL] = NpfsFileSystemControl;
|
||||
//DriverObject->MajorFunction[IRP_MJ_QUERY_SECURITY] = NpfsQuerySecurity;
|
||||
//DriverObject->MajorFunction[IRP_MJ_SET_SECURITY] = NpfsSetSecurity;
|
||||
|
||||
DriverObject->DriverUnload = NULL;
|
||||
|
||||
Status = IoCreateDevice(DriverObject,
|
||||
sizeof(NPFS_DEVICE_EXTENSION),
|
||||
&DeviceName,
|
||||
FILE_DEVICE_NAMED_PIPE,
|
||||
0,
|
||||
FALSE,
|
||||
&DeviceObject);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
WARN_(NPFS, "Failed to create named pipe device! (Status 0x%08x)\n", Status);
|
||||
return Status;
|
||||
}
|
||||
|
||||
/* initialize the device object */
|
||||
DeviceObject->Flags = DO_DIRECT_IO;
|
||||
|
||||
/* initialize the device extension */
|
||||
DeviceExtension = DeviceObject->DeviceExtension;
|
||||
|
||||
NpfsInitializeVcb(&DeviceExtension->Vcb);
|
||||
|
||||
InitializeListHead(&DeviceExtension->PipeListHead);
|
||||
InitializeListHead(&DeviceExtension->ThreadListHead);
|
||||
KeInitializeMutex(&DeviceExtension->PipeListLock, 0);
|
||||
DeviceExtension->EmptyWaiterCount = 0;
|
||||
|
||||
/* set the size quotas */
|
||||
DeviceExtension->MinQuota = PAGE_SIZE;
|
||||
DeviceExtension->DefaultQuota = 8 * PAGE_SIZE;
|
||||
DeviceExtension->MaxQuota = 64 * PAGE_SIZE;
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,147 +0,0 @@
|
|||
#ifndef __DRIVERS_FS_NP_NPFS_H
|
||||
#define __DRIVERS_FS_NP_NPFS_H
|
||||
|
||||
#include <ntifs.h>
|
||||
#include <ndk/iotypes.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
|
||||
#define DPFLTR_NPFS_ID DPFLTR_FASTFAT_ID
|
||||
|
||||
/* Node type codes for NPFS */
|
||||
#define NPFS_NODETYPE_VCB 0x401
|
||||
#define NPFS_NODETYPE_DCB 0x402
|
||||
#define NPFS_NODETYPE_FCB 0x404
|
||||
#define NPFS_NODETYPE_CCB 0x406
|
||||
|
||||
typedef struct _NPFS_VCB
|
||||
{
|
||||
/* Common node header */
|
||||
CSHORT NodeTypeCode;
|
||||
CSHORT NodeByteSize;
|
||||
|
||||
} NPFS_VCB, *PNPFS_VCB;
|
||||
|
||||
typedef struct _NPFS_FCB
|
||||
{
|
||||
FSRTL_COMMON_FCB_HEADER RFCB; /* Includes common node header */
|
||||
UNICODE_STRING PipeName;
|
||||
LIST_ENTRY PipeListEntry;
|
||||
KMUTEX CcbListLock;
|
||||
LIST_ENTRY ServerCcbListHead;
|
||||
LIST_ENTRY ClientCcbListHead;
|
||||
LIST_ENTRY WaiterListHead;
|
||||
LIST_ENTRY EmptyBufferListHead;
|
||||
ULONG PipeType;
|
||||
ULONG ReadMode;
|
||||
ULONG WriteMode;
|
||||
ULONG CompletionMode;
|
||||
ULONG PipeConfiguration;
|
||||
ULONG MaximumInstances;
|
||||
ULONG CurrentInstances;
|
||||
ULONG InboundQuota;
|
||||
ULONG OutboundQuota;
|
||||
LARGE_INTEGER TimeOut;
|
||||
} NPFS_FCB, *PNPFS_FCB;
|
||||
|
||||
typedef struct _NPFS_CCB
|
||||
{
|
||||
/* Common node header */
|
||||
CSHORT NodeTypeCode;
|
||||
CSHORT NodeByteSize;
|
||||
|
||||
LIST_ENTRY CcbListEntry;
|
||||
struct _NPFS_CCB* OtherSide;
|
||||
struct ETHREAD *Thread;
|
||||
PNPFS_FCB Fcb;
|
||||
KEVENT ConnectEvent;
|
||||
KEVENT ReadEvent;
|
||||
KEVENT WriteEvent;
|
||||
ULONG PipeEnd;
|
||||
ULONG PipeState;
|
||||
ULONG ReadDataAvailable;
|
||||
ULONG WriteQuotaAvailable;
|
||||
|
||||
LIST_ENTRY ReadRequestListHead;
|
||||
|
||||
PVOID Data;
|
||||
PVOID ReadPtr;
|
||||
PVOID WritePtr;
|
||||
ULONG MaxDataLength;
|
||||
|
||||
FAST_MUTEX DataListLock; /* Data queue lock */
|
||||
} NPFS_CCB, *PNPFS_CCB;
|
||||
|
||||
typedef struct _NPFS_DEVICE_EXTENSION
|
||||
{
|
||||
LIST_ENTRY PipeListHead;
|
||||
LIST_ENTRY ThreadListHead;
|
||||
KMUTEX PipeListLock;
|
||||
ULONG EmptyWaiterCount;
|
||||
ULONG MinQuota;
|
||||
ULONG DefaultQuota;
|
||||
ULONG MaxQuota;
|
||||
|
||||
NPFS_VCB Vcb;
|
||||
} NPFS_DEVICE_EXTENSION, *PNPFS_DEVICE_EXTENSION;
|
||||
|
||||
|
||||
typedef struct _NPFS_CONTEXT
|
||||
{
|
||||
LIST_ENTRY ListEntry;
|
||||
PKEVENT WaitEvent;
|
||||
} NPFS_CONTEXT, *PNPFS_CONTEXT;
|
||||
|
||||
typedef struct _NPFS_THREAD_CONTEXT
|
||||
{
|
||||
ULONG Count;
|
||||
KEVENT Event;
|
||||
PNPFS_DEVICE_EXTENSION DeviceExt;
|
||||
LIST_ENTRY ListEntry;
|
||||
PVOID WaitObjectArray[MAXIMUM_WAIT_OBJECTS];
|
||||
KWAIT_BLOCK WaitBlockArray[MAXIMUM_WAIT_OBJECTS];
|
||||
PIRP WaitIrpArray[MAXIMUM_WAIT_OBJECTS];
|
||||
} NPFS_THREAD_CONTEXT, *PNPFS_THREAD_CONTEXT;
|
||||
|
||||
typedef struct _NPFS_WAITER_ENTRY
|
||||
{
|
||||
LIST_ENTRY Entry;
|
||||
PNPFS_CCB Ccb;
|
||||
} NPFS_WAITER_ENTRY, *PNPFS_WAITER_ENTRY;
|
||||
|
||||
extern NPAGED_LOOKASIDE_LIST NpfsPipeDataLookasideList;
|
||||
|
||||
|
||||
#define KeLockMutex(x) KeWaitForSingleObject(x, \
|
||||
UserRequest, \
|
||||
KernelMode, \
|
||||
FALSE, \
|
||||
NULL);
|
||||
|
||||
#define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
|
||||
|
||||
#define PAGE_ROUND_UP(x) ( (((ULONG_PTR)x)%PAGE_SIZE) ? ((((ULONG_PTR)x)&(~(PAGE_SIZE-1)))+PAGE_SIZE) : ((ULONG_PTR)x) )
|
||||
|
||||
DRIVER_DISPATCH NpfsCreate;
|
||||
DRIVER_DISPATCH NpfsCreateNamedPipe;
|
||||
DRIVER_DISPATCH NpfsCleanup;
|
||||
DRIVER_DISPATCH NpfsClose;
|
||||
|
||||
DRIVER_DISPATCH NpfsRead;
|
||||
DRIVER_DISPATCH NpfsWrite;
|
||||
|
||||
DRIVER_DISPATCH NpfsFlushBuffers;
|
||||
|
||||
DRIVER_DISPATCH NpfsFileSystemControl;
|
||||
DRIVER_DISPATCH NpfsDirectoryControl;
|
||||
|
||||
DRIVER_DISPATCH NpfsQueryInformation;
|
||||
DRIVER_DISPATCH NpfsSetInformation;
|
||||
|
||||
DRIVER_DISPATCH NpfsQueryVolumeInformation;
|
||||
|
||||
DRIVER_INITIALIZE DriverEntry;
|
||||
|
||||
#endif /* __DRIVERS_FS_NP_NPFS_H */
|
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
|
||||
<module name="npfs" type="kernelmodedriver" installbase="system32/drivers" installname="npfs.sys">
|
||||
<define name="__NO_CTYPE_INLINES" />
|
||||
<library>ntoskrnl</library>
|
||||
<library>hal</library>
|
||||
<file>create.c</file>
|
||||
<file>finfo.c</file>
|
||||
<file>fsctrl.c</file>
|
||||
<file>npfs.c</file>
|
||||
<file>rw.c</file>
|
||||
<file>volume.c</file>
|
||||
<file>npfs.rc</file>
|
||||
<pch>npfs.h</pch>
|
||||
</module>
|
|
@ -1,5 +0,0 @@
|
|||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Named Pipe IFS Driver\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "npfs\0"
|
||||
#define REACTOS_STR_ORIGINAL_FILENAME "npfs.sys\0"
|
||||
#include <reactos/version.rc>
|
|
@ -1,92 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/rw.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
VOID HexDump(IN PUCHAR Buffer,
|
||||
IN SIZE_T Length)
|
||||
{
|
||||
CHAR Line[65];
|
||||
UCHAR ch;
|
||||
const char Hex[] = "0123456789ABCDEF";
|
||||
ULONG i, j;
|
||||
|
||||
DbgPrint("---------------\n");
|
||||
|
||||
for (i = 0; i < Length; i+= 16)
|
||||
{
|
||||
memset(Line, ' ', 64);
|
||||
Line[64] = 0;
|
||||
|
||||
for (j = 0; j < 16 && j + i < Length; j++)
|
||||
{
|
||||
ch = Buffer[i + j];
|
||||
Line[3*j + 0] = Hex[ch >> 4];
|
||||
Line[3*j + 1] = Hex[ch & 0x0f];
|
||||
Line[48 + j] = isprint(ch) ? ch : '.';
|
||||
}
|
||||
DbgPrint("%s\n", Line);
|
||||
}
|
||||
DbgPrint("---------------\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsRead(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsRead()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsWrite(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsWrite()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsFlushBuffers(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsFlushBuffers()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
* PROJECT: ReactOS Drivers
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: drivers/filesystems/npfs/volume.c
|
||||
* PURPOSE: Named pipe filesystem
|
||||
* PROGRAMMERS:
|
||||
*/
|
||||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS ****************************************************************/
|
||||
|
||||
NTSTATUS NTAPI
|
||||
NpfsQueryVolumeInformation(IN PDEVICE_OBJECT DeviceObject,
|
||||
IN PIRP Irp)
|
||||
{
|
||||
TRACE_(NPFS, "NpfsQueryVolumeInformation()\n");
|
||||
|
||||
FsRtlEnterFileSystem();
|
||||
|
||||
UNIMPLEMENTED;
|
||||
IoCompleteRequest(Irp, IO_NO_INCREMENT);
|
||||
|
||||
FsRtlExitFileSystem();
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Reference in a new issue