static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnRelease(IShellExecuteHookW* iface) { ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)\n", This); return IUnknown_Release(This->pUnkOuter); }
static ULONG STDMETHODCALLTYPE IShellExecuteHookW_fnAddRef(IShellExecuteHookW* iface) { ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); return IUnknown_AddRef(This->pUnkOuter); }
static HRESULT WINAPI IShellExecuteHookW_fnQueryInterface( IShellExecuteHookW* iface, REFIID riid, void** ppvObject) { ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); TRACE("(%p)->(count=%lu)\n", This, This->ref); return IUnknown_QueryInterface(This->pUnkOuter, riid, ppvObject); }
static HRESULT WINAPI IShellExecuteHookW_fnExecute(IShellExecuteHookW *iface, LPSHELLEXECUTEINFOW psei) { ICPanelImpl *This = impl_from_IShellExecuteHookW(iface); static const WCHAR wCplopen[] = {'c','p','l','o','p','e','n','\0'}; SHELLEXECUTEINFOW sei_tmp; PIDLCPanelStruct* pcpanel; WCHAR path[MAX_PATH]; WCHAR params[MAX_PATH]; BOOL ret; int l; TRACE("(%p)->execute(%p)\n", This, psei); if (!psei) return E_INVALIDARG; pcpanel = _ILGetCPanelPointer(ILFindLastID(psei->lpIDList)); if (!pcpanel) return E_INVALIDARG; path[0] = '\"'; /* Return value from MultiByteToWideChar includes terminating NUL, which * compensates for the starting double quote we just put in */ l = MultiByteToWideChar(CP_ACP, 0, pcpanel->szName, -1, path+1, MAX_PATH-1); /* pass applet name to Control_RunDLL to distinguish between applets in one .cpl file */ path[l++] = '"'; path[l] = '\0'; MultiByteToWideChar(CP_ACP, 0, pcpanel->szName+pcpanel->offsDispName, -1, params, MAX_PATH); sei_tmp = *psei; sei_tmp.lpFile = path; sei_tmp.lpParameters = params; sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; sei_tmp.lpVerb = wCplopen; ret = ShellExecuteExW(&sei_tmp); if (ret) return S_OK; else return S_FALSE; }