mirror of
https://github.com/reactos/reactos.git
synced 2025-05-13 14:20:31 +00:00
Allow compilation of npfs driver with MSVC
svn path=/trunk/; revision=17642
This commit is contained in:
parent
e7ad48c2a3
commit
8857a8b8fd
9 changed files with 81 additions and 48 deletions
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/np/create.c
|
||||
|
@ -9,13 +8,11 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include <ndk/iotypes.h>
|
||||
#include "npfs.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static PNPFS_PIPE
|
||||
|
@ -110,7 +107,7 @@ NTSTATUS STDCALL
|
|||
NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
PEXTENDED_IO_STACK_LOCATION IoStack;
|
||||
PFILE_OBJECT FileObject;
|
||||
PNPFS_PIPE Pipe;
|
||||
PNPFS_FCB ClientFcb;
|
||||
|
@ -121,14 +118,14 @@ NpfsCreate(PDEVICE_OBJECT DeviceObject,
|
|||
DPRINT("NpfsCreate(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||
|
||||
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
|
||||
FileObject = IoStack->FileObject;
|
||||
DPRINT("FileObject %p\n", FileObject);
|
||||
DPRINT("FileName %wZ\n", &FileObject->FileName);
|
||||
|
||||
Irp->IoStatus.Information = 0;
|
||||
|
||||
SpecialAccess = ((IoStack->Parameters.Create.ShareAccess & 3) == 3);
|
||||
SpecialAccess = ((IoStack->Parameters.CreatePipe.ShareAccess & 3) == 3);
|
||||
if (SpecialAccess)
|
||||
{
|
||||
DPRINT("NpfsCreate() open client end for special use!\n");
|
||||
|
@ -310,7 +307,7 @@ NTSTATUS STDCALL
|
|||
NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
||||
PIRP Irp)
|
||||
{
|
||||
PIO_STACK_LOCATION IoStack;
|
||||
PEXTENDED_IO_STACK_LOCATION IoStack;
|
||||
PFILE_OBJECT FileObject;
|
||||
PNPFS_DEVICE_EXTENSION DeviceExt;
|
||||
PNPFS_PIPE Pipe;
|
||||
|
@ -321,7 +318,7 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
|||
DPRINT("NpfsCreateNamedPipe(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||
|
||||
DeviceExt = (PNPFS_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
IoStack = IoGetCurrentIrpStackLocation(Irp);
|
||||
IoStack = (PEXTENDED_IO_STACK_LOCATION)IoGetCurrentIrpStackLocation(Irp);
|
||||
FileObject = IoStack->FileObject;
|
||||
DPRINT("FileObject %p\n", FileObject);
|
||||
DPRINT("Pipe name %wZ\n", &FileObject->FileName);
|
||||
|
@ -416,8 +413,8 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
|||
Pipe->MaximumInstances = Buffer->MaximumInstances;
|
||||
Pipe->CurrentInstances = 0;
|
||||
Pipe->TimeOut = Buffer->DefaultTimeout;
|
||||
if (!(IoStack->Parameters.Create.Options & FILE_PIPE_OUTBOUND) ||
|
||||
IoStack->Parameters.Create.Options & FILE_PIPE_FULL_DUPLEX)
|
||||
if (!(IoStack->Parameters.CreatePipe.Options & FILE_PIPE_OUTBOUND) ||
|
||||
IoStack->Parameters.CreatePipe.Options & FILE_PIPE_FULL_DUPLEX)
|
||||
{
|
||||
if (Buffer->InboundQuota == 0)
|
||||
{
|
||||
|
@ -441,7 +438,7 @@ NpfsCreateNamedPipe(PDEVICE_OBJECT DeviceObject,
|
|||
Pipe->InboundQuota = 0;
|
||||
}
|
||||
|
||||
if (IoStack->Parameters.Create.Options & (FILE_PIPE_FULL_DUPLEX|FILE_PIPE_OUTBOUND))
|
||||
if (IoStack->Parameters.CreatePipe.Options & (FILE_PIPE_FULL_DUPLEX|FILE_PIPE_OUTBOUND))
|
||||
{
|
||||
if (Buffer->OutboundQuota == 0)
|
||||
{
|
||||
|
@ -540,7 +537,7 @@ NpfsCleanup(PDEVICE_OBJECT DeviceObject,
|
|||
PFILE_OBJECT FileObject;
|
||||
PNPFS_FCB Fcb, OtherSide;
|
||||
PNPFS_PIPE Pipe;
|
||||
BOOL Server;
|
||||
BOOLEAN Server;
|
||||
|
||||
DPRINT("NpfsCleanup(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||
|
||||
|
@ -676,7 +673,7 @@ NpfsClose(PDEVICE_OBJECT DeviceObject,
|
|||
PFILE_OBJECT FileObject;
|
||||
PNPFS_FCB Fcb;
|
||||
PNPFS_PIPE Pipe;
|
||||
BOOL Server;
|
||||
BOOLEAN Server;
|
||||
|
||||
DPRINT("NpfsClose(DeviceObject %p Irp %p)\n", DeviceObject, Irp);
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/np/finfo.c
|
||||
|
@ -9,12 +8,11 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include "npfs.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/np/fsctrl.c
|
||||
|
@ -10,12 +9,11 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include "npfs.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
static VOID STDCALL
|
||||
|
@ -170,7 +168,7 @@ NpfsDisconnectPipe(PNPFS_FCB Fcb)
|
|||
NTSTATUS Status;
|
||||
PNPFS_FCB OtherSide;
|
||||
PNPFS_PIPE Pipe;
|
||||
BOOL Server;
|
||||
BOOLEAN Server;
|
||||
|
||||
DPRINT("NpfsDisconnectPipe()\n");
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/np/mount.c
|
||||
|
@ -9,12 +8,11 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include "npfs.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS STDCALL
|
||||
|
|
|
@ -1,8 +1,58 @@
|
|||
/* $Id$ */
|
||||
|
||||
#ifndef __DRIVERS_FS_NP_NPFS_H
|
||||
#define __DRIVERS_FS_NP_NPFS_H
|
||||
|
||||
#include <ntifs.h>
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#include <ndk/iotypes.h>
|
||||
#define EXTENDED_IO_STACK_LOCATION IO_STACK_LOCATION
|
||||
#define PEXTENDED_IO_STACK_LOCATION PIO_STACK_LOCATION
|
||||
|
||||
#elif defined(_MSC_VER)
|
||||
#define STDCALL
|
||||
#define KEBUGCHECK KeBugCheck
|
||||
typedef struct _NAMED_PIPE_CREATE_PARAMETERS
|
||||
{
|
||||
ULONG NamedPipeType;
|
||||
ULONG ReadMode;
|
||||
ULONG CompletionMode;
|
||||
ULONG MaximumInstances;
|
||||
ULONG InboundQuota;
|
||||
ULONG OutboundQuota;
|
||||
LARGE_INTEGER DefaultTimeout;
|
||||
BOOLEAN TimeoutSpecified;
|
||||
} NAMED_PIPE_CREATE_PARAMETERS, *PNAMED_PIPE_CREATE_PARAMETERS;
|
||||
typedef struct _EXTENDED_IO_STACK_LOCATION {
|
||||
|
||||
/* Included for padding */
|
||||
UCHAR MajorFunction;
|
||||
UCHAR MinorFunction;
|
||||
UCHAR Flags;
|
||||
UCHAR Control;
|
||||
|
||||
union {
|
||||
|
||||
struct {
|
||||
PIO_SECURITY_CONTEXT SecurityContext;
|
||||
ULONG Options;
|
||||
USHORT Reserved;
|
||||
USHORT ShareAccess;
|
||||
PNAMED_PIPE_CREATE_PARAMETERS Parameters;
|
||||
} CreatePipe;
|
||||
|
||||
} Parameters;
|
||||
PDEVICE_OBJECT DeviceObject;
|
||||
PFILE_OBJECT FileObject;
|
||||
PIO_COMPLETION_ROUTINE CompletionRoutine;
|
||||
PVOID Context;
|
||||
|
||||
} EXTENDED_IO_STACK_LOCATION, *PEXTENDED_IO_STACK_LOCATION;
|
||||
|
||||
|
||||
#else
|
||||
#error Unknown compiler
|
||||
#endif
|
||||
|
||||
typedef struct _NPFS_DEVICE_EXTENSION
|
||||
{
|
||||
LIST_ENTRY PipeListHead;
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* $Id$ */
|
||||
|
||||
#define REACTOS_VERSION_DLL
|
||||
#define REACTOS_STR_FILE_DESCRIPTION "Named Pipe IFS Driver\0"
|
||||
#define REACTOS_STR_INTERNAL_NAME "npfs\0"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<module name="npfs" type="kernelmodedriver" installbase="system32/drivers" installname="npfs.sys">
|
||||
<include base="npfs">.</include>
|
||||
<define name="__USE_W32API" />
|
||||
<define name="__USE_W32API" />
|
||||
<library>ntoskrnl</library>
|
||||
<library>hal</library>
|
||||
<file>create.c</file>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/np/rw.c
|
||||
|
@ -9,12 +8,11 @@
|
|||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include "npfs.h"
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
#include "npfs.h"
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
#ifndef NDEBUG
|
||||
|
@ -431,7 +429,7 @@ NpfsRead(IN PDEVICE_OBJECT DeviceObject,
|
|||
}
|
||||
else
|
||||
{
|
||||
PNPFS_CONTEXT Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext;
|
||||
Context = (PNPFS_CONTEXT)&Irp->Tail.Overlay.DriverContext;
|
||||
|
||||
Context->WaitEvent = &Fcb->ReadEvent;
|
||||
Status = NpfsAddWaitingReadWriteRequest(DeviceObject, Irp);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
/* $Id$
|
||||
*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* FILE: drivers/fs/npfs/volume.c
|
||||
|
@ -9,9 +8,6 @@
|
|||
|
||||
/* INCLUDES *****************************************************************/
|
||||
|
||||
#include <ntifs.h>
|
||||
#include <wchar.h>
|
||||
|
||||
#define NDEBUG
|
||||
#include <debug.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue