Build file system drivers w/ W32API headers.

svn path=/trunk/; revision=15972
This commit is contained in:
Filip Navara 2005-06-17 12:29:33 +00:00
parent b0d3f5b991
commit e0463986d3
33 changed files with 73 additions and 60 deletions

View file

@ -213,7 +213,9 @@ typedef struct _CCB
ULONG LastOffset;
} CCB, *PCCB;
#ifndef TAG
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#endif
#define TAG_CCB TAG('I', 'C', 'C', 'B')

View file

@ -1,6 +1,7 @@
<module name="cdfs" type="kernelmodedriver" installbase="system32/drivers" installname="cdfs.sys">
<bootstrap base="reactos" />
<include base="cdfs">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>cdfs.c</file>

View file

@ -29,6 +29,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntddcdrm.h>
#define NDEBUG
#include <debug.h>

View file

@ -39,6 +39,7 @@
/* DEFINES ******************************************************************/
#define ROUND_DOWN(N, S) (((N) / (S)) * (S))
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
/* FUNCTIONS ****************************************************************/

View file

@ -29,7 +29,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntos/kefuncs.h>
#define NDEBUG
#include <debug.h>
@ -39,7 +38,6 @@
/* MACROS *******************************************************************/
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#define TAG_FCB TAG('I', 'F', 'C', 'B')
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))

View file

@ -29,6 +29,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntddcdrm.h>
#include <ntos/minmax.h>
#define NDEBUG

View file

