Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shell32/tests/shellpath.c | 62 +++++++++++++--------------------- 1 file changed, 23 insertions(+), 39 deletions(-)
diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 4ea2ef14cd..8161330b1e 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -86,8 +86,6 @@ struct shellExpectedValues {
static HRESULT (WINAPI *pDllGetVersion)(DLLVERSIONINFO *); static HRESULT (WINAPI *pSHGetFolderPathA)(HWND, int, HANDLE, DWORD, LPSTR); -static HRESULT (WINAPI *pSHGetFolderLocation)(HWND, int, HANDLE, DWORD, - LPITEMIDLIST *); static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL); static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *); static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST); @@ -196,7 +194,6 @@ static void loadShell32(void) GET_PROC(DllGetVersion) GET_PROC(SHGetFolderPathA) GET_PROC(SHGetFolderPathEx) - GET_PROC(SHGetFolderLocation) GET_PROC(SHGetKnownFolderPath) GET_PROC(SHSetKnownFolderPath) GET_PROC(SHGetSpecialFolderPathA) @@ -1318,22 +1315,19 @@ static void test_parameters(void) char path[MAX_PATH]; HRESULT hr;
- if (pSHGetFolderLocation) - { - /* check a bogus CSIDL: */ - pidl = NULL; - hr = pSHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl); - ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr); - if (hr == S_OK) IMalloc_Free(pMalloc, pidl); + /* check a bogus CSIDL: */ + pidl = NULL; + hr = SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl); + ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr); + if (hr == S_OK) IMalloc_Free(pMalloc, pidl);
- /* check a bogus user token: */ - pidl = NULL; - hr = pSHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl); - ok(hr == E_FAIL || hr == E_HANDLE, "got 0x%08x, expected E_FAIL or E_HANDLE\n", hr); - if (hr == S_OK) IMalloc_Free(pMalloc, pidl); + /* check a bogus user token: */ + pidl = NULL; + hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl); + ok(hr == E_FAIL || hr == E_HANDLE, "got 0x%08x, expected E_FAIL or E_HANDLE\n", hr); + if (hr == S_OK) IMalloc_Free(pMalloc, pidl);
- /* a NULL pidl pointer crashes, so don't test it */ - } + /* a NULL pidl pointer crashes, so don't test it */
if (pSHGetSpecialFolderLocation) { @@ -1381,11 +1375,8 @@ static BYTE testSHGetFolderLocation(int folder) HRESULT hr; BYTE ret = 0xff;
- /* treat absence of function as success */ - if (!pSHGetFolderLocation) return TRUE; - pidl = NULL; - hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl); + hr = SHGetFolderLocation(NULL, folder, NULL, 0, &pidl); if (hr == S_OK) { if (pidl) @@ -1399,6 +1390,7 @@ static BYTE testSHGetFolderLocation(int folder) IMalloc_Free(pMalloc, pidl); } } + return ret; }
@@ -1468,16 +1460,14 @@ static void test_ShellValues(const struct shellExpectedValues testEntries[], int j; BOOL foundTypeMatch = FALSE;
- if (pSHGetFolderLocation) - { - type = testSHGetFolderLocation(testEntries[i].folder); - for (j = 0; !foundTypeMatch && j < testEntries[i].numTypes; j++) - if (testEntries[i].types[j] == type) - foundTypeMatch = TRUE; - ok(foundTypeMatch || optional || broken(type == 0xff) /* Win9x */, - "%s has unexpected type %d (0x%02x)\n", - getFolderName(testEntries[i].folder), type, type); - } + type = testSHGetFolderLocation(testEntries[i].folder); + for (j = 0; !foundTypeMatch && j < testEntries[i].numTypes; j++) + if (testEntries[i].types[j] == type) + foundTypeMatch = TRUE; + ok(foundTypeMatch || optional || broken(type == 0xff) /* Win9x */, + "%s has unexpected type %d (0x%02x)\n", + getFolderName(testEntries[i].folder), type, type); + type = testSHGetSpecialFolderLocation(testEntries[i].folder); for (j = 0, foundTypeMatch = FALSE; !foundTypeMatch && j < testEntries[i].numTypes; j++) @@ -1533,11 +1523,10 @@ static void matchGUID(int folder, const GUID *guid, const GUID *guid_alt) LPITEMIDLIST pidl; HRESULT hr;
- if (!pSHGetFolderLocation) return; if (!guid) return;
pidl = NULL; - hr = pSHGetFolderLocation(NULL, folder, NULL, 0, &pidl); + hr = SHGetFolderLocation(NULL, folder, NULL, 0, &pidl); if (hr == S_OK) { LPITEMIDLIST pidlLast = pILFindLastID(pidl); @@ -1710,7 +1699,7 @@ static void doChild(const char *arg) "SHGetFolderPath returned 0x%08x, expected 0x80070002\n", hr);
pidl = NULL; - hr = pSHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl); + hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl); ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "SHGetFolderLocation returned 0x%08x\n", hr); if (hr == S_OK && pidl) IMalloc_Free(pMalloc, pidl); @@ -1780,7 +1769,6 @@ static void test_NonExistentPath(void) HKEY key;
if (!pSHGetFolderPathA) return; - if (!pSHGetFolderLocation) return; if (!pSHGetSpecialFolderPathA) return; if (!pSHGetSpecialFolderLocation) return; if (!pSHFileOperationA) return; @@ -2993,10 +2981,6 @@ START_TEST(shellpath) doChild(myARGV[2]); else { - /* Report missing functions once */ - if (!pSHGetFolderLocation) - win_skip("SHGetFolderLocation is not available\n"); - /* first test various combinations of parameters: */ test_parameters();
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shell32/tests/shelllink.c | 12 +++------- dlls/shell32/tests/shellpath.c | 23 +++--------------- dlls/shell32/tests/shlfolder.c | 43 +++++++++++++++------------------- 3 files changed, 25 insertions(+), 53 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index db839200d5..f760990a0a 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -492,13 +492,10 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int save_fails) lok(str != NULL || broken(str == NULL), /* shell32 < 5.0 */ "Didn't expect NULL\n"); - if (str != NULL) + if (str) { - IMalloc *pmalloc; - lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); - SHGetMalloc(&pmalloc); - IMalloc_Free(pmalloc, str); + CoTaskMemFree(str); } else win_skip("GetCurFile fails on shell32 < 5.0\n"); @@ -550,11 +547,8 @@ static void check_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int todo) "Didn't expect NULL\n"); if (str != NULL) { - IMalloc *pmalloc; - lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); - SHGetMalloc(&pmalloc); - IMalloc_Free(pmalloc, str); + CoTaskMemFree(str); } else win_skip("GetCurFile fails on shell32 < 5.0\n"); diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index 8161330b1e..9ec7226312 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -90,7 +90,6 @@ static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL); static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *); static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST); static int (WINAPI *pSHFileOperationA)(LPSHFILEOPSTRUCTA); -static HRESULT (WINAPI *pSHGetMalloc)(LPMALLOC *); static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR,UINT); static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *); static HRESULT (WINAPI *pSHSetKnownFolderPath)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR); @@ -100,7 +99,6 @@ static HRESULT (WINAPI *pSHGetKnownFolderIDList)(REFKNOWNFOLDERID, DWORD, HANDLE static BOOL (WINAPI *pPathResolve)(PWSTR, PZPCWSTR, UINT);
static DLLVERSIONINFO shellVersion = { 0 }; -static LPMALLOC pMalloc; static const BYTE guidType[] = { PT_GUID }; static const BYTE controlPanelType[] = { PT_SHELLEXT, PT_GUID, PT_CPL }; static const BYTE folderType[] = { PT_FOLDER, PT_FOLDERW }; @@ -202,20 +200,10 @@ static void loadShell32(void) if (!pILFindLastID) pILFindLastID = (void *)GetProcAddress(hShell32, (LPCSTR)16); GET_PROC(SHFileOperationA) - GET_PROC(SHGetMalloc) GET_PROC(PathYetAnotherMakeUniqueName) GET_PROC(SHGetKnownFolderIDList) GET_PROC(PathResolve);
- ok(pSHGetMalloc != NULL, "shell32 is missing SHGetMalloc\n"); - if (pSHGetMalloc) - { - HRESULT hr = pSHGetMalloc(&pMalloc); - - ok(hr == S_OK, "SHGetMalloc failed: 0x%08x\n", hr); - ok(pMalloc != NULL, "SHGetMalloc returned a NULL IMalloc\n"); - } - if (pDllGetVersion) { shellVersion.cbSize = sizeof(shellVersion); @@ -1319,13 +1307,11 @@ static void test_parameters(void) pidl = NULL; hr = SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl); ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr); - if (hr == S_OK) IMalloc_Free(pMalloc, pidl);
/* check a bogus user token: */ pidl = NULL; hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl); ok(hr == E_FAIL || hr == E_HANDLE, "got 0x%08x, expected E_FAIL or E_HANDLE\n", hr); - if (hr == S_OK) IMalloc_Free(pMalloc, pidl);
/* a NULL pidl pointer crashes, so don't test it */
@@ -1387,7 +1373,7 @@ static BYTE testSHGetFolderLocation(int folder) getFolderName(folder)); if (pidlLast) ret = pidlLast->mkid.abID[0]; - IMalloc_Free(pMalloc, pidl); + ILFree(pidl); } }
@@ -1416,7 +1402,7 @@ static BYTE testSHGetSpecialFolderLocation(int folder) "%s: ILFindLastID failed\n", getFolderName(folder)); if (pidlLast) ret = pidlLast->mkid.abID[0]; - IMalloc_Free(pMalloc, pidl); + ILFree(pidl); } } return ret; @@ -1546,7 +1532,7 @@ static void matchGUID(int folder, const GUID *guid, const GUID *guid_alt) "%s: got GUID %s, expected %s or %s\n", getFolderName(folder), wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid), wine_dbgstr_guid(guid_alt)); } - IMalloc_Free(pMalloc, pidl); + ILFree(pidl); } }
@@ -1702,7 +1688,6 @@ static void doChild(const char *arg) hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl); ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "SHGetFolderLocation returned 0x%08x\n", hr); - if (hr == S_OK && pidl) IMalloc_Free(pMalloc, pidl);
ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE), "SHGetSpecialFolderPath succeeded, expected failure\n"); @@ -1712,8 +1697,6 @@ static void doChild(const char *arg) ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "SHGetFolderLocation returned 0x%08x\n", hr);
- if (hr == S_OK && pidl) IMalloc_Free(pMalloc, pidl); - /* now test success: */ hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL, SHGFP_TYPE_CURRENT, path); diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c index ebeaf4e20e..3918a4387c 100644 --- a/dlls/shell32/tests/shlfolder.c +++ b/dlls/shell32/tests/shlfolder.c @@ -44,8 +44,6 @@ DEFINE_GUID(IID_IParentAndItem, 0xB3A4B685, 0xB685, 0x4805, 0x99,0xD9, 0x5D,0xEA,0xD2,0x87,0x32,0x36); DEFINE_GUID(CLSID_ShellDocObjView, 0xe7e4bc40, 0xe76a, 0x11ce, 0xa9,0xbb, 0x00,0xaa,0x00,0x4a,0xe8,0x37);
-static IMalloc *ppM; - static HRESULT (WINAPI *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv); static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**); static HRESULT (WINAPI *pSHCreateItemFromRelativeName)(IShellItem*,PCWSTR,IBindCtx*,REFIID,void**); @@ -149,9 +147,6 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("kernel32.dll"); pIsWow64Process = (void*)GetProcAddress(hmod, "IsWow64Process"); - - hr = SHGetMalloc(&ppM); - ok(hr == S_OK, "SHGetMalloc failed %08x\n", hr); }
/* Based on PathAddBackslashW from dlls/shlwapi/path.c */ @@ -405,7 +400,7 @@ static void test_EnumObjects(IShellFolder *iFolder) }
for (i=0;i<5;i++) - IMalloc_Free(ppM, idlArr[i]); + ILFree(idlArr[i]); }
static void test_BindToObject(void) @@ -451,7 +446,7 @@ static void test_BindToObject(void) hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer); ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr); IShellFolder_Release(psfDesktop); - IMalloc_Free(ppM, pidlMyComputer); + ILFree(pidlMyComputer); if (hr != S_OK) return;
hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); @@ -478,7 +473,7 @@ static void test_BindToObject(void) hr = IShellFolder_BindToObject(psfMyComputer, pidlSystemDir, NULL, &IID_IShellFolder, (LPVOID*)&psfSystemDir); ok (hr == S_OK, "MyComputer failed to bind to a FileSystem ShellFolder! hr = %08x\n", hr); IShellFolder_Release(psfMyComputer); - IMalloc_Free(ppM, pidlSystemDir); + ILFree(pidlSystemDir); if (hr != S_OK) return;
hr = IShellFolder_BindToObject(psfSystemDir, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); @@ -860,7 +855,7 @@ static void test_CallForAttributes(void) if (lResult != ERROR_SUCCESS) { if (lResult == ERROR_ACCESS_DENIED) skip("Not enough rights to open the registry key\n"); - IMalloc_Free(ppM, pidlMyDocuments); + ILFree(pidlMyDocuments); IShellFolder_Release(psfDesktop); return; } @@ -871,7 +866,7 @@ static void test_CallForAttributes(void) ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult); if (lResult != ERROR_SUCCESS) { RegCloseKey(hKey); - IMalloc_Free(ppM, pidlMyDocuments); + ILFree(pidlMyDocuments); IShellFolder_Release(psfDesktop); return; } @@ -883,7 +878,7 @@ static void test_CallForAttributes(void) ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult); if (lResult != ERROR_SUCCESS) { RegCloseKey(hKey); - IMalloc_Free(ppM, pidlMyDocuments); + ILFree(pidlMyDocuments); IShellFolder_Release(psfDesktop); return; } @@ -916,7 +911,7 @@ static void test_CallForAttributes(void) RegSetValueExW(hKey, wszCallForAttributes, 0, REG_DWORD, (LPBYTE)&dwOrigCallForAttributes, sizeof(DWORD)); RegCloseKey(hKey); - IMalloc_Free(ppM, pidlMyDocuments); + ILFree(pidlMyDocuments); IShellFolder_Release(psfDesktop); }
@@ -978,7 +973,7 @@ static void test_GetAttributesOf(void) hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer); ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr); IShellFolder_Release(psfDesktop); - IMalloc_Free(ppM, pidlMyComputer); + ILFree(pidlMyComputer); if (hr != S_OK) return;
hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags); @@ -1017,7 +1012,7 @@ static void test_GetAttributesOf(void) hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder); ok(hr == S_OK, "BindToObject failed %08x\n", hr);
- IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
/* get relative PIDL */ hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0); @@ -1030,7 +1025,7 @@ static void test_GetAttributesOf(void) ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for relative PIDL: %08x\n", dwFlags);
/* free memory */ - IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
/* append testdirectory name to path */ if (cCurrDirA[len-1] == '\') @@ -1048,7 +1043,7 @@ static void test_GetAttributesOf(void) ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for absolute PIDL: %08x\n", dwFlags);
/* free memory */ - IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
IShellFolder_Release(testIShellFolder);
@@ -1120,7 +1115,7 @@ static void test_SHGetPathFromIDList(void) return; }
- IMalloc_Free(ppM, pidlMyComputer); + ILFree(pidlMyComputer);
result = SHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE); ok(result, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError()); @@ -1143,7 +1138,7 @@ static void test_SHGetPathFromIDList(void) if (hr != S_OK) { IShellFolder_Release(psfDesktop); DeleteFileW(wszFileName); - IMalloc_Free(ppM, pidlTestFile); + ILFree(pidlTestFile); return; }
@@ -1154,7 +1149,7 @@ static void test_SHGetPathFromIDList(void) IShellFolder_Release(psfDesktop); DeleteFileW(wszFileName); if (hr != S_OK) { - IMalloc_Free(ppM, pidlTestFile); + ILFree(pidlTestFile); return; } StrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH); @@ -1191,7 +1186,7 @@ static void test_SHGetPathFromIDList(void) else win_skip("SHGetPathFromIDListEx not available\n");
- IMalloc_Free(ppM, pidlTestFile); + ILFree(pidlTestFile);
/* Test if we can get the path from the start menu "program files" PIDL. */ hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms); @@ -1199,7 +1194,7 @@ static void test_SHGetPathFromIDList(void)
SetLastError(0xdeadbeef); result = SHGetPathFromIDListW(pidlPrograms, wszPath); - IMalloc_Free(ppM, pidlPrograms); + ILFree(pidlPrograms); ok(result, "SHGetPathFromIDListW failed\n"); }
@@ -1243,7 +1238,7 @@ static void test_EnumObjects_and_CompareIDs(void)
Cleanup();
- IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
IShellFolder_Release(IDesktopFolder); } @@ -1948,7 +1943,7 @@ static void test_LocalizedNames(void) hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder); ok(hr == S_OK, "BindToObject failed %08x\n", hr);
- IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
/* windows reads the display name from the resource */ hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, foldernameW, NULL, &newPIDL, 0); @@ -1982,7 +1977,7 @@ static void test_LocalizedNames(void) IShellFolder_Release(IDesktopFolder); IShellFolder_Release(testIShellFolder);
- IMalloc_Free(ppM, newPIDL); + ILFree(newPIDL);
cleanup: DeleteFileA(".\testfolder\desktop.ini");
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=62937
Your paranoid android.
=== w2003std (32 bit report) ===
shell32: shlfolder.c:4950: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 8) shlfolder.c:4950: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 2) shlfolder.c:4950: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 10) shlfolder.c:4950: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8) shlfolder.c:4950: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8) shlfolder.c:4950: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 1e8)
=== w1064v1809 (32 bit report) ===
shell32: shlfolder.c:4845: Test failed: MKDIR: expected notification type 8, got: 40000 shlfolder.c:4852: Test failed: GetDisplayNameOf failed: 0x80070057 shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 8)
=== w1064v1809_2scr (32 bit report) ===
shell32: shlfolder.c:4845: Test failed: CREATE: expected notification type 2, got: 40000 shlfolder.c:4852: Test failed: GetDisplayNameOf failed: 0x80070057 shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 2)
=== w1064v1809_ar (32 bit report) ===
shell32: shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 3)
=== w1064v1809_he (32 bit report) ===
shell32: shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 3)
=== w1064v1809 (64 bit report) ===
shell32: shlfolder.c:4845: Test failed: CREATE: expected notification type 2, got: 40000 shlfolder.c:4852: Test failed: GetDisplayNameOf failed: 0x80070057 shlfolder.c:4862: Test failed: Didn't expect a WM_USER_NOTIFY message (event: 2)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shell32/tests/shelllink.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index f760990a0a..983c51bbd9 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -38,7 +38,6 @@ # define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */ #endif
-static void (WINAPI *pILFree)(LPITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); @@ -228,7 +227,7 @@ static void test_get_set(void) ok(ret, "SHGetPathFromIDListA failed\n"); if (ret) ok(lstrcmpiA(buffer,str)==0, "GetIDList returned '%s'\n", buffer); - pILFree(tmp_pidl); + ILFree(tmp_pidl); }
pidl=path_to_pidl(mypath); @@ -253,9 +252,9 @@ static void test_get_set(void) "GetIDList returned an incorrect pidl\n"); ok(second_pidl != tmp_pidl, "pidls are the same\n");
- pILFree(second_pidl); - pILFree(tmp_pidl); - pILFree(pidl); + ILFree(second_pidl); + ILFree(tmp_pidl); + ILFree(pidl);
strcpy(buffer,"garbage"); r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); @@ -294,7 +293,7 @@ static void test_get_set(void) ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes); ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName);
- pILFree(pidl_controls); + ILFree(pidl_controls); }
/* test path with quotes (IShellLinkA_SetPath returns S_FALSE on W2K and below and S_OK on XP and above */ @@ -1000,7 +999,7 @@ static void test_GetIconLocation(void) pidl = path_to_pidl(mypath); r = IShellLinkA_SetIDList(sl, pidl); ok(r == S_OK, "SetPath failed (0x%08x)\n", r); - pILFree(pidl); + ILFree(pidl);
i = 0xdeadbeef; strcpy(buffer, "garbage"); @@ -1474,7 +1473,6 @@ START_TEST(shelllink) HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); HMODULE huser32 = GetModuleHandleA("user32.dll");
- pILFree = (void *)GetProcAddress(hmod, (LPSTR)155); pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21); pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28); pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation");
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shell32/tests/shelllink.c | 39 +++++++++------------------------- 1 file changed, 10 insertions(+), 29 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 983c51bbd9..0cf24524a5 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -43,7 +43,6 @@ static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT); static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *); -static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR, LPSTR, DWORD); static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD); static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT); static BOOL (WINAPI *pIsProcessDPIAware)(void); @@ -170,19 +169,12 @@ static void test_get_set(void) ok(finddata.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes); ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName);
- r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, - &IID_IShellLinkW, (LPVOID*)&slW); + r = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (void **)&slW); ok(r == S_OK, "CoCreateInstance failed (0x%08x)\n", r); - if (!slW /* Win9x */ || !pGetLongPathNameA /* NT4 */) - skip("SetPath with NULL parameter crashes on Win9x and some NT4\n"); - else - { - IShellLinkW_Release(slW); - r = IShellLinkA_SetPath(sl, NULL); - ok(r==E_INVALIDARG || - broken(r==S_OK), /* Some Win95 and NT4 */ - "SetPath returned wrong error (0x%08x)\n", r); - } + IShellLinkW_Release(slW); + + r = IShellLinkA_SetPath(sl, NULL); + ok(r == E_INVALIDARG, "Unexpected hr %#x.\n", r);
r = IShellLinkA_SetPath(sl, ""); ok(r==S_OK, "SetPath failed (0x%08x)\n", r); @@ -643,12 +635,6 @@ static void test_load_save(void) HANDLE hf; DWORD r;
- if (!pGetLongPathNameA) - { - win_skip("GetLongPathNameA is not available\n"); - return; - } - /* Don't used a fixed path for the test.lnk file */ GetTempPathA(MAX_PATH, lnkfileA); lstrcatA(lnkfileA, lnkfileA_name); @@ -687,7 +673,8 @@ static void test_load_save(void) *p='\0';
/* IShellLink returns path in long form */ - if (!pGetLongPathNameA(mypath, realpath, MAX_PATH)) strcpy( realpath, mypath ); + if (!GetLongPathNameA(mypath, realpath, MAX_PATH)) + strcpy( realpath, mypath );
/* Overwrite the existing lnk file and point it to existing files */ desc.description="test 2"; @@ -755,7 +742,7 @@ static void test_load_save(void) /* Create a temporary non-executable file */ r=GetTempPathA(sizeof(mypath), mypath); ok(r<sizeof(mypath), "GetTempPath failed (%d), err %d\n", r, GetLastError()); - r=pGetLongPathNameA(mypath, mydir, sizeof(mydir)); + r = GetLongPathNameA(mypath, mydir, sizeof(mydir)); ok(r<sizeof(mydir), "GetLongPathName failed (%d), err %d\n", r, GetLastError()); p=strrchr(mydir, '\'); if (p) @@ -895,13 +882,8 @@ static void test_datalink(void) ok( r == E_FAIL, "CopyDataBlock failed\n"); ok( dar == NULL, "should be null\n");
- if (!pGetLongPathNameA /* NT4 */) - skip("SetPath with NULL parameter crashes on NT4\n"); - else - { - r = IShellLinkW_SetPath(sl, NULL); - ok(r == E_INVALIDARG, "SetPath returned wrong error (0x%08x)\n", r); - } + r = IShellLinkW_SetPath(sl, NULL); + ok(r == E_INVALIDARG, "Unexpected hr %#x.\n", r);
r = IShellLinkW_SetPath(sl, lnk); ok(r == S_OK, "SetPath failed\n"); @@ -1478,7 +1460,6 @@ START_TEST(shelllink) pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation"); pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA"); pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo"); - pGetLongPathNameA = (void *)GetProcAddress(hkernel32, "GetLongPathNameA"); pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA"); pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW"); pIsProcessDPIAware = (void *)GetProcAddress(huser32, "IsProcessDPIAware");
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/shell32/tests/shelllink.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c index 0cf24524a5..2c2ee94c17 100644 --- a/dlls/shell32/tests/shelllink.c +++ b/dlls/shell32/tests/shelllink.c @@ -43,7 +43,6 @@ static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); static HRESULT (WINAPI *pSHDefExtractIconA)(LPCSTR, int, UINT, HICON*, HICON*, UINT); static HRESULT (WINAPI *pSHGetStockIconInfo)(SHSTOCKICONID, UINT, SHSTOCKICONINFO *); -static DWORD (WINAPI *pGetShortPathNameA)(LPCSTR, LPSTR, DWORD); static UINT (WINAPI *pSHExtractIconsW)(LPCWSTR, int, int, int, HICON *, UINT *, UINT, UINT); static BOOL (WINAPI *pIsProcessDPIAware)(void);
@@ -767,7 +766,7 @@ static void test_load_save(void) create_lnk(lnkfile, &desc, 0); check_lnk(lnkfile, &desc, 0x0);
- r=pGetShortPathNameA(mydir, mypath, sizeof(mypath)); + r = GetShortPathNameA(mydir, mypath, sizeof(mypath)); ok(r<sizeof(mypath), "GetShortPathName failed (%d), err %d\n", r, GetLastError());
strcpy(realpath, mypath); @@ -1452,7 +1451,6 @@ START_TEST(shelllink) { HRESULT r; HMODULE hmod = GetModuleHandleA("shell32.dll"); - HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); HMODULE huser32 = GetModuleHandleA("user32.dll");
pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21); @@ -1460,7 +1458,6 @@ START_TEST(shelllink) pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation"); pSHDefExtractIconA = (void *)GetProcAddress(hmod, "SHDefExtractIconA"); pSHGetStockIconInfo = (void *)GetProcAddress(hmod, "SHGetStockIconInfo"); - pGetShortPathNameA = (void *)GetProcAddress(hkernel32, "GetShortPathNameA"); pSHExtractIconsW = (void *)GetProcAddress(hmod, "SHExtractIconsW"); pIsProcessDPIAware = (void *)GetProcAddress(huser32, "IsProcessDPIAware");