1diff
--git
"a/C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\TortoiseGit\\wsy2995.tmp\\wsystem-830bcab-left.c" "b/E:\\myroom\\libraries\\allegro\\src\\win\\wsystem.c"
2index 68fb78e..
6c72b08 100644
3--- "a/C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\TortoiseGit\\wsy2995.tmp\\wsystem-830bcab-left.c"
4+++ "b/E:\\myroom\\libraries\\allegro\\src\\win\\wsystem.c"
5@@
-450,
7 +450,
9 @@ ALLEGRO_PATH
*_al_win_get_path
(int id
)
6 switch (id
) {
7 case ALLEGRO_TEMP_PATH:
{
8 /* Check: TMP, TMPDIR, TEMP or TEMPDIR */
9- DWORD ret
= GetTempPath
(MAX_PATH, path
);
10+ wchar_t pathw
[MAX_PATH
];
11+ DWORD ret
= GetTempPathW
(MAX_PATH, pathw
);
12+ WideCharToMultiByte
(CP_UTF8,
0, pathw,
-1, path, wcslen
(pathw
) + 1, NULL, NULL
);
13 if (ret
> MAX_PATH
) {
14 /* should this ever happen, windows is more broken than I ever thought */
15 return NULL
;
16@@
-463,
7 +465,
9 @@ ALLEGRO_PATH
*_al_win_get_path
(int id
)
17 case ALLEGRO_RESOURCES_PATH:
{ /* where the program is in */
18 HANDLE process
= GetCurrentProcess
();
19 char *ptr
;
20- GetModuleFileNameEx
(process, NULL, path, MAX_PATH
);
21+ wchar_t pathw
[MAX_PATH
];
22+ GetModuleFileNameExW
(process, NULL, pathw, MAX_PATH
);
23+ WideCharToMultiByte
(CP_UTF8,
0, pathw,
-1, path, wcslen
(pathw
) + 1, NULL, NULL
);
24 ptr
= strrchr(path,
'\\');
25 if (!ptr
) { /* shouldn't happen */
26 return NULL
;
27@@
-491,
7 +495,
9 @@ ALLEGRO_PATH
*_al_win_get_path
(int id
)
28
29 case ALLEGRO_EXENAME_PATH:
{ /* full path to the exe including its name */
30 HANDLE process
= GetCurrentProcess
();
31- GetModuleFileNameEx
(process, NULL, path, MAX_PATH
);
32+ wchar_t pathw
[MAX_PATH
];
33+ GetModuleFileNameExW
(process, NULL, pathw, MAX_PATH
);
34+ WideCharToMultiByte
(CP_UTF8,
0, pathw,
-1, path, wcslen
(pathw
) + 1, NULL, NULL
);
35
36 return al_create_path(path
);
37 } break;
38@@
-500,
7 +506,
9 @@ ALLEGRO_PATH
*_al_win_get_path
(int id
)
39 return NULL
;
40 }
41
42- ret
= SHGetFolderPath
(NULL, csidl, NULL, SHGFP_TYPE_CURRENT, path
);
43+ wchar_t pathw
[MAX_PATH
];
44+ ret
= SHGetFolderPathW
(NULL, csidl, NULL, SHGFP_TYPE_CURRENT, pathw
);
45+ WideCharToMultiByte
(CP_UTF8,
0, pathw,
-1, path, wcslen
(pathw
) + 1, NULL, NULL
);
46 if (ret
!= S_OK
) {
47 return NULL
;
48 }