#include <mono/utils/mono-memory-model.h>
#include <mono/utils/mono-threads.h>
#include <mono/metadata/w32handle.h>
-#include <mono/io-layer/io-layer.h>
+#include <mono/metadata/w32error.h>
+#include <mono/utils/w32api.h>
#ifdef HOST_WIN32
#include <direct.h>
#endif
full_path = mono_path_resolve_symlinks (filename);
result = mono_w32file_write (handle, full_path, strlen (full_path), &n);
g_free (full_path);
- CloseHandle (handle);
+ mono_w32file_close (handle);
return result;
}
g_free (shadow);
/* Fix for bug #17251 - if file not found try finding assembly by other means (it is not fatal error) */
- if (GetLastError() == ERROR_FILE_NOT_FOUND || GetLastError() == ERROR_PATH_NOT_FOUND)
+ if (mono_w32error_get_last() == ERROR_FILE_NOT_FOUND || mono_w32error_get_last() == ERROR_PATH_NOT_FOUND)
return NULL; /* file not found, shadow copy failed */
mono_error_set_execution_engine (oerror, "Failed to create shadow copy (mono_w32file_copy).");