35#define REG_TEST_BASEKEYA "Software\\Wine"
36#define REG_TEST_BASESUBKEYA "Test"
37#define REG_TEST_KEYA REG_TEST_BASEKEYA "\\" REG_TEST_BASESUBKEYA
38#define REG_TEST_SUBKEYA "MRUTest"
39#define REG_TEST_FULLKEY REG_TEST_KEYA "\\" REG_TEST_SUBKEYA
64#define MRU_CACHEWRITE 2
84#define X2(f, ord) p##f = (void*)GetProcAddress(hComctl32, (const char *)ord);
102 DWORD dwMaxSubkeyLen, dwMaxValueLen;
120 dwMaxLen =
max(dwMaxSubkeyLen, dwMaxValueLen);
158 if (lpszName != szNameBuf)
203 ok(!
ret &&
buff[0],
"Checking MRU: got %d from RegQueryValueExW\n",
ret);
206 ok(
strcmp(
buff, mrulist) == 0,
"Checking MRU: Expected list %s, got %s\n",
213 name[0] = mrulist[
i];
220 "Checking MRU item %d ('%c'): got %d from RegQueryValueExW\n",
224 "Checking MRU item %d ('%c'): expected \"%s\", got \"%s\"\n",
242 if (!pCreateMRUListA || !pFreeMRUList || !pAddMRUStringA || !pEnumMRUListA)
244 win_skip(
"MRU entry points not found\n");
251 hMRU = pCreateMRUListA(
NULL);
263 hMRU = pCreateMRUListA(&
infoA);
265 "CreateMRUListA(too small) expected NULL,0 got %p,%d\n",
277 hMRU = pCreateMRUListA(&
infoA);
279 "CreateMRUListA(too big) expected NULL,0 got %p,%d\n",
291 hMRU = pCreateMRUListA(&
infoA);
293 "CreateMRUListA(NULL key) expected NULL,0 got %p,%d\n",
305 hMRU = pCreateMRUListA(&
infoA);
307 "CreateMRUListA(NULL name) expected NULL,0 got %p,%d\n",
322 hMRU = pCreateMRUListA(&
infoA);
324 "CreateMRUListA(string) expected non-NULL,0 got %p,%d\n",
330 checks[0] =
"Test 1";
331 checks[1] =
"Test 2";
332 checks[2] =
"Test 3";
333 checks[3] =
"Test 4";
337 iRet = pAddMRUStringA(
NULL, checks[0]);
339 "AddMRUStringA(NULL list) expected -1,0 got %d,%d\n",
347 iRet = pAddMRUStringA(hMRU,
NULL);
349 "AddMRUStringA(NULL str) expected 0,ERROR_INVALID_PARAMETER got %d,%d\n",
355 iRet = pAddMRUStringA(hMRU, checks[0]);
357 "AddMRUStringA(1) expected 0,0 got %d,%d\n",
362 iRet = pAddMRUStringA(hMRU, checks[1]);
364 "AddMRUStringA(2) expected 1,0 got %d,%d\n",
369 iRet = pAddMRUStringA(hMRU, checks[2]);
371 "AddMRUStringA(2) expected 2,0 got %d,%d\n",
379 iRet = pAddMRUStringA(hMRU, checks[1]);
381 "AddMRUStringA(re-add 1) expected 1,0 got %d,%d\n",
387 iRet = pAddMRUStringA(hMRU, checks[3]);
389 "AddMRUStringA(add new) expected 0,0 got %d,%d\n",
391 checks[0] = checks[3];
395 iRet = pEnumMRUListA(hMRU, 0,
NULL, 0);
396 ok(iRet == 3 || iRet == -1 ,
"EnumMRUList expected %d or -1, got %d\n",
LIST_SIZE, iRet);
399 iRet = pEnumMRUListA(hMRU, -1,
NULL, 0);
400 ok(iRet == 3 || iRet == -1 ,
"EnumMRUList expected %d or -1, got %d\n",
LIST_SIZE, iRet);
403 iRet = pEnumMRUListA(hMRU, -5,
NULL, 0);
404 ok(iRet == 3 || iRet == -1 ,
"EnumMRUList expected %d or -1, got %d\n",
LIST_SIZE, iRet);
407 iRet = pEnumMRUListA(hMRU, -1,
buffer, 255);
408 ok(iRet == 3,
"EnumMRUList expected %d, got %d\n",
LIST_SIZE, iRet);
411 iRet = pEnumMRUListA(hMRU, -5,
buffer, 255);
412 ok(iRet == 3,
"EnumMRUList expected %d, got %d\n",
LIST_SIZE, iRet);
416 iRet = pEnumMRUListA(hMRU, 0,
buffer, 255);
417 ok(iRet ==
lstrlenA(checks[3]),
"EnumMRUList expected %d, got %d\n",
lstrlenA(checks[3]), iRet);
425 iRet = pEnumMRUListA(hMRU, 0,
buffer, 2);
426 ok(iRet ==
lstrlenA(checks[3]),
"EnumMRUList expected %d, got %d\n",
lstrlenA(checks[3]), iRet);
429 ok(
buffer[2] ==
'A',
"EnumMRUList expected %02x, got %02x\n",
'A',
buffer[2]);
433 iRet = pEnumMRUListA(hMRU, 1,
buffer, 255);
434 ok(iRet ==
lstrlenA(checks[1]),
"EnumMRUList expected %d, got %d\n",
lstrlenA(checks[1]), iRet);
439 iRet = pEnumMRUListA(hMRU, 2,
buffer, 255);
440 ok(iRet ==
lstrlenA(checks[2]),
"EnumMRUList expected %d, got %d\n",
lstrlenA(checks[2]), iRet);
445 iRet = pEnumMRUListA(hMRU, 3,
buffer, 255);
446 ok(iRet == -1,
"EnumMRUList expected %d, got %d\n", -1, iRet);
447 ok(
strcmp(
buffer,
"dummy") == 0,
"EnumMRUList expected unchanged buffer %s, got %s\n",
"dummy",
buffer);
477 if (!pCreateMRUListLazyA || !pFreeMRUList)
479 win_skip(
"CreateMRUListLazyA or FreeMRUList entry points not found\n");
488 hMRU = pCreateMRUListLazyA((
MRUINFOA*)&
ptr->mruA, 0, 0, 0);
491 ok(hMRU !=
NULL,
"%d: got %p\n",
i, hMRU);
495 ok(hMRU ==
NULL,
"%d: got %p\n",
i, hMRU);
501 if (!pEnumMRUListA || !pEnumMRUListW)
503 win_skip(
"EnumMRUListA/EnumMRUListW entry point not found\n");
522 win_skip(
"FindMRUData entry point not found\n");
528 ok(iRet == -1,
"FindMRUData expected -1, got %d\n", iRet);
537 win_skip(
"AddMRUData entry point not found\n");
543 ok(iRet == -1,
"AddMRUData expected -1, got %d\n", iRet);
548 static const WCHAR mrutestW[] = {
'M',
'R',
'U',
'T',
'e',
's',
't',0};
554 if (!pCreateMRUListW)
556 win_skip(
"CreateMRUListW entry point not found\n");
563 ok(named == pCreateMRUListW,
"got %p, expected %p\n", named, pCreateMRUListW);
571 infoW.lpszSubKey = mrutestW;
575 hMru = pCreateMRUListW(&
infoW);
576 ok(hMru !=
NULL,
"got %p\n", hMru);
583 infoW.lpszSubKey = mrutestW;
587 hMru = pCreateMRUListW(&
infoW);
588 ok(hMru !=
NULL,
"got %p\n", hMru);
595 infoW.lpszSubKey = mrutestW;
599 hMru = pCreateMRUListW(&
infoW);
600 ok(hMru !=
NULL,
"got %p\n", hMru);
607 infoW.lpszSubKey = mrutestW;
611 hMru = pCreateMRUListW(&
infoW);
612 ok(hMru !=
NULL,
"got %p\n", hMru);
619 infoW.lpszSubKey = mrutestW;
623 hMru = pCreateMRUListW(&
infoW);
624 ok(hMru ==
NULL,
"got %p\n", hMru);
631 static const WCHAR mrutestW[] = {
'M',
'R',
'U',
'T',
'e',
's',
't',0};
637 if (!pCreateMRUListLazyW)
639 win_skip(
"CreateMRUListLazyW entry point not found\n");
645 ok(named ==
NULL,
"got %p\n", named);
653 infoW.lpszSubKey = mrutestW;
657 hMru = pCreateMRUListLazyW(&
infoW, 0, 0, 0);
658 ok(hMru !=
NULL,
"got %p\n", hMru);
665 infoW.lpszSubKey = mrutestW;
669 hMru = pCreateMRUListLazyW(&
infoW, 0, 0, 0);
670 ok(hMru !=
NULL,
"got %p\n", hMru);
677 infoW.lpszSubKey = mrutestW;
681 hMru = pCreateMRUListLazyW(&
infoW, 0, 0, 0);
682 ok(hMru !=
NULL,
"got %p\n", hMru);
689 infoW.lpszSubKey = mrutestW;
693 hMru = pCreateMRUListLazyW(&
infoW, 0, 0, 0);
694 ok(hMru !=
NULL,
"got %p\n", hMru);
701 infoW.lpszSubKey = mrutestW;
705 hMru = pCreateMRUListLazyW(&
infoW, 0, 0, 0);
706 ok(hMru ==
NULL,
"got %p\n", hMru);
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define RegCloseKey(hKey)
INT WINAPI FindMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
INT WINAPI AddMRUStringA(HANDLE hList, LPCSTR lpszString)
INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
HANDLE WINAPI CreateMRUListW(const MRUINFOW *infoW)
HANDLE WINAPI CreateMRUListA(const MRUINFOA *lpcml)
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer, DWORD nBufferSize)
void WINAPI FreeMRUList(HANDLE hMRUList)
HANDLE WINAPI CreateMRUListLazyA(const MRUINFOA *lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
INT WINAPI AddMRUData(HANDLE hList, LPCVOID lpData, DWORD cbData)
HANDLE WINAPI CreateMRUListLazyW(const MRUINFOW *infoW, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
#define ERROR_NOT_ENOUGH_MEMORY
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegOpenKeyExA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey, _In_ DWORD ulOptions, _In_ REGSAM samDesired, _Out_ PHKEY phkResult)
LONG WINAPI RegQueryInfoKeyA(HKEY hKey, LPSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
LONG WINAPI RegOpenKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegEnumValueA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpdwReserved, _Out_opt_ LPDWORD lpdwType, _Out_opt_ LPBYTE lpData, _Inout_opt_ LPDWORD lpcbData)
LONG WINAPI RegDeleteValueA(HKEY hKey, LPCSTR lpValueName)
LONG WINAPI RegQueryValueExA(_In_ HKEY hkeyorg, _In_ LPCSTR name, _In_ LPDWORD reserved, _Out_opt_ LPDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ LPDWORD count)
LONG WINAPI RegEnumKeyExA(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
#define ERROR_INVALID_PARAMETER
#define GetProcAddress(x, y)
static void cleanup(void)
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryA(LPCSTR lpLibFileName)
int WINAPI lstrcmpiA(LPCSTR str1, LPCSTR str2)
static unsigned char buff[32768]
GLuint GLuint GLsizei GLenum type
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static const SecPkgInfoW infoW
static const SecPkgInfoA infoA
int WINAPI lstrlenA(LPCSTR lpString)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static void test_CreateMRUListLazyA(void)
struct tagMRUINFOW MRUINFOW
#define REG_TEST_BASEKEYA
static void test_CreateMRUListW(void)
struct tagMRUINFOA MRUINFOA
static void test_FindMRUData(void)
static LSTATUS mru_RegDeleteTreeA(HKEY hKey, LPCSTR lpszSubKey)
static void test_AddMRUData(void)
static const create_lazya_t create_lazyA[]
static void test_MRUListA(void)
static void test_CreateMRUListLazyW(void)
static void check_reg_entries(const char *mrulist, const char **items)
static void delete_reg_entries(void)
static BOOL create_reg_entries(void)
static void init_functions(void)
static int CALLBACK cmp_mru_strA(LPCSTR data1, LPCSTR data2)
static void test_EnumMRUList(void)
#define REG_TEST_BASESUBKEYA
int(CALLBACK *lpfnCompare)(LPCSTR
int(CALLBACK *lpfnCompare)(LPCWSTR
DWORD WINAPI GetLastError(void)
#define HKEY_CURRENT_USER