Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 382 of file powrprof.c.
{ HKEY hKey; BYTE lpValue[40]; LONG Ret; DWORD cbValue = sizeof(lpValue); TRACE("(%p, %p)\n", RangeMax, RangeMin); if (RangeMax == NULL || RangeMin == NULL) { SetLastError(ERROR_INVALID_PARAMETER); return FALSE; } WaitForSingleObject(PPRegSemaphore, INFINITE); Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE, szPowerCfgSubKey, 0, KEY_READ, &hKey); if (Ret != ERROR_SUCCESS) { TRACE("RegOpenKeyEx failed: %d\n", Ret); TRACE("Using defaults: 3600, 3\n"); *RangeMax = 3600; *RangeMin = 3; ReleaseSemaphore(PPRegSemaphore, 1, NULL); return TRUE; } Ret = RegQueryValueExW(hKey, szDiskMax, 0, 0, lpValue, &cbValue); if (Ret != ERROR_SUCCESS) { TRACE("Couldn't open DiskSpinDownMax: %d\n", Ret); TRACE("Using default: 3600\n"); *RangeMax = 3600; } else { *RangeMax = _wtoi((LPCWSTR)lpValue); } cbValue = sizeof(lpValue); Ret = RegQueryValueExW(hKey, szDiskMin, 0, 0, lpValue, &cbValue); if (Ret != ERROR_SUCCESS) { TRACE("Couldn't open DiskSpinDownMin: %d\n", Ret); TRACE("Using default: 3\n"); *RangeMin = 3; } else { *RangeMin = _wtoi((LPCWSTR)lpValue); } RegCloseKey(hKey); ReleaseSemaphore(PPRegSemaphore, 1, NULL); return TRUE; }