shell32/tests: Get rid of SHGetMalloc() in tests.

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:22 +03:00 committed by Alexandre Julliard
parent 5b66af0204
commit 9a2e36b214
3 changed files with 25 additions and 54 deletions

View File

@ -492,13 +492,10 @@ void create_lnk_(int line, const WCHAR* path, lnk_desc_t* desc, int save_fails)
lok(str != NULL || lok(str != NULL ||
broken(str == NULL), /* shell32 < 5.0 */ broken(str == NULL), /* shell32 < 5.0 */
"Didn't expect NULL\n"); "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)); lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str));
SHGetMalloc(&pmalloc); CoTaskMemFree(str);
IMalloc_Free(pmalloc, str);
} }
else else
win_skip("GetCurFile fails on shell32 < 5.0\n"); 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"); "Didn't expect NULL\n");
if (str != NULL) if (str != NULL)
{ {
IMalloc *pmalloc;
lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str)); lok(!wcscmp(path, str), "Expected %s, got %s\n", wine_dbgstr_w(path), wine_dbgstr_w(str));
SHGetMalloc(&pmalloc); CoTaskMemFree(str);
IMalloc_Free(pmalloc, str);
} }
else else
win_skip("GetCurFile fails on shell32 < 5.0\n"); win_skip("GetCurFile fails on shell32 < 5.0\n");

View File

@ -90,7 +90,6 @@ static BOOL (WINAPI *pSHGetSpecialFolderPathA)(HWND, LPSTR, int, BOOL);
static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *); static HRESULT (WINAPI *pSHGetSpecialFolderLocation)(HWND, int, LPITEMIDLIST *);
static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST); static LPITEMIDLIST (WINAPI *pILFindLastID)(LPCITEMIDLIST);
static int (WINAPI *pSHFileOperationA)(LPSHFILEOPSTRUCTA); static int (WINAPI *pSHFileOperationA)(LPSHFILEOPSTRUCTA);
static HRESULT (WINAPI *pSHGetMalloc)(LPMALLOC *);
static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR,UINT); static UINT (WINAPI *pGetSystemWow64DirectoryA)(LPSTR,UINT);
static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *); static HRESULT (WINAPI *pSHGetKnownFolderPath)(REFKNOWNFOLDERID, DWORD, HANDLE, PWSTR *);
static HRESULT (WINAPI *pSHSetKnownFolderPath)(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 BOOL (WINAPI *pPathResolve)(PWSTR, PZPCWSTR, UINT);
static DLLVERSIONINFO shellVersion = { 0 }; static DLLVERSIONINFO shellVersion = { 0 };
static LPMALLOC pMalloc;
static const BYTE guidType[] = { PT_GUID }; static const BYTE guidType[] = { PT_GUID };
static const BYTE controlPanelType[] = { PT_SHELLEXT, PT_GUID, PT_CPL }; static const BYTE controlPanelType[] = { PT_SHELLEXT, PT_GUID, PT_CPL };
static const BYTE folderType[] = { PT_FOLDER, PT_FOLDERW }; static const BYTE folderType[] = { PT_FOLDER, PT_FOLDERW };
@ -202,20 +200,10 @@ static void loadShell32(void)
if (!pILFindLastID) if (!pILFindLastID)
pILFindLastID = (void *)GetProcAddress(hShell32, (LPCSTR)16); pILFindLastID = (void *)GetProcAddress(hShell32, (LPCSTR)16);
GET_PROC(SHFileOperationA) GET_PROC(SHFileOperationA)
GET_PROC(SHGetMalloc)
GET_PROC(PathYetAnotherMakeUniqueName) GET_PROC(PathYetAnotherMakeUniqueName)
GET_PROC(SHGetKnownFolderIDList) GET_PROC(SHGetKnownFolderIDList)
GET_PROC(PathResolve); 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) if (pDllGetVersion)
{ {
shellVersion.cbSize = sizeof(shellVersion); shellVersion.cbSize = sizeof(shellVersion);
@ -1319,13 +1307,11 @@ static void test_parameters(void)
pidl = NULL; pidl = NULL;
hr = SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl); hr = SHGetFolderLocation(NULL, 0xeeee, NULL, 0, &pidl);
ok(hr == E_INVALIDARG, "got 0x%08x, expected E_INVALIDARG\n", hr); 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: */ /* check a bogus user token: */
pidl = NULL; pidl = NULL;
hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, (HANDLE)2, 0, &pidl); 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); 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 */
@ -1387,7 +1373,7 @@ static BYTE testSHGetFolderLocation(int folder)
getFolderName(folder)); getFolderName(folder));
if (pidlLast) if (pidlLast)
ret = pidlLast->mkid.abID[0]; 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)); "%s: ILFindLastID failed\n", getFolderName(folder));
if (pidlLast) if (pidlLast)
ret = pidlLast->mkid.abID[0]; ret = pidlLast->mkid.abID[0];
IMalloc_Free(pMalloc, pidl); ILFree(pidl);
} }
} }
return ret; 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), "%s: got GUID %s, expected %s or %s\n", getFolderName(folder),
wine_dbgstr_guid(shellGuid), wine_dbgstr_guid(guid), wine_dbgstr_guid(guid_alt)); 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); hr = SHGetFolderLocation(NULL, CSIDL_FAVORITES, NULL, 0, &pidl);
ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr); "SHGetFolderLocation returned 0x%08x\n", hr);
if (hr == S_OK && pidl) IMalloc_Free(pMalloc, pidl);
ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE), ok(!pSHGetSpecialFolderPathA(NULL, path, CSIDL_FAVORITES, FALSE),
"SHGetSpecialFolderPath succeeded, expected failure\n"); "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), ok(hr == E_FAIL || hr == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND),
"SHGetFolderLocation returned 0x%08x\n", hr); "SHGetFolderLocation returned 0x%08x\n", hr);
if (hr == S_OK && pidl) IMalloc_Free(pMalloc, pidl);
/* now test success: */ /* now test success: */
hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL, hr = pSHGetFolderPathA(NULL, CSIDL_FAVORITES | CSIDL_FLAG_CREATE, NULL,
SHGFP_TYPE_CURRENT, path); SHGFP_TYPE_CURRENT, path);

