2001-05-05 15:21:05 +00:00
|
|
|
#ifndef __SERVICES_FS_MS_MSFS_H
|
|
|
|
#define __SERVICES_FS_MS_MSFS_H
|
|
|
|
|
2005-09-04 22:33:28 +00:00
|
|
|
#include <ntifs.h>
|
2005-09-05 04:48:20 +00:00
|
|
|
#include <ndk/ntndk.h>
|
2005-09-04 22:33:28 +00:00
|
|
|
|
2006-05-06 15:37:40 +00:00
|
|
|
/*
|
2005-09-04 23:18:34 +00:00
|
|
|
* FIXME: GCC doesn't have a working option for defaulting to a calling
|
|
|
|
* convention. It will always default to cdecl. The MS DDK was designed
|
|
|
|
* for compilers which support this option, and thus some of their headers
|
|
|
|
* do not specify STDCALL or NTAPI everywhere. As such, callbacks will be
|
|
|
|
* interpreted as cdecl on gcc, while they should be stdcall. Defining
|
|
|
|
* NTAPI manually won't work either, since msvc will realize that the
|
|
|
|
* two definitions are different. So we have to use something to close
|
|
|
|
* the compatibility gap, until someone fixes gcc.
|
|
|
|
*/
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define DEFAULTAPI
|
|
|
|
#else
|
|
|
|
#define DEFAULTAPI __stdcall
|
|
|
|
#endif
|
|
|
|
|
2001-05-05 15:21:05 +00:00
|
|
|
typedef struct _MSFS_DEVICE_EXTENSION
|
|
|
|
{
|
2006-05-06 20:04:30 +00:00
|
|
|
LIST_ENTRY FcbListHead;
|
|
|
|
KMUTEX FcbListLock;
|
2001-05-05 15:21:05 +00:00
|
|
|
} MSFS_DEVICE_EXTENSION, *PMSFS_DEVICE_EXTENSION;
|
|
|
|
|
2006-05-06 20:04:30 +00:00
|
|
|
typedef struct _MSFS_FCB
|
2001-05-05 15:21:05 +00:00
|
|
|
{
|
|
|
|
UNICODE_STRING Name;
|
2006-05-06 20:04:30 +00:00
|
|
|
LIST_ENTRY FcbListEntry;
|
2006-05-06 15:37:40 +00:00
|
|
|
KSPIN_LOCK CcbListLock;
|
|
|
|
LIST_ENTRY CcbListHead;
|
|
|
|
struct _MSFS_CCB *ServerCcb;
|
2001-05-05 15:21:05 +00:00
|
|
|
ULONG ReferenceCount;
|
|
|
|
LARGE_INTEGER TimeOut;
|
|
|
|
KEVENT MessageEvent;
|
|
|
|
ULONG MaxMessageSize;
|
|
|
|
ULONG MessageCount;
|
|
|
|
KSPIN_LOCK MessageListLock;
|
|
|
|
LIST_ENTRY MessageListHead;
|
2006-05-06 20:04:30 +00:00
|
|
|
} MSFS_FCB, *PMSFS_FCB;
|
2001-05-05 15:21:05 +00:00
|
|
|
|
2006-05-06 15:37:40 +00:00
|
|
|
typedef struct _MSFS_CCB
|
2001-05-05 15:21:05 +00:00
|
|
|
{
|
2006-05-06 15:37:40 +00:00
|
|
|
LIST_ENTRY CcbListEntry;
|
2006-05-06 20:04:30 +00:00
|
|
|
PMSFS_FCB Fcb;
|
2006-05-06 15:37:40 +00:00
|
|
|
} MSFS_CCB, *PMSFS_CCB;
|
2001-05-05 15:21:05 +00:00
|
|
|
|
|
|
|
typedef struct _MSFS_MESSAGE
|
|
|
|
{
|
|
|
|
LIST_ENTRY MessageListEntry;
|
|
|
|
ULONG Size;
|
|
|
|
UCHAR Buffer[1];
|
|
|
|
} MSFS_MESSAGE, *PMSFS_MESSAGE;
|
|
|
|
|
|
|
|
|
|
|
|
#define KeLockMutex(x) KeWaitForSingleObject(x, \
|
|
|
|
UserRequest, \
|
|
|
|
KernelMode, \
|
|
|
|
FALSE, \
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
#define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
|
|
|
|
|
2005-09-04 23:18:34 +00:00
|
|
|
NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
|
|
|
NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
|
|
|
NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
2001-05-05 15:21:05 +00:00
|
|
|
|
2005-09-04 23:18:34 +00:00
|
|
|
NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
|
|
|
NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
2001-05-05 15:21:05 +00:00
|
|
|
|
2005-09-04 23:18:34 +00:00
|
|
|
NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
|
|
|
NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
2001-05-05 15:21:05 +00:00
|
|
|
|
2005-09-04 23:18:34 +00:00
|
|
|
NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
|
2001-05-05 15:21:05 +00:00
|
|
|
|
2005-10-06 21:39:18 +00:00
|
|
|
NTSTATUS NTAPI
|
|
|
|
DriverEntry(PDRIVER_OBJECT DriverObject,
|
|
|
|
PUNICODE_STRING RegistryPath);
|
|
|
|
|
2001-05-05 15:21:05 +00:00
|
|
|
#endif /* __SERVICES_FS_NP_NPFS_H */
|