shell32/tests: Use ILFree() directly.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2020-01-07 00:08:23 +03:00 committed by Alexandre Julliard
parent 9a2e36b214
commit 0c1a701e24
1 changed files with 6 additions and 8 deletions

View File

@ -38,7 +38,6 @@
# define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */ # define SLDF_HAS_LOGO3ID 0x00000800 /* not available in the Vista SDK */
#endif #endif
static void (WINAPI *pILFree)(LPITEMIDLIST);
static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST); static BOOL (WINAPI *pILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*); static HRESULT (WINAPI *pSHILCreateFromPath)(LPCWSTR, LPITEMIDLIST *,DWORD*);
static HRESULT (WINAPI *pSHGetFolderLocation)(HWND,INT,HANDLE,DWORD,PIDLIST_ABSOLUTE*); 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"); ok(ret, "SHGetPathFromIDListA failed\n");
if (ret) if (ret)
ok(lstrcmpiA(buffer,str)==0, "GetIDList returned '%s'\n", buffer); ok(lstrcmpiA(buffer,str)==0, "GetIDList returned '%s'\n", buffer);
pILFree(tmp_pidl); ILFree(tmp_pidl);
} }
pidl=path_to_pidl(mypath); pidl=path_to_pidl(mypath);
@ -253,9 +252,9 @@ static void test_get_set(void)
"GetIDList returned an incorrect pidl\n"); "GetIDList returned an incorrect pidl\n");
ok(second_pidl != tmp_pidl, "pidls are the same\n"); ok(second_pidl != tmp_pidl, "pidls are the same\n");
pILFree(second_pidl); ILFree(second_pidl);
pILFree(tmp_pidl); ILFree(tmp_pidl);
pILFree(pidl); ILFree(pidl);
strcpy(buffer,"garbage"); strcpy(buffer,"garbage");
r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH); 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.dwFileAttributes == 0, "unexpected attributes %x\n", finddata.dwFileAttributes);
ok(finddata.cFileName[0] == 0, "unexpected filename '%s'\n", finddata.cFileName); 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 */ /* 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); pidl = path_to_pidl(mypath);
r = IShellLinkA_SetIDList(sl, pidl); r = IShellLinkA_SetIDList(sl, pidl);
ok(r == S_OK, "SetPath failed (0x%08x)\n", r); ok(r == S_OK, "SetPath failed (0x%08x)\n", r);
pILFree(pidl); ILFree(pidl);
i = 0xdeadbeef; i = 0xdeadbeef;
strcpy(buffer, "garbage"); strcpy(buffer, "garbage");
@ -1474,7 +1473,6 @@ START_TEST(shelllink)
HMODULE hkernel32 = GetModuleHandleA("kernel32.dll"); HMODULE hkernel32 = GetModuleHandleA("kernel32.dll");
HMODULE huser32 = GetModuleHandleA("user32.dll"); HMODULE huser32 = GetModuleHandleA("user32.dll");
pILFree = (void *)GetProcAddress(hmod, (LPSTR)155);
pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21); pILIsEqual = (void *)GetProcAddress(hmod, (LPSTR)21);
pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28); pSHILCreateFromPath = (void *)GetProcAddress(hmod, (LPSTR)28);
pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation"); pSHGetFolderLocation = (void *)GetProcAddress(hmod, "SHGetFolderLocation");