mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-30 15:08:31 +00:00
Set error using function hresult
This commit is contained in:

committed by
Sam Lantinga

parent
6eca02a0e7
commit
22bc430bbb
@@ -102,6 +102,7 @@ char *SDL_SYS_GetPrefPath(const char *org, const char *app)
|
|||||||
* NULL, &wszPath);
|
* NULL, &wszPath);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
HRESULT hr = E_FAIL;
|
||||||
WCHAR path[MAX_PATH];
|
WCHAR path[MAX_PATH];
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
WCHAR *worg = NULL;
|
WCHAR *worg = NULL;
|
||||||
@@ -117,8 +118,9 @@ char *SDL_SYS_GetPrefPath(const char *org, const char *app)
|
|||||||
org = "";
|
org = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path))) {
|
hr = SHGetFolderPathW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, path);
|
||||||
WIN_SetError("Couldn't locate our prefpath");
|
if (!SUCCEEDED(hr)) {
|
||||||
|
WIN_SetErrorFromHRESULT("Couldn't locate our prefpath", hr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user