This function is supposed to allocate memory for a GUID on success. Applications should check the return status before trying to access this pointer, but apparently vrmonitor.exe in SteamVR isn't.
From: Robert Lippmann robert.lippmann.development@gmail.com
--- dlls/powrprof/powrprof.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/powrprof/powrprof.c b/dlls/powrprof/powrprof.c index c1b71b5682e..7fa7709a4c9 100644 --- a/dlls/powrprof/powrprof.c +++ b/dlls/powrprof/powrprof.c @@ -287,8 +287,16 @@ BOOLEAN WINAPI WritePwrScheme(PUINT puiID, LPWSTR lpszName, LPWSTR lpszDescripti
DWORD WINAPI PowerGetActiveScheme(HKEY UserRootPowerKey, GUID **polguid) { - FIXME("(%p,%p) stub!\n", UserRootPowerKey, polguid); - return ERROR_CALL_NOT_IMPLEMENTED; + GUID dummy_guid= { 0x8c5e7f13, 0x46f4, 0x4f4b, { 0xb4, 0x6f, 0x88, 0xbb, 0xf1, 0xf1, 0x58, 0x6f } }; + FIXME("(%p,%p) partial stub!\n", UserRootPowerKey, polguid); + /* Windows SDK docs say this should be freed by LocalFree() */ + *polguid = LocalAlloc(LPTR, sizeof(GUID)); + if (*polguid) + { + memcpy(*polguid, &dummy_guid, sizeof(GUID)); + return ERROR_SUCCESS; + } + return ERROR_NOT_ENOUGH_MEMORY; }
DWORD WINAPI PowerSetActiveScheme(HKEY UserRootPowerKey, GUID *polguid)