gdk: Add SDL_GDKGetDefaultUser, SDL_GetPrefPath implementation

This commit is contained in:
Ethan Lee
2023-08-25 10:39:39 -04:00
parent 106abce69f
commit c0cd8c8142
7 changed files with 141 additions and 25 deletions

View File

@@ -214,3 +214,23 @@ SDL_GDKSuspendComplete()
SetEvent(plmSuspendComplete);
}
}
extern "C" DECLSPEC int
SDL_GDKGetDefaultUser(XUserHandle *outUserHandle)
{
XAsyncBlock block = { 0 };
HRESULT result;
if (FAILED(result = XUserAddAsync(XUserAddOptions::AddDefaultUserAllowingUI, &block))) {
return WIN_SetErrorFromHRESULT("XUserAddAsync", result);
}
do {
result = XUserAddResult(&block, outUserHandle);
} while (result == E_PENDING);
if (FAILED(result)) {
return WIN_SetErrorFromHRESULT("XUserAddResult", result);
}
return 0;
}