- Fix incorrect PFILE_MAILSLOT_SET_INFORMATION definition

- Fix MSFS to build with MSDDK.
- Fix iotypes.h to be MSDDK compatible.

svn path=/trunk/; revision=17648
This commit is contained in:
Alex Ionescu 2005-09-04 23:18:34 +00:00
parent f069c69225
commit 851e0f3f36
8 changed files with 44 additions and 29 deletions

View file

@ -17,7 +17,7 @@
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsCreate(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
@ -101,7 +101,7 @@ MsfsCreate(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
@ -229,7 +229,7 @@ MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsClose(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{

View file

@ -60,13 +60,13 @@ MsfsSetMailslotInformation(PMSFS_FCB Fcb,
if (*BufferLength < sizeof(FILE_MAILSLOT_SET_INFORMATION))
return(STATUS_BUFFER_OVERFLOW);
Fcb->Mailslot->TimeOut = Buffer->ReadTimeout;
Fcb->Mailslot->TimeOut = *Buffer->ReadTimeout;
return(STATUS_SUCCESS);
}
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsQueryInformation(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
@ -132,7 +132,7 @@ MsfsQueryInformation(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsSetInformation(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{

View file

@ -17,7 +17,7 @@
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{

View file

@ -17,7 +17,7 @@
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL
NTSTATUS NTAPI
DriverEntry(PDRIVER_OBJECT DriverObject,
PUNICODE_STRING RegistryPath)
{

View file

@ -4,6 +4,22 @@
#include <ntifs.h>
#include <ndk/iotypes.h>
/*
* 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
typedef struct _MSFS_DEVICE_EXTENSION
{
LIST_ENTRY MailslotListHead;
@ -48,16 +64,16 @@ typedef struct _MSFS_MESSAGE
#define KeUnlockMutex(x) KeReleaseMutex(x, FALSE);
NTSTATUS STDCALL MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsCreate(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsClose(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsQueryInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsSetInformation(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsRead(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsWrite(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS STDCALL MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
NTSTATUS DEFAULTAPI MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject, PIRP Irp);
#endif /* __SERVICES_FS_NP_NPFS_H */

View file

@ -17,7 +17,7 @@
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsRead(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{
@ -93,7 +93,7 @@ MsfsRead(PDEVICE_OBJECT DeviceObject,
}
NTSTATUS STDCALL
NTSTATUS DEFAULTAPI
MsfsWrite(PDEVICE_OBJECT DeviceObject,
PIRP Irp)
{

View file

@ -14,11 +14,10 @@
/* EXPORTED DATA *************************************************************/
#ifndef NTOS_MODE_USER
extern POBJECT_TYPE NTOSAPI IoAdapterObjectType;
extern POBJECT_TYPE NTOSAPI IoDeviceHandlerObjectType;
extern POBJECT_TYPE NTOSAPI IoDeviceObjectType;
extern POBJECT_TYPE NTOSAPI IoDriverObjectType;
extern POBJECT_TYPE NTOSAPI IoFileObjectType;
extern POBJECT_TYPE NTSYSAPI IoAdapterObjectType;
extern POBJECT_TYPE NTSYSAPI IoDeviceHandlerObjectType;
extern POBJECT_TYPE NTSYSAPI IoDeviceObjectType;
extern POBJECT_TYPE NTSYSAPI IoDriverObjectType;
#endif
/* CONSTANTS *****************************************************************/
@ -369,7 +368,7 @@ typedef struct _FILE_MAILSLOT_QUERY_INFORMATION
typedef struct _FILE_MAILSLOT_SET_INFORMATION
{
LARGE_INTEGER ReadTimeout;
PLARGE_INTEGER ReadTimeout;
} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
typedef struct _FILE_BOTH_DIR_INFORMATION
@ -554,12 +553,12 @@ typedef struct _DEVICE_NODE
struct _DEVICE_NODE *PrevSibling;
struct _DEVICE_NODE *NextSibling;
struct _DEVICE_NODE *Child;
UINT Level;
ULONG Level;
struct _PO_DEVICE_NOTIFY *Notify;
PNP_DEVNODE_STATE State;
PNP_DEVNODE_STATE PreviousState;
PNP_DEVNODE_STATE StateHistory[20];
UINT StateHistoryEntry;
ULONG StateHistoryEntry;
INT CompletionStatus;
PIRP PendingIrp;
ULONG Flags;
@ -625,7 +624,7 @@ typedef struct _PI_RESOURCE_ARBITER_ENTRY
UCHAR ResourcesChanged;
} PI_RESOURCE_ARBITER_ENTRY, *PPI_RESOURCE_ARBITER_ENTRY;
typedef struct _DEVOBJ_EXTENSION
typedef struct _EXTENDED_DEVOBJ_EXTENSION
{
CSHORT Type;
USHORT Size;
@ -639,7 +638,7 @@ typedef struct _DEVOBJ_EXTENSION
LONG StartIoKey;
ULONG StartIoFlags;
struct _VPB *Vpb;
} DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION;
} EXTENDED_DEVOBJ_EXTENSION, *PEXTENDED_DEVOBJ_EXTENSION;
typedef struct _PRIVATE_DRIVER_EXTENSIONS
{

View file

@ -899,7 +899,7 @@ typedef struct _FILE_MAILSLOT_QUERY_INFORMATION {
} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION;
typedef struct _FILE_MAILSLOT_SET_INFORMATION {
LARGE_INTEGER ReadTimeout;
PLARGE_INTEGER ReadTimeout;
} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION;
typedef struct _FILE_MODE_INFORMATION {