Fix mono_mutex_trylock on Windows
[mono.git] / mono / io-layer / io.h
index 9e07a86d05f09ecb4e3095040f47d497b892ccb8..e8627764812f3e98632ca244254d96fa7efc823d 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
@@ -75,18 +82,21 @@ struct _WapiOverlapped
 #define FILE_FLAG_OVERLAPPED                   0x40000000
 #define FILE_FLAG_WRITE_THROUGH                        0x80000000
 
+#define REPLACEFILE_WRITE_THROUGH       0x00000001
+#define REPLACEFILE_IGNORE_MERGE_ERRORS 0x00000002
+
 #define MAX_PATH       260
 
 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,9 +104,19 @@ 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 {
+       DRIVE_UNKNOWN=0,
+       DRIVE_NO_ROOT_DIR=1,
+       DRIVE_REMOVABLE=2,
+       DRIVE_FIXED=3,
+       DRIVE_REMOTE=4,
+       DRIVE_CDROM=5,
+       DRIVE_RAMDISK=6
+} WapiDriveType;
+
 typedef enum {
        GetFileExInfoStandard=0x0000,
        GetFileExMaxInfoLevel=0x0001
@@ -178,6 +198,9 @@ extern gboolean RemoveDirectory (const gunichar2 *name);
 extern gboolean MoveFile (const gunichar2 *name, const gunichar2 *dest_name);
 extern gboolean CopyFile (const gunichar2 *name, const gunichar2 *dest_name,
                          gboolean fail_if_exists);
+extern gboolean ReplaceFile (const gunichar2 *replacedFileName, const gunichar2 *replacementFileName,
+                            const gunichar2 *backupFileName, guint32 replaceFlags, 
+                            gpointer exclude, gpointer reserved);
 extern guint32 GetFileAttributes (const gunichar2 *name);
 extern gboolean GetFileAttributesEx (const gunichar2 *name,
                                     WapiGetFileExInfoLevels level,
@@ -187,5 +210,23 @@ 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 GetDiskFreeSpaceEx(const gunichar2 *path_name, WapiULargeInteger *free_bytes_avail,
+                                  WapiULargeInteger *total_number_of_bytes,
+                                  WapiULargeInteger *total_number_of_free_bytes);
+extern guint32 GetDriveType(const gunichar2 *root_path_name);
+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);
+extern gboolean GetVolumeInformation (const gunichar2 *path, gunichar2 *volumename, int volumesize, int *outserial, int *maxcomp, int *fsflags, gunichar2 *fsbuffer, int fsbuffersize);
+
+
+extern void _wapi_io_init (void);
+
+G_END_DECLS
 
 #endif /* _WAPI_IO_H_ */