View File

@ -44,8 +44,6 @@
DEFINE_GUID(IID_IParentAndItem, 0xB3A4B685, 0xB685, 0x4805, 0x99,0xD9, 0x5D,0xEA,0xD2,0x87,0x32,0x36); 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); 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 *pSHCreateItemFromIDList)(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);
static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**); static HRESULT (WINAPI *pSHCreateItemFromParsingName)(PCWSTR,IBindCtx*,REFIID,void**);
static HRESULT (WINAPI *pSHCreateItemFromRelativeName)(IShellItem*,PCWSTR,IBindCtx*,REFIID,void**); static HRESULT (WINAPI *pSHCreateItemFromRelativeName)(IShellItem*,PCWSTR,IBindCtx*,REFIID,void**);
@ -95,7 +93,6 @@ static int strcmp_wa(LPCWSTR strw, const char *stra)
static void init_function_pointers(void) static void init_function_pointers(void)
{ {
HMODULE hmod; HMODULE hmod;
HRESULT hr;
void *ptr; void *ptr;
hmod = GetModuleHandleA("shell32.dll"); hmod = GetModuleHandleA("shell32.dll");
@ -149,9 +146,6 @@ static void init_function_pointers(void)
hmod = GetModuleHandleA("kernel32.dll"); hmod = GetModuleHandleA("kernel32.dll");
pIsWow64Process = (void*)GetProcAddress(hmod, "IsWow64Process"); 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 */ /* Based on PathAddBackslashW from dlls/shlwapi/path.c */
@ -405,7 +399,7 @@ static void test_EnumObjects(IShellFolder *iFolder)
} }
for (i=0;i<5;i++) for (i=0;i<5;i++)
IMalloc_Free(ppM, idlArr[i]); ILFree(idlArr[i]);
} }
static void test_BindToObject(void) static void test_BindToObject(void)
@ -451,7 +445,7 @@ static void test_BindToObject(void)
hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer); 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); ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
IMalloc_Free(ppM, pidlMyComputer); ILFree(pidlMyComputer);
if (hr != S_OK) return; if (hr != S_OK) return;
hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); hr = IShellFolder_BindToObject(psfMyComputer, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
@ -478,7 +472,7 @@ static void test_BindToObject(void)
hr = IShellFolder_BindToObject(psfMyComputer, pidlSystemDir, NULL, &IID_IShellFolder, (LPVOID*)&psfSystemDir); 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); ok (hr == S_OK, "MyComputer failed to bind to a FileSystem ShellFolder! hr = %08x\n", hr);
IShellFolder_Release(psfMyComputer); IShellFolder_Release(psfMyComputer);
IMalloc_Free(ppM, pidlSystemDir); ILFree(pidlSystemDir);
if (hr != S_OK) return; if (hr != S_OK) return;
hr = IShellFolder_BindToObject(psfSystemDir, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild); hr = IShellFolder_BindToObject(psfSystemDir, pidlEmpty, NULL, &IID_IShellFolder, (LPVOID*)&psfChild);
@ -860,7 +854,7 @@ static void test_CallForAttributes(void)
if (lResult != ERROR_SUCCESS) { if (lResult != ERROR_SUCCESS) {
if (lResult == ERROR_ACCESS_DENIED) if (lResult == ERROR_ACCESS_DENIED)
skip("Not enough rights to open the registry key\n"); skip("Not enough rights to open the registry key\n");
IMalloc_Free(ppM, pidlMyDocuments); ILFree(pidlMyDocuments);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
return; return;
} }
@ -871,7 +865,7 @@ static void test_CallForAttributes(void)
ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult); ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult);
if (lResult != ERROR_SUCCESS) { if (lResult != ERROR_SUCCESS) {
RegCloseKey(hKey); RegCloseKey(hKey);
IMalloc_Free(ppM, pidlMyDocuments); ILFree(pidlMyDocuments);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
return; return;
} }
@ -883,7 +877,7 @@ static void test_CallForAttributes(void)
ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult); ok (lResult == ERROR_SUCCESS, "RegQueryValueEx failed! result: %08x\n", lResult);
if (lResult != ERROR_SUCCESS) { if (lResult != ERROR_SUCCESS) {
RegCloseKey(hKey); RegCloseKey(hKey);
IMalloc_Free(ppM, pidlMyDocuments); ILFree(pidlMyDocuments);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
return; return;
} }
@ -916,7 +910,7 @@ static void test_CallForAttributes(void)
RegSetValueExW(hKey, wszCallForAttributes, 0, REG_DWORD, RegSetValueExW(hKey, wszCallForAttributes, 0, REG_DWORD,
(LPBYTE)&dwOrigCallForAttributes, sizeof(DWORD)); (LPBYTE)&dwOrigCallForAttributes, sizeof(DWORD));
RegCloseKey(hKey); RegCloseKey(hKey);
IMalloc_Free(ppM, pidlMyDocuments); ILFree(pidlMyDocuments);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
} }
@ -978,7 +972,7 @@ static void test_GetAttributesOf(void)
hr = IShellFolder_BindToObject(psfDesktop, pidlMyComputer, NULL, &IID_IShellFolder, (LPVOID*)&psfMyComputer); 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); ok (hr == S_OK, "Desktop failed to bind to MyComputer object! hr = %08x\n", hr);
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
IMalloc_Free(ppM, pidlMyComputer); ILFree(pidlMyComputer);
if (hr != S_OK) return; if (hr != S_OK) return;
hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags); hr = IShellFolder_GetAttributesOf(psfMyComputer, 1, &pidlEmpty, &dwFlags);
@ -1017,7 +1011,7 @@ static void test_GetAttributesOf(void)
hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder); hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder);
ok(hr == S_OK, "BindToObject failed %08x\n", hr); ok(hr == S_OK, "BindToObject failed %08x\n", hr);
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
/* get relative PIDL */ /* get relative PIDL */
hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0); hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, cTestDirW, NULL, &newPIDL, 0);
@ -1030,7 +1024,7 @@ static void test_GetAttributesOf(void)
ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for relative PIDL: %08x\n", dwFlags); ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for relative PIDL: %08x\n", dwFlags);
/* free memory */ /* free memory */
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
/* append testdirectory name to path */ /* append testdirectory name to path */
if (cCurrDirA[len-1] == '\\') if (cCurrDirA[len-1] == '\\')
@ -1048,7 +1042,7 @@ static void test_GetAttributesOf(void)
ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for absolute PIDL: %08x\n", dwFlags); ok ((dwFlags&SFGAO_FOLDER), "Wrong directory attribute for absolute PIDL: %08x\n", dwFlags);
/* free memory */ /* free memory */
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
IShellFolder_Release(testIShellFolder); IShellFolder_Release(testIShellFolder);
@ -1120,7 +1114,7 @@ static void test_SHGetPathFromIDList(void)
return; return;
} }
IMalloc_Free(ppM, pidlMyComputer); ILFree(pidlMyComputer);
result = SHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE); result = SHGetSpecialFolderPathW(NULL, wszFileName, CSIDL_DESKTOPDIRECTORY, FALSE);
ok(result, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError()); ok(result, "SHGetSpecialFolderPathW failed! Last error: %u\n", GetLastError());
@ -1143,7 +1137,7 @@ static void test_SHGetPathFromIDList(void)
if (hr != S_OK) { if (hr != S_OK) {
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
DeleteFileW(wszFileName); DeleteFileW(wszFileName);
IMalloc_Free(ppM, pidlTestFile); ILFree(pidlTestFile);
return; return;
} }
@ -1154,7 +1148,7 @@ static void test_SHGetPathFromIDList(void)
IShellFolder_Release(psfDesktop); IShellFolder_Release(psfDesktop);
DeleteFileW(wszFileName); DeleteFileW(wszFileName);
if (hr != S_OK) { if (hr != S_OK) {
IMalloc_Free(ppM, pidlTestFile); ILFree(pidlTestFile);
return; return;
} }
StrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH); StrRetToBufW(&strret, pidlTestFile, wszPath, MAX_PATH);
@ -1191,7 +1185,7 @@ static void test_SHGetPathFromIDList(void)
else else
win_skip("SHGetPathFromIDListEx not available\n"); 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. */ /* Test if we can get the path from the start menu "program files" PIDL. */
hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms); hr = SHGetSpecialFolderLocation(NULL, CSIDL_PROGRAM_FILES, &pidlPrograms);
@ -1199,7 +1193,7 @@ static void test_SHGetPathFromIDList(void)
SetLastError(0xdeadbeef); SetLastError(0xdeadbeef);
result = SHGetPathFromIDListW(pidlPrograms, wszPath); result = SHGetPathFromIDListW(pidlPrograms, wszPath);
IMalloc_Free(ppM, pidlPrograms); ILFree(pidlPrograms);
ok(result, "SHGetPathFromIDListW failed\n"); ok(result, "SHGetPathFromIDListW failed\n");
} }
@ -1243,7 +1237,7 @@ static void test_EnumObjects_and_CompareIDs(void)
Cleanup(); Cleanup();
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
IShellFolder_Release(IDesktopFolder); IShellFolder_Release(IDesktopFolder);
} }
@ -1948,7 +1942,7 @@ static void test_LocalizedNames(void)
hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder); hr = IShellFolder_BindToObject(IDesktopFolder, newPIDL, NULL, (REFIID)&IID_IShellFolder, (LPVOID *)&testIShellFolder);
ok(hr == S_OK, "BindToObject failed %08x\n", hr); ok(hr == S_OK, "BindToObject failed %08x\n", hr);
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
/* windows reads the display name from the resource */ /* windows reads the display name from the resource */
hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, foldernameW, NULL, &newPIDL, 0); hr = IShellFolder_ParseDisplayName(testIShellFolder, NULL, NULL, foldernameW, NULL, &newPIDL, 0);
@ -1982,7 +1976,7 @@ static void test_LocalizedNames(void)
IShellFolder_Release(IDesktopFolder); IShellFolder_Release(IDesktopFolder);
IShellFolder_Release(testIShellFolder); IShellFolder_Release(testIShellFolder);
IMalloc_Free(ppM, newPIDL); ILFree(newPIDL);
cleanup: cleanup:
DeleteFileA(".\\testfolder\\desktop.ini"); DeleteFileA(".\\testfolder\\desktop.ini");