ReactOS 0.4.16-dev-1946-g52006dd
shell.c
Go to the documentation of this file.
1/*
2 * Copyright 2011 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#ifdef __REACTOS__
20#include <wchar.h>
21#define STATUS_PENDING ((DWORD)0x00000103)
22#endif
23
24#include "wshom_private.h"
25#include "wshom.h"
26
27#include "shellapi.h"
28#include "shlobj.h"
29#include "dispex.h"
30
31#include "wine/debug.h"
32#include "wine/heap.h"
33
35
36typedef struct
37{
39 IWshShell3 IWshShell3_iface;
42
43typedef struct
44{
46 IWshCollection IWshCollection_iface;
49
50typedef struct
51{
53 IWshShortcut IWshShortcut_iface;
55
59
60typedef struct
61{
63 IWshEnvironment IWshEnvironment_iface;
66
67typedef struct
68{
74
75static inline WshCollection *impl_from_IWshCollection( IWshCollection *iface )
76{
77 return CONTAINING_RECORD(iface, WshCollection, IWshCollection_iface);
78}
79
80static inline WshShortcut *impl_from_IWshShortcut( IWshShortcut *iface )
81{
82 return CONTAINING_RECORD(iface, WshShortcut, IWshShortcut_iface);
83}
84
85static inline WshEnvironment *impl_from_IWshEnvironment( IWshEnvironment *iface )
86{
87 return CONTAINING_RECORD(iface, WshEnvironment, IWshEnvironment_iface);
88}
89
90static inline WshExecImpl *impl_from_IWshExec( IWshExec *iface )
91{
92 return CONTAINING_RECORD(iface, WshExecImpl, IWshExec_iface);
93}
94
95static HRESULT WINAPI WshExec_QueryInterface(IWshExec *iface, REFIID riid, void **obj)
96{
98
99 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
100
102 IsEqualGUID(riid, &IID_IWshExec) ||
104 {
105 *obj = iface;
106 }
108 {
109 *obj = &This->classinfo.IProvideClassInfo_iface;
110 }
111 else {
112 FIXME("Unknown iface %s\n", debugstr_guid(riid));
113 *obj = NULL;
114 return E_NOINTERFACE;
115 }
116
117 IUnknown_AddRef((IUnknown *)*obj);
118 return S_OK;
119}
120
121static ULONG WINAPI WshExec_AddRef(IWshExec *iface)
122{
125 TRACE("(%p) ref = %d\n", This, ref);
126 return ref;
127}
128
129static ULONG WINAPI WshExec_Release(IWshExec *iface)
130{
133 TRACE("(%p) ref = %d\n", This, ref);
134
135 if (!ref) {
136 CloseHandle(This->info.hThread);
137 CloseHandle(This->info.hProcess);
139 }
140
141 return ref;
142}
143
144static HRESULT WINAPI WshExec_GetTypeInfoCount(IWshExec *iface, UINT *pctinfo)
145{
147 TRACE("(%p)->(%p)\n", This, pctinfo);
148 *pctinfo = 1;
149 return S_OK;
150}
151
152static HRESULT WINAPI WshExec_GetTypeInfo(IWshExec *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
153{
155 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
156 return get_typeinfo(IWshExec_tid, ppTInfo);
157}
158
159static HRESULT WINAPI WshExec_GetIDsOfNames(IWshExec *iface, REFIID riid, LPOLESTR *rgszNames,
160 UINT cNames, LCID lcid, DISPID *rgDispId)
161{
164 HRESULT hr;
165
166 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
167
169 if(SUCCEEDED(hr))
170 {
171 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
172 ITypeInfo_Release(typeinfo);
173 }
174
175 return hr;
176}
177
178static HRESULT WINAPI WshExec_Invoke(IWshExec *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
179 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
180{
183 HRESULT hr;
184
185 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
186 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
187
189 if(SUCCEEDED(hr))
190 {
191 hr = ITypeInfo_Invoke(typeinfo, &This->IWshExec_iface, dispIdMember, wFlags,
192 pDispParams, pVarResult, pExcepInfo, puArgErr);
193 ITypeInfo_Release(typeinfo);
194 }
195
196 return hr;
197}
198
199static HRESULT WINAPI WshExec_get_Status(IWshExec *iface, WshExecStatus *status)
200{
202 DWORD code;
203
204 TRACE("(%p)->(%p)\n", This, status);
205
206 if (!status)
207 return E_INVALIDARG;
208
209 if (!GetExitCodeProcess(This->info.hProcess, &code))
211
212 switch (code)
213 {
214 case 0:
215 *status = WshFinished;
216 break;
217 case STILL_ACTIVE:
218 *status = WshRunning;
219 break;
220 default:
221 *status = WshFailed;
222 }
223
224 return S_OK;
225}
226
227static HRESULT WINAPI WshExec_get_StdIn(IWshExec *iface, ITextStream **stream)
228{
230
231 FIXME("(%p)->(%p): stub\n", This, stream);
232
233 return E_NOTIMPL;
234}
235
236static HRESULT WINAPI WshExec_get_StdOut(IWshExec *iface, ITextStream **stream)
237{
239
240 FIXME("(%p)->(%p): stub\n", This, stream);
241
242 return E_NOTIMPL;
243}
244
245static HRESULT WINAPI WshExec_get_StdErr(IWshExec *iface, ITextStream **stream)
246{
248
249 FIXME("(%p)->(%p): stub\n", This, stream);
250
251 return E_NOTIMPL;
252}
253
255{
257
258 TRACE("(%p)->(%p)\n", This, pid);
259
260 if (!pid)
261 return E_INVALIDARG;
262
263 *pid = This->info.dwProcessId;
264 return S_OK;
265}
266
268{
270
271 FIXME("(%p)->(%p): stub\n", This, code);
272
273 return E_NOTIMPL;
274}
275
277{
278 INT *count = (INT*)lParam;
279
280 (*count)++;
281 PostMessageW(hwnd, WM_CLOSE, 0, 0);
282 /* try to send it to all windows, even if failed for some */
283 return TRUE;
284}
285
286static HRESULT WINAPI WshExec_Terminate(IWshExec *iface)
287{
289 BOOL ret, kill = FALSE;
290 INT count = 0;
291
292 TRACE("(%p)\n", This);
293
295 if (ret && count) {
296 /* manual testing shows that it waits 2 seconds before forcing termination */
297 if (WaitForSingleObject(This->info.hProcess, 2000) != WAIT_OBJECT_0)
298 kill = TRUE;
299 }
300 else
301 kill = TRUE;
302
303 if (kill)
304 TerminateProcess(This->info.hProcess, 0);
305
306 return S_OK;
307}
308
309static const IWshExecVtbl WshExecVtbl = {
324};
325
327{
328 STARTUPINFOW si = {0};
330
331 *ret = NULL;
332
333 This = heap_alloc(sizeof(*This));
334 if (!This)
335 return E_OUTOFMEMORY;
336
337 This->IWshExec_iface.lpVtbl = &WshExecVtbl;
338 This->ref = 1;
339
340 if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &This->info)) {
343 }
344
345 init_classinfo(&CLSID_WshExec, (IUnknown *)&This->IWshExec_iface, &This->classinfo);
346 *ret = &This->IWshExec_iface;
347 return S_OK;
348}
349
350static HRESULT WINAPI WshEnvironment_QueryInterface(IWshEnvironment *iface, REFIID riid, void **obj)
351{
353
354 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
355
358 IsEqualGUID(riid, &IID_IWshEnvironment))
359 {
360 *obj = iface;
361 }
363 {
364 *obj = &This->classinfo.IProvideClassInfo_iface;
365 }
366 else {
367 FIXME("Unknown iface %s\n", debugstr_guid(riid));
368 *obj = NULL;
369 return E_NOINTERFACE;
370 }
371
372 IUnknown_AddRef((IUnknown*)*obj);
373 return S_OK;
374}
375
376static ULONG WINAPI WshEnvironment_AddRef(IWshEnvironment *iface)
377{
380 TRACE("(%p) ref = %d\n", This, ref);
381 return ref;
382}
383
384static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
385{
388 TRACE("(%p) ref = %d\n", This, ref);
389
390 if (!ref)
392
393 return ref;
394}
395
396static HRESULT WINAPI WshEnvironment_GetTypeInfoCount(IWshEnvironment *iface, UINT *pctinfo)
397{
399 TRACE("(%p)->(%p)\n", This, pctinfo);
400 *pctinfo = 1;
401 return S_OK;
402}
403
404static HRESULT WINAPI WshEnvironment_GetTypeInfo(IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
405{
407 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
408 return get_typeinfo(IWshEnvironment_tid, ppTInfo);
409}
410
411static HRESULT WINAPI WshEnvironment_GetIDsOfNames(IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames,
412 UINT cNames, LCID lcid, DISPID *rgDispId)
413{
416 HRESULT hr;
417
418 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
419
421 if(SUCCEEDED(hr))
422 {
423 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
424 ITypeInfo_Release(typeinfo);
425 }
426
427 return hr;
428}
429
430static HRESULT WINAPI WshEnvironment_Invoke(IWshEnvironment *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
431 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
432{
435 HRESULT hr;
436
437 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
438 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
439
441 if(SUCCEEDED(hr))
442 {
443 hr = ITypeInfo_Invoke(typeinfo, &This->IWshEnvironment_iface, dispIdMember, wFlags,
444 pDispParams, pVarResult, pExcepInfo, puArgErr);
445 ITypeInfo_Release(typeinfo);
446 }
447
448 return hr;
449}
450
451static HRESULT WINAPI WshEnvironment_get_Item(IWshEnvironment *iface, BSTR name, BSTR *value)
452{
454 DWORD len;
455
456 TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
457
458 if (!value)
459 return E_POINTER;
460
462 if (len)
463 {
465 if (*value)
467 }
468 else
470
471 return *value ? S_OK : E_OUTOFMEMORY;
472}
473
474static HRESULT WINAPI WshEnvironment_put_Item(IWshEnvironment *iface, BSTR name, BSTR value)
475{
477 FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(name), debugstr_w(value));
478 return E_NOTIMPL;
479}
480
481static HRESULT WINAPI WshEnvironment_Count(IWshEnvironment *iface, LONG *count)
482{
484 FIXME("(%p)->(%p): stub\n", This, count);
485 return E_NOTIMPL;
486}
487
488static HRESULT WINAPI WshEnvironment_get_length(IWshEnvironment *iface, LONG *len)
489{
491 FIXME("(%p)->(%p): stub\n", This, len);
492 return E_NOTIMPL;
493}
494
495static HRESULT WINAPI WshEnvironment__NewEnum(IWshEnvironment *iface, IUnknown **penum)
496{
498 FIXME("(%p)->(%p): stub\n", This, penum);
499 return E_NOTIMPL;
500}
501
502static HRESULT WINAPI WshEnvironment_Remove(IWshEnvironment *iface, BSTR name)
503{
505 FIXME("(%p)->(%s): stub\n", This, debugstr_w(name));
506 return E_NOTIMPL;
507}
508
509static const IWshEnvironmentVtbl WshEnvironmentVtbl = {
523};
524
525static HRESULT WshEnvironment_Create(IWshEnvironment **env)
526{
528
529 This = heap_alloc(sizeof(*This));
530 if (!This) return E_OUTOFMEMORY;
531
532 This->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
533 This->ref = 1;
534
535 init_classinfo(&IID_IWshEnvironment, (IUnknown *)&This->IWshEnvironment_iface, &This->classinfo);
536 *env = &This->IWshEnvironment_iface;
537
538 return S_OK;
539}
540
541static HRESULT WINAPI WshCollection_QueryInterface(IWshCollection *iface, REFIID riid, void **ppv)
542{
544
545 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
546
549 IsEqualGUID(riid, &IID_IWshCollection))
550 {
551 *ppv = iface;
552 }
554 {
555 *ppv = &This->classinfo.IProvideClassInfo_iface;
556 }
557 else {
558 FIXME("Unknown iface %s\n", debugstr_guid(riid));
559 *ppv = NULL;
560 return E_NOINTERFACE;
561 }
562
563 IUnknown_AddRef((IUnknown*)*ppv);
564 return S_OK;
565}
566
567static ULONG WINAPI WshCollection_AddRef(IWshCollection *iface)
568{
571 TRACE("(%p) ref = %d\n", This, ref);
572 return ref;
573}
574
575static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
576{
579 TRACE("(%p) ref = %d\n", This, ref);
580
581 if (!ref)
583
584 return ref;
585}
586
587static HRESULT WINAPI WshCollection_GetTypeInfoCount(IWshCollection *iface, UINT *pctinfo)
588{
590 TRACE("(%p)->(%p)\n", This, pctinfo);
591 *pctinfo = 1;
592 return S_OK;
593}
594
595static HRESULT WINAPI WshCollection_GetTypeInfo(IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
596{
598 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
599 return get_typeinfo(IWshCollection_tid, ppTInfo);
600}
601
602static HRESULT WINAPI WshCollection_GetIDsOfNames(IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames,
603 UINT cNames, LCID lcid, DISPID *rgDispId)
604{
607 HRESULT hr;
608
609 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
610
612 if(SUCCEEDED(hr))
613 {
614 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
615 ITypeInfo_Release(typeinfo);
616 }
617
618 return hr;
619}
620
621static HRESULT WINAPI WshCollection_Invoke(IWshCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
622 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
623{
626 HRESULT hr;
627
628 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
629 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
630
632 if(SUCCEEDED(hr))
633 {
634 hr = ITypeInfo_Invoke(typeinfo, &This->IWshCollection_iface, dispIdMember, wFlags,
635 pDispParams, pVarResult, pExcepInfo, puArgErr);
636 ITypeInfo_Release(typeinfo);
637 }
638
639 return hr;
640}
641
642static HRESULT WINAPI WshCollection_Item(IWshCollection *iface, VARIANT *index, VARIANT *value)
643{
645 static const WCHAR allusersdesktopW[] = {'A','l','l','U','s','e','r','s','D','e','s','k','t','o','p',0};
646 static const WCHAR allusersprogramsW[] = {'A','l','l','U','s','e','r','s','P','r','o','g','r','a','m','s',0};
647 static const WCHAR desktopW[] = {'D','e','s','k','t','o','p',0};
648 PIDLIST_ABSOLUTE pidl;
649 WCHAR pathW[MAX_PATH];
650 int kind = 0;
651 BSTR folder;
652 HRESULT hr;
653
654 TRACE("(%p)->(%s %p)\n", This, debugstr_variant(index), value);
655
656 if (V_VT(index) != VT_BSTR)
657 {
658 FIXME("only BSTR index supported, got %d\n", V_VT(index));
659 return E_NOTIMPL;
660 }
661
663 if (!wcsicmp(folder, desktopW))
664 kind = CSIDL_DESKTOP;
665 else if (!wcsicmp(folder, allusersdesktopW))
667 else if (!wcsicmp(folder, allusersprogramsW))
669 else
670 {
671 FIXME("folder kind %s not supported\n", debugstr_w(folder));
672 return E_NOTIMPL;
673 }
674
675 hr = SHGetSpecialFolderLocation(NULL, kind, &pidl);
676 if (hr != S_OK) return hr;
677
678 if (SHGetPathFromIDListW(pidl, pathW))
679 {
680 V_VT(value) = VT_BSTR;
681 V_BSTR(value) = SysAllocString(pathW);
683 }
684 else
685 hr = E_FAIL;
686
687 CoTaskMemFree(pidl);
688
689 return hr;
690}
691
692static HRESULT WINAPI WshCollection_Count(IWshCollection *iface, LONG *count)
693{
695 FIXME("(%p)->(%p): stub\n", This, count);
696 return E_NOTIMPL;
697}
698
699static HRESULT WINAPI WshCollection_get_length(IWshCollection *iface, LONG *count)
700{
702 FIXME("(%p)->(%p): stub\n", This, count);
703 return E_NOTIMPL;
704}
705
706static HRESULT WINAPI WshCollection__NewEnum(IWshCollection *iface, IUnknown **Enum)
707{
709 FIXME("(%p)->(%p): stub\n", This, Enum);
710 return E_NOTIMPL;
711}
712
713static const IWshCollectionVtbl WshCollectionVtbl = {
725};
726
728{
730
731 This = heap_alloc(sizeof(*This));
732 if (!This) return E_OUTOFMEMORY;
733
734 This->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
735 This->ref = 1;
736
737 init_classinfo(&IID_IWshCollection, (IUnknown *)&This->IWshCollection_iface, &This->classinfo);
738 *collection = &This->IWshCollection_iface;
739
740 return S_OK;
741}
742
743/* IWshShortcut */
744static HRESULT WINAPI WshShortcut_QueryInterface(IWshShortcut *iface, REFIID riid, void **ppv)
745{
747
748 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
749
752 IsEqualGUID(riid, &IID_IWshShortcut))
753 {
754 *ppv = iface;
755 }
757 {
758 *ppv = &This->classinfo.IProvideClassInfo_iface;
759 }
760 else {
761 FIXME("Unknown iface %s\n", debugstr_guid(riid));
762 *ppv = NULL;
763 return E_NOINTERFACE;
764 }
765
766 IUnknown_AddRef((IUnknown*)*ppv);
767 return S_OK;
768}
769
770static ULONG WINAPI WshShortcut_AddRef(IWshShortcut *iface)
771{
774 TRACE("(%p) ref = %d\n", This, ref);
775 return ref;
776}
777
778static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
779{
782 TRACE("(%p) ref = %d\n", This, ref);
783
784 if (!ref)
785 {
786 SysFreeString(This->path_link);
787 IShellLinkW_Release(This->link);
789 }
790
791 return ref;
792}
793
794static HRESULT WINAPI WshShortcut_GetTypeInfoCount(IWshShortcut *iface, UINT *pctinfo)
795{
797 TRACE("(%p)->(%p)\n", This, pctinfo);
798 *pctinfo = 1;
799 return S_OK;
800}
801
802static HRESULT WINAPI WshShortcut_GetTypeInfo(IWshShortcut *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
803{
805 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
806 return get_typeinfo(IWshShortcut_tid, ppTInfo);
807}
808
809static HRESULT WINAPI WshShortcut_GetIDsOfNames(IWshShortcut *iface, REFIID riid, LPOLESTR *rgszNames,
810 UINT cNames, LCID lcid, DISPID *rgDispId)
811{
814 HRESULT hr;
815
816 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
817
819 if(SUCCEEDED(hr))
820 {
821 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
822 ITypeInfo_Release(typeinfo);
823 }
824
825 return hr;
826}
827
828static HRESULT WINAPI WshShortcut_Invoke(IWshShortcut *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
829 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
830{
833 HRESULT hr;
834
835 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
836 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
837
839 if(SUCCEEDED(hr))
840 {
841 hr = ITypeInfo_Invoke(typeinfo, &This->IWshShortcut_iface, dispIdMember, wFlags,
842 pDispParams, pVarResult, pExcepInfo, puArgErr);
843 ITypeInfo_Release(typeinfo);
844 }
845
846 return hr;
847}
848
849static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name)
850{
852 FIXME("(%p)->(%p): stub\n", This, name);
853 return E_NOTIMPL;
854}
855
856static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments)
857{
859 WCHAR buffW[INFOTIPSIZE];
860 HRESULT hr;
861
862 TRACE("(%p)->(%p)\n", This, Arguments);
863
864 if (!Arguments)
865 return E_POINTER;
866
867 *Arguments = NULL;
868
869 hr = IShellLinkW_GetArguments(This->link, buffW, ARRAY_SIZE(buffW));
870 if (FAILED(hr))
871 return hr;
872
873 *Arguments = SysAllocString(buffW);
874 return *Arguments ? S_OK : E_OUTOFMEMORY;
875}
876
877static HRESULT WINAPI WshShortcut_put_Arguments(IWshShortcut *iface, BSTR Arguments)
878{
880
881 TRACE("(%p)->(%s)\n", This, debugstr_w(Arguments));
882
883 return IShellLinkW_SetArguments(This->link, Arguments);
884}
885
887{
889 FIXME("(%p)->(%p): stub\n", This, Description);
890 return E_NOTIMPL;
891}
892
894{
896 TRACE("(%p)->(%s)\n", This, debugstr_w(Description));
897 return IShellLinkW_SetDescription(This->link, Description);
898}
899
900static HRESULT WINAPI WshShortcut_get_Hotkey(IWshShortcut *iface, BSTR *Hotkey)
901{
903 FIXME("(%p)->(%p): stub\n", This, Hotkey);
904 return E_NOTIMPL;
905}
906
907static HRESULT WINAPI WshShortcut_put_Hotkey(IWshShortcut *iface, BSTR Hotkey)
908{
910 FIXME("(%p)->(%s): stub\n", This, debugstr_w(Hotkey));
911 return E_NOTIMPL;
912}
913
915{
916 static const WCHAR fmtW[] = {'%','s',',',' ','%','d',0};
918 WCHAR buffW[MAX_PATH], pathW[MAX_PATH];
919 INT icon = 0;
920 HRESULT hr;
921
922 TRACE("(%p)->(%p)\n", This, IconPath);
923
924 if (!IconPath)
925 return E_POINTER;
926
927 hr = IShellLinkW_GetIconLocation(This->link, buffW, ARRAY_SIZE(buffW), &icon);
928 if (FAILED(hr)) return hr;
929
930 swprintf(pathW, fmtW, buffW, icon);
931 *IconPath = SysAllocString(pathW);
932 if (!*IconPath) return E_OUTOFMEMORY;
933
934 return S_OK;
935}
936
938{
940 HRESULT hr;
941 WCHAR *ptr;
942 BSTR path;
943 INT icon;
944
945 TRACE("(%p)->(%s)\n", This, debugstr_w(IconPath));
946
947 /* scan for icon id */
948 ptr = wcsrchr(IconPath, ',');
949 if (!ptr)
950 {
951 WARN("icon index not found\n");
952 return E_FAIL;
953 }
954
956
957 /* skip spaces if any */
958 while (iswspace(*++ptr))
959 ;
960
961 icon = wcstol(ptr, NULL, 10);
962
963 hr = IShellLinkW_SetIconLocation(This->link, path, icon);
965
966 return hr;
967}
968
969static HRESULT WINAPI WshShortcut_put_RelativePath(IWshShortcut *iface, BSTR rhs)
970{
972 FIXME("(%p)->(%s): stub\n", This, debugstr_w(rhs));
973 return E_NOTIMPL;
974}
975
976static HRESULT WINAPI WshShortcut_get_TargetPath(IWshShortcut *iface, BSTR *Path)
977{
979 FIXME("(%p)->(%p): stub\n", This, Path);
980 return E_NOTIMPL;
981}
982
984{
986 TRACE("(%p)->(%s)\n", This, debugstr_w(Path));
987 return IShellLinkW_SetPath(This->link, Path);
988}
989
990static HRESULT WINAPI WshShortcut_get_WindowStyle(IWshShortcut *iface, int *ShowCmd)
991{
993 TRACE("(%p)->(%p)\n", This, ShowCmd);
994 return IShellLinkW_GetShowCmd(This->link, ShowCmd);
995}
996
997static HRESULT WINAPI WshShortcut_put_WindowStyle(IWshShortcut *iface, int ShowCmd)
998{
1000 TRACE("(%p)->(%d)\n", This, ShowCmd);
1001 return IShellLinkW_SetShowCmd(This->link, ShowCmd);
1002}
1003
1004static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR *WorkingDirectory)
1005{
1007 WCHAR buffW[MAX_PATH];
1008 HRESULT hr;
1009
1010 TRACE("(%p)->(%p)\n", This, WorkingDirectory);
1011
1012 if (!WorkingDirectory)
1013 return E_POINTER;
1014
1015 *WorkingDirectory = NULL;
1016 hr = IShellLinkW_GetWorkingDirectory(This->link, buffW, ARRAY_SIZE(buffW));
1017 if (FAILED(hr)) return hr;
1018
1019 *WorkingDirectory = SysAllocString(buffW);
1020 return *WorkingDirectory ? S_OK : E_OUTOFMEMORY;
1021}
1022
1023static HRESULT WINAPI WshShortcut_put_WorkingDirectory(IWshShortcut *iface, BSTR WorkingDirectory)
1024{
1026 TRACE("(%p)->(%s)\n", This, debugstr_w(WorkingDirectory));
1027 return IShellLinkW_SetWorkingDirectory(This->link, WorkingDirectory);
1028}
1029
1030static HRESULT WINAPI WshShortcut_Load(IWshShortcut *iface, BSTR PathLink)
1031{
1033 FIXME("(%p)->(%s): stub\n", This, debugstr_w(PathLink));
1034 return E_NOTIMPL;
1035}
1036
1037static HRESULT WINAPI WshShortcut_Save(IWshShortcut *iface)
1038{
1041 HRESULT hr;
1042
1043 TRACE("(%p)\n", This);
1044
1045 IShellLinkW_QueryInterface(This->link, &IID_IPersistFile, (void**)&file);
1046 hr = IPersistFile_Save(file, This->path_link, TRUE);
1047 IPersistFile_Release(file);
1048
1049 return hr;
1050}
1051
1052static const IWshShortcutVtbl WshShortcutVtbl = {
1078};
1079
1081{
1083 HRESULT hr;
1084
1085 *shortcut = NULL;
1086
1087 This = heap_alloc(sizeof(*This));
1088 if (!This) return E_OUTOFMEMORY;
1089
1090 This->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
1091 This->ref = 1;
1092
1093 hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
1094 &IID_IShellLinkW, (void**)&This->link);
1095 if (FAILED(hr))
1096 {
1097 heap_free(This);
1098 return hr;
1099 }
1100
1101 This->path_link = SysAllocString(path);
1102 if (!This->path_link)
1103 {
1104 IShellLinkW_Release(This->link);
1105 heap_free(This);
1106 return E_OUTOFMEMORY;
1107 }
1108
1109 init_classinfo(&IID_IWshShortcut, (IUnknown *)&This->IWshShortcut_iface, &This->classinfo);
1110 *shortcut = (IDispatch*)&This->IWshShortcut_iface;
1111
1112 return S_OK;
1113}
1114
1115static HRESULT WINAPI WshShell3_QueryInterface(IWshShell3 *iface, REFIID riid, void **ppv)
1116{
1117 TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
1118
1119 *ppv = NULL;
1120
1122 IsEqualGUID(riid, &IID_IWshShell3) ||
1123 IsEqualGUID(riid, &IID_IWshShell2) ||
1124 IsEqualGUID(riid, &IID_IWshShell) ||
1126 {
1127 *ppv = iface;
1128 }
1129 else if (IsEqualGUID(riid, &IID_IDispatchEx))
1130 {
1131 return E_NOINTERFACE;
1132 }
1134 {
1135 *ppv = &WshShell3.classinfo.IProvideClassInfo_iface;
1136 }
1137 else
1138 {
1139 WARN("unknown iface %s\n", debugstr_guid(riid));
1140 return E_NOINTERFACE;
1141 }
1142
1143 IUnknown_AddRef((IUnknown *)*ppv);
1144 return S_OK;
1145}
1146
1147static ULONG WINAPI WshShell3_AddRef(IWshShell3 *iface)
1148{
1149 TRACE("()\n");
1150 return 2;
1151}
1152
1153static ULONG WINAPI WshShell3_Release(IWshShell3 *iface)
1154{
1155 TRACE("()\n");
1156 return 2;
1157}
1158
1159static HRESULT WINAPI WshShell3_GetTypeInfoCount(IWshShell3 *iface, UINT *pctinfo)
1160{
1161 TRACE("(%p)\n", pctinfo);
1162 *pctinfo = 1;
1163 return S_OK;
1164}
1165
1166static HRESULT WINAPI WshShell3_GetTypeInfo(IWshShell3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
1167{
1168 TRACE("(%u %u %p)\n", iTInfo, lcid, ppTInfo);
1169 return get_typeinfo(IWshShell3_tid, ppTInfo);
1170}
1171
1172static HRESULT WINAPI WshShell3_GetIDsOfNames(IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames,
1173 UINT cNames, LCID lcid, DISPID *rgDispId)
1174{
1176 HRESULT hr;
1177
1178 TRACE("(%s %p %u %u %p)\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
1179
1181 if(SUCCEEDED(hr))
1182 {
1183 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
1184 ITypeInfo_Release(typeinfo);
1185 }
1186
1187 return hr;
1188}
1189
1190static HRESULT WINAPI WshShell3_Invoke(IWshShell3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
1191 WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
1192{
1194 HRESULT hr;
1195
1196 TRACE("(%d %s %d %d %p %p %p %p)\n", dispIdMember, debugstr_guid(riid),
1197 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1198
1200 if(SUCCEEDED(hr))
1201 {
1202 hr = ITypeInfo_Invoke(typeinfo, &WshShell3.IWshShell3_iface, dispIdMember, wFlags,
1203 pDispParams, pVarResult, pExcepInfo, puArgErr);
1204 ITypeInfo_Release(typeinfo);
1205 }
1206
1207 return hr;
1208}
1209
1210static HRESULT WINAPI WshShell3_get_SpecialFolders(IWshShell3 *iface, IWshCollection **folders)
1211{
1212 TRACE("(%p)\n", folders);
1213 return WshCollection_Create(folders);
1214}
1215
1216static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *type, IWshEnvironment **env)
1217{
1218 FIXME("(%s %p): semi-stub\n", debugstr_variant(type), env);
1219 return WshEnvironment_Create(env);
1220}
1221
1223{
1224 return V_VT(arg) == VT_ERROR && V_ERROR(arg) == DISP_E_PARAMNOTFOUND;
1225}
1226
1228{
1229 WCHAR *ret, *ptr;
1230 BOOL in_quotes = FALSE;
1231
1232 if (!(ret = heap_alloc((lstrlenW(cmd) + 1) * sizeof(WCHAR)))) return NULL;
1233 lstrcpyW( ret, cmd );
1234
1235 *params = NULL;
1236 for (ptr = ret; *ptr; ptr++)
1237 {
1238 if (*ptr == '"') in_quotes = !in_quotes;
1239 else if (*ptr == ' ' && !in_quotes)
1240 {
1241 *ptr = 0;
1242 *params = ptr + 1;
1243 break;
1244 }
1245 }
1246
1247 return ret;
1248}
1249
1251{
1253 int waitforprocess;
1254 WCHAR *file, *params;
1255 VARIANT s;
1256 HRESULT hr;
1257 BOOL ret;
1258
1259 TRACE("(%s %s %s %p)\n", debugstr_w(cmd), debugstr_variant(style), debugstr_variant(wait), exit_code);
1260
1261 if (!style || !wait || !exit_code)
1262 return E_POINTER;
1263
1264 VariantInit(&s);
1265#ifdef __REACTOS__
1267 {
1268 V_VT(&s) = VT_I4;
1269 V_I4(&s) = SW_SHOW;
1270 hr = S_OK;
1271 }
1272 else
1273#endif
1274 hr = VariantChangeType(&s, style, 0, VT_I4);
1275 if (FAILED(hr))
1276 {
1277 ERR("failed to convert style argument, 0x%08x\n", hr);
1278 return hr;
1279 }
1280
1281 if (is_optional_argument(wait))
1282 waitforprocess = 0;
1283 else {
1284 VARIANT w;
1285
1286 VariantInit(&w);
1287 hr = VariantChangeType(&w, wait, 0, VT_I4);
1288 if (FAILED(hr))
1289 return hr;
1290
1291 waitforprocess = V_I4(&w);
1292 }
1293
1294 if (!(file = split_command(cmd, &params))) return E_OUTOFMEMORY;
1295
1296 memset(&info, 0, sizeof(info));
1297 info.cbSize = sizeof(info);
1299 info.lpFile = file;
1300 info.lpParameters = params;
1301 info.nShow = V_I4(&s);
1302
1304 heap_free( file );
1305 if (!ret)
1306 {
1307 TRACE("ShellExecute failed, %d\n", GetLastError());
1309 }
1310 else
1311 {
1312 if (waitforprocess)
1313 {
1316 CloseHandle(info.hProcess);
1317 }
1318 else
1319 *exit_code = 0;
1320
1321 return S_OK;
1322 }
1323}
1324
1326{
1331};
1332
1334{
1335 static const WCHAR defaulttitleW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0};
1336 struct popup_thread_param *param = (struct popup_thread_param *)arg;
1337
1338 param->button = MessageBoxW(NULL, param->text, is_optional_argument(&param->title) ?
1339 defaulttitleW : V_BSTR(&param->title), V_I4(&param->type));
1340 return 0;
1341}
1342
1343static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title,
1344 VARIANT *type, int *button)
1345{
1347 DWORD tid, status;
1349 HANDLE hthread;
1350 HRESULT hr;
1351
1352 TRACE("(%s %s %s %s %p)\n", debugstr_w(text), debugstr_variant(seconds_to_wait), debugstr_variant(title),
1354
1355 if (!seconds_to_wait || !title || !type || !button)
1356 return E_POINTER;
1357
1359 if (!is_optional_argument(seconds_to_wait))
1360 {
1361 hr = VariantChangeType(&timeout, seconds_to_wait, 0, VT_I4);
1362 if (FAILED(hr))
1363 return hr;
1364 }
1365#ifdef __REACTOS__
1366 else
1367 {
1369 }
1370#endif
1371
1372 VariantInit(&param.type);
1374 {
1375 hr = VariantChangeType(&param.type, type, 0, VT_I4);
1376 if (FAILED(hr))
1377 return hr;
1378 }
1379#ifdef __REACTOS__
1380 else
1381 {
1382 VariantChangeType(&param.type, &param.type, 0, VT_I4);
1383 }
1384#endif
1385
1387 param.title = *title;
1388 else
1389 {
1390 VariantInit(&param.title);
1391 hr = VariantChangeType(&param.title, title, 0, VT_BSTR);
1392 if (FAILED(hr))
1393 return hr;
1394 }
1395
1396 param.text = text;
1397 param.button = -1;
1398 hthread = CreateThread(NULL, 0, popup_thread_proc, &param, 0, &tid);
1399 status = MsgWaitForMultipleObjects(1, &hthread, FALSE, V_I4(&timeout) ? V_I4(&timeout) * 1000: INFINITE, 0);
1400 if (status == WAIT_TIMEOUT)
1401 {
1403 MsgWaitForMultipleObjects(1, &hthread, FALSE, INFINITE, 0);
1404 param.button = -1;
1405 }
1406 *button = param.button;
1407
1408 VariantClear(&param.title);
1409 CloseHandle(hthread);
1410
1411 return S_OK;
1412}
1413
1414static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch** Shortcut)
1415{
1416 TRACE("(%s %p)\n", debugstr_w(PathLink), Shortcut);
1417 return WshShortcut_Create(PathLink, Shortcut);
1418}
1419
1421{
1422 DWORD ret;
1423
1424 TRACE("(%s %p)\n", debugstr_w(Src), Dst);
1425
1426 if (!Src || !Dst) return E_POINTER;
1427
1430 if (!*Dst) return E_OUTOFMEMORY;
1431
1432 if (ExpandEnvironmentStringsW(Src, *Dst, ret))
1433 return S_OK;
1434 else
1435 {
1437 *Dst = NULL;
1439 }
1440}
1441
1443{
1444 static const struct {
1445 const WCHAR full[20];
1446 const WCHAR abbrev[5];
1447 HKEY hkey;
1448 } rootkeys[] = {
1449 { {'H','K','E','Y','_','C','U','R','R','E','N','T','_','U','S','E','R',0}, {'H','K','C','U',0}, HKEY_CURRENT_USER },
1450 { {'H','K','E','Y','_','L','O','C','A','L','_','M','A','C','H','I','N','E',0}, {'H','K','L','M',0}, HKEY_LOCAL_MACHINE },
1451 { {'H','K','E','Y','_','C','L','A','S','S','E','S','_','R','O','O','T',0}, {'H','K','C','R',0}, HKEY_CLASSES_ROOT },
1452 { {'H','K','E','Y','_','U','S','E','R','S',0}, {0}, HKEY_USERS },
1453 { {'H','K','E','Y','_','C','U','R','R','E','N','T','_','C','O','N','F','I','G',0}, {0}, HKEY_CURRENT_CONFIG }
1454 };
1455 int i;
1456
1457 for (i = 0; i < ARRAY_SIZE(rootkeys); i++) {
1458 if (!wcsncmp(path, rootkeys[i].full, lstrlenW(rootkeys[i].full)))
1459 return rootkeys[i].hkey;
1460 if (rootkeys[i].abbrev[0] && !wcsncmp(path, rootkeys[i].abbrev, lstrlenW(rootkeys[i].abbrev)))
1461 return rootkeys[i].hkey;
1462 }
1463
1464 return NULL;
1465}
1466
1467/* Caller is responsible to free 'subkey' if 'value' is not NULL */
1468static HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey, WCHAR **value)
1469{
1470 *value = NULL;
1471
1472 /* at least one separator should be present */
1473 *subkey = wcschr(path, '\\');
1474 if (!*subkey)
1476
1477 /* default value or not */
1478 if ((*subkey)[lstrlenW(*subkey)-1] == '\\') {
1479 (*subkey)++;
1480 *value = NULL;
1481 }
1482 else {
1483 *value = wcsrchr(*subkey, '\\');
1484 if (*value - *subkey > 1) {
1485 unsigned int len = *value - *subkey - 1;
1486 WCHAR *ret;
1487
1488 ret = heap_alloc((len + 1)*sizeof(WCHAR));
1489 if (!ret)
1490 return E_OUTOFMEMORY;
1491
1492 memcpy(ret, *subkey + 1, len*sizeof(WCHAR));
1493 ret[len] = 0;
1494 *subkey = ret;
1495 }
1496 (*value)++;
1497 }
1498
1499 return S_OK;
1500}
1501
1503{
1505 WCHAR *subkey, *val;
1506 HRESULT hr;
1507 HKEY root;
1508
1509 TRACE("(%s %p)\n", debugstr_w(name), value);
1510
1511 if (!name || !value)
1512 return E_POINTER;
1513
1515 if (!root)
1517
1518 hr = split_reg_path(name, &subkey, &val);
1519 if (FAILED(hr))
1520 return hr;
1521
1522 type = REG_NONE;
1523 datalen = 0;
1524 ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, NULL, &datalen);
1525 if (ret == ERROR_SUCCESS) {
1526 void *data;
1527
1529 if (!data) {
1530 hr = E_OUTOFMEMORY;
1531 goto fail;
1532 }
1533
1534 ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, data, &datalen);
1535 if (ret) {
1536 heap_free(data);
1538 goto fail;
1539 }
1540
1541 switch (type) {
1542 case REG_SZ:
1543 case REG_EXPAND_SZ:
1544 V_VT(value) = VT_BSTR;
1546 if (!V_BSTR(value))
1547 hr = E_OUTOFMEMORY;
1548 break;
1549 case REG_DWORD:
1550 V_VT(value) = VT_I4;
1551 V_I4(value) = *(DWORD*)data;
1552 break;
1553 case REG_BINARY:
1554 {
1555 BYTE *ptr = (BYTE*)data;
1556 SAFEARRAYBOUND bound;
1557 unsigned int i;
1558 SAFEARRAY *sa;
1559 VARIANT *v;
1560
1561 bound.lLbound = 0;
1562 bound.cElements = datalen;
1563 sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
1564 if (!sa)
1565 break;
1566
1567 hr = SafeArrayAccessData(sa, (void**)&v);
1568 if (FAILED(hr)) {
1570 break;
1571 }
1572
1573 for (i = 0; i < datalen; i++) {
1574 V_VT(&v[i]) = VT_UI1;
1575 V_UI1(&v[i]) = ptr[i];
1576 }
1578
1580 V_ARRAY(value) = sa;
1581 break;
1582 }
1583 case REG_MULTI_SZ:
1584 {
1585 WCHAR *ptr = (WCHAR*)data;
1586 SAFEARRAYBOUND bound;
1587 SAFEARRAY *sa;
1588 VARIANT *v;
1589
1590 /* get element count first */
1591 bound.lLbound = 0;
1592 bound.cElements = 0;
1593 while (*ptr) {
1594 bound.cElements++;
1595 ptr += lstrlenW(ptr)+1;
1596 }
1597
1598 sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
1599 if (!sa)
1600 break;
1601
1602 hr = SafeArrayAccessData(sa, (void**)&v);
1603 if (FAILED(hr)) {
1605 break;
1606 }
1607
1608 ptr = (WCHAR*)data;
1609 while (*ptr) {
1610 V_VT(v) = VT_BSTR;
1612 ptr += lstrlenW(ptr)+1;
1613 v++;
1614 }
1615
1618 V_ARRAY(value) = sa;
1619 break;
1620 }
1621 default:
1622 FIXME("value type %d not supported\n", type);
1623 hr = E_FAIL;
1624 };
1625
1626 heap_free(data);
1627 if (FAILED(hr))
1629 }
1630 else
1632
1633fail:
1634 if (val)
1635 heap_free(subkey);
1636 return hr;
1637}
1638
1640{
1641 static const WCHAR regexpandszW[] = {'R','E','G','_','E','X','P','A','N','D','_','S','Z',0};
1642 static const WCHAR regszW[] = {'R','E','G','_','S','Z',0};
1643 static const WCHAR regdwordW[] = {'R','E','G','_','D','W','O','R','D',0};
1644 static const WCHAR regbinaryW[] = {'R','E','G','_','B','I','N','A','R','Y',0};
1645
1646 DWORD regtype, data_len;
1647 WCHAR *subkey, *val;
1648 const BYTE *data;
1649 HRESULT hr;
1650 HKEY root;
1651 VARIANT v;
1652 LONG ret;
1653
1655
1656 if (!name || !value || !type)
1657 return E_POINTER;
1658
1660 if (!root)
1662
1663 /* value type */
1665 regtype = REG_SZ;
1666 else {
1667 if (V_VT(type) != VT_BSTR)
1668 return E_INVALIDARG;
1669
1670 if (!wcscmp(V_BSTR(type), regszW))
1671 regtype = REG_SZ;
1672 else if (!wcscmp(V_BSTR(type), regdwordW))
1673 regtype = REG_DWORD;
1674 else if (!wcscmp(V_BSTR(type), regexpandszW))
1675 regtype = REG_EXPAND_SZ;
1676 else if (!wcscmp(V_BSTR(type), regbinaryW))
1677 regtype = REG_BINARY;
1678 else {
1679 FIXME("unrecognized value type %s\n", debugstr_w(V_BSTR(type)));
1680 return E_FAIL;
1681 }
1682 }
1683
1684 /* it's always a string or a DWORD */
1685 VariantInit(&v);
1686 switch (regtype)
1687 {
1688 case REG_SZ:
1689 case REG_EXPAND_SZ:
1691 if (hr == S_OK) {
1692 data = (BYTE*)V_BSTR(&v);
1693 data_len = SysStringByteLen(V_BSTR(&v)) + sizeof(WCHAR);
1694 }
1695 break;
1696 case REG_DWORD:
1697 case REG_BINARY:
1698 hr = VariantChangeType(&v, value, 0, VT_I4);
1699 data = (BYTE*)&V_I4(&v);
1700 data_len = sizeof(DWORD);
1701 break;
1702 default:
1703 FIXME("unexpected regtype %d\n", regtype);
1704 return E_FAIL;
1705 };
1706
1707 if (FAILED(hr)) {
1708 FIXME("failed to convert value, regtype %d, 0x%08x\n", regtype, hr);
1709 return hr;
1710 }
1711
1712 hr = split_reg_path(name, &subkey, &val);
1713 if (FAILED(hr))
1714 goto fail;
1715
1716 ret = RegSetKeyValueW(root, subkey, val, regtype, data, data_len);
1717 if (ret)
1719
1720fail:
1721 VariantClear(&v);
1722 if (val)
1723 heap_free(subkey);
1724 return hr;
1725}
1726
1727static HRESULT WINAPI WshShell3_RegDelete(IWshShell3 *iface, BSTR Name)
1728{
1729 FIXME("(%s): stub\n", debugstr_w(Name));
1730 return E_NOTIMPL;
1731}
1732
1734{
1735 FIXME("(%s %s %s %p): stub\n", debugstr_variant(Type), debugstr_w(Message), debugstr_w(Target), out_Success);
1736 return E_NOTIMPL;
1737}
1738
1739static HRESULT WINAPI WshShell3_AppActivate(IWshShell3 *iface, VARIANT *App, VARIANT *Wait, VARIANT_BOOL *out_Success)
1740{
1741 FIXME("(%s %s %p): stub\n", debugstr_variant(App), debugstr_variant(Wait), out_Success);
1742 return E_NOTIMPL;
1743}
1744
1745static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *Wait)
1746{
1747 FIXME("(%s %p): stub\n", debugstr_w(Keys), Wait);
1748 return E_NOTIMPL;
1749}
1750
1751static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec **ret)
1752{
1753 TRACE("(%s %p)\n", debugstr_w(command), ret);
1754
1755 if (!ret)
1756 return E_POINTER;
1757
1758 if (!command)
1759 return DISP_E_EXCEPTION;
1760
1761 return WshExec_create(command, ret);
1762}
1763
1765{
1766 DWORD ret;
1767
1768 TRACE("(%p)\n", dir);
1769
1771 if (!ret)
1773
1775 if (!*dir)
1776 return E_OUTOFMEMORY;
1777
1779 if (!ret) {
1781 *dir = NULL;
1783 }
1784
1785 return S_OK;
1786}
1787
1789{
1790 TRACE("(%s)\n", debugstr_w(dir));
1791
1792 if (!dir)
1793 return E_INVALIDARG;
1794
1797
1798 return S_OK;
1799}
1800
1801static const IWshShell3Vtbl WshShell3Vtbl = {
1824};
1825
1827{
1828 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
1829
1832 return IWshShell3_QueryInterface(&WshShell3.IWshShell3_iface, riid, ppv);
1833}
PRTL_UNICODE_STRING_BUFFER Path
Type
Definition: Type.h:7
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
Arabic default style
Definition: afstyles.h:94
unsigned int dir
Definition: maze.c:112
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
struct _root root
LPARAM lParam
Definition: combotst.c:139
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:171
#define WAIT_TIMEOUT
Definition: dderror.h:14
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
LPWSTR Name
Definition: desk.c:124
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
LONG WINAPI RegSetKeyValueW(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValueName OPTIONAL, IN DWORD dwType, IN LPCVOID lpData OPTIONAL, IN DWORD cbData)
Definition: reg.c:2139
static const WCHAR Description[]
Definition: oid.c:1266
#define CloseHandle
Definition: compat.h:739
#define wcschr
Definition: compat.h:17
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756
#define wcsrchr
Definition: compat.h:16
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpyW
Definition: compat.h:749
short VARIANT_BOOL
Definition: compat.h:2290
@ VT_BSTR
Definition: compat.h:2303
@ VT_ERROR
Definition: compat.h:2305
@ VT_ARRAY
Definition: compat.h:2341
@ VT_VARIANT
Definition: compat.h:2307
@ VT_I4
Definition: compat.h:2298
@ VT_UI1
Definition: compat.h:2311
#define wcsicmp
Definition: compat.h:15
#define lstrlenW
Definition: compat.h:750
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2249
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW(LPCWSTR lpApplicationName, LPWSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCWSTR lpCurrentDirectory, LPSTARTUPINFOW lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4600
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1534
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
LCID lcid
Definition: locale.c:5656
const WCHAR * text
Definition: package.c:1794
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static const WCHAR desktopW[]
Definition: main.c:46
HRESULT WINAPI SafeArrayAccessData(SAFEARRAY *psa, void **ppvData)
Definition: safearray.c:1137
HRESULT WINAPI SafeArrayUnaccessData(SAFEARRAY *psa)
Definition: safearray.c:1168
HRESULT WINAPI SafeArrayDestroy(SAFEARRAY *psa)
Definition: safearray.c:1347
SAFEARRAY *WINAPI SafeArrayCreate(VARTYPE vt, UINT cDims, SAFEARRAYBOUND *rgsabound)
Definition: safearray.c:600
static const WCHAR IconPath[]
Definition: install.c:51
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
MIXER_STATUS Enum(IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutKey)
Definition: mmixer.c:220
#define swprintf
Definition: precomp.h:40
static const WCHAR Message[]
Definition: register.c:74
static ULONG WINAPI WshExec_Release(IWshExec *iface)
Definition: shell.c:129
static HRESULT WINAPI WshShell3_GetTypeInfoCount(IWshShell3 *iface, UINT *pctinfo)
Definition: shell.c:1159
static HRESULT WINAPI WshShortcut_get_WindowStyle(IWshShortcut *iface, int *ShowCmd)
Definition: shell.c:990
static HRESULT WINAPI WshCollection_QueryInterface(IWshCollection *iface, REFIID riid, void **ppv)
Definition: shell.c:541
static WshShellImpl WshShell3
Definition: shell.c:41
static HRESULT WINAPI WshEnvironment_GetTypeInfoCount(IWshEnvironment *iface, UINT *pctinfo)
Definition: shell.c:396
static HRESULT WINAPI WshShortcut_put_Hotkey(IWshShortcut *iface, BSTR Hotkey)
Definition: shell.c:907
static HRESULT WINAPI WshShell3_AppActivate(IWshShell3 *iface, VARIANT *App, VARIANT *Wait, VARIANT_BOOL *out_Success)
Definition: shell.c:1739
static WshEnvironment * impl_from_IWshEnvironment(IWshEnvironment *iface)
Definition: shell.c:85
static HRESULT WINAPI WshShortcut_put_Arguments(IWshShortcut *iface, BSTR Arguments)
Definition: shell.c:877
static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments)
Definition: shell.c:856
static HRESULT WINAPI WshShell3_RegDelete(IWshShell3 *iface, BSTR Name)
Definition: shell.c:1727
static HRESULT WINAPI WshCollection_Item(IWshCollection *iface, VARIANT *index, VARIANT *value)
Definition: shell.c:642
static HRESULT WshEnvironment_Create(IWshEnvironment **env)
Definition: shell.c:525
static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR *WorkingDirectory)
Definition: shell.c:1004
static HRESULT WINAPI WshExec_Terminate(IWshExec *iface)
Definition: shell.c:286
static HRESULT WINAPI WshShell3_get_CurrentDirectory(IWshShell3 *iface, BSTR *dir)
Definition: shell.c:1764
static HRESULT WINAPI WshCollection_Invoke(IWshCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: shell.c:621
static WshExecImpl * impl_from_IWshExec(IWshExec *iface)
Definition: shell.c:90
static ULONG WINAPI WshShell3_Release(IWshShell3 *iface)
Definition: shell.c:1153
static HRESULT WINAPI WshEnvironment__NewEnum(IWshEnvironment *iface, IUnknown **penum)
Definition: shell.c:495
static HRESULT WINAPI WshExec_QueryInterface(IWshExec *iface, REFIID riid, void **obj)
Definition: shell.c:95
static HRESULT WINAPI WshShortcut_put_WorkingDirectory(IWshShortcut *iface, BSTR WorkingDirectory)
Definition: shell.c:1023
static HRESULT WINAPI WshEnvironment_GetTypeInfo(IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:404
static ULONG WINAPI WshShell3_AddRef(IWshShell3 *iface)
Definition: shell.c:1147
static HRESULT WINAPI WshShortcut_put_RelativePath(IWshShortcut *iface, BSTR rhs)
Definition: shell.c:969
static HRESULT WINAPI WshShortcut_put_TargetPath(IWshShortcut *iface, BSTR Path)
Definition: shell.c:983
static HRESULT WINAPI WshExec_GetTypeInfo(IWshExec *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:152
static HRESULT WINAPI WshShortcut_get_Description(IWshShortcut *iface, BSTR *Description)
Definition: shell.c:886
static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *value, VARIANT *type)
Definition: shell.c:1639
static HRESULT WshExec_create(BSTR command, IWshExec **ret)
Definition: shell.c:326
static const IWshShortcutVtbl WshShortcutVtbl
Definition: shell.c:1052
static HRESULT WINAPI WshCollection_GetTypeInfo(IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:595
static HRESULT WINAPI WshEnvironment_put_Item(IWshEnvironment *iface, BSTR name, BSTR value)
Definition: shell.c:474
static HRESULT WINAPI WshExec_get_StdIn(IWshExec *iface, ITextStream **stream)
Definition: shell.c:227
static const IWshShell3Vtbl WshShell3Vtbl
Definition: shell.c:1801
static HRESULT WINAPI WshShortcut_put_WindowStyle(IWshShortcut *iface, int ShowCmd)
Definition: shell.c:997
static HRESULT WINAPI WshShortcut_Load(IWshShortcut *iface, BSTR PathLink)
Definition: shell.c:1030
static HRESULT WINAPI WshExec_GetIDsOfNames(IWshExec *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:159
static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *wait, DWORD *exit_code)
Definition: shell.c:1250
static HRESULT WINAPI WshEnvironment_get_length(IWshEnvironment *iface, LONG *len)
Definition: shell.c:488
static HRESULT WINAPI WshEnvironment_get_Item(IWshEnvironment *iface, BSTR name, BSTR *value)
Definition: shell.c:451
static BOOL CALLBACK enum_thread_wnd_proc(HWND hwnd, LPARAM lParam)
Definition: shell.c:276
static HRESULT WINAPI WshShortcut_GetIDsOfNames(IWshShortcut *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:809
static HRESULT WINAPI WshShell3_get_SpecialFolders(IWshShell3 *iface, IWshCollection **folders)
Definition: shell.c:1210
static HRESULT WINAPI WshEnvironment_Invoke(IWshEnvironment *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: shell.c:430
static const IWshExecVtbl WshExecVtbl
Definition: shell.c:309
static const IWshEnvironmentVtbl WshEnvironmentVtbl
Definition: shell.c:509
static HRESULT WINAPI WshShortcut_get_TargetPath(IWshShortcut *iface, BSTR *Path)
Definition: shell.c:976
static HRESULT WINAPI WshExec_GetTypeInfoCount(IWshExec *iface, UINT *pctinfo)
Definition: shell.c:144
static HRESULT WINAPI WshShortcut_put_IconLocation(IWshShortcut *iface, BSTR IconPath)
Definition: shell.c:937
static HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey, WCHAR **value)
Definition: shell.c:1468
static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut *iface, BSTR *IconPath)
Definition: shell.c:914
static HRESULT WINAPI WshEnvironment_Remove(IWshEnvironment *iface, BSTR name)
Definition: shell.c:502
static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
Definition: shell.c:575
static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *Wait)
Definition: shell.c:1745
static HKEY get_root_key(const WCHAR *path)
Definition: shell.c:1442
static ULONG WINAPI WshShortcut_AddRef(IWshShortcut *iface)
Definition: shell.c:770
static HRESULT WINAPI WshEnvironment_QueryInterface(IWshEnvironment *iface, REFIID riid, void **obj)
Definition: shell.c:350
static HRESULT WINAPI WshShell3_GetTypeInfo(IWshShell3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:1166
static WshCollection * impl_from_IWshCollection(IWshCollection *iface)
Definition: shell.c:75
static HRESULT WINAPI WshShortcut_QueryInterface(IWshShortcut *iface, REFIID riid, void **ppv)
Definition: shell.c:744
static HRESULT WINAPI WshExec_get_ExitCode(IWshExec *iface, DWORD *code)
Definition: shell.c:267
static HRESULT WINAPI WshShell3_Invoke(IWshShell3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: shell.c:1190
static HRESULT WINAPI WshCollection_get_length(IWshCollection *iface, LONG *count)
Definition: shell.c:699
static HRESULT WINAPI WshShell3_QueryInterface(IWshShell3 *iface, REFIID riid, void **ppv)
Definition: shell.c:1115
static HRESULT WINAPI WshShell3_LogEvent(IWshShell3 *iface, VARIANT *Type, BSTR Message, BSTR Target, VARIANT_BOOL *out_Success)
Definition: shell.c:1733
static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *value)
Definition: shell.c:1502
static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
Definition: shell.c:778
static HRESULT WINAPI WshShell3_GetIDsOfNames(IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:1172
HRESULT WINAPI WshShellFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: shell.c:1826
static HRESULT WINAPI WshExec_get_StdErr(IWshExec *iface, ITextStream **stream)
Definition: shell.c:245
static ULONG WINAPI WshCollection_AddRef(IWshCollection *iface)
Definition: shell.c:567
static BOOL is_optional_argument(const VARIANT *arg)
Definition: shell.c:1222
static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec **ret)
Definition: shell.c:1751
static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name)
Definition: shell.c:849
static HRESULT WINAPI WshShortcut_GetTypeInfoCount(IWshShortcut *iface, UINT *pctinfo)
Definition: shell.c:794
static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
Definition: shell.c:384
static ULONG WINAPI WshEnvironment_AddRef(IWshEnvironment *iface)
Definition: shell.c:376
static HRESULT WINAPI WshShortcut_GetTypeInfo(IWshShortcut *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:802
static WCHAR * split_command(BSTR cmd, WCHAR **params)
Definition: shell.c:1227
static HRESULT WINAPI WshCollection__NewEnum(IWshCollection *iface, IUnknown **Enum)
Definition: shell.c:706
static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
Definition: shell.c:1080
static HRESULT WINAPI WshExec_Invoke(IWshExec *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: shell.c:178
static ULONG WINAPI WshExec_AddRef(IWshExec *iface)
Definition: shell.c:121
static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch **Shortcut)
Definition: shell.c:1414
static HRESULT WINAPI WshCollection_GetIDsOfNames(IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:602
static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *type, IWshEnvironment **env)
Definition: shell.c:1216
static HRESULT WINAPI WshShortcut_put_Description(IWshShortcut *iface, BSTR Description)
Definition: shell.c:893
static HRESULT WINAPI WshCollection_Count(IWshCollection *iface, LONG *count)
Definition: shell.c:692
static HRESULT WINAPI WshShortcut_Save(IWshShortcut *iface)
Definition: shell.c:1037
static HRESULT WINAPI WshExec_get_Status(IWshExec *iface, WshExecStatus *status)
Definition: shell.c:199
static HRESULT WINAPI WshShell3_ExpandEnvironmentStrings(IWshShell3 *iface, BSTR Src, BSTR *Dst)
Definition: shell.c:1420
static HRESULT WINAPI WshShortcut_Invoke(IWshShortcut *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: shell.c:828
static HRESULT WINAPI WshExec_get_ProcessID(IWshExec *iface, DWORD *pid)
Definition: shell.c:254
static const IWshCollectionVtbl WshCollectionVtbl
Definition: shell.c:713
static HRESULT WINAPI WshEnvironment_GetIDsOfNames(IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:411
static HRESULT WINAPI WshShell3_put_CurrentDirectory(IWshShell3 *iface, BSTR dir)
Definition: shell.c:1788
static WshShortcut * impl_from_IWshShortcut(IWshShortcut *iface)
Definition: shell.c:80
static HRESULT WshCollection_Create(IWshCollection **collection)
Definition: shell.c:727
static HRESULT WINAPI WshCollection_GetTypeInfoCount(IWshCollection *iface, UINT *pctinfo)
Definition: shell.c:587
static DWORD WINAPI popup_thread_proc(void *arg)
Definition: shell.c:1333
static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, VARIANT *type, int *button)
Definition: shell.c:1343
static HRESULT WINAPI WshExec_get_StdOut(IWshExec *iface, ITextStream **stream)
Definition: shell.c:236
static HRESULT WINAPI WshEnvironment_Count(IWshEnvironment *iface, LONG *count)
Definition: shell.c:481
static HRESULT WINAPI WshShortcut_get_Hotkey(IWshShortcut *iface, BSTR *Hotkey)
Definition: shell.c:900
return ret
Definition: mutex.c:146
#define INFINITE
Definition: serial.h:102
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
const GLdouble * v
Definition: gl.h:2040
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint index
Definition: glext.h:6031
GLenum const GLfloat * params
Definition: glext.h:5645
GLuint GLfloat * val
Definition: glext.h:7180
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
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 const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define iswspace(_c)
Definition: ctype.h:669
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static TfClientId tid
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1031
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
#define Dst
Definition: mesh.h:153
#define STILL_ACTIVE
Definition: minwinbase.h:43
LONG_PTR LPARAM
Definition: minwindef.h:175
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
DWORD button
Definition: button.c:166
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
static UINT exit_code
Definition: process.c:78
static LPOLESTR
Definition: stg_prop.c:27
static ICollection collection
Definition: typelib.c:184
static VARIANTARG static DISPID
Definition: ordinal.c:49
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1499
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define DWORD
Definition: nt_native.h:44
#define REG_NONE
Definition: nt_native.h:1495
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:215
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_ERROR(A)
Definition: oleauto.h:241
#define V_UI1(A)
Definition: oleauto.h:266
#define V_ARRAY(A)
Definition: oleauto.h:222
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
const GUID IID_IProvideClassInfo
const GUID IID_IDispatch
const GUID IID_IPersistFile
long LONG
Definition: pedump.c:60
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1490
static char title[]
Definition: ps.c:92
#define INFOTIPSIZE
Definition: commctrl.h:124
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define REFIID
Definition: guiddef.h:118
void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo)
Definition: scrrun.c:232
#define REG_DWORD
Definition: sdbapi.c:615
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
DWORD LCID
Definition: nls.h:13
#define memset(x, y, z)
Definition: compat.h:39
#define SEE_MASK_NOCLOSEPROCESS
Definition: shellapi.h:33
#define SEE_MASK_NOASYNC
Definition: shellapi.h:35
#define SEE_MASK_DEFAULT
Definition: shellapi.h:24
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2723
HRESULT hr
Definition: shlfolder.c:183
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2203
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2201
#define CSIDL_DESKTOP
Definition: shlobj.h:2179
#define TRACE(s)
Definition: solgame.cpp:4
LONG ref
Definition: shell.c:47
IWshCollection IWshCollection_iface
Definition: shell.c:46
LONG ref
Definition: shell.c:64
IWshEnvironment IWshEnvironment_iface
Definition: shell.c:63
IWshExec IWshExec_iface
Definition: shell.c:70
PROCESS_INFORMATION info
Definition: shell.c:72
LONG ref
Definition: shell.c:71
IWshShell3 IWshShell3_iface
Definition: shell.c:39
struct provideclassinfo classinfo
Definition: shell.c:38
BSTR path_link
Definition: shell.c:57
IWshShortcut IWshShortcut_iface
Definition: shell.c:53
LONG ref
Definition: shell.c:54
IShellLinkW * link
Definition: shell.c:56
Definition: ftp_var.h:139
Definition: inflate.c:139
Definition: fci.c:127
Definition: fci.c:116
Definition: name.c:39
WCHAR * text
Definition: shell.c:1327
VARIANT title
Definition: shell.c:1328
VARIANT type
Definition: shell.c:1329
Definition: send.c:48
Definition: ps.c:97
Definition: parse.h:23
Definition: dhcpd.h:248
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:96
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:962
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:648
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:568
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define WAIT_OBJECT_0
Definition: winbase.h:383
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
#define WINAPI
Definition: msvc.h:6
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:3616
#define E_NOINTERFACE
Definition: winerror.h:3479
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228
#define DISP_E_EXCEPTION
Definition: winerror.h:3621
#define E_POINTER
Definition: winerror.h:3480
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define RRF_RT_ANY
Definition: winreg.h:66
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
#define WM_CLOSE
Definition: winuser.h:1649
#define WM_QUIT
Definition: winuser.h:1651
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SW_SHOW
Definition: winuser.h:786
BOOL WINAPI EnumThreadWindows(_In_ DWORD, _In_ WNDENUMPROC, _In_ LPARAM)
@ IWshEnvironment_tid
Definition: wshom_private.h:34
@ IWshShortcut_tid
Definition: wshom_private.h:37
@ IWshExec_tid
Definition: wshom_private.h:35
@ IWshShell3_tid
Definition: wshom_private.h:36
@ IWshCollection_tid
Definition: wshom_private.h:33
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned char BYTE
Definition: xxhash.c:193