- ret = ReplaceFile (utf16_destinationFileName, utf16_sourceFileName, utf16_destinationBackupFileName,
- replaceFlags, NULL, NULL);
- if (ret == FALSE)
- *error = GetLastError ();
+ return mono_file_io_replace_file (utf16_destinationFileName, utf16_sourceFileName,
+ utf16_destinationBackupFileName, replaceFlags, error);
+}
+
+#if G_HAVE_API_SUPPORT(HAVE_CLASSIC_WINAPI_SUPPORT)
+gboolean
+mono_file_io_copy_file (gunichar2 *path, gunichar2 *dest, gboolean overwrite, gint32 *error)
+{
+ gboolean result = FALSE;
+ MONO_ENTER_GC_SAFE;
+
+ result = CopyFile (path, dest, !overwrite);
+ if (result == FALSE) {
+ *error=GetLastError ();
+ }