src/mess/osd/windows/winmess.c
| r767 | r768 | |
| 7 | 7 | #include "utils.h" |
| 8 | 8 | #include "winutil.h" |
| 9 | 9 | #include "strconv.h" |
| 10 | #include "winutf8.h" |
| 10 | 11 | |
| 12 | |
| 11 | 13 | //============================================================ |
| 12 | 14 | // win_error_to_mame_file_error |
| 13 | 15 | //============================================================ |
| r767 | r768 | |
| 81 | 83 | |
| 82 | 84 | file_error osd_copyfile(const char *destfile, const char *srcfile) |
| 83 | 85 | { |
| 84 | | file_error filerr = FILERR_NONE; |
| 85 | | TCHAR *t_destfile = tstring_from_utf8(destfile); |
| 86 | | TCHAR *t_srcfile = tstring_from_utf8(srcfile); |
| 86 | // wrapper for win_copy_file_utf8() |
| 87 | if (!win_copy_file_utf8(srcfile, destfile, TRUE)) |
| 88 | return win_error_to_mame_file_error(GetLastError()); |
| 87 | 89 | |
| 88 | | if (!t_destfile || !t_srcfile) |
| 89 | | { |
| 90 | | filerr = FILERR_OUT_OF_MEMORY; |
| 91 | | goto done; |
| 92 | | } |
| 93 | | |
| 94 | | if (!CopyFile(t_srcfile, t_destfile, TRUE)) |
| 95 | | { |
| 96 | | filerr = win_error_to_mame_file_error(GetLastError()); |
| 97 | | goto done; |
| 98 | | } |
| 99 | | |
| 100 | | done: |
| 101 | | if (t_destfile) |
| 102 | | free(t_destfile); |
| 103 | | if (t_srcfile) |
| 104 | | free(t_srcfile); |
| 105 | | return filerr; |
| 90 | return FILERR_NONE; |
| 106 | 91 | } |
| 107 | 92 | |
| 108 | 93 | |