mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 22:32:58 +00:00
implemented IShellExecuteHook for control panel
svn path=/trunk/; revision=7492
This commit is contained in:
parent
95d7074a7f
commit
35e2c06791
9 changed files with 341 additions and 159 deletions
|
@ -465,7 +465,25 @@ HRESULT WINAPI Control_FillCache_RunDLLW(HWND hWnd, HANDLE hModule, DWORD w, DWO
|
||||||
void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
|
void WINAPI RunDLL_CallEntry16( DWORD proc, HWND hwnd, HINSTANCE inst,
|
||||||
LPCSTR cmdline, INT cmdshow )
|
LPCSTR cmdline, INT cmdshow )
|
||||||
{
|
{
|
||||||
FIXME("RunDLL_CallEntry16 not implemented\n");
|
#if !defined(__CYGWIN__) && !defined (__MINGW32__) && !defined(_MSC_VER)
|
||||||
|
WORD args[5];
|
||||||
|
SEGPTR cmdline_seg;
|
||||||
|
|
||||||
|
TRACE( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
|
||||||
|
proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
|
||||||
|
|
||||||
|
cmdline_seg = MapLS( cmdline );
|
||||||
|
args[4] = HWND_16(hwnd);
|
||||||
|
args[3] = MapHModuleLS(inst);
|
||||||
|
args[2] = SELECTOROF(cmdline_seg);
|
||||||
|
args[1] = OFFSETOF(cmdline_seg);
|
||||||
|
args[0] = cmdshow;
|
||||||
|
WOWCallback16Ex( proc, WCB16_PASCAL, sizeof(args), args, NULL );
|
||||||
|
UnMapLS( cmdline_seg );
|
||||||
|
#else
|
||||||
|
FIXME( "proc %lx hwnd %p inst %p cmdline %s cmdshow %d\n",
|
||||||
|
proc, hwnd, inst, debugstr_a(cmdline), cmdshow );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
|
|
|
@ -1545,7 +1545,9 @@ HRESULT WINAPI SHBindToParent(LPCITEMIDLIST pidl, REFIID riid, LPVOID *ppv, LPCI
|
||||||
ILFree (pidlChild);
|
ILFree (pidlChild);
|
||||||
|
|
||||||
SHFree (pidlParent);
|
SHFree (pidlParent);
|
||||||
if (psf) IShellFolder_Release(psf);
|
|
||||||
|
if (psf)
|
||||||
|
IShellFolder_Release(psf);
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
|
TRACE_(shell)("-- psf=%p pidl=%p ret=0x%08lx\n", *ppv, (ppidlLast)?*ppidlLast:NULL, hr);
|
||||||
|
|
|
@ -676,4 +676,5 @@ static ICOM_VTABLE (IShellFolder2) vt_MCFldr_ShellFolder2 =
|
||||||
ISF_Desktop_fnGetDefaultColumnState,
|
ISF_Desktop_fnGetDefaultColumnState,
|
||||||
ISF_Desktop_fnGetDetailsEx,
|
ISF_Desktop_fnGetDetailsEx,
|
||||||
ISF_Desktop_fnGetDetailsOf,
|
ISF_Desktop_fnGetDetailsOf,
|
||||||
ISF_Desktop_fnMapColumnToSCID};
|
ISF_Desktop_fnMapColumnToSCID
|
||||||
|
};
|
||||||
|
|
|
@ -58,19 +58,33 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ICOM_VFIELD(IShellFolder2);
|
ICOM_VFIELD(IShellFolder2);
|
||||||
DWORD ref;
|
DWORD ref;
|
||||||
|
|
||||||
ICOM_VTABLE(IPersistFolder2)* lpVtblPersistFolder2;
|
ICOM_VTABLE(IPersistFolder2)* lpVtblPersistFolder2;
|
||||||
|
ICOM_VTABLE(IShellExecuteHookW)* lpVtblShellExecuteHookW;
|
||||||
|
ICOM_VTABLE(IShellExecuteHookA)* lpVtblShellExecuteHookA;
|
||||||
|
|
||||||
|
IUnknown *pUnkOuter; /* used for aggregation */
|
||||||
|
|
||||||
/* both paths are parsible from the desktop */
|
/* both paths are parsible from the desktop */
|
||||||
LPITEMIDLIST pidlRoot; /* absolute pidl */
|
LPITEMIDLIST pidlRoot; /* absolute pidl */
|
||||||
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
|
int dwAttributes; /* attributes returned by GetAttributesOf FIXME: use it */
|
||||||
} IGenericSFImpl;
|
} ICPanelImpl;
|
||||||
|
|
||||||
static struct ICOM_VTABLE(IShellFolder2) vt_ShellFolder2;
|
static ICOM_VTABLE(IShellFolder2) vt_ShellFolder2;
|
||||||
static struct ICOM_VTABLE(IPersistFolder2) vt_PersistFolder2;
|
static ICOM_VTABLE(IPersistFolder2) vt_PersistFolder2;
|
||||||
|
static ICOM_VTABLE(IShellExecuteHookW) vt_ShellExecuteHookW;
|
||||||
|
static ICOM_VTABLE(IShellExecuteHookA) vt_ShellExecuteHookA;
|
||||||
|
|
||||||
#define _IPersistFolder2_Offset ((int)(&(((IGenericSFImpl*)0)->lpVtblPersistFolder2)))
|
#define _IPersistFolder2_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblPersistFolder2)))
|
||||||
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This =(class*)(((char*)name)-_IPersistFolder2_Offset);
|
#define _ICOM_THIS_From_IPersistFolder2(class, name) class* This =(class*)(((char*)name)-_IPersistFolder2_Offset);
|
||||||
|
|
||||||
|
#define IShellExecuteHookW_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookW)))
|
||||||
|
#define _ICOM_THIS_From_IShellExecuteHookW(class, name) class* This =(class*)(((char*)name)-IShellExecuteHookW_Offset);
|
||||||
|
|
||||||
|
#define IShellExecuteHookA_Offset ((int)(&(((ICPanelImpl*)0)->lpVtblShellExecuteHookA)))
|
||||||
|
#define _ICOM_THIS_From_IShellExecuteHookA(class, name) class* This =(class*)(((char*)name)-IShellExecuteHookA_Offset);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
converts This to a interface pointer
|
converts This to a interface pointer
|
||||||
*/
|
*/
|
||||||
|
@ -81,6 +95,8 @@ static struct ICOM_VTABLE(IPersistFolder2) vt_PersistFolder2;
|
||||||
#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2)
|
#define _IPersist_(This) (IPersist*)&(This->lpVtblPersistFolder2)
|
||||||
#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2)
|
#define _IPersistFolder_(This) (IPersistFolder*)&(This->lpVtblPersistFolder2)
|
||||||
#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
|
#define _IPersistFolder2_(This) (IPersistFolder2*)&(This->lpVtblPersistFolder2)
|
||||||
|
#define _IShellExecuteHookW_(This) (IShellExecuteHookW*)&(This->lpVtblShellExecuteHookW)
|
||||||
|
#define _IShellExecuteHookA_(This) (IShellExecuteHookA*)&(This->lpVtblShellExecuteHookA)
|
||||||
|
|
||||||
/***********************************************************************
|
/***********************************************************************
|
||||||
* IShellFolder [ControlPanel] implementation
|
* IShellFolder [ControlPanel] implementation
|
||||||
|
@ -98,23 +114,26 @@ static shvheader ControlPanelSFHeader[] = {
|
||||||
*/
|
*/
|
||||||
HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID * ppv)
|
HRESULT WINAPI IControlPanel_Constructor(IUnknown* pUnkOuter, REFIID riid, LPVOID * ppv)
|
||||||
{
|
{
|
||||||
IGenericSFImpl *sf;
|
ICPanelImpl *sf;
|
||||||
|
|
||||||
TRACE("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid(riid));
|
TRACE("unkOut=%p %s\n", pUnkOuter, shdebugstr_guid(riid));
|
||||||
|
|
||||||
if (!ppv)
|
if (!ppv)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
if (pUnkOuter)
|
if (pUnkOuter && !IsEqualIID (riid, &IID_IUnknown))
|
||||||
return CLASS_E_NOAGGREGATION;
|
return CLASS_E_NOAGGREGATION;
|
||||||
|
|
||||||
sf = (IGenericSFImpl *) LocalAlloc(GMEM_ZEROINIT, sizeof(IGenericSFImpl));
|
sf = (ICPanelImpl *) LocalAlloc(GMEM_ZEROINIT, sizeof(ICPanelImpl));
|
||||||
if (!sf)
|
if (!sf)
|
||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
|
|
||||||
sf->ref = 0;
|
sf->ref = 0;
|
||||||
sf->lpVtbl = &vt_ShellFolder2;
|
sf->lpVtbl = &vt_ShellFolder2;
|
||||||
sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
|
sf->lpVtblPersistFolder2 = &vt_PersistFolder2;
|
||||||
|
sf->lpVtblShellExecuteHookW = &vt_ShellExecuteHookW;
|
||||||
|
sf->lpVtblShellExecuteHookA = &vt_ShellExecuteHookA;
|
||||||
sf->pidlRoot = _ILCreateControl(); /* my qualified pidl */
|
sf->pidlRoot = _ILCreateControl(); /* my qualified pidl */
|
||||||
|
sf->pUnkOuter = pUnkOuter ? pUnkOuter : _IUnknown_ (sf);
|
||||||
|
|
||||||
if (!SUCCEEDED(IUnknown_QueryInterface(_IUnknown_(sf), riid, ppv))) {
|
if (!SUCCEEDED(IUnknown_QueryInterface(_IUnknown_(sf), riid, ppv))) {
|
||||||
IUnknown_Release(_IUnknown_(sf));
|
IUnknown_Release(_IUnknown_(sf));
|
||||||
|
@ -130,25 +149,28 @@ HRESULT WINAPI IControlPanel_Constructor(IUnknown * pUnkOuter, REFIID riid, LPVO
|
||||||
*
|
*
|
||||||
* NOTES supports not IPersist/IPersistFolder
|
* NOTES supports not IPersist/IPersistFolder
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnQueryInterface(IShellFolder2 * iface, REFIID riid, LPVOID * ppvObj)
|
static HRESULT WINAPI ISF_ControlPanel_fnQueryInterface(IShellFolder2 * iface, REFIID riid, LPVOID * ppvObject)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%s,%p)\n", This, shdebugstr_guid(riid), ppvObj);
|
TRACE("(%p)->(%s,%p)\n", This, shdebugstr_guid(riid), ppvObject);
|
||||||
|
|
||||||
*ppvObj = NULL;
|
*ppvObject = NULL;
|
||||||
|
|
||||||
if (IsEqualIID(riid, &IID_IUnknown) ||
|
if (IsEqualIID(riid, &IID_IUnknown) ||
|
||||||
IsEqualIID(riid, &IID_IShellFolder) || IsEqualIID(riid, &IID_IShellFolder2)) {
|
IsEqualIID(riid, &IID_IShellFolder) || IsEqualIID(riid, &IID_IShellFolder2))
|
||||||
*ppvObj = This;
|
*ppvObject = This;
|
||||||
} else if (IsEqualIID(riid, &IID_IPersist) ||
|
else if (IsEqualIID(riid, &IID_IPersist) ||
|
||||||
IsEqualIID(riid, &IID_IPersistFolder) || IsEqualIID(riid, &IID_IPersistFolder2)) {
|
IsEqualIID(riid, &IID_IPersistFolder) || IsEqualIID(riid, &IID_IPersistFolder2))
|
||||||
*ppvObj = _IPersistFolder2_(This);
|
*ppvObject = _IPersistFolder2_(This);
|
||||||
}
|
else if (IsEqualIID(riid, &IID_IShellExecuteHookW))
|
||||||
|
*ppvObject = _IShellExecuteHookW_(This);
|
||||||
|
else if (IsEqualIID(riid, &IID_IShellExecuteHookA))
|
||||||
|
*ppvObject = _IShellExecuteHookA_(This);
|
||||||
|
|
||||||
if (*ppvObj) {
|
if (*ppvObject) {
|
||||||
IUnknown_AddRef((IUnknown *)(*ppvObj));
|
IUnknown_AddRef((IUnknown *)(*ppvObject));
|
||||||
TRACE("-- Interface:(%p)->(%p)\n", ppvObj, *ppvObj);
|
TRACE("-- Interface:(%p)->(%p)\n", ppvObject, *ppvObject);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
TRACE("-- Interface: E_NOINTERFACE\n");
|
TRACE("-- Interface: E_NOINTERFACE\n");
|
||||||
|
@ -157,7 +179,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnQueryInterface(IShellFolder2 * iface, R
|
||||||
|
|
||||||
static ULONG WINAPI ISF_ControlPanel_fnAddRef(IShellFolder2 * iface)
|
static ULONG WINAPI ISF_ControlPanel_fnAddRef(IShellFolder2 * iface)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
@ -166,7 +188,7 @@ static ULONG WINAPI ISF_ControlPanel_fnAddRef(IShellFolder2 * iface)
|
||||||
|
|
||||||
static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface)
|
static ULONG WINAPI ISF_ControlPanel_fnRelease(IShellFolder2 * iface)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
@ -190,47 +212,17 @@ ISF_ControlPanel_fnParseDisplayName(IShellFolder2 * iface,
|
||||||
LPOLESTR lpszDisplayName,
|
LPOLESTR lpszDisplayName,
|
||||||
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
DWORD * pchEaten, LPITEMIDLIST * ppidl, DWORD * pdwAttributes)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
HRESULT hr = E_OUTOFMEMORY;
|
HRESULT hr = E_INVALIDARG;
|
||||||
LPCWSTR szNext = NULL;
|
|
||||||
WCHAR szElement[MAX_PATH];
|
|
||||||
CHAR szTempA[MAX_PATH];
|
|
||||||
LPITEMIDLIST pidlTemp = NULL;
|
|
||||||
CLSID clsid;
|
|
||||||
|
|
||||||
TRACE("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
|
FIXME("(%p)->(HWND=%p,%p,%p=%s,%p,pidl=%p,%p)\n",
|
||||||
This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), pchEaten, ppidl, pdwAttributes);
|
This, hwndOwner, pbc, lpszDisplayName, debugstr_w(lpszDisplayName), pchEaten, ppidl, pdwAttributes);
|
||||||
|
|
||||||
*ppidl = 0;
|
*ppidl = 0;
|
||||||
if (pchEaten)
|
if (pchEaten)
|
||||||
*pchEaten = 0;
|
*pchEaten = 0;
|
||||||
|
|
||||||
/* handle CLSID paths */
|
|
||||||
if (lpszDisplayName[0] == ':' && lpszDisplayName[1] == ':') {
|
|
||||||
szNext = GetNextElementW(lpszDisplayName, szElement, MAX_PATH);
|
|
||||||
TRACE("-- element: %s\n", debugstr_w(szElement));
|
|
||||||
SHCLSIDFromStringW(szElement + 2, &clsid);
|
|
||||||
pidlTemp = _ILCreate(PT_MYCOMP, &clsid, sizeof(clsid));
|
|
||||||
}
|
|
||||||
/* do we have an absolute path name ? */
|
|
||||||
else if (PathGetDriveNumberW(lpszDisplayName)>=0 && lpszDisplayName[2]==(WCHAR) '\\') {
|
|
||||||
szNext = GetNextElementW(lpszDisplayName, szElement, MAX_PATH);
|
|
||||||
WideCharToMultiByte(CP_ACP, 0, szElement, -1, szTempA, MAX_PATH, NULL, NULL);
|
|
||||||
pidlTemp = _ILCreateDrive(szTempA);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (szNext && *szNext) {
|
|
||||||
hr = SHELL32_ParseNextElement(iface, hwndOwner, pbc, &pidlTemp,(LPOLESTR) szNext, pchEaten, pdwAttributes);
|
|
||||||
} else {
|
|
||||||
if (pdwAttributes && *pdwAttributes) {
|
|
||||||
SHELL32_GetItemAttributes(_IShellFolder_(This), pidlTemp, pdwAttributes);
|
|
||||||
}
|
|
||||||
hr = S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
*ppidl = pidlTemp;
|
|
||||||
|
|
||||||
TRACE("(%p)->(-- ret=0x%08lx)\n", This, hr);
|
TRACE("(%p)->(-- ret=0x%08lx)\n", This, hr);
|
||||||
|
|
||||||
return hr;
|
return hr;
|
||||||
|
@ -242,7 +234,7 @@ ISF_ControlPanel_fnParseDisplayName(IShellFolder2 * iface,
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnEnumObjects(IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
ISF_ControlPanel_fnEnumObjects(IShellFolder2 * iface, HWND hwndOwner, DWORD dwFlags, LPENUMIDLIST * ppEnumIDList)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
|
TRACE("(%p)->(HWND=%p flags=0x%08lx pplist=%p)\n", This, hwndOwner, dwFlags, ppEnumIDList);
|
||||||
|
|
||||||
|
@ -260,7 +252,7 @@ static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnBindToObject(IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
ISF_ControlPanel_fnBindToObject(IShellFolder2 * iface, LPCITEMIDLIST pidl,
|
||||||
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut);
|
TRACE("(%p)->(pidl=%p,%p,%s,%p)\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut);
|
||||||
|
|
||||||
|
@ -274,7 +266,7 @@ static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnBindToStorage(IShellFolder2 * iface,
|
ISF_ControlPanel_fnBindToStorage(IShellFolder2 * iface,
|
||||||
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
LPCITEMIDLIST pidl, LPBC pbcReserved, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut);
|
FIXME("(%p)->(pidl=%p,%p,%s,%p) stub\n", This, pidl, pbcReserved, shdebugstr_guid(riid), ppvOut);
|
||||||
|
|
||||||
|
@ -289,7 +281,7 @@ ISF_ControlPanel_fnBindToStorage(IShellFolder2 * iface,
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnCompareIDs(IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
ISF_ControlPanel_fnCompareIDs(IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
int nReturn;
|
int nReturn;
|
||||||
|
|
||||||
|
@ -305,7 +297,7 @@ ISF_ControlPanel_fnCompareIDs(IShellFolder2 * iface, LPARAM lParam, LPCITEMIDLIS
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnCreateViewObject(IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
ISF_ControlPanel_fnCreateViewObject(IShellFolder2 * iface, HWND hwndOwner, REFIID riid, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
LPSHELLVIEW pShellView;
|
LPSHELLVIEW pShellView;
|
||||||
HRESULT hr = E_INVALIDARG;
|
HRESULT hr = E_INVALIDARG;
|
||||||
|
@ -339,7 +331,7 @@ ISF_ControlPanel_fnCreateViewObject(IShellFolder2 * iface, HWND hwndOwner, REFII
|
||||||
static HRESULT WINAPI
|
static HRESULT WINAPI
|
||||||
ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
ISF_ControlPanel_fnGetAttributesOf(IShellFolder2 * iface, UINT cidl, LPCITEMIDLIST * apidl, DWORD * rgfInOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
HRESULT hr = S_OK;
|
HRESULT hr = S_OK;
|
||||||
|
|
||||||
|
@ -376,7 +368,7 @@ ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface,
|
||||||
HWND hwndOwner,
|
HWND hwndOwner,
|
||||||
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
|
UINT cidl, LPCITEMIDLIST * apidl, REFIID riid, UINT * prgfInOut, LPVOID * ppvOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
LPITEMIDLIST pidl;
|
LPITEMIDLIST pidl;
|
||||||
IUnknown *pObj = NULL;
|
IUnknown *pObj = NULL;
|
||||||
|
@ -404,8 +396,6 @@ ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface,
|
||||||
pObj =(LPUNKNOWN) IExtractIconW_Constructor(pidl);
|
pObj =(LPUNKNOWN) IExtractIconW_Constructor(pidl);
|
||||||
SHFree(pidl);
|
SHFree(pidl);
|
||||||
hr = S_OK;
|
hr = S_OK;
|
||||||
} else if (IsEqualIID(riid, &IID_IDropTarget) &&(cidl >= 1)) {
|
|
||||||
hr = IShellFolder_QueryInterface(iface, &IID_IDropTarget,(LPVOID *) & pObj);
|
|
||||||
} else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
|
} else if ((IsEqualIID(riid,&IID_IShellLinkW) || IsEqualIID(riid,&IID_IShellLinkA))
|
||||||
&&(cidl >= 1)) {
|
&&(cidl >= 1)) {
|
||||||
pidl = ILCombine(This->pidlRoot, apidl[0]);
|
pidl = ILCombine(This->pidlRoot, apidl[0]);
|
||||||
|
@ -429,7 +419,7 @@ ISF_ControlPanel_fnGetUIObjectOf(IShellFolder2 * iface,
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, DWORD dwFlags, LPSTRRET strRet)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
CHAR szPath[MAX_PATH*2];
|
CHAR szPath[MAX_PATH*2];
|
||||||
PIDLCPanelStruct* pcpanel;
|
PIDLCPanelStruct* pcpanel;
|
||||||
|
@ -445,14 +435,6 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface,
|
||||||
pcpanel = _ILGetCPanelPointer(pidl);
|
pcpanel = _ILGetCPanelPointer(pidl);
|
||||||
|
|
||||||
if (pcpanel) {
|
if (pcpanel) {
|
||||||
if (dwFlags & SHGDN_FORPARSING) {
|
|
||||||
lstrcpyA(szPath, "\"");
|
|
||||||
lstrcpyA(szPath+1, pcpanel->szName);
|
|
||||||
|
|
||||||
/* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
|
|
||||||
lstrcatA(szPath, "\" ");
|
|
||||||
lstrcatA(szPath, pcpanel->szName+pcpanel->offsDispName);
|
|
||||||
} else
|
|
||||||
lstrcpyA(szPath, pcpanel->szName+pcpanel->offsDispName);
|
lstrcpyA(szPath, pcpanel->szName+pcpanel->offsDispName);
|
||||||
|
|
||||||
if (!(dwFlags & SHGDN_FORPARSING))
|
if (!(dwFlags & SHGDN_FORPARSING))
|
||||||
|
@ -502,26 +484,26 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDisplayNameOf(IShellFolder2 * iface,
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnSetNameOf(IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
static HRESULT WINAPI ISF_ControlPanel_fnSetNameOf(IShellFolder2 * iface, HWND hwndOwner, LPCITEMIDLIST pidl, /*simple pidl */
|
||||||
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
LPCOLESTR lpName, DWORD dwFlags, LPITEMIDLIST * pPidlOut)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
FIXME("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut);
|
FIXME("(%p)->(%p,pidl=%p,%s,%lu,%p)\n", This, hwndOwner, pidl, debugstr_w(lpName), dwFlags, pPidlOut);
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 * iface, GUID * pguid)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 * iface, GUID * pguid)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnEnumSearches(IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
|
static HRESULT WINAPI ISF_ControlPanel_fnEnumSearches(IShellFolder2 * iface, IEnumExtraSearch ** ppenum)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2 * iface, DWORD dwRes, ULONG * pSort, ULONG * pDisplay)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
@ -531,7 +513,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumn(IShellFolder2 * iface,
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2 * iface, UINT iColumn, DWORD * pcsFlags)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
@ -541,14 +523,14 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultColumnState(IShellFolder2 * i
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsEx(IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsEx(IShellFolder2 * iface, LPCITEMIDLIST pidl, const SHCOLUMNID * pscid, VARIANT * pv)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 * iface, LPCITEMIDLIST pidl, UINT iColumn, SHELLDETAILS * psd)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
|
TRACE("(%p)->(%p %i %p)\n", This, pidl, iColumn, psd);
|
||||||
|
@ -580,7 +562,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnGetDetailsOf(IShellFolder2 * iface, LPC
|
||||||
}
|
}
|
||||||
static HRESULT WINAPI ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
|
static HRESULT WINAPI ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2 * iface, UINT column, SHCOLUMNID * pscid)
|
||||||
{
|
{
|
||||||
ICOM_THIS(IGenericSFImpl, iface);
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
FIXME("(%p)\n", This);
|
FIXME("(%p)\n", This);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
@ -588,6 +570,7 @@ static HRESULT WINAPI ISF_ControlPanel_fnMapColumnToSCID(IShellFolder2 * iface,
|
||||||
static ICOM_VTABLE(IShellFolder2) vt_ShellFolder2 =
|
static ICOM_VTABLE(IShellFolder2) vt_ShellFolder2 =
|
||||||
{
|
{
|
||||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
|
||||||
ISF_ControlPanel_fnQueryInterface,
|
ISF_ControlPanel_fnQueryInterface,
|
||||||
ISF_ControlPanel_fnAddRef,
|
ISF_ControlPanel_fnAddRef,
|
||||||
ISF_ControlPanel_fnRelease,
|
ISF_ControlPanel_fnRelease,
|
||||||
|
@ -601,6 +584,7 @@ static ICOM_VTABLE(IShellFolder2) vt_ShellFolder2 =
|
||||||
ISF_ControlPanel_fnGetUIObjectOf,
|
ISF_ControlPanel_fnGetUIObjectOf,
|
||||||
ISF_ControlPanel_fnGetDisplayNameOf,
|
ISF_ControlPanel_fnGetDisplayNameOf,
|
||||||
ISF_ControlPanel_fnSetNameOf,
|
ISF_ControlPanel_fnSetNameOf,
|
||||||
|
|
||||||
/* ShellFolder2 */
|
/* ShellFolder2 */
|
||||||
ISF_ControlPanel_fnGetDefaultSearchGUID,
|
ISF_ControlPanel_fnGetDefaultSearchGUID,
|
||||||
ISF_ControlPanel_fnEnumSearches,
|
ISF_ControlPanel_fnEnumSearches,
|
||||||
|
@ -612,23 +596,23 @@ static ICOM_VTABLE(IShellFolder2) vt_ShellFolder2 =
|
||||||
};
|
};
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* IMCFldr_PersistFolder2_QueryInterface
|
* ICPanel_PersistFolder2_QueryInterface
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI IMCFldr_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObj)
|
static HRESULT WINAPI ICPanel_PersistFolder2_QueryInterface(IPersistFolder2 * iface, REFIID iid, LPVOID * ppvObject)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObj);
|
return IUnknown_QueryInterface(_IUnknown_(This), iid, ppvObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* IMCFldr_PersistFolder2_AddRef
|
* ICPanel_PersistFolder2_AddRef
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IMCFldr_PersistFolder2_AddRef(IPersistFolder2 * iface)
|
static ULONG WINAPI ICPanel_PersistFolder2_AddRef(IPersistFolder2 * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
@ -638,9 +622,9 @@ static ULONG WINAPI IMCFldr_PersistFolder2_AddRef(IPersistFolder2 * iface)
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* ISFPersistFolder_Release
|
* ISFPersistFolder_Release
|
||||||
*/
|
*/
|
||||||
static ULONG WINAPI IMCFldr_PersistFolder2_Release(IPersistFolder2 * iface)
|
static ULONG WINAPI ICPanel_PersistFolder2_Release(IPersistFolder2 * iface)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
@ -648,11 +632,11 @@ static ULONG WINAPI IMCFldr_PersistFolder2_Release(IPersistFolder2 * iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* IMCFldr_PersistFolder2_GetClassID
|
* ICPanel_PersistFolder2_GetClassID
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId)
|
static HRESULT WINAPI ICPanel_PersistFolder2_GetClassID(IPersistFolder2 * iface, CLSID * lpClassId)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)\n", This);
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
@ -664,13 +648,13 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_GetClassID(IPersistFolder2 * iface,
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* IMCFldr_PersistFolder2_Initialize
|
* ICPanel_PersistFolder2_Initialize
|
||||||
*
|
*
|
||||||
* NOTES: it makes no sense to change the pidl
|
* NOTES: it makes no sense to change the pidl
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl)
|
static HRESULT WINAPI ICPanel_PersistFolder2_Initialize(IPersistFolder2 * iface, LPCITEMIDLIST pidl)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
TRACE("(%p)->(%p)\n", This, pidl);
|
TRACE("(%p)->(%p)\n", This, pidl);
|
||||||
return E_NOTIMPL;
|
return E_NOTIMPL;
|
||||||
}
|
}
|
||||||
|
@ -678,9 +662,9 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_Initialize(IPersistFolder2 * iface,
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* IPersistFolder2_fnGetCurFolder
|
* IPersistFolder2_fnGetCurFolder
|
||||||
*/
|
*/
|
||||||
static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl)
|
static HRESULT WINAPI ICPanel_PersistFolder2_GetCurFolder(IPersistFolder2 * iface, LPITEMIDLIST * pidl)
|
||||||
{
|
{
|
||||||
_ICOM_THIS_From_IPersistFolder2(IGenericSFImpl, iface);
|
_ICOM_THIS_From_IPersistFolder2(ICPanelImpl, iface);
|
||||||
|
|
||||||
TRACE("(%p)->(%p)\n", This, pidl);
|
TRACE("(%p)->(%p)\n", This, pidl);
|
||||||
|
|
||||||
|
@ -693,12 +677,13 @@ static HRESULT WINAPI IMCFldr_PersistFolder2_GetCurFolder(IPersistFolder2 * ifac
|
||||||
static ICOM_VTABLE(IPersistFolder2) vt_PersistFolder2 =
|
static ICOM_VTABLE(IPersistFolder2) vt_PersistFolder2 =
|
||||||
{
|
{
|
||||||
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
IMCFldr_PersistFolder2_QueryInterface,
|
|
||||||
IMCFldr_PersistFolder2_AddRef,
|
ICPanel_PersistFolder2_QueryInterface,
|
||||||
IMCFldr_PersistFolder2_Release,
|
ICPanel_PersistFolder2_AddRef,
|
||||||
IMCFldr_PersistFolder2_GetClassID,
|
ICPanel_PersistFolder2_Release,
|
||||||
IMCFldr_PersistFolder2_Initialize,
|
ICPanel_PersistFolder2_GetClassID,
|
||||||
IMCFldr_PersistFolder2_GetCurFolder
|
ICPanel_PersistFolder2_Initialize,
|
||||||
|
ICPanel_PersistFolder2_GetCurFolder
|
||||||
};
|
};
|
||||||
|
|
||||||
HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex)
|
HRESULT WINAPI CPanel_GetIconLocationA(LPITEMIDLIST pidl, LPSTR szIconFile, UINT cchMax, int* piIndex)
|
||||||
|
@ -726,3 +711,166 @@ HRESULT WINAPI CPanel_GetIconLocationW(LPITEMIDLIST pidl, LPWSTR szIconFile, UIN
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* IShellExecuteHookW Implementation
|
||||||
|
*/
|
||||||
|
|
||||||
|
static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface(IShellExecuteHookW* iface, REFIID riid, void** ppvObject)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
return IUnknown_AddRef(This->pUnkOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookW(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
return IUnknown_Release(This->pUnkOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW* iface, LPSHELLEXECUTEINFOW psei)
|
||||||
|
{
|
||||||
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
SHELLEXECUTEINFOW sei_tmp;
|
||||||
|
PIDLCPanelStruct* pcpanel;
|
||||||
|
WCHAR path[MAX_PATH];
|
||||||
|
BOOL ret;
|
||||||
|
int l;
|
||||||
|
|
||||||
|
TRACE("(%p)->execute(%x)\n", This, psei);
|
||||||
|
|
||||||
|
if (!psei)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList));
|
||||||
|
|
||||||
|
if (!pcpanel)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
path[0] = '\"';
|
||||||
|
l = 1 + MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, path+1, MAX_PATH);
|
||||||
|
|
||||||
|
/* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
|
||||||
|
lstrcpyW(path+1, L"\" ");
|
||||||
|
l += 2;
|
||||||
|
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, path+l, MAX_PATH);
|
||||||
|
|
||||||
|
memcpy(&sei_tmp, psei, sizeof(sei_tmp));
|
||||||
|
sei_tmp.lpFile = path;
|
||||||
|
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
|
||||||
|
|
||||||
|
ret = ShellExecuteExW(&sei_tmp);
|
||||||
|
if (ret)
|
||||||
|
return S_OK;
|
||||||
|
else
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ICOM_VTABLE(IShellExecuteHookW) vt_ShellExecuteHookW =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
|
||||||
|
IShellExecuteHookW_fnQueryInterface,
|
||||||
|
IShellExecuteHookW_fnAddRef,
|
||||||
|
IShellExecuteHookW_fnRelease,
|
||||||
|
|
||||||
|
IShellExecuteHookW_fnExecute
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
* IShellExecuteHookA Implementation
|
||||||
|
*/
|
||||||
|
|
||||||
|
static HRESULT WINAPI IShellExecuteHookA_fnQueryInterface(IShellExecuteHookA* iface, REFIID riid, void** ppvObject)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnAddRef(IShellExecuteHookA* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)->(count=%lu)\n", This, This->ref);
|
||||||
|
|
||||||
|
return IUnknown_AddRef(This->pUnkOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ULONG STDMETHODCALLTYPE IShellExecuteHookA_fnRelease(IShellExecuteHookA* iface)
|
||||||
|
{
|
||||||
|
_ICOM_THIS_From_IShellExecuteHookA(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
TRACE("(%p)\n", This);
|
||||||
|
|
||||||
|
return IUnknown_Release(This->pUnkOuter);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI IShellExecuteHookA_fnExecute(IShellExecuteHookA* iface, LPSHELLEXECUTEINFOA psei)
|
||||||
|
{
|
||||||
|
ICOM_THIS(ICPanelImpl, iface);
|
||||||
|
|
||||||
|
SHELLEXECUTEINFOA sei_tmp;
|
||||||
|
PIDLCPanelStruct* pcpanel;
|
||||||
|
char path[MAX_PATH];
|
||||||
|
BOOL ret;
|
||||||
|
|
||||||
|
TRACE("(%p)->execute(%x)\n", This, psei);
|
||||||
|
|
||||||
|
if (!psei)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList));
|
||||||
|
|
||||||
|
if (!pcpanel)
|
||||||
|
return E_INVALIDARG;
|
||||||
|
|
||||||
|
path[0] = '\"';
|
||||||
|
lstrcpyA(path+1, pcpanel->szName);
|
||||||
|
|
||||||
|
/* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */
|
||||||
|
lstrcatA(path, "\" ");
|
||||||
|
lstrcatA(path, pcpanel->szName+pcpanel->offsDispName);
|
||||||
|
|
||||||
|
memcpy(&sei_tmp, psei, sizeof(sei_tmp));
|
||||||
|
sei_tmp.lpFile = path;
|
||||||
|
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST;
|
||||||
|
|
||||||
|
ret = ShellExecuteExA(&sei_tmp);
|
||||||
|
if (ret)
|
||||||
|
return S_OK;
|
||||||
|
else
|
||||||
|
return S_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ICOM_VTABLE(IShellExecuteHookA) vt_ShellExecuteHookA =
|
||||||
|
{
|
||||||
|
ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
|
||||||
|
|
||||||
|
IShellExecuteHookA_fnQueryInterface,
|
||||||
|
IShellExecuteHookA_fnAddRef,
|
||||||
|
IShellExecuteHookA_fnRelease,
|
||||||
|
|
||||||
|
IShellExecuteHookA_fnExecute
|
||||||
|
};
|
||||||
|
|
|
@ -851,6 +851,19 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
|
||||||
/* process the IDList */
|
/* process the IDList */
|
||||||
if (sei->fMask & SEE_MASK_INVOKEIDLIST) /* 0x0c: includes SEE_MASK_IDLIST */
|
if (sei->fMask & SEE_MASK_INVOKEIDLIST) /* 0x0c: includes SEE_MASK_IDLIST */
|
||||||
{
|
{
|
||||||
|
IShellExecuteHookA* pSEH;
|
||||||
|
|
||||||
|
HRESULT hr = SHBindToParent(pidl, &IID_IShellExecuteHookA, (LPVOID*)&pSEH, NULL);
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
hr = IShellExecuteHookA_Execute(pSEH, sei);
|
||||||
|
|
||||||
|
IShellExecuteHookA_Release(pSEH);
|
||||||
|
|
||||||
|
if (hr == S_OK)
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
if (!SHGetPathFromIDListA(pidl, szApplicationName))
|
if (!SHGetPathFromIDListA(pidl, szApplicationName))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -970,7 +983,8 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/*FIXME This search loop should be moved into CreateProcess() ? */
|
/* We have to use this search loop here, that in CreateProcess()
|
||||||
|
is not sufficent because it does not handle shell links. */
|
||||||
LPSTR space, s;
|
LPSTR space, s;
|
||||||
char buffer[MAX_PATH], xlpFile[MAX_PATH];
|
char buffer[MAX_PATH], xlpFile[MAX_PATH];
|
||||||
|
|
||||||
|
|
|
@ -388,9 +388,9 @@ HRESULT SHELL32_GetItemAttributes (IShellFolder * psf, LPCITEMIDLIST pidl, LPDWO
|
||||||
*pdwAttributes &= ~SFGAO_READONLY;
|
*pdwAttributes &= ~SFGAO_READONLY;
|
||||||
|
|
||||||
if (SFGAO_LINK & *pdwAttributes) {
|
if (SFGAO_LINK & *pdwAttributes) {
|
||||||
char ext[_MAX_EXT];
|
char ext[MAX_PATH];
|
||||||
|
|
||||||
if (!_ILGetExtension(pidl, ext, _MAX_EXT) || stricmp(ext, "lnk"))
|
if (!_ILGetExtension(pidl, ext, MAX_PATH) || stricmp(ext, "lnk"))
|
||||||
*pdwAttributes &= ~SFGAO_READONLY;
|
*pdwAttributes &= ~SFGAO_READONLY;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "wingdi.h"
|
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "shlobj.h"
|
#include "shlobj.h"
|
||||||
|
|
|
@ -295,7 +295,7 @@ static void DoOpenExplore(
|
||||||
sei.cbSize = sizeof(sei);
|
sei.cbSize = sizeof(sei);
|
||||||
sei.fMask = SEE_MASK_IDLIST | SEE_MASK_CLASSNAME;
|
sei.fMask = SEE_MASK_IDLIST | SEE_MASK_CLASSNAME;
|
||||||
sei.lpIDList = pidlFQ;
|
sei.lpIDList = pidlFQ;
|
||||||
sei.lpClass = "folder";
|
sei.lpClass = "Folder";
|
||||||
sei.hwnd = hwnd;
|
sei.hwnd = hwnd;
|
||||||
sei.nShow = SW_SHOWNORMAL;
|
sei.nShow = SW_SHOWNORMAL;
|
||||||
sei.lpVerb = verb;
|
sei.lpVerb = verb;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue