- Fix incorrect PFILE_MAILSLOT_SET_INFORMATION definition
- Fix MSFS to build with MSDDK.
- Fix iotypes.h to be MSDDK compatible.
Modified: trunk/reactos/drivers/fs/ms/create.c
Modified: trunk/reactos/drivers/fs/ms/finfo.c
Modified: trunk/reactos/drivers/fs/ms/fsctrl.c
Modified: trunk/reactos/drivers/fs/ms/msfs.c
Modified: trunk/reactos/drivers/fs/ms/msfs.h
Modified: trunk/reactos/drivers/fs/ms/rw.c
Modified: trunk/reactos/include/ndk/iotypes.h
Modified: trunk/reactos/w32api/include/ddk/ntifs.h

Modified: trunk/reactos/drivers/fs/ms/create.c
--- trunk/reactos/drivers/fs/ms/create.c	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/create.c	2005-09-04 23:18:34 UTC (rev 17648)
@@ -17,7 +17,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsCreate(PDEVICE_OBJECT DeviceObject,
 	   PIRP Irp)
 {
@@ -101,7 +101,7 @@
 }
 
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsCreateMailslot(PDEVICE_OBJECT DeviceObject,
 		   PIRP Irp)
 {
@@ -229,7 +229,7 @@
 }
 
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsClose(PDEVICE_OBJECT DeviceObject,
 	  PIRP Irp)
 {

Modified: trunk/reactos/drivers/fs/ms/finfo.c
--- trunk/reactos/drivers/fs/ms/finfo.c	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/finfo.c	2005-09-04 23:18:34 UTC (rev 17648)
@@ -60,13 +60,13 @@
    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 @@
 }
 
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsSetInformation(PDEVICE_OBJECT DeviceObject,
 		   PIRP Irp)
 {

Modified: trunk/reactos/drivers/fs/ms/fsctrl.c
--- trunk/reactos/drivers/fs/ms/fsctrl.c	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/fsctrl.c	2005-09-04 23:18:34 UTC (rev 17648)
@@ -17,7 +17,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsFileSystemControl(PDEVICE_OBJECT DeviceObject,
 		      PIRP Irp)
 {

Modified: trunk/reactos/drivers/fs/ms/msfs.c
--- trunk/reactos/drivers/fs/ms/msfs.c	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/msfs.c	2005-09-04 23:18:34 UTC (rev 17648)
@@ -17,7 +17,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-NTSTATUS STDCALL
+NTSTATUS NTAPI
 DriverEntry(PDRIVER_OBJECT DriverObject,
 	    PUNICODE_STRING RegistryPath)
 {

Modified: trunk/reactos/drivers/fs/ms/msfs.h
--- trunk/reactos/drivers/fs/ms/msfs.h	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/msfs.h	2005-09-04 23:18:34 UTC (rev 17648)
@@ -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 @@
 
 #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 */

Modified: trunk/reactos/drivers/fs/ms/rw.c
--- trunk/reactos/drivers/fs/ms/rw.c	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/drivers/fs/ms/rw.c	2005-09-04 23:18:34 UTC (rev 17648)
@@ -17,7 +17,7 @@
 
 /* FUNCTIONS *****************************************************************/
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsRead(PDEVICE_OBJECT DeviceObject,
 	 PIRP Irp)
 {
@@ -93,7 +93,7 @@
 }
 
 
-NTSTATUS STDCALL
+NTSTATUS DEFAULTAPI
 MsfsWrite(PDEVICE_OBJECT DeviceObject,
 	  PIRP Irp)
 {

Modified: trunk/reactos/include/ndk/iotypes.h
--- trunk/reactos/include/ndk/iotypes.h	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/include/ndk/iotypes.h	2005-09-04 23:18:34 UTC (rev 17648)
@@ -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_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 @@
     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 @@
     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 @@
     LONG StartIoKey;
     ULONG StartIoFlags;
     struct _VPB *Vpb;
-} DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION;
+} EXTENDED_DEVOBJ_EXTENSION, *PEXTENDED_DEVOBJ_EXTENSION;
 
 typedef struct _PRIVATE_DRIVER_EXTENSIONS
 {

Modified: trunk/reactos/w32api/include/ddk/ntifs.h
--- trunk/reactos/w32api/include/ddk/ntifs.h	2005-09-04 22:33:28 UTC (rev 17647)
+++ trunk/reactos/w32api/include/ddk/ntifs.h	2005-09-04 23:18:34 UTC (rev 17648)
@@ -899,7 +899,7 @@
 } 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 {