kernel32: Implement GetSystemRegistryQuota as a semi-stub.

This commit is contained in:
Andrew Nguyen 2010-10-11 05:16:16 -05:00 committed by Alexandre Julliard
parent fbcf44aa23
commit 43e99d6e0c
4 changed files with 49 additions and 1 deletions

View File

@ -630,7 +630,7 @@
@ stdcall GetSystemDirectoryW(ptr long)
@ stdcall GetSystemInfo(ptr)
@ stdcall GetSystemPowerStatus(ptr)
# @ stub GetSystemRegistryQuota
@ stdcall GetSystemRegistryQuota(ptr ptr)
@ stdcall GetSystemTime(ptr)
@ stdcall GetSystemTimeAdjustment(ptr ptr ptr)
@ stdcall GetSystemTimeAsFileTime(ptr)

View File

@ -207,3 +207,19 @@ DWORD WINAPI GetTickCount(void)
{
return GetTickCount64();
}
/******************************************************************************
* GetSystemRegistryQuota (KERNEL32.@)
*/
BOOL WINAPI GetSystemRegistryQuota(PDWORD pdwQuotaAllowed, PDWORD pdwQuotaUsed)
{
FIXME("(%p, %p) faking reported quota values\n", pdwQuotaAllowed, pdwQuotaUsed);
if (pdwQuotaAllowed)
*pdwQuotaAllowed = 2 * 1000 * 1000 * 1000; /* 2 GB */
if (pdwQuotaUsed)
*pdwQuotaUsed = 100 * 1000 * 1000; /* 100 MB */
return TRUE;
}

View File

@ -56,6 +56,7 @@
static HINSTANCE hkernel32;
static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
static BOOL (WINAPI *pGetSystemRegistryQuota)(PDWORD, PDWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
static LPVOID (WINAPI *pVirtualAllocEx)(HANDLE, LPVOID, SIZE_T, DWORD, DWORD);
static BOOL (WINAPI *pVirtualFreeEx)(HANDLE, LPVOID, SIZE_T, DWORD);
@ -197,6 +198,7 @@ static int init(void)
hkernel32 = GetModuleHandleA("kernel32");
pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo");
pGetSystemRegistryQuota = (void *) GetProcAddress(hkernel32, "GetSystemRegistryQuota");
pIsWow64Process = (void *) GetProcAddress(hkernel32, "IsWow64Process");
pVirtualAllocEx = (void *) GetProcAddress(hkernel32, "VirtualAllocEx");
pVirtualFreeEx = (void *) GetProcAddress(hkernel32, "VirtualFreeEx");
@ -1831,6 +1833,34 @@ static void test_SystemInfo(void)
}
}
static void test_RegistryQuota(void)
{
BOOL ret;
DWORD max_quota, used_quota;
if (!pGetSystemRegistryQuota)
{
win_skip("GetSystemRegistryQuota is not available\n");
return;
}
ret = pGetSystemRegistryQuota(NULL, NULL);
ok(ret == TRUE,
"Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret);
ret = pGetSystemRegistryQuota(&max_quota, NULL);
ok(ret == TRUE,
"Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret);
ret = pGetSystemRegistryQuota(NULL, &used_quota);
ok(ret == TRUE,
"Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret);
ret = pGetSystemRegistryQuota(&max_quota, &used_quota);
ok(ret == TRUE,
"Expected GetSystemRegistryQuota to return TRUE, got %d\n", ret);
}
START_TEST(process)
{
int b = init();
@ -1856,6 +1886,7 @@ START_TEST(process)
test_ProcessName();
test_Handles();
test_SystemInfo();
test_RegistryQuota();
/* things that can be tested:
* lookup: check the way program to be executed is searched
* handles: check the handle inheritance stuff (+sec options)

View File

@ -1755,6 +1755,7 @@ WINBASEAPI UINT WINAPI GetSystemDirectoryW(LPWSTR,UINT);
#define GetSystemDirectory WINELIB_NAME_AW(GetSystemDirectory)
WINBASEAPI VOID WINAPI GetSystemInfo(LPSYSTEM_INFO);
WINBASEAPI BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS);
WINBASEAPI BOOL WINAPI GetSystemRegistryQuota(PDWORD,PDWORD);
WINBASEAPI VOID WINAPI GetSystemTime(LPSYSTEMTIME);
WINBASEAPI BOOL WINAPI GetSystemTimeAdjustment(PDWORD,PDWORD,PBOOL);
WINBASEAPI VOID WINAPI GetSystemTimeAsFileTime(LPFILETIME);