2006-06-23 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / io.h
index a0c037d22ba3cbaf0f7d0568757dae8984b5eb74..abab516c89f2b2f27992f5e8a9345589ef472ee9 100644 (file)
@@ -15,6 +15,8 @@
 #include "mono/io-layer/wapi.h"
 #include "mono/io-layer/timefuncs.h"
 
+G_BEGIN_DECLS
+
 typedef struct _WapiSecurityAttributes WapiSecurityAttributes;
 
 struct _WapiSecurityAttributes 
@@ -33,8 +35,13 @@ struct _WapiOverlapped
        guint32 Offset;
        guint32 OffsetHigh;
        gpointer hEvent;
+       gpointer handle1;
+       gpointer handle2;
 };
 
+typedef void (*WapiOverlappedCB) (guint32 error, guint32 numbytes,
+                                 WapiOverlapped *overlapped);
+
 #define GENERIC_READ   0x80000000
 #define GENERIC_WRITE  0x40000000
 #define GENERIC_EXECUTE        0x20000000
@@ -80,13 +87,13 @@ struct _WapiOverlapped
 typedef enum {
        STD_INPUT_HANDLE=-10,
        STD_OUTPUT_HANDLE=-11,
-       STD_ERROR_HANDLE=-12,
+       STD_ERROR_HANDLE=-12
 } WapiStdHandle;
 
 typedef enum {
        FILE_BEGIN=0,
        FILE_CURRENT=1,
-       FILE_END=2,
+       FILE_END=2
 } WapiSeekMethod;
 
 typedef enum {
@@ -94,7 +101,7 @@ typedef enum {
        FILE_TYPE_DISK=0x0001,
        FILE_TYPE_CHAR=0x0002,
        FILE_TYPE_PIPE=0x0003,
-       FILE_TYPE_REMOTE=0x8000,
+       FILE_TYPE_REMOTE=0x8000
 } WapiFileType;
 
 typedef enum {
@@ -140,6 +147,7 @@ typedef struct
 
 #define INVALID_SET_FILE_POINTER ((guint32)-1)
 #define INVALID_FILE_SIZE ((guint32)0xFFFFFFFF)
+#define INVALID_FILE_ATTRIBUTES ((guint32)-1)
 
 extern gpointer CreateFile(const gunichar2 *name, guint32 fileaccess,
                           guint32 sharemode,
@@ -186,5 +194,15 @@ extern guint32 GetCurrentDirectory (guint32 length, gunichar2 *buffer);
 extern gboolean SetCurrentDirectory (const gunichar2 *path);
 extern gboolean CreatePipe (gpointer *readpipe, gpointer *writepipe,
                            WapiSecurityAttributes *security, guint32 size);
+extern guint32 GetTempPath (guint32 len, gunichar2 *buf);
+extern gint32 GetLogicalDriveStrings (guint32 len, gunichar2 *buf);
+extern gboolean LockFile (gpointer handle, guint32 offset_low,
+                         guint32 offset_high, guint32 length_low,
+                         guint32 length_high);
+extern gboolean UnlockFile (gpointer handle, guint32 offset_low,
+                           guint32 offset_high, guint32 length_low,
+                           guint32 length_high);
+
+G_END_DECLS
 
 #endif /* _WAPI_IO_H_ */