@ -27,8 +27,9 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <rosrtl/string.h>
#include <ntifs.h>
#include <ntdddisk.h>
#include <ntddcdrm.h>
#define NDEBUG
#include <debug.h>
@ -102,7 +103,8 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
UNICODE_STRING RegistryPath;
static UNICODE_STRING RegistryPath =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs");
NTSTATUS Status;
Stack = IoGetCurrentIrpStackLocation(Irp);
@ -121,8 +123,6 @@ FsRecCdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("Cdfs: IRP_MN_LOAD_FILE_SYSTEM\n");
RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Cdfs");
Status = ZwLoadDriver(&RegistryPath);
if (!NT_SUCCESS(Status))
{

View file

@ -27,8 +27,8 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <rosrtl/string.h>
#include <ntifs.h>
#include <ntdddisk.h>
#define NDEBUG
#include <debug.h>
@ -186,7 +186,8 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
UNICODE_STRING RegistryPath;
static UNICODE_STRING RegistryPath =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs");
NTSTATUS Status;
Stack = IoGetCurrentIrpStackLocation(Irp);
@ -205,8 +206,6 @@ FsRecVfatFsControl(IN PDEVICE_OBJECT DeviceObject,
case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("FAT: IRP_MN_LOAD_FILE_SYSTEM\n");
RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Vfatfs");
Status = ZwLoadDriver(&RegistryPath);
if (!NT_SUCCESS(Status))
{

View file

@ -27,7 +27,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#define NDEBUG
#include <debug.h>
@ -154,7 +154,7 @@ FsRecRegisterFs(PDRIVER_OBJECT DriverObject,
NULL,
0,
FILE_SHARE_READ | FILE_SHARE_WRITE,
OPEN_EXISTING,
FILE_OPEN,
0,
NULL,
0);

View file

@ -1,5 +1,6 @@
<module name="fs_rec" type="kernelmodedriver" installbase="system32/drivers" installname="fs_rec.sys">
<include base="fs_rec">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>blockdev.c</file>

View file

@ -27,7 +27,8 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include <ntdddisk.h>
#define NDEBUG
#include <debug.h>
@ -99,7 +100,8 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
UNICODE_STRING RegistryPath;
static UNICODE_STRING RegistryPath =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ntfs");
NTSTATUS Status;
Stack = IoGetCurrentIrpStackLocation(Irp);
@ -119,8 +121,6 @@ FsRecNtfsFsControl(IN PDEVICE_OBJECT DeviceObject,
case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("NTFS: IRP_MN_LOAD_FILE_SYSTEM\n");
RtlInitUnicodeString(&RegistryPath,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Ntfs");
Status = ZwLoadDriver(&RegistryPath);
if (!NT_SUCCESS(Status))
{

View file

@ -27,8 +27,9 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <rosrtl/string.h>
#include <ntifs.h>
#include <ntdddisk.h>
#include <ntddcdrm.h>
#define NDEBUG
#include <debug.h>
@ -258,7 +259,8 @@ FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PIO_STACK_LOCATION Stack;
UNICODE_STRING RegistryPath;
static UNICODE_STRING RegistryPath =
RTL_CONSTANT_STRING(L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
NTSTATUS Status;
Stack = IoGetCurrentIrpStackLocation(Irp);
@ -277,8 +279,6 @@ FsRecUdfsFsControl(IN PDEVICE_OBJECT DeviceObject,
case IRP_MN_LOAD_FILE_SYSTEM:
DPRINT("Udfs: IRP_MN_LOAD_FILE_SYSTEM\n");
RtlRosInitUnicodeStringFromLiteral(&RegistryPath,
L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\Udfs");
Status = ZwLoadDriver(&RegistryPath);
if (!NT_SUCCESS(Status))
{

View file

@ -9,8 +9,9 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ddk/iotypes.h> /* FIXME: Temporary Until NDK implemented */
#include <ntifs.h>
/* FIXME: The headers are broken! */
#undef CreateMailslot
#include "msfs.h"
#define NDEBUG
@ -137,7 +138,10 @@ MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject,
return(STATUS_NO_MEMORY);
}
if (!RtlCreateUnicodeString(&Mailslot->Name, FileObject->FileName.Buffer))
Mailslot->Name.Length = FileObject->FileName.Length;
Mailslot->Name.MaximumLength = Mailslot->Name.Length + sizeof(UNICODE_NULL);
Mailslot->Name.Buffer = ExAllocatePool(NonPagedPool, Mailslot->Name.MaximumLength);
if (Mailslot->Name.Buffer == NULL)
{
ExFreePool(Mailslot);
@ -149,6 +153,8 @@ MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject,
return(STATUS_NO_MEMORY);
}
RtlCopyUnicodeString(&Mailslot->Name, &FileObject->FileName);
Fcb = ExAllocatePool(NonPagedPool, sizeof(MSFS_FCB));
if (Fcb == NULL)
{

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "msfs.h"
#define NDEBUG
@ -31,19 +31,19 @@ MsfsQueryMailslotInformation(PMSFS_FCB Fcb,
Mailslot = Fcb->Mailslot;
Buffer->MaxMessageSize = Mailslot->MaxMessageSize;
Buffer->Timeout = Mailslot->TimeOut;
Buffer->MaximumMessageSize = Mailslot->MaxMessageSize;
Buffer->ReadTimeout = Mailslot->TimeOut;
KeAcquireSpinLock(&Mailslot->MessageListLock, &oldIrql);
Buffer->MessageCount = Mailslot->MessageCount;
Buffer->MessagesAvailable = Mailslot->MessageCount;
if (Mailslot->MessageCount == 0)
{
Buffer->NextSize = 0;
Buffer->NextMessageSize = 0;
}
else
{
/* FIXME: read size of first message (head) */
Buffer->NextSize = 0;
Buffer->NextMessageSize = 0;
}
KeReleaseSpinLock(&Mailslot->MessageListLock, oldIrql);
@ -61,7 +61,7 @@ MsfsSetMailslotInformation(PMSFS_FCB Fcb,
if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
Fcb->Mailslot->TimeOut = Buffer->Timeout;
Fcb->Mailslot->TimeOut = Buffer->ReadTimeout;
return(STATUS_SUCCESS);
}

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "msfs.h"
//#define NDEBUG

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "msfs.h"
#define NDEBUG

View file

@ -1,5 +1,6 @@
<module name="msfs" type="kernelmodedriver" installbase="system32/drivers" installname="msfs.sys">
<include base="msfs">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>create.c</file>

View file

@ -9,8 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntos/minmax.h>
#include <ntifs.h>
#include "msfs.h"
#define NDEBUG

View file

@ -27,7 +27,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
//#define NDEBUG
#include <debug.h>

View file

@ -1,10 +1,9 @@
#ifndef MUP_H
#define MUP_H
#include <ddk/ntifs.h>
#ifndef TAG
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#endif
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))

View file

@ -1,5 +1,6 @@
<module name="mup" type="kernelmodedriver" installbase="system32/drivers" installname="mup.sys">
<include base="mup">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>create.c</file>

View file

@ -9,8 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "npfs.h"
#define NDEBUG
@ -387,7 +386,10 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
return STATUS_NO_MEMORY;
}
if (RtlCreateUnicodeString(&Pipe->PipeName, FileObject->FileName.Buffer) == FALSE)
Pipe->PipeName.Length = FileObject->FileName.Length;
Pipe->PipeName.MaximumLength = Pipe->PipeName.Length + sizeof(UNICODE_NULL);
Pipe->PipeName.Buffer = ExAllocatePool(NonPagedPool, Pipe->PipeName.MaximumLength);
if (Pipe->PipeName.Buffer == NULL)
{
KeUnlockMutex(&DeviceExt->PipeListLock);
ExFreePool(Pipe);
@ -398,6 +400,8 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
return STATUS_NO_MEMORY;
}
RtlCopyUnicodeString(&Pipe->PipeName, &FileObject->FileName);
InitializeListHead(&Pipe->ServerFcbListHead);
InitializeListHead(&Pipe->ClientFcbListHead);
InitializeListHead(&Pipe->WaiterListHead);

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "npfs.h"
#define NDEBUG

View file

@ -10,7 +10,8 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include <napi/npipe.h>
#include "npfs.h"
#define NDEBUG

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include "npfs.h"
#define NDEBUG
@ -28,8 +28,8 @@ DriverEntry(PDRIVER_OBJECT DriverObject,
DPRINT("Named Pipe FSD 0.0.2\n");
ASSERT (sizeof(NPFS_CONTEXT) <= sizeof (((PIRP)NULL)->Tail.Overlay.DriverContext));
ASSERT (sizeof(NPFS_WAITER_ENTRY) <= sizeof(((PIRP)NULL)->Tail.Overlay.DriverContext));
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] =

View file

@ -94,6 +94,7 @@ extern NPAGED_LOOKASIDE_LIST NpfsPipeDataLookasideList;
#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) )
NTSTATUS STDCALL NpfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject, PIRP Irp);

View file

@ -1,5 +1,6 @@
<module name="npfs" type="kernelmodedriver" installbase="system32/drivers" installname="npfs.sys">
<include base="npfs">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>create.c</file>

View file

@ -9,7 +9,7 @@
/* INCLUDES ******************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include <rosrtl/minmax.h>
#include "npfs.h"

View file

@ -9,7 +9,7 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntifs.h>
#include <wchar.h>
#define NDEBUG

View file

@ -27,9 +27,6 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntos/kefuncs.h>
#include "ntfs.h"
#define NDEBUG

View file

@ -28,14 +28,12 @@
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <ntos/minmax.h>
#include "ntfs.h"
#include <ntdddisk.h>
//#define NDEBUG
#include <debug.h>
#include "ntfs.h"
/* FUNCTIONS ****************************************************************/
static NTSTATUS

View file

@ -10,7 +10,9 @@
((pDeviceExt)->NtfsInfo.BytesPerCluster > PAGE_SIZE ? \
(pDeviceExt)->NtfsInfo.BytesPerCluster : PAGE_SIZE)
#ifndef TAG
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#endif
#define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
@ -128,8 +130,6 @@ typedef struct _CCB
ULONG LastOffset;
} CCB, *PCCB;
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) + ((D)<<24))
#define TAG_CCB TAG('I', 'C', 'C', 'B')
typedef struct

View file

@ -1,6 +1,7 @@
<module name="ntfs" type="kernelmodedriver" installbase="system32/drivers" installname="ntfs.sys">
<bootstrap base="reactos" />
<include base="ntfs">.</include>
<define name="__USE_W32API" />
<library>ntoskrnl</library>
<library>hal</library>
<file>attrib.c</file>