ReactOS 0.4.16-dev-329-g9223134
CShellDispatch Class Reference

#include <CShellDispatch.h>

Inheritance diagram for CShellDispatch:
Collaboration diagram for CShellDispatch:

Public Member Functions

 CShellDispatch ()
 
 ~CShellDispatch ()
 
HRESULT Initialize ()
 
STDMETHOD() get_Application (IDispatch **ppid) override
 
STDMETHOD() get_Parent (IDispatch **ppid) override
 
STDMETHOD() NameSpace (VARIANT vDir, Folder **ppsdf) override
 
STDMETHOD() BrowseForFolder (LONG Hwnd, BSTR Title, LONG Options, VARIANT RootFolder, Folder **ppsdf) override
 
STDMETHOD() Windows (IDispatch **ppid) override
 
STDMETHOD() Open (VARIANT vDir) override
 
STDMETHOD() Explore (VARIANT vDir) override
 
STDMETHOD() MinimizeAll () override
 
STDMETHOD() UndoMinimizeALL () override
 
STDMETHOD() FileRun () override
 
STDMETHOD() CascadeWindows () override
 
STDMETHOD() TileVertically () override
 
STDMETHOD() TileHorizontally () override
 
STDMETHOD() ShutdownWindows () override
 
STDMETHOD() Suspend () override
 
STDMETHOD() EjectPC () override
 
STDMETHOD() SetTime () override
 
STDMETHOD() TrayProperties () override
 
STDMETHOD() Help () override
 
STDMETHOD() FindFiles () override
 
STDMETHOD() FindComputer () override
 
STDMETHOD() RefreshMenu () override
 
STDMETHOD() ControlPanelItem (BSTR szDir) override
 
STDMETHOD() IsRestricted (BSTR group, BSTR restriction, LONG *value) override
 
STDMETHOD() ShellExecute (BSTR file, VARIANT args, VARIANT dir, VARIANT op, VARIANT show) override
 
STDMETHOD() FindPrinter (BSTR name, BSTR location, BSTR model) override
 
STDMETHOD() GetSystemInformation (BSTR name, VARIANT *ret) override
 
STDMETHOD() ServiceStart (BSTR service, VARIANT persistent, VARIANT *ret) override
 
STDMETHOD() ServiceStop (BSTR service, VARIANT persistent, VARIANT *ret) override
 
STDMETHOD() IsServiceRunning (BSTR service, VARIANT *running) override
 
STDMETHOD() CanStartStopService (BSTR service, VARIANT *ret) override
 
STDMETHOD() ShowBrowserBar (BSTR clsid, VARIANT show, VARIANT *ret) override
 
STDMETHOD() AddToRecent (VARIANT file, BSTR category) override
 
STDMETHOD() WindowsSecurity () override
 
STDMETHOD() ToggleDesktop () override
 
STDMETHOD() ExplorerPolicy (BSTR policy, VARIANT *value) override
 
STDMETHOD() GetSetting (LONG setting, VARIANT_BOOL *result) override
 
STDMETHOD() GetInterfaceSafetyOptions (REFIID riid, DWORD *pdwSupportedOptions, DWORD *pdwEnabledOptions) override
 
STDMETHOD() SetInterfaceSafetyOptions (REFIID riid, DWORD dwOptionSetMask, DWORD dwEnabledOptions) override
 
STDMETHOD() SetSite (IUnknown *pUnkSite) override
 
STDMETHOD() GetSite (REFIID riid, PVOID *ppvSite) override
 
- Public Member Functions inherited from ATL::CComObjectRootEx< CComMultiThreadModelNoCS >
 ~CComObjectRootEx ()
 
ULONG InternalAddRef ()
 
ULONG InternalRelease ()
 
void Lock ()
 
void Unlock ()
 
HRESULT _AtlInitialConstruct ()
 
- Public Member Functions inherited from ATL::CComObjectRootBase
 CComObjectRootBase ()
 
 ~CComObjectRootBase ()
 
void SetVoid (void *)
 
HRESULT _AtlFinalConstruct ()
 
HRESULT FinalConstruct ()
 
void InternalFinalConstructAddRef ()
 
void InternalFinalConstructRelease ()
 
void FinalRelease ()
 
HRESULT GetInterfaceSafetyOptions ([in] REFIID riid, [out] DWORD *pdwSupportedOptions, [out] DWORD *pdwEnabledOptions)
 
HRESULT SetInterfaceSafetyOptions ([in] REFIID riid, [in] DWORD dwOptionSetMask, [in] DWORD dwEnabledOptions)
 
- Public Member Functions inherited from IUnknown
HRESULT QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
 
ULONG AddRef ()
 
ULONG Release ()
 
HRESULT SetSite ([in] IUnknown *pUnkSite)
 
HRESULT GetSite ([in] REFIID riid, [out, iid_is(riid)] PVOID *ppvSite)
 

Additional Inherited Members

- Public Types inherited from IUnknown
typedef IUnknownLPUNKNOWN
 
- Public Types inherited from IObjectWithSite
typedef IObjectWithSiteLPOBJECTWITHSITE
 
- Static Public Member Functions inherited from ATL::CComObjectRootBase
static void WINAPI ObjectMain (bool)
 
static const struct _ATL_CATMAP_ENTRYGetCategoryMap ()
 
static HRESULT WINAPI InternalQueryInterface (void *pThis, const _ATL_INTMAP_ENTRY *pEntries, REFIID iid, void **ppvObject)
 
- Public Attributes inherited from ATL::CComObjectRootBase
LONG m_dwRef
 

Detailed Description

Definition at line 13 of file CShellDispatch.h.

Constructor & Destructor Documentation

◆ CShellDispatch()

CShellDispatch::CShellDispatch ( )

Definition at line 24 of file CShellDispatch.cpp.

25{
26}

◆ ~CShellDispatch()

CShellDispatch::~CShellDispatch ( )

Definition at line 28 of file CShellDispatch.cpp.

29{
30}

Member Function Documentation

◆ AddToRecent()

HRESULT STDMETHODCALLTYPE CShellDispatch::AddToRecent ( VARIANT  file,
BSTR  category 
)
override

Definition at line 492 of file CShellDispatch.cpp.

493{
494 TRACE("(%p, %s, %ls)\n", this, wine_dbgstr_variant(&file), category);
495
497 HRESULT hr = VariantToIdlist(&file, &idlist);
498 if (hr == S_OK)
500 else
501 hr = S_FALSE;
502 return hr;
503}
HRESULT VariantToIdlist(VARIANT *var, LPITEMIDLIST *idlist)
#define S_OK
Definition: intsafe.h:52
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:1010
HRESULT hr
Definition: shlfolder.c:183
#define SHARD_PIDL
Definition: shlobj.h:1174
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
Definition: shtypes.idl:42
#define TRACE(s)
Definition: solgame.cpp:4
Definition: fci.c:127
#define S_FALSE
Definition: winerror.h:2357

◆ BrowseForFolder()

HRESULT STDMETHODCALLTYPE CShellDispatch::BrowseForFolder ( LONG  Hwnd,
BSTR  Title,
LONG  Options,
VARIANT  RootFolder,
Folder **  ppsdf 
)
override

Definition at line 106 of file CShellDispatch.cpp.

107{
108 TRACE("(%p, %lu, %ls, %lu, %s, %p)\n", this, Hwnd, Title, Options, debugstr_variant(&RootFolder), ppsdf);
109
110 *ppsdf = NULL;
111
112 BROWSEINFOW bi = { 0 };
113 bi.hwndOwner = reinterpret_cast<HWND>(LongToHandle(Hwnd));
114 bi.lpszTitle = Title;
116
118 if (!is_optional_argument(&RootFolder) && VariantToIdlist(&RootFolder, &idlist) == S_OK)
119 bi.pidlRoot = idlist;
120
122 selection.Attach(SHBrowseForFolderW(&bi));
123 if (!selection)
124 return S_FALSE;
125
126 return ShellObjectCreatorInit<CFolder>(static_cast<LPITEMIDLIST>(selection), IID_PPV_ARG(Folder, ppsdf));
127}
static BOOL is_optional_argument(const VARIANT *arg)
#define LongToHandle(h)
Definition: basetsd.h:82
EXTERN_C LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brfolder.cpp:1370
int selection
Definition: ctm.c:92
#define NULL
Definition: types.h:112
static const WCHAR Title[]
Definition: oid.c:1259
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
#define BIF_NEWDIALOGSTYLE
Definition: shlobj.h:1223
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1201
UINT ulFlags
Definition: shlobj.h:1204
HWND hwndOwner
Definition: shlobj.h:1200
LPCWSTR lpszTitle
Definition: shlobj.h:1203
_In_ PWDFDEVICE_INIT _In_ PWDF_REMOVE_LOCK_OPTIONS Options
Definition: wdfdevice.h:3534
#define IID_PPV_ARG(Itype, ppType)

◆ CanStartStopService()

HRESULT STDMETHODCALLTYPE CShellDispatch::CanStartStopService ( BSTR  service,
VARIANT ret 
)
override

Definition at line 471 of file CShellDispatch.cpp.

472{
473 TRACE("(%p, %ls, %p)\n", this, service, ret);
474
475 SC_HANDLE hSvc;
477 if (SUCCEEDED(hr))
478 CloseServiceHandle(hSvc);
479 V_VT(ret) = VT_BOOL;
480 V_BOOL(ret) = (hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE);
481 return S_OK;
482}
static HRESULT OpenServiceHelper(LPCWSTR name, DWORD access, SC_HANDLE &hSvc)
@ VT_BOOL
Definition: compat.h:2306
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VT(A)
Definition: oleauto.h:211
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
Definition: scm.c:580
int ret
#define SERVICE_START
Definition: winsvc.h:57
#define SERVICE_STOP
Definition: winsvc.h:58

◆ CascadeWindows()

HRESULT STDMETHODCALLTYPE CShellDispatch::CascadeWindows ( )
override

Definition at line 192 of file CShellDispatch.cpp.

193{
194 TRACE("(%p)\n", this);
196}
static HRESULT PostTrayCommand(UINT cmd)
#define TRAYCMD_CASCADE
Definition: undocshell.h:864

◆ ControlPanelItem()

HRESULT STDMETHODCALLTYPE CShellDispatch::ControlPanelItem ( BSTR  szDir)
override

Definition at line 264 of file CShellDispatch.cpp.

265{
266 TRACE("(%p, %ls)\n", this, szDir);
267 return SHRunControlPanel(szDir, NULL) ? S_OK : S_FALSE;
268}
BOOL WINAPI SHRunControlPanel(_In_ LPCWSTR commandLine, _In_opt_ HWND parent)
Definition: shellord.c:1661

◆ EjectPC()

HRESULT STDMETHODCALLTYPE CShellDispatch::EjectPC ( )
override

Definition at line 222 of file CShellDispatch.cpp.

223{
224 TRACE("(%p)\n", this);
225 return E_NOTIMPL;
226}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Explore()

HRESULT STDMETHODCALLTYPE CShellDispatch::Explore ( VARIANT  vDir)
override

Definition at line 168 of file CShellDispatch.cpp.

169{
170 TRACE("(%p, %s)\n", this, debugstr_variant(&vDir));
171 return OpenFolder(vDir, L"explore");
172}
static HRESULT OpenFolder(VARIANT vDir, LPCWSTR verb=NULL)
#define L(x)
Definition: ntvdm.h:50

◆ ExplorerPolicy()

HRESULT STDMETHODCALLTYPE CShellDispatch::ExplorerPolicy ( BSTR  policy,
VARIANT value 
)
override

Definition at line 520 of file CShellDispatch.cpp.

521{
522 TRACE("(%p, %ls, %p)\n", this, policy, value);
523 return E_NOTIMPL;
524}
WINBASEAPI _Check_return_ _Out_ AppPolicyProcessTerminationMethod * policy
Definition: appmodel.h:47
Definition: pdh_main.c:94

◆ FileRun()

HRESULT STDMETHODCALLTYPE CShellDispatch::FileRun ( )
override

Definition at line 186 of file CShellDispatch.cpp.

187{
188 TRACE("(%p)\n", this);
190}
#define TRAYCMD_RUN_DIALOG
Definition: undocshell.h:862

◆ FindComputer()

HRESULT STDMETHODCALLTYPE CShellDispatch::FindComputer ( )
override

