0
下面調用SetSystemFileCacheSize()失敗,但它傳遞如果與0電話SetSystemFileCacheSize未能在C++
取代「FILE_CACHE_MIN_HARD_ENABLE」我在做什麼錯?
SIZE_T dwMinimumFileCacheSize = 1048576; // Exact number reported by SetSystemFileCacheSize.
SIZE_T dwMaximumFileCacheSize = 1099511627776; // Exact number reported by SetSystemFileCacheSize.
int result = SetSystemFileCacheSize(
dwMinimumFileCacheSize, // dwMinimumWorkingSetSize
dwMaximumFileCacheSize, // dwMaximumWorkingSetSize,
FILE_CACHE_MIN_HARD_ENABLE // Works if this flag is set to 0.
);
if (result == 0)
{
// Error is "5" if it fails.
wprintf(L" Error E2469: Could not set size of system cache, error %u.\n", GetLastError());
}
else
{
wprintf(L" Pass.\n");
}
是否啓用了SE_INCREASE_QUOTA_NAME特權? –
@Alan Stokes好主意,我馬上試試。 – Contango
錯誤'5' ='ERROR_ACCESS_DENIED'應該提示您缺少權限。 –