From 51cb83bd084deaab038e6f328ff2af56a3a0bd16 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 17 May 2015 14:38:09 +0200 Subject: [PATCH] GetFolderPathW needs wchar_t and can otherwise fail (returning an invalid path) and use AppData path instead of users home directory. Use Local AppData instead of roaming to users on domain networks aren't uploading DAG files to servers. --- libethash/io_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libethash/io_win32.c b/libethash/io_win32.c index 2e6c8deb8..34f1aaa77 100644 --- a/libethash/io_win32.c +++ b/libethash/io_win32.c @@ -87,9 +87,9 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - static const char dir_suffix[] = "Appdata\\Ethash\\"; + static const char dir_suffix[] = "Ethash\\"; strbuf[0] = '\0'; - if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { + if (!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, (CHAR*)strbuf))) { return false; } if (!ethash_strncat(strbuf, buffsize, "\\", 1)) {