Definition at line 252 of file CShellDispatch.cpp.

253{
254 TRACE("(%p)\n", this);
256}
#define TRAYCMD_SEARCH_COMPUTERS
Definition: undocshell.h:883

◆ FindFiles()

HRESULT STDMETHODCALLTYPE CShellDispatch::FindFiles ( )
override

Definition at line 246 of file CShellDispatch.cpp.

247{
248 TRACE("(%p)\n", this);
250}
#define TRAYCMD_SEARCH_FILES
Definition: undocshell.h:882

◆ FindPrinter()

HRESULT STDMETHODCALLTYPE CShellDispatch::FindPrinter ( BSTR  name,
BSTR  location,
BSTR  model 
)
override

Definition at line 313 of file CShellDispatch.cpp.

314{
315 TRACE("(%p, %ls, %ls, %ls)\n", this, name, location, model);
316 return E_NOTIMPL;
317}
Definition: name.c:39

◆ get_Application()

HRESULT STDMETHODCALLTYPE CShellDispatch::get_Application ( IDispatch **  ppid)
override

Definition at line 38 of file CShellDispatch.cpp.

39{
40 TRACE("(%p, %p)\n", this, ppid);
41
42 if (!ppid)
43 return E_INVALIDARG;
44
45 *ppid = this;
46 AddRef();
47
48 return S_OK;
49}
#define E_INVALIDARG
Definition: ddrawi.h:101
ULONG AddRef()

◆ get_Parent()

HRESULT STDMETHODCALLTYPE CShellDispatch::get_Parent ( IDispatch **  ppid)
override

Definition at line 51 of file CShellDispatch.cpp.

52{
53 TRACE("(%p, %p)\n", this, ppid);
54
55 if (ppid)
56 {
57 *ppid = static_cast<IDispatch*>(this);
58 AddRef();
59 }
60
61 return S_OK;
62}

◆ GetInterfaceSafetyOptions()

HRESULT STDMETHODCALLTYPE CShellDispatch::GetInterfaceSafetyOptions ( REFIID  riid,
DWORD pdwSupportedOptions,
DWORD pdwEnabledOptions 
)
override

Implements IObjectSafety.

Definition at line 559 of file CShellDispatch.cpp.

560{
561 TRACE("(%p, %s, %p, %p)\n", this, wine_dbgstr_guid(&riid), pdwSupportedOptions, pdwEnabledOptions);
562 return E_NOTIMPL;
563}
REFIID riid
Definition: atlbase.h:39
static __inline const char * wine_dbgstr_guid(const GUID *id)
Definition: debug.h:197

◆ GetSetting()

HRESULT STDMETHODCALLTYPE CShellDispatch::GetSetting ( LONG  setting,
VARIANT_BOOL result 
)
override

Definition at line 529 of file CShellDispatch.cpp.

530{
531 TRACE("(%p, %lu, %p)\n", this, setting, result);
532
533 int flag = -1;
534 SHELLSTATE ss = { };
536 switch (setting)
537 {
538 case SSF_SHOWALLOBJECTS: flag = ss.fShowAllObjects; break;
539 case SSF_SHOWEXTENSIONS: flag = ss.fShowExtensions; break;
540 case SSF_SHOWSYSFILES: flag = ss.fShowSysFiles; break;
541 case SSF_DONTPRETTYPATH: flag = ss.fDontPrettyPath; break;
542 case SSF_NOCONFIRMRECYCLE: flag = ss.fNoConfirmRecycle; break;
543 case SSF_SHOWSUPERHIDDEN: flag = ss.fShowSuperHidden; break;
544 case SSF_SEPPROCESS: flag = ss.fSepProcess; break;
545 case SSF_STARTPANELON: flag = ss.fStartPanelOn; break;
547 }
548 if (flag >= 0)
549 {
550 *result = flag ? VARIANT_TRUE : VARIANT_FALSE;
551 return S_OK;
552 }
553
554 return S_FALSE;
555}
#define SSF_SERVERADMINUI
#define FALSE
Definition: types.h:117
BOOL WINAPI IsOS(DWORD feature)
Definition: ordinal.c:4107
GLuint64EXT * result
Definition: glext.h:11304
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean flag
Definition: glfuncs.h:52
#define ss
Definition: i386-dis.c:441
VOID WINAPI SHGetSetSettings(LPSHELLSTATE lpss, DWORD dwMask, BOOL bSet)
Definition: shellord.c:225
#define SSF_DONTPRETTYPATH
Definition: shlobj.h:1614
#define SSF_SEPPROCESS
Definition: shlobj.h:1622
#define SSF_NOCONFIRMRECYCLE
Definition: shlobj.h:1618
#define SSF_SHOWSYSFILES
Definition: shlobj.h:1609
#define SSF_SHOWEXTENSIONS
Definition: shlobj.h:1606
#define SSF_STARTPANELON
Definition: shlobj.h:1625
#define SSF_SHOWSUPERHIDDEN
Definition: shlobj.h:1621
#define SSF_SHOWALLOBJECTS
Definition: shlobj.h:1605
#define OS_SERVERADMINUI
Definition: shlwapi.h:2078

