Replace a few more direct lpVtbl accesses by the proper macros.

This commit is contained in:
Alexandre Julliard 2005-09-07 13:28:25 +00:00
parent 90b897f00e
commit 7f67b35a0d
3 changed files with 70 additions and 65 deletions

View File

@ -21,6 +21,7 @@
#define NONAMELESSSTRUCT
#define NONAMELESSUNION
#define COBJMACROS
#include <windows.h>
#include "wine/test.h"
@ -209,12 +210,12 @@ static void propset_private_tests(void)
/* direct sound doesn't have an IKsPropertySet */
/* DSOUND: Error: Invalid interface buffer */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)0);
ok(rc==DSERR_INVALIDPARAM, "CreateInstance(IID_IKsPropertySet) should have "
"returned DSERR_INVALIDPARAM, returned: %s\n",DXGetErrorString8(rc));
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
@ -228,7 +229,7 @@ static void propset_private_tests(void)
goto error;
/* direct sound 8 doesn't have an IKsPropertySet */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
@ -244,7 +245,7 @@ static void propset_private_tests(void)
goto error;
/* direct sound capture doesn't have an IKsPropertySet */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE,returned: %s\n",DXGetErrorString8(rc));
@ -260,7 +261,7 @@ static void propset_private_tests(void)
goto error;
/* direct sound capture 8 doesn't have an IKsPropertySet */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned E_NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
@ -276,7 +277,7 @@ static void propset_private_tests(void)
goto error;
/* direct sound full duplex doesn't have an IKsPropertySet */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==E_NOINTERFACE, "CreateInstance(IID_IKsPropertySet) should have "
"returned NOINTERFACE, returned: %s\n",DXGetErrorString8(rc));
@ -291,7 +292,7 @@ static void propset_private_tests(void)
goto error;
/* direct sound private does have an IKsPropertySet */
rc = pcf->lpVtbl->CreateInstance(pcf, NULL, &IID_IKsPropertySet,
rc = IClassFactory_CreateInstance(pcf, NULL, &IID_IKsPropertySet,
(void **)(&pps));
ok(rc==DS_OK, "CreateInstance(IID_IKsPropertySet) failed: %s\n",
DXGetErrorString8(rc));
@ -299,7 +300,7 @@ static void propset_private_tests(void)
goto error;
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION,
&support);
ok(rc==DS_OK||rc==E_INVALIDARG,
@ -320,7 +321,7 @@ static void propset_private_tests(void)
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1 */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_1,
&support);
ok(rc==DS_OK||rc==E_INVALIDARG,
@ -341,7 +342,7 @@ static void propset_private_tests(void)
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_A,
&support);
ok(rc==DS_OK||rc==E_INVALIDARG,
@ -362,7 +363,7 @@ static void propset_private_tests(void)
"support = 0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_DESCRIPTION_W,
&support);
ok(rc==DS_OK||rc==E_INVALIDARG,
@ -383,7 +384,7 @@ static void propset_private_tests(void)
"support = 0x%lx\n",support);
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING, &support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING) failed: %s\n",
@ -399,7 +400,7 @@ static void propset_private_tests(void)
"0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A, &support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_A) failed: %s\n",
@ -415,7 +416,7 @@ static void propset_private_tests(void)
"0x%lx\n",support);
/* test DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W */
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W, &support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
"DSPROPERTY_DIRECTSOUNDDEVICE_WAVEDEVICEMAPPING_W) failed: %s\n",
@ -432,7 +433,7 @@ static void propset_private_tests(void)
/* test generic DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE */
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE ***\n");
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE,
&support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
@ -454,7 +455,7 @@ static void propset_private_tests(void)
data.Callback = callback;
data.Context = 0;
rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE,
NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
@ -462,7 +463,7 @@ static void propset_private_tests(void)
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 */
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1 ***\n");
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1,
&support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
@ -484,7 +485,7 @@ static void propset_private_tests(void)
data.Callback = callback1;
data.Context = 0;
rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_1,
NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
@ -492,7 +493,7 @@ static void propset_private_tests(void)
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A */
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A ***\n");
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A,
&support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
@ -514,7 +515,7 @@ static void propset_private_tests(void)
data.Callback = callbackA;
data.Context = 0;
rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_A,
NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);
@ -522,7 +523,7 @@ static void propset_private_tests(void)
/* test DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W */
trace("*** Testing DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W ***\n");
rc = pps->lpVtbl->QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_QuerySupport(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W,
&support);
ok(rc==DS_OK, "QuerySupport(DSPROPSETID_DirectSoundDevice, "
@ -544,7 +545,7 @@ static void propset_private_tests(void)
data.Callback = callbackW;
data.Context = 0;
rc = pps->lpVtbl->Get(pps, &DSPROPSETID_DirectSoundDevice,
rc = IKsPropertySet_Get(pps, &DSPROPSETID_DirectSoundDevice,
DSPROPERTY_DIRECTSOUNDDEVICE_ENUMERATE_W,
NULL, 0, &data, sizeof(data), &bytes);
ok(rc==DS_OK, "Couldn't enumerate: 0x%lx\n",rc);

View File

@ -24,6 +24,8 @@
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include <windef.h>
#include <winbase.h>
#include <winreg.h>
@ -622,10 +624,10 @@ static void browse_for_folder(HWND dialog)
hr = SHGetDesktopFolder(&pDesktop);
if (!SUCCEEDED(hr)) return;
hr = pDesktop->lpVtbl->ParseDisplayName(pDesktop, NULL, NULL, wszUnixRootDisplayName, NULL,
&pidlUnixRoot, NULL);
hr = IShellFolder_ParseDisplayName(pDesktop, NULL, NULL, wszUnixRootDisplayName, NULL,
&pidlUnixRoot, NULL);
if (!SUCCEEDED(hr)) {
pDesktop->lpVtbl->Release(pDesktop);
IShellFolder_Release(pDesktop);
return;
}
@ -638,9 +640,9 @@ static void browse_for_folder(HWND dialog)
char *pszSelectedPath;
HRESULT hr;
hr = pDesktop->lpVtbl->GetDisplayNameOf(pDesktop, pidlSelectedPath, SHGDN_FORPARSING,
&strSelectedPath);
pDesktop->lpVtbl->Release(pDesktop);
hr = IShellFolder_GetDisplayNameOf(pDesktop, pidlSelectedPath, SHGDN_FORPARSING,
&strSelectedPath);
IShellFolder_Release(pDesktop);
if (!SUCCEEDED(hr)) {
SHFree(pidlSelectedPath);
return;

View File

@ -28,6 +28,8 @@
#include <dirent.h>
#endif
#define COBJMACROS
#include "winefile.h"
#include "resource.h"
@ -303,10 +305,10 @@ static void free_entry(Entry* entry)
DestroyIcon(entry->hicon);
if (entry->folder && entry->folder!=Globals.iDesktop)
(*entry->folder->lpVtbl->Release)(entry->folder);
IShellFolder_Release(entry->folder);
if (entry->pidl)
(*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, entry->pidl);
IMalloc_Free(Globals.iMalloc, entry->pidl);
#endif
free(entry);
@ -661,7 +663,7 @@ static Entry* read_tree_unix(Root* root, LPCTSTR path, SORT_ORDER sortOrder, HWN
static void free_strret(STRRET* str)
{
if (str->uType == STRRET_WSTR)
(*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, str->UNION_MEMBER(pOleStr));
IMalloc_Free(Globals.iMalloc, str->UNION_MEMBER(pOleStr));
}
@ -699,7 +701,7 @@ static HRESULT path_from_pidlA(IShellFolder* folder, LPITEMIDLIST pidl, LPSTR bu
STRRET str;
/* SHGDN_FORPARSING: get full path of id list */
HRESULT hr = (*folder->lpVtbl->GetDisplayNameOf)(folder, pidl, SHGDN_FORPARSING, &str);
HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
if (SUCCEEDED(hr)) {
get_strretA(&str, &pidl->mkid, buffer, len);
@ -744,7 +746,7 @@ static HRESULT name_from_pidl(IShellFolder* folder, LPITEMIDLIST pidl, LPTSTR bu
{
STRRET str;
HRESULT hr = (*folder->lpVtbl->GetDisplayNameOf)(folder, pidl, flags, &str);
HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, flags, &str);
if (SUCCEEDED(hr)) {
get_strret(&str, &pidl->mkid, buffer, len);
@ -761,7 +763,7 @@ static HRESULT path_from_pidlW(IShellFolder* folder, LPITEMIDLIST pidl, LPWSTR b
STRRET str;
/* SHGDN_FORPARSING: get full path of id list */
HRESULT hr = (*folder->lpVtbl->GetDisplayNameOf)(folder, pidl, SHGDN_FORPARSING, &str);
HRESULT hr = IShellFolder_GetDisplayNameOf(folder, pidl, SHGDN_FORPARSING, &str);
if (SUCCEEDED(hr)) {
get_strretW(&str, &pidl->mkid, buffer, len);
@ -788,7 +790,7 @@ static LPITEMIDLIST get_path_pidl(LPTSTR path, HWND hwnd)
MultiByteToWideChar(CP_ACP, 0, path, -1, buffer, MAX_PATH);
#endif
hr = (*Globals.iDesktop->lpVtbl->ParseDisplayName)(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
if (FAILED(hr))
return NULL;
@ -810,7 +812,7 @@ static LPITEMIDLIST get_to_absolute_pidl(Entry* entry, HWND hwnd)
LPITEMIDLIST pidl;
ULONG len;
hr = (*Globals.iDesktop->lpVtbl->ParseDisplayName)(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
hr = IShellFolder_ParseDisplayName(Globals.iDesktop, hwnd, NULL, buffer, &len, &pidl, NULL);
if (SUCCEEDED(hr))
return pidl;
@ -832,13 +834,13 @@ static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl)
{
IExtractIcon* pExtract;
if (SUCCEEDED((*folder->lpVtbl->GetUIObjectOf)(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
if (SUCCEEDED(IShellFolder_GetUIObjectOf(folder, 0, 1, (LPCITEMIDLIST*)&pidl, &IID_IExtractIcon, 0, (LPVOID*)&pExtract))) {
TCHAR path[_MAX_PATH];
unsigned flags;
HICON hicon;
int idx;
if (SUCCEEDED((*pExtract->lpVtbl->GetIconLocation)(pExtract, GIL_FORSHELL, path, _MAX_PATH, &idx, &flags))) {
if (SUCCEEDED(IExtractIconW_GetIconLocation(pExtract, GIL_FORSHELL, path, _MAX_PATH, &idx, &flags))) {
if (!(flags & GIL_NOTFILENAME)) {
if (idx == -1)
idx = 0; /* special case for some control panel applications */
@ -848,7 +850,7 @@ static HICON extract_icon(IShellFolder* folder, LPCITEMIDLIST pidl)
} else {
HICON hIconLarge = 0;
HRESULT hr = (*pExtract->lpVtbl->Extract)(pExtract, path, idx, &hIconLarge, &hicon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)));
HRESULT hr = IExtractIconW_Extract(pExtract, path, idx, &hIconLarge, &hicon, MAKELONG(0/*GetSystemMetrics(SM_CXICON)*/,GetSystemMetrics(SM_CXSMICON)));
if (SUCCEEDED(hr))
DestroyIcon(hIconLarge);
@ -900,11 +902,11 @@ static Entry* read_tree_shell(Root* root, LPITEMIDLIST pidl, SORT_ORDER sortOrde
break;
/* copy first element of item idlist */
next_pidl = (*Globals.iMalloc->lpVtbl->Alloc)(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
next_pidl = IMalloc_Alloc(Globals.iMalloc, pidl->mkid.cb+sizeof(USHORT));
memcpy(next_pidl, pidl, pidl->mkid.cb);
((LPITEMIDLIST)((LPBYTE)next_pidl+pidl->mkid.cb))->mkid.cb = 0;
hr = (*folder->lpVtbl->BindToObject)(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
hr = IShellFolder_BindToObject(folder, next_pidl, 0, &IID_IShellFolder, (void**)&child);
if (!SUCCEEDED(hr))
break;
@ -940,12 +942,12 @@ static void fill_w32fdata_shell(IShellFolder* folder, LPCITEMIDLIST pidl, SFGAOF
STGMEDIUM medium = {0, {0}, 0};
FORMATETC fmt = {Globals.cfStrFName, 0, DVASPECT_CONTENT, -1, TYMED_HGLOBAL};
HRESULT hr = (*folder->lpVtbl->GetUIObjectOf)(folder, 0, 1, &pidl, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
HRESULT hr = IShellFolder_GetUIObjectOf(folder, 0, 1, &pidl, &IID_IDataObject, 0, (LPVOID*)&pDataObj);
if (SUCCEEDED(hr)) {
hr = (*pDataObj->lpVtbl->GetData)(pDataObj, &fmt, &medium);
hr = IDataObject_GetData(pDataObj, &fmt, &medium);
(*pDataObj->lpVtbl->Release)(pDataObj);
IDataObject_Release(pDataObj);
if (SUCCEEDED(hr)) {
LPCTSTR path = (LPCTSTR)GlobalLock(medium.UNION_MEMBER(hGlobal));
@ -998,7 +1000,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd)
if (!folder)
return;
hr = (*folder->lpVtbl->EnumObjects)(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
hr = IShellFolder_EnumObjects(folder, hwnd, SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN|SHCONTF_SHAREABLE|SHCONTF_STORAGE, &idlist);
if (SUCCEEDED(hr)) {
for(;;) {
@ -1010,7 +1012,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd)
memset(pidls, 0, sizeof(pidls));
hr = (*idlist->lpVtbl->Next)(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
hr = IEnumIDList_Next(idlist, FETCH_ITEM_COUNT, pidls, &cnt);
if (!SUCCEEDED(hr))
break;
@ -1031,7 +1033,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd)
attribs = ~SFGAO_FILESYSTEM; /*SFGAO_HASSUBFOLDER|SFGAO_FOLDER; SFGAO_FILESYSTEM sorgt dafür, daß "My Documents" anstatt von "Martin's Documents" angezeigt wird */
hr = (*folder->lpVtbl->GetAttributesOf)(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
hr = IShellFolder_GetAttributesOf(folder, 1, (LPCITEMIDLIST*)&pidls[n], &attribs);
if (SUCCEEDED(hr)) {
if (attribs != (SFGAOF)~SFGAO_FILESYSTEM) {
@ -1046,7 +1048,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd)
entry->pidl = pidls[n];
if (entry->data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
hr = (*folder->lpVtbl->BindToObject)(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
hr = IShellFolder_BindToObject(folder, pidls[n], 0, &IID_IShellFolder, (void**)&child);
if (SUCCEEDED(hr))
entry->folder = child;
@ -1083,7 +1085,7 @@ static void read_directory_shell(Entry* dir, HWND hwnd)
}
}
(*idlist->lpVtbl->Release)(idlist);
IEnumIDList_Release(idlist);
}
if (last)
@ -1488,7 +1490,7 @@ static void get_path(Entry* dir, PTSTR path)
attribs = 0;
if (dir->folder)
hr = (*dir->folder->lpVtbl->GetAttributesOf)(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
hr = IShellFolder_GetAttributesOf(dir->folder, 1, (LPCITEMIDLIST*)&dir->pidl, &attribs);
if (SUCCEEDED(hr) && (attribs&SFGAO_FILESYSTEM)) {
IShellFolder* parent = dir->up? dir->up->folder: Globals.iDesktop;
@ -3870,7 +3872,7 @@ static BOOL launch_entry(Entry* entry, HWND hwnd, UINT nCmdShow)
}
if (shexinfo.lpIDList != entry->pidl)
(*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, shexinfo.lpIDList);
IMalloc_Free(Globals.iMalloc, shexinfo.lpIDList);
return ret;
}
@ -4063,13 +4065,13 @@ static IContextMenu* CtxMenu_query_interfaces(IContextMenu* pcm1)
CtxMenu_reset();
if ((*pcm1->lpVtbl->QueryInterface)(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR)
if (IContextMenu_QueryInterface(pcm1, &IID_IContextMenu3, (void**)&pcm) == NOERROR)
s_pctxmenu3 = (LPCONTEXTMENU3)pcm;
else if ((*pcm1->lpVtbl->QueryInterface)(pcm1, &IID_IContextMenu2, (void**)&pcm) == NOERROR)
else if (IContextMenu_QueryInterface(pcm1, &IID_IContextMenu2, (void**)&pcm) == NOERROR)
s_pctxmenu2 = (LPCONTEXTMENU2)pcm;
if (pcm) {
(*pcm1->lpVtbl->Release)(pcm1);
IContextMenu_Release(pcm1);
return pcm;
} else
return pcm1;
@ -4078,12 +4080,12 @@ static IContextMenu* CtxMenu_query_interfaces(IContextMenu* pcm1)
static BOOL CtxMenu_HandleMenuMsg(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
if (s_pctxmenu3) {
if (SUCCEEDED((*s_pctxmenu3->lpVtbl->HandleMenuMsg)(s_pctxmenu3, nmsg, wparam, lparam)))
if (SUCCEEDED(IContextMenu3_HandleMenuMsg(s_pctxmenu3, nmsg, wparam, lparam)))
return TRUE;
}
if (s_pctxmenu2)
if (SUCCEEDED((*s_pctxmenu2->lpVtbl->HandleMenuMsg)(s_pctxmenu2, nmsg, wparam, lparam)))
if (SUCCEEDED(IContextMenu2_HandleMenuMsg(s_pctxmenu2, nmsg, wparam, lparam)))
return TRUE;
return FALSE;
@ -4095,7 +4097,7 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen
IContextMenu* pcm;
BOOL executed = FALSE;
HRESULT hr = (*shell_folder->lpVtbl->GetUIObjectOf)(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
HRESULT hr = IShellFolder_GetUIObjectOf(shell_folder, hwndParent, cidl, apidl, &IID_IContextMenu, NULL, (LPVOID*)&pcm);
/* HRESULT hr = CDefFolderMenu_Create2(dir?dir->_pidl:DesktopFolder(), hwndParent, 1, &pidl, shell_folder, NULL, 0, NULL, &pcm); */
if (SUCCEEDED(hr)) {
@ -4104,7 +4106,7 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen
pcm = CtxMenu_query_interfaces(pcm);
if (hmenu) {
hr = (*pcm->lpVtbl->QueryContextMenu)(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
hr = IContextMenu_QueryContextMenu(pcm, hmenu, 0, FCIDM_SHVIEWFIRST, FCIDM_SHVIEWLAST, CMF_NORMAL);
if (SUCCEEDED(hr)) {
UINT idCmd = TrackPopupMenu(hmenu, TPM_LEFTALIGN|TPM_RETURNCMD|TPM_RIGHTBUTTON, x, y, 0, hwndParent, NULL);
@ -4124,14 +4126,14 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen
cmi.dwHotKey = 0;
cmi.hIcon = 0;
hr = (*pcm->lpVtbl->InvokeCommand)(pcm, &cmi);
hr = IContextMenu_InvokeCommand(pcm, &cmi);
executed = TRUE;
}
} else
CtxMenu_reset();
}
(*pcm->lpVtbl->Release)(pcm);
IContextMenu_Release(pcm);
}
return FAILED(hr)? hr: executed? S_OK: S_FALSE;
@ -4472,10 +4474,10 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
if (ShellFolderContextMenu(parentFolder, hwnd, 1, &pidlLast, pt.x, pt.y) == S_OK)
refresh_child(child);
(*parentFolder->lpVtbl->Release)(parentFolder);
IShellFolder_Release(parentFolder);
}
(*Globals.iMalloc->lpVtbl->Free)(Globals.iMalloc, pidl_abs);
IMalloc_Free(Globals.iMalloc, pidl_abs);
}
}
break;}
@ -4500,7 +4502,7 @@ static LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM
if (s_pctxmenu3) {
LRESULT lResult = 0;
(*s_pctxmenu3->lpVtbl->HandleMenuMsg2)(s_pctxmenu3, nmsg, wparam, lparam, &lResult);
IContextMenu3_HandleMenuMsg2(s_pctxmenu3, nmsg, wparam, lparam, &lResult);
return lResult;
}
@ -4749,8 +4751,8 @@ static void show_frame(HWND hwndParent, int cmdshow)
static void ExitInstance(void)
{
#ifdef _SHELL_FOLDERS
(*Globals.iDesktop->lpVtbl->Release)(Globals.iDesktop);
(*Globals.iMalloc->lpVtbl->Release)(Globals.iMalloc);
IShellFolder_Release(Globals.iDesktop);
IMalloc_Release(Globals.iMalloc);
CoUninitialize();
#endif