◆ GetSite()

HRESULT STDMETHODCALLTYPE CShellDispatch::GetSite ( REFIID  riid,
PVOID ppvSite 
)
override

Implements IObjectWithSite.

Definition at line 579 of file CShellDispatch.cpp.

580{
581 TRACE("(%p, %s, %p)\n", this, wine_dbgstr_guid(&riid), ppvSite);
582 return E_NOTIMPL;
583}

◆ GetSystemInformation()

HRESULT STDMETHODCALLTYPE CShellDispatch::GetSystemInformation ( BSTR  name,
VARIANT ret 
)
override

Definition at line 319 of file CShellDispatch.cpp.

320{
321 TRACE("(%p, %ls, %p)\n", this, name, ret);
322
323 if (!lstrcmpiW(name, L"ProcessorArchitecture"))
324 {
325 SYSTEM_INFO si;
326 GetSystemInfo(&si);
327 V_VT(ret) = VT_I4;
329 return S_OK;
330 }
331
332 UINT os = 0;
333 if (!lstrcmpiW(name, L"IsOS_Professional"))
334 os = OS_PROFESSIONAL;
335 else if (!lstrcmpiW(name, L"IsOS_Personal"))
336 os = OS_HOME;
337 else if (!lstrcmpiW(name, L"IsOS_DomainMember"))
338 os = OS_DOMAINMEMBER;
339 if (os)
340 {
341 V_VT(ret) = VT_BOOL;
342 V_BOOL(ret) = IsOS(os) ? VARIANT_TRUE : VARIANT_FALSE;
343 return S_OK;
344 }
345
346 return E_NOTIMPL;
347}
@ VT_I4
Definition: compat.h:2298
VOID WINAPI GetSystemInfo(IN LPSYSTEM_INFO lpSystemInfo)
Definition: sysinfo.c:143
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4262
unsigned int UINT
Definition: ndis.h:50
#define V_UI4(A)
Definition: oleauto.h:270
#define OS_PROFESSIONAL
Definition: shlwapi.h:2064
#define OS_DOMAINMEMBER
Definition: shlwapi.h:2072
#define OS_HOME
Definition: shlwapi.h:2063
WORD wProcessorArchitecture
Definition: winbase.h:1194

◆ Help()

HRESULT STDMETHODCALLTYPE CShellDispatch::Help ( )
override

Definition at line 240 of file CShellDispatch.cpp.

241{
242 TRACE("(%p)\n", this);
244}
#define TRAYCMD_HELP_AND_SUPPORT
Definition: undocshell.h:876

◆ Initialize()

HRESULT CShellDispatch::Initialize ( )

Definition at line 32 of file CShellDispatch.cpp.

33{
34 return S_OK;
35}

◆ IsRestricted()

HRESULT STDMETHODCALLTYPE CShellDispatch::IsRestricted ( BSTR  group,
BSTR  restriction,
LONG value 
)
override

Definition at line 272 of file CShellDispatch.cpp.

273{
274 TRACE("(%p, %ls, %ls, %p)\n", this, group, restriction, value);
275
276 if (!value)
277 return E_INVALIDARG;
278 *value = SHGetRestriction(NULL, group, restriction);
279 return S_OK;
280}
EXTERN_C DWORD WINAPI SHGetRestriction(LPCWSTR lpSubKey, LPCWSTR lpSubName, LPCWSTR lpValue)
Definition: ordinal.c:2744
GLboolean GLuint group
Definition: glext.h:11120

◆ IsServiceRunning()

HRESULT STDMETHODCALLTYPE CShellDispatch::IsServiceRunning ( BSTR  service,
VARIANT running 
)
override

Definition at line 427 of file CShellDispatch.cpp.

428{
430 SC_HANDLE scm, service;
431 DWORD dummy;
432
433 TRACE("(%s, %p)\n", debugstr_w(name), running);
434
435 V_VT(running) = VT_BOOL;
436 V_BOOL(running) = VARIANT_FALSE;
437
439 if (!scm)
440 {
441 ERR("failed to connect to service manager\n");
442 return S_OK;
443 }
444
445 service = OpenServiceW(scm, name, SERVICE_QUERY_STATUS);
446 if (!service)
447 {
448 ERR("Failed to open service %s (%u)\n", debugstr_w(name), GetLastError());
450 return S_OK;
451 }
452
454 sizeof(SERVICE_STATUS_PROCESS), &dummy))
455 {
456 TRACE("failed to query service status (%u)\n", GetLastError());
457 CloseServiceHandle(service);
459 return S_OK;
460 }
461
462 if (status.dwCurrentState == SERVICE_RUNNING)
463 V_BOOL(running) = VARIANT_TRUE;
464
465 CloseServiceHandle(service);
467
468 return S_OK;
469}
#define ERR(fmt,...)
Definition: precomp.h:57
unsigned long DWORD
Definition: ntddk_ex.h:95
#define debugstr_w
Definition: kernel32.h:32
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
Definition: scm.c:2068
BOOL WINAPI QueryServiceStatusEx(SC_HANDLE hService, SC_STATUS_TYPE InfoLevel, LPBYTE lpBuffer, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
Definition: scm.c:2887
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
Definition: scm.c:2160
Definition: ps.c:97
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SERVICE_QUERY_STATUS
Definition: winsvc.h:55
@ SC_STATUS_PROCESS_INFO
Definition: winsvc.h:119
#define SC_MANAGER_CONNECT
Definition: winsvc.h:14
#define SERVICE_RUNNING
Definition: winsvc.h:24
unsigned char BYTE
Definition: xxhash.c:193

◆ MinimizeAll()

HRESULT STDMETHODCALLTYPE CShellDispatch::MinimizeAll ( )
override

Definition at line 174 of file CShellDispatch.cpp.

175{
176 TRACE("(%p)\n", this);
178}
#define TRAYCMD_MINIMIZE_ALL
Definition: undocshell.h:870

◆ NameSpace()

HRESULT STDMETHODCALLTYPE CShellDispatch::NameSpace ( VARIANT  vDir,
Folder **  ppsdf 
)
override

Definition at line 78 of file CShellDispatch.cpp.

79{
80 TRACE("(%p, %s, %p)\n", this, debugstr_variant(&vDir), ppsdf);
81 if (!ppsdf)
82 return E_POINTER;
83 *ppsdf = NULL;
84 HRESULT hr;
85
86 if (V_VT(&vDir) == VT_I2)
87 {
88 hr = VariantChangeType(&vDir, &vDir, 0, VT_I4);
90 return hr;
91 }
92
94 hr = VariantToIdlist(&vDir, &idlist);
95 if (!SUCCEEDED(hr))
96 return S_FALSE;
97
98 return ShellObjectCreatorInit<CFolder>(static_cast<LPITEMIDLIST>(idlist), IID_PPV_ARG(Folder, ppsdf));
99}
@ VT_I2
Definition: compat.h:2297
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
#define E_POINTER
Definition: winerror.h:2365

◆ Open()

HRESULT STDMETHODCALLTYPE CShellDispatch::Open ( VARIANT  vDir)
override

Definition at line 162 of file CShellDispatch.cpp.

163{
164 TRACE("(%p, %s)\n", this, debugstr_variant(&vDir));
165 return OpenFolder(vDir);
166}

◆ RefreshMenu()

HRESULT STDMETHODCALLTYPE CShellDispatch::RefreshMenu ( )
override

Definition at line 258 of file CShellDispatch.cpp.

259{
260 TRACE("(%p)\n", this);
261 return E_NOTIMPL;
262}

◆ ServiceStart()

HRESULT STDMETHODCALLTYPE CShellDispatch::ServiceStart ( BSTR  service,
VARIANT  persistent,
VARIANT ret 
)
override

Definition at line 407 of file CShellDispatch.cpp.

408{
409 TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret);
410
411 HRESULT hr = SHELL32_ControlService(service, 0, persistent);
412 V_VT(ret) = VT_BOOL;
413 V_BOOL(ret) = (hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE);
414 return hr == S_OK ? S_OK : S_FALSE;
415}
static HRESULT SHELL32_ControlService(BSTR name, DWORD control, VARIANT &persistent)

◆ ServiceStop()

HRESULT STDMETHODCALLTYPE CShellDispatch::ServiceStop ( BSTR  service,
VARIANT  persistent,
VARIANT ret 
)
override

Definition at line 417 of file CShellDispatch.cpp.

418{
419 TRACE("(%p, %ls, %s, %p)\n", this, service, wine_dbgstr_variant(&persistent), ret);
420
422 V_VT(ret) = VT_BOOL;
423 V_BOOL(ret) = (hr == S_OK ? VARIANT_TRUE : VARIANT_FALSE);
424 return hr == S_OK ? S_OK : S_FALSE;
425}
#define SERVICE_CONTROL_STOP
Definition: winsvc.h:36

◆ SetInterfaceSafetyOptions()

HRESULT STDMETHODCALLTYPE CShellDispatch::SetInterfaceSafetyOptions ( REFIID  riid,
DWORD  dwOptionSetMask,
DWORD  dwEnabledOptions 
)
override

Implements IObjectSafety.

Definition at line 565 of file CShellDispatch.cpp.

566{
567 TRACE("(%p, %s, %lu, %lu)\n", this, wine_dbgstr_guid(&riid), dwOptionSetMask, dwEnabledOptions);
568 return E_NOTIMPL;
569}

◆ SetSite()

HRESULT STDMETHODCALLTYPE CShellDispatch::SetSite ( IUnknown pUnkSite)
override

Implements IObjectWithSite.

Definition at line 573 of file CShellDispatch.cpp.

574{
575 TRACE("(%p, %p)\n", this, pUnkSite);
576 return E_NOTIMPL;
577}

◆ SetTime()

HRESULT STDMETHODCALLTYPE CShellDispatch::SetTime ( )
override

Definition at line 228 of file CShellDispatch.cpp.

229{
230 TRACE("(%p)\n", this);
232}
#define TRAYCMD_DATE_AND_TIME
Definition: undocshell.h:868

◆ ShellExecute()

HRESULT STDMETHODCALLTYPE CShellDispatch::ShellExecute ( BSTR  file,
VARIANT  args,
VARIANT  dir,
VARIANT  op,
VARIANT  show 
)
override

Definition at line 282 of file CShellDispatch.cpp.

283{
284 CComVariant args_str, dir_str, op_str, show_int;
285 WCHAR *args = NULL, *dir = NULL, *op = NULL;
286 INT show = SW_SHOW;
288
289 TRACE("(%s, %s, %s, %s, %s)\n", debugstr_w(file), debugstr_variant(&v_args),
290 debugstr_variant(&v_dir), debugstr_variant(&v_op), debugstr_variant(&v_show));
291
292 args_str.ChangeType(VT_BSTR, &v_args);
293 if (V_VT(&args_str) == VT_BSTR)
294 args = V_BSTR(&args_str);
295
296 dir_str.ChangeType(VT_BSTR, &v_dir);
297 if (V_VT(&dir_str) == VT_BSTR)
298 dir = V_BSTR(&dir_str);
299
300 op_str.ChangeType(VT_BSTR, &v_op);
301 if (V_VT(&op_str) == VT_BSTR)
302 op = V_BSTR(&op_str);
303
304 show_int.ChangeType(VT_I4, &v_show);
305 if (V_VT(&show_int) == VT_I4)
306 show = V_I4(&show_int);
307
308 ret = ShellExecuteW(NULL, op, file, args, dir, show);
309
310 return (ULONG_PTR)ret > 32 ? S_OK : S_FALSE;
311}
unsigned int dir
Definition: maze.c:112
HRESULT ChangeType(_In_ VARTYPE newType, _In_opt_ const LPVARIANT src=NULL)
Definition: atlcomcli.h:589
UINT op
Definition: effect.c:236
@ VT_BSTR
Definition: compat.h:2303
const char * op_str
Definition: compile.c:77
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
HINSTANCE WINAPI ShellExecuteW(HWND hwnd, LPCWSTR lpVerb, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
Definition: shlexec.cpp:2492
Definition: match.c:390
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define SW_SHOW
Definition: winuser.h:778
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ ShowBrowserBar()

HRESULT STDMETHODCALLTYPE CShellDispatch::ShowBrowserBar ( BSTR  clsid,
VARIANT  show,
VARIANT ret 
)
override

Definition at line 484 of file CShellDispatch.cpp.

485{
486 TRACE("(%p, %ls, %s, %p)\n", this, clsid, wine_dbgstr_variant(&show), ret);
487 return E_NOTIMPL;
488}
REFCLSID clsid
Definition: msctf.c:82

◆ ShutdownWindows()

HRESULT STDMETHODCALLTYPE CShellDispatch::ShutdownWindows ( )
override

Definition at line 210 of file CShellDispatch.cpp.

211{
213 return S_OK;
214}
void WINAPI ExitWindowsDialog(HWND hWndOwner)
Definition: dialogs.cpp:1608

◆ Suspend()

HRESULT STDMETHODCALLTYPE CShellDispatch::Suspend ( )
override

Definition at line 216 of file CShellDispatch.cpp.

217{
218 TRACE("(%p)\n", this);
219 return E_NOTIMPL;
220}

◆ TileHorizontally()

HRESULT STDMETHODCALLTYPE CShellDispatch::TileHorizontally ( )
override

Definition at line 204 of file CShellDispatch.cpp.

205{
206 TRACE("(%p)\n", this);
208}
#define TRAYCMD_TILE_H
Definition: undocshell.h:865

◆ TileVertically()

HRESULT STDMETHODCALLTYPE CShellDispatch::TileVertically ( )
override

Definition at line 198 of file CShellDispatch.cpp.

199{
200 TRACE("(%p)\n", this);
202}
#define TRAYCMD_TILE_V
Definition: undocshell.h:866

◆ ToggleDesktop()

HRESULT STDMETHODCALLTYPE CShellDispatch::ToggleDesktop ( )
override

Definition at line 514 of file CShellDispatch.cpp.

515{
516 TRACE("(%p)\n", this);
518}
#define TRAYCMD_TOGGLE_DESKTOP
Definition: undocshell.h:867

◆ TrayProperties()

HRESULT STDMETHODCALLTYPE CShellDispatch::TrayProperties ( )
override

Definition at line 234 of file CShellDispatch.cpp.

235{
236 TRACE("(%p)\n", this);
238}
#define TRAYCMD_TASKBAR_PROPERTIES
Definition: undocshell.h:869

◆ UndoMinimizeALL()

HRESULT STDMETHODCALLTYPE CShellDispatch::UndoMinimizeALL ( )
override

Definition at line 180 of file CShellDispatch.cpp.

181{
182 TRACE("(%p)\n", this);
184}
#define TRAYCMD_RESTORE_ALL
Definition: undocshell.h:871

◆ Windows()

HRESULT STDMETHODCALLTYPE CShellDispatch::Windows ( IDispatch **  ppid)
override

Definition at line 129 of file CShellDispatch.cpp.

130{
131 TRACE("(%p, %p)\n", this, ppid);
132 return CoCreateInstance(CLSID_ShellWindows, NULL, CLSCTX_LOCAL_SERVER, IID_PPV_ARG(IDispatch, ppid));
133}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325

◆ WindowsSecurity()

HRESULT STDMETHODCALLTYPE CShellDispatch::WindowsSecurity ( )
override

Definition at line 508 of file CShellDispatch.cpp.

509{
510 TRACE("(%p)\n", this);
512}
#define IDM_SECURITY
Definition: resource.h:67

The documentation for this class was generated from the following files: