ReactOS 0.4.16-dev-1946-g52006dd
shell.c File Reference
#include "wshom_private.h"
#include "wshom.h"
#include "shellapi.h"
#include "shlobj.h"
#include "dispex.h"
#include "wine/debug.h"
#include "wine/heap.h"
Include dependency graph for shell.c:

Go to the source code of this file.

Classes

struct  WshShellImpl
 
struct  WshCollection
 
struct  WshShortcut
 
struct  WshEnvironment
 
struct  WshExecImpl
 
struct  popup_thread_param
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (wshom)
 
static WshCollectionimpl_from_IWshCollection (IWshCollection *iface)
 
static WshShortcutimpl_from_IWshShortcut (IWshShortcut *iface)
 
static WshEnvironmentimpl_from_IWshEnvironment (IWshEnvironment *iface)
 
static WshExecImplimpl_from_IWshExec (IWshExec *iface)
 
static HRESULT WINAPI WshExec_QueryInterface (IWshExec *iface, REFIID riid, void **obj)
 
static ULONG WINAPI WshExec_AddRef (IWshExec *iface)
 
static ULONG WINAPI WshExec_Release (IWshExec *iface)
 
static HRESULT WINAPI WshExec_GetTypeInfoCount (IWshExec *iface, UINT *pctinfo)
 
static HRESULT WINAPI WshExec_GetTypeInfo (IWshExec *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI WshExec_GetIDsOfNames (IWshExec *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI WshExec_Invoke (IWshExec *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI WshExec_get_Status (IWshExec *iface, WshExecStatus *status)
 
static HRESULT WINAPI WshExec_get_StdIn (IWshExec *iface, ITextStream **stream)
 
static HRESULT WINAPI WshExec_get_StdOut (IWshExec *iface, ITextStream **stream)
 
static HRESULT WINAPI WshExec_get_StdErr (IWshExec *iface, ITextStream **stream)
 
static HRESULT WINAPI WshExec_get_ProcessID (IWshExec *iface, DWORD *pid)
 
static HRESULT WINAPI WshExec_get_ExitCode (IWshExec *iface, DWORD *code)
 
static BOOL CALLBACK enum_thread_wnd_proc (HWND hwnd, LPARAM lParam)
 
static HRESULT WINAPI WshExec_Terminate (IWshExec *iface)
 
static HRESULT WshExec_create (BSTR command, IWshExec **ret)
 
static HRESULT WINAPI WshEnvironment_QueryInterface (IWshEnvironment *iface, REFIID riid, void **obj)
 
static ULONG WINAPI WshEnvironment_AddRef (IWshEnvironment *iface)
 
static ULONG WINAPI WshEnvironment_Release (IWshEnvironment *iface)
 
static HRESULT WINAPI WshEnvironment_GetTypeInfoCount (IWshEnvironment *iface, UINT *pctinfo)
 
static HRESULT WINAPI WshEnvironment_GetTypeInfo (IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI WshEnvironment_GetIDsOfNames (IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI WshEnvironment_Invoke (IWshEnvironment *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI WshEnvironment_get_Item (IWshEnvironment *iface, BSTR name, BSTR *value)
 
static HRESULT WINAPI WshEnvironment_put_Item (IWshEnvironment *iface, BSTR name, BSTR value)
 
static HRESULT WINAPI WshEnvironment_Count (IWshEnvironment *iface, LONG *count)
 
static HRESULT WINAPI WshEnvironment_get_length (IWshEnvironment *iface, LONG *len)
 
static HRESULT WINAPI WshEnvironment__NewEnum (IWshEnvironment *iface, IUnknown **penum)
 
static HRESULT WINAPI WshEnvironment_Remove (IWshEnvironment *iface, BSTR name)
 
static HRESULT WshEnvironment_Create (IWshEnvironment **env)
 
static HRESULT WINAPI WshCollection_QueryInterface (IWshCollection *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI WshCollection_AddRef (IWshCollection *iface)
 
static ULONG WINAPI WshCollection_Release (IWshCollection *iface)
 
static HRESULT WINAPI WshCollection_GetTypeInfoCount (IWshCollection *iface, UINT *pctinfo)
 
static HRESULT WINAPI WshCollection_GetTypeInfo (IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI WshCollection_GetIDsOfNames (IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI WshCollection_Invoke (IWshCollection *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI WshCollection_Item (IWshCollection *iface, VARIANT *index, VARIANT *value)
 
static HRESULT WINAPI WshCollection_Count (IWshCollection *iface, LONG *count)
 
static HRESULT WINAPI WshCollection_get_length (IWshCollection *iface, LONG *count)
 
static HRESULT WINAPI WshCollection__NewEnum (IWshCollection *iface, IUnknown **Enum)
 
static HRESULT WshCollection_Create (IWshCollection **collection)
 
static HRESULT WINAPI WshShortcut_QueryInterface (IWshShortcut *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI WshShortcut_AddRef (IWshShortcut *iface)
 
static ULONG WINAPI WshShortcut_Release (IWshShortcut *iface)
 
static HRESULT WINAPI WshShortcut_GetTypeInfoCount (IWshShortcut *iface, UINT *pctinfo)
 
static HRESULT WINAPI WshShortcut_GetTypeInfo (IWshShortcut *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI WshShortcut_GetIDsOfNames (IWshShortcut *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI WshShortcut_Invoke (IWshShortcut *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI WshShortcut_get_FullName (IWshShortcut *iface, BSTR *name)
 
static HRESULT WINAPI WshShortcut_get_Arguments (IWshShortcut *iface, BSTR *Arguments)
 
static HRESULT WINAPI WshShortcut_put_Arguments (IWshShortcut *iface, BSTR Arguments)
 
static HRESULT WINAPI WshShortcut_get_Description (IWshShortcut *iface, BSTR *Description)
 
static HRESULT WINAPI WshShortcut_put_Description (IWshShortcut *iface, BSTR Description)
 
static HRESULT WINAPI WshShortcut_get_Hotkey (IWshShortcut *iface, BSTR *Hotkey)
 
static HRESULT WINAPI WshShortcut_put_Hotkey (IWshShortcut *iface, BSTR Hotkey)
 
static HRESULT WINAPI WshShortcut_get_IconLocation (IWshShortcut *iface, BSTR *IconPath)
 
static HRESULT WINAPI WshShortcut_put_IconLocation (IWshShortcut *iface, BSTR IconPath)
 
static HRESULT WINAPI WshShortcut_put_RelativePath (IWshShortcut *iface, BSTR rhs)
 
static HRESULT WINAPI WshShortcut_get_TargetPath (IWshShortcut *iface, BSTR *Path)
 
static HRESULT WINAPI WshShortcut_put_TargetPath (IWshShortcut *iface, BSTR Path)
 
static HRESULT WINAPI WshShortcut_get_WindowStyle (IWshShortcut *iface, int *ShowCmd)
 
static HRESULT WINAPI WshShortcut_put_WindowStyle (IWshShortcut *iface, int ShowCmd)
 
static HRESULT WINAPI WshShortcut_get_WorkingDirectory (IWshShortcut *iface, BSTR *WorkingDirectory)
 
static HRESULT WINAPI WshShortcut_put_WorkingDirectory (IWshShortcut *iface, BSTR WorkingDirectory)
 
static HRESULT WINAPI WshShortcut_Load (IWshShortcut *iface, BSTR PathLink)
 
static HRESULT WINAPI WshShortcut_Save (IWshShortcut *iface)
 
static HRESULT WshShortcut_Create (const WCHAR *path, IDispatch **shortcut)
 
static HRESULT WINAPI WshShell3_QueryInterface (IWshShell3 *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI WshShell3_AddRef (IWshShell3 *iface)
 
static ULONG WINAPI WshShell3_Release (IWshShell3 *iface)
 
static HRESULT WINAPI WshShell3_GetTypeInfoCount (IWshShell3 *iface, UINT *pctinfo)
 
static HRESULT WINAPI WshShell3_GetTypeInfo (IWshShell3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
 
static HRESULT WINAPI WshShell3_GetIDsOfNames (IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
 
static HRESULT WINAPI WshShell3_Invoke (IWshShell3 *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
 
static HRESULT WINAPI WshShell3_get_SpecialFolders (IWshShell3 *iface, IWshCollection **folders)
 
static HRESULT WINAPI WshShell3_get_Environment (IWshShell3 *iface, VARIANT *type, IWshEnvironment **env)
 
static BOOL is_optional_argument (const VARIANT *arg)
 
static WCHARsplit_command (BSTR cmd, WCHAR **params)
 
static HRESULT WINAPI WshShell3_Run (IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *wait, DWORD *exit_code)
 
static DWORD WINAPI popup_thread_proc (void *arg)
 
static HRESULT WINAPI WshShell3_Popup (IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, VARIANT *type, int *button)
 
static HRESULT WINAPI WshShell3_CreateShortcut (IWshShell3 *iface, BSTR PathLink, IDispatch **Shortcut)
 
static HRESULT WINAPI WshShell3_ExpandEnvironmentStrings (IWshShell3 *iface, BSTR Src, BSTR *Dst)
 
static HKEY get_root_key (const WCHAR *path)
 
static HRESULT split_reg_path (const WCHAR *path, WCHAR **subkey, WCHAR **value)
 
static HRESULT WINAPI WshShell3_RegRead (IWshShell3 *iface, BSTR name, VARIANT *value)
 
static HRESULT WINAPI WshShell3_RegWrite (IWshShell3 *iface, BSTR name, VARIANT *value, VARIANT *type)
 
static HRESULT WINAPI WshShell3_RegDelete (IWshShell3 *iface, BSTR Name)
 
static HRESULT WINAPI WshShell3_LogEvent (IWshShell3 *iface, VARIANT *Type, BSTR Message, BSTR Target, VARIANT_BOOL *out_Success)
 
static HRESULT WINAPI WshShell3_AppActivate (IWshShell3 *iface, VARIANT *App, VARIANT *Wait, VARIANT_BOOL *out_Success)
 
static HRESULT WINAPI WshShell3_SendKeys (IWshShell3 *iface, BSTR Keys, VARIANT *Wait)
 
static HRESULT WINAPI WshShell3_Exec (IWshShell3 *iface, BSTR command, IWshExec **ret)
 
static HRESULT WINAPI WshShell3_get_CurrentDirectory (IWshShell3 *iface, BSTR *dir)
 
static HRESULT WINAPI WshShell3_put_CurrentDirectory (IWshShell3 *iface, BSTR dir)
 
HRESULT WINAPI WshShellFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 

Variables

static WshShellImpl WshShell3
 
static const IWshExecVtbl WshExecVtbl
 
static const IWshEnvironmentVtbl WshEnvironmentVtbl
 
static const IWshCollectionVtbl WshCollectionVtbl
 
static const IWshShortcutVtbl WshShortcutVtbl
 
static const IWshShell3Vtbl WshShell3Vtbl
 

Function Documentation

◆ enum_thread_wnd_proc()

static BOOL CALLBACK enum_thread_wnd_proc ( HWND  hwnd,
LPARAM  lParam 
)
static

Definition at line 276 of file shell.c.

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}
LPARAM lParam
Definition: combotst.c:139
#define TRUE
Definition: types.h:120
GLuint GLuint GLsizei count
Definition: gl.h:1545
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define WM_CLOSE
Definition: winuser.h:1649
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by WshExec_Terminate().

◆ get_root_key()

static HKEY get_root_key ( const WCHAR path)
static

Definition at line 1442 of file shell.c.

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}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define NULL
Definition: types.h:112
#define lstrlenW
Definition: compat.h:750
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
_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)
#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 HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by WshShell3_RegRead(), and WshShell3_RegWrite().

◆ impl_from_IWshCollection()

static WshCollection * impl_from_IWshCollection ( IWshCollection *  iface)
inlinestatic

◆ impl_from_IWshEnvironment()

◆ impl_from_IWshExec()

◆ impl_from_IWshShortcut()

◆ is_optional_argument()

static BOOL is_optional_argument ( const VARIANT arg)
inlinestatic

Definition at line 1222 of file shell.c.

1223{
1224 return V_VT(arg) == VT_ERROR && V_ERROR(arg) == DISP_E_PARAMNOTFOUND;
1225}
@ VT_ERROR
Definition: compat.h:2305
#define V_ERROR(A)
Definition: oleauto.h:241
#define V_VT(A)
Definition: oleauto.h:211
#define DISP_E_PARAMNOTFOUND
Definition: winerror.h:3616

Referenced by popup_thread_proc(), WshShell3_Popup(), WshShell3_RegWrite(), and WshShell3_Run().

◆ popup_thread_proc()

static DWORD WINAPI popup_thread_proc ( void arg)
static

Definition at line 1333 of file shell.c.

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}
static BOOL is_optional_argument(const VARIANT *arg)
Definition: shell.c:1222
GLfloat param
Definition: glext.h:5796
#define V_BSTR(A)
Definition: oleauto.h:226
#define V_I4(A)
Definition: oleauto.h:247
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)

Referenced by WshShell3_Popup().

◆ split_command()

static WCHAR * split_command ( BSTR  cmd,
WCHAR **  params 
)
static

Definition at line 1227 of file shell.c.

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}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
#define FALSE
Definition: types.h:117
#define lstrcpyW
Definition: compat.h:749
return ret
Definition: mutex.c:146
unsigned int BOOL
Definition: ntddk_ex.h:94
GLenum const GLfloat * params
Definition: glext.h:5645
static PVOID ptr
Definition: dispmode.c:27
Definition: ftp_var.h:139

Referenced by WshShell3_Run().

◆ split_reg_path()

static HRESULT split_reg_path ( const WCHAR path,
WCHAR **  subkey,
WCHAR **  value 
)
static

Definition at line 1468 of file shell.c.

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}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define wcschr
Definition: compat.h:17
#define wcsrchr
Definition: compat.h:16
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:52
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: pdh_main.c:96
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:228

Referenced by WshShell3_RegRead(), and WshShell3_RegWrite().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( wshom  )

◆ WshCollection__NewEnum()

static HRESULT WINAPI WshCollection__NewEnum ( IWshCollection *  iface,
IUnknown **  Enum 
)
static

Definition at line 706 of file shell.c.

707{
709 FIXME("(%p)->(%p): stub\n", This, Enum);
710 return E_NOTIMPL;
711}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define E_NOTIMPL
Definition: ddrawi.h:99
MIXER_STATUS Enum(IN PVOID EnumContext, IN ULONG DeviceIndex, OUT LPWSTR *DeviceName, OUT PHANDLE OutHandle, OUT PHANDLE OutKey)
Definition: mmixer.c:220
static WshCollection * impl_from_IWshCollection(IWshCollection *iface)
Definition: shell.c:75

◆ WshCollection_AddRef()

static ULONG WINAPI WshCollection_AddRef ( IWshCollection *  iface)
static

Definition at line 567 of file shell.c.

568{
571 TRACE("(%p) ref = %d\n", This, ref);
572 return ref;
573}
#define InterlockedIncrement
Definition: armddk.h:53
long LONG
Definition: pedump.c:60
#define TRACE(s)
Definition: solgame.cpp:4
Definition: send.c:48

◆ WshCollection_Count()

static HRESULT WINAPI WshCollection_Count ( IWshCollection *  iface,
LONG count 
)
static

Definition at line 692 of file shell.c.

693{
695 FIXME("(%p)->(%p): stub\n", This, count);
696 return E_NOTIMPL;
697}

◆ WshCollection_Create()

static HRESULT WshCollection_Create ( IWshCollection **  collection)
static

Definition at line 727 of file shell.c.

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}
static const IWshCollectionVtbl WshCollectionVtbl
Definition: shell.c:713
static ICollection collection
Definition: typelib.c:184
void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo)
Definition: scrrun.c:232

Referenced by WshShell3_get_SpecialFolders().

◆ WshCollection_get_length()

static HRESULT WINAPI WshCollection_get_length ( IWshCollection *  iface,
LONG count 
)
static

Definition at line 699 of file shell.c.

700{
702 FIXME("(%p)->(%p): stub\n", This, count);
703 return E_NOTIMPL;
704}

◆ WshCollection_GetIDsOfNames()

static HRESULT WINAPI WshCollection_GetIDsOfNames ( IWshCollection *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 602 of file shell.c.

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}
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:124
LCID lcid
Definition: locale.c:5656
REFIID riid
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
HRESULT hr
Definition: shlfolder.c:183
@ IWshCollection_tid
Definition: wshom_private.h:33

◆ WshCollection_GetTypeInfo()

static HRESULT WINAPI WshCollection_GetTypeInfo ( IWshCollection *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 595 of file shell.c.

596{
598 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
599 return get_typeinfo(IWshCollection_tid, ppTInfo);
600}

◆ WshCollection_GetTypeInfoCount()

static HRESULT WINAPI WshCollection_GetTypeInfoCount ( IWshCollection *  iface,
UINT pctinfo 
)
static

Definition at line 587 of file shell.c.

588{
590 TRACE("(%p)->(%p)\n", This, pctinfo);
591 *pctinfo = 1;
592 return S_OK;
593}

◆ WshCollection_Invoke()

static HRESULT WINAPI WshCollection_Invoke ( IWshCollection *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 621 of file shell.c.

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}
WINBASEAPI _In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon_undoc.h:337

◆ WshCollection_Item()

static HRESULT WINAPI WshCollection_Item ( IWshCollection *  iface,
VARIANT index,
VARIANT value 
)
static

Definition at line 642 of file shell.c.

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}
#define E_FAIL
Definition: ddrawi.h:102
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
@ VT_BSTR
Definition: compat.h:2303
#define wcsicmp
Definition: compat.h:15
static const WCHAR desktopW[]
Definition: main.c:46
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3384
GLuint index
Definition: glext.h:6031
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
#define debugstr_w
Definition: kernel32.h:32
static const char * debugstr_variant(const VARIANT *var)
Definition: container.c:46
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1490
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2203
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2201
#define CSIDL_DESKTOP
Definition: shlobj.h:2179
Definition: fci.c:116

◆ WshCollection_QueryInterface()

static HRESULT WINAPI WshCollection_QueryInterface ( IWshCollection *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 541 of file shell.c.

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}
const GUID IID_IUnknown
REFIID LPVOID * ppv
Definition: atlbase.h:39
const GUID IID_IProvideClassInfo
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
#define E_NOINTERFACE
Definition: winerror.h:3479

◆ WshCollection_Release()

static ULONG WINAPI WshCollection_Release ( IWshCollection *  iface)
static

Definition at line 575 of file shell.c.

576{
579 TRACE("(%p) ref = %d\n", This, ref);
580
581 if (!ref)
583
584 return ref;
585}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52

◆ WshEnvironment__NewEnum()

static HRESULT WINAPI WshEnvironment__NewEnum ( IWshEnvironment *  iface,
IUnknown **  penum 
)
static

Definition at line 495 of file shell.c.

496{
498 FIXME("(%p)->(%p): stub\n", This, penum);
499 return E_NOTIMPL;
500}
static WshEnvironment * impl_from_IWshEnvironment(IWshEnvironment *iface)
Definition: shell.c:85

◆ WshEnvironment_AddRef()

static ULONG WINAPI WshEnvironment_AddRef ( IWshEnvironment *  iface)
static

Definition at line 376 of file shell.c.

377{
380 TRACE("(%p) ref = %d\n", This, ref);
381 return ref;
382}

◆ WshEnvironment_Count()

static HRESULT WINAPI WshEnvironment_Count ( IWshEnvironment *  iface,
LONG count 
)
static

Definition at line 481 of file shell.c.

482{
484 FIXME("(%p)->(%p): stub\n", This, count);
485 return E_NOTIMPL;
486}

◆ WshEnvironment_Create()

static HRESULT WshEnvironment_Create ( IWshEnvironment **  env)
static

Definition at line 525 of file shell.c.

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}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:171
static const IWshEnvironmentVtbl WshEnvironmentVtbl
Definition: shell.c:509

Referenced by WshShell3_get_Environment().

◆ WshEnvironment_get_Item()

static HRESULT WINAPI WshEnvironment_get_Item ( IWshEnvironment *  iface,
BSTR  name,
BSTR value 
)
static

Definition at line 451 of file shell.c.

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}
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
unsigned long DWORD
Definition: ntddk_ex.h:95
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
Definition: name.c:39
#define E_POINTER
Definition: winerror.h:3480

◆ WshEnvironment_get_length()

static HRESULT WINAPI WshEnvironment_get_length ( IWshEnvironment *  iface,
LONG len 
)
static

Definition at line 488 of file shell.c.

489{
491 FIXME("(%p)->(%p): stub\n", This, len);
492 return E_NOTIMPL;
493}

◆ WshEnvironment_GetIDsOfNames()

static HRESULT WINAPI WshEnvironment_GetIDsOfNames ( IWshEnvironment *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 411 of file shell.c.

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}
@ IWshEnvironment_tid
Definition: wshom_private.h:34

◆ WshEnvironment_GetTypeInfo()

static HRESULT WINAPI WshEnvironment_GetTypeInfo ( IWshEnvironment *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 404 of file shell.c.

405{
407 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
408 return get_typeinfo(IWshEnvironment_tid, ppTInfo);
409}

◆ WshEnvironment_GetTypeInfoCount()

static HRESULT WINAPI WshEnvironment_GetTypeInfoCount ( IWshEnvironment *  iface,
UINT pctinfo 
)
static

Definition at line 396 of file shell.c.

397{
399 TRACE("(%p)->(%p)\n", This, pctinfo);
400 *pctinfo = 1;
401 return S_OK;
402}

◆ WshEnvironment_Invoke()

static HRESULT WINAPI WshEnvironment_Invoke ( IWshEnvironment *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 430 of file shell.c.

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}

◆ WshEnvironment_put_Item()

static HRESULT WINAPI WshEnvironment_put_Item ( IWshEnvironment *  iface,
BSTR  name,
BSTR  value 
)
static

Definition at line 474 of file shell.c.

475{
477 FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(name), debugstr_w(value));
478 return E_NOTIMPL;
479}

◆ WshEnvironment_QueryInterface()

static HRESULT WINAPI WshEnvironment_QueryInterface ( IWshEnvironment *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 350 of file shell.c.

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}

◆ WshEnvironment_Release()

static ULONG WINAPI WshEnvironment_Release ( IWshEnvironment *  iface)
static

Definition at line 384 of file shell.c.

385{
388 TRACE("(%p) ref = %d\n", This, ref);
389
390 if (!ref)
392
393 return ref;
394}

◆ WshEnvironment_Remove()

static HRESULT WINAPI WshEnvironment_Remove ( IWshEnvironment *  iface,
BSTR  name 
)
static

Definition at line 502 of file shell.c.

503{
505 FIXME("(%p)->(%s): stub\n", This, debugstr_w(name));
506 return E_NOTIMPL;
507}

◆ WshExec_AddRef()

static ULONG WINAPI WshExec_AddRef ( IWshExec *  iface)
static

Definition at line 121 of file shell.c.

122{
125 TRACE("(%p) ref = %d\n", This, ref);
126 return ref;
127}
static WshExecImpl * impl_from_IWshExec(IWshExec *iface)
Definition: shell.c:90

◆ WshExec_create()

static HRESULT WshExec_create ( BSTR  command,
IWshExec **  ret 
)
static

Definition at line 326 of file shell.c.

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}
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
static const IWshExecVtbl WshExecVtbl
Definition: shell.c:309
DWORD WINAPI GetLastError(void)
Definition: except.c:1042

Referenced by WshShell3_Exec().

◆ WshExec_get_ExitCode()

static HRESULT WINAPI WshExec_get_ExitCode ( IWshExec *  iface,
DWORD code 
)
static

Definition at line 267 of file shell.c.

268{
270
271 FIXME("(%p)->(%p): stub\n", This, code);
272
273 return E_NOTIMPL;
274}
Definition: inflate.c:139

◆ WshExec_get_ProcessID()

static HRESULT WINAPI WshExec_get_ProcessID ( IWshExec *  iface,
DWORD pid 
)
static

Definition at line 254 of file shell.c.

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}
#define E_INVALIDARG
Definition: ddrawi.h:101
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837

◆ WshExec_get_Status()

static HRESULT WINAPI WshExec_get_Status ( IWshExec *  iface,
WshExecStatus *  status 
)
static

Definition at line 199 of file shell.c.

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:
216 break;
217 case STILL_ACTIVE:
219 break;
220 default:
221 *status = WshFailed;
222 }
223
224 return S_OK;
225}
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
#define STILL_ACTIVE
Definition: minwinbase.h:43
Definition: ps.c:97

◆ WshExec_get_StdErr()

static HRESULT WINAPI WshExec_get_StdErr ( IWshExec *  iface,
ITextStream **  stream 
)
static

Definition at line 245 of file shell.c.

246{
248
249 FIXME("(%p)->(%p): stub\n", This, stream);
250
251 return E_NOTIMPL;
252}
Definition: parse.h:23

◆ WshExec_get_StdIn()

static HRESULT WINAPI WshExec_get_StdIn ( IWshExec *  iface,
ITextStream **  stream 
)
static

Definition at line 227 of file shell.c.

228{
230
231 FIXME("(%p)->(%p): stub\n", This, stream);
232
233 return E_NOTIMPL;
234}

◆ WshExec_get_StdOut()

static HRESULT WINAPI WshExec_get_StdOut ( IWshExec *  iface,
ITextStream **  stream 
)
static

Definition at line 236 of file shell.c.

237{
239
240 FIXME("(%p)->(%p): stub\n", This, stream);
241
242 return E_NOTIMPL;
243}

◆ WshExec_GetIDsOfNames()

static HRESULT WINAPI WshExec_GetIDsOfNames ( IWshExec *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 159 of file shell.c.

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}
@ IWshExec_tid
Definition: wshom_private.h:35

◆ WshExec_GetTypeInfo()

static HRESULT WINAPI WshExec_GetTypeInfo ( IWshExec *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 152 of file shell.c.

153{
155 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
156 return get_typeinfo(IWshExec_tid, ppTInfo);
157}

◆ WshExec_GetTypeInfoCount()

static HRESULT WINAPI WshExec_GetTypeInfoCount ( IWshExec *  iface,
UINT pctinfo 
)
static

Definition at line 144 of file shell.c.

145{
147 TRACE("(%p)->(%p)\n", This, pctinfo);
148 *pctinfo = 1;
149 return S_OK;
150}

◆ WshExec_Invoke()

static HRESULT WINAPI WshExec_Invoke ( IWshExec *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 178 of file shell.c.

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}

◆ WshExec_QueryInterface()

static HRESULT WINAPI WshExec_QueryInterface ( IWshExec *  iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 95 of file shell.c.

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}

◆ WshExec_Release()

static ULONG WINAPI WshExec_Release ( IWshExec *  iface)
static

Definition at line 129 of file shell.c.

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}
#define CloseHandle
Definition: compat.h:739

◆ WshExec_Terminate()

static HRESULT WINAPI WshExec_Terminate ( IWshExec *  iface)
static

Definition at line 286 of file shell.c.

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}
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1534
static BOOL CALLBACK enum_thread_wnd_proc(HWND hwnd, LPARAM lParam)
Definition: shell.c:276
LONG_PTR LPARAM
Definition: minwindef.h:175
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define WAIT_OBJECT_0
Definition: winbase.h:383
BOOL WINAPI EnumThreadWindows(_In_ DWORD, _In_ WNDENUMPROC, _In_ LPARAM)

◆ WshShell3_AddRef()

static ULONG WINAPI WshShell3_AddRef ( IWshShell3 *  iface)
static

Definition at line 1147 of file shell.c.

1148{
1149 TRACE("()\n");
1150 return 2;
1151}

◆ WshShell3_AppActivate()

static HRESULT WINAPI WshShell3_AppActivate ( IWshShell3 *  iface,
VARIANT App,
VARIANT Wait,
VARIANT_BOOL out_Success 
)
static

Definition at line 1739 of file shell.c.

1740{
1741 FIXME("(%s %s %p): stub\n", debugstr_variant(App), debugstr_variant(Wait), out_Success);
1742 return E_NOTIMPL;
1743}
_In_ WDFDPC _In_ BOOLEAN Wait
Definition: wdfdpc.h:170

◆ WshShell3_CreateShortcut()

static HRESULT WINAPI WshShell3_CreateShortcut ( IWshShell3 *  iface,
BSTR  PathLink,
IDispatch **  Shortcut 
)
static

Definition at line 1414 of file shell.c.

1415{
1416 TRACE("(%s %p)\n", debugstr_w(PathLink), Shortcut);
1417 return WshShortcut_Create(PathLink, Shortcut);
1418}
static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
Definition: shell.c:1080

◆ WshShell3_Exec()

static HRESULT WINAPI WshShell3_Exec ( IWshShell3 *  iface,
BSTR  command,
IWshExec **  ret 
)
static

Definition at line 1751 of file shell.c.

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}
static HRESULT WshExec_create(BSTR command, IWshExec **ret)
Definition: shell.c:326
#define DISP_E_EXCEPTION
Definition: winerror.h:3621

◆ WshShell3_ExpandEnvironmentStrings()

static HRESULT WINAPI WshShell3_ExpandEnvironmentStrings ( IWshShell3 *  iface,
BSTR  Src,
BSTR Dst 
)
static

Definition at line 1420 of file shell.c.

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}
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define Dst
Definition: mesh.h:153
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:271

◆ WshShell3_get_CurrentDirectory()

static HRESULT WINAPI WshShell3_get_CurrentDirectory ( IWshShell3 *  iface,
BSTR dir 
)
static

Definition at line 1764 of file shell.c.

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}
unsigned int dir
Definition: maze.c:112
#define GetCurrentDirectoryW(x, y)
Definition: compat.h:756

◆ WshShell3_get_Environment()

static HRESULT WINAPI WshShell3_get_Environment ( IWshShell3 *  iface,
VARIANT type,
IWshEnvironment **  env 
)
static

Definition at line 1216 of file shell.c.

1217{
1218 FIXME("(%s %p): semi-stub\n", debugstr_variant(type), env);
1219 return WshEnvironment_Create(env);
1220}
static HRESULT WshEnvironment_Create(IWshEnvironment **env)
Definition: shell.c:525
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ WshShell3_get_SpecialFolders()

static HRESULT WINAPI WshShell3_get_SpecialFolders ( IWshShell3 *  iface,
IWshCollection **  folders 
)
static

Definition at line 1210 of file shell.c.

1211{
1212 TRACE("(%p)\n", folders);
1213 return WshCollection_Create(folders);
1214}
static HRESULT WshCollection_Create(IWshCollection **collection)
Definition: shell.c:727

◆ WshShell3_GetIDsOfNames()

static HRESULT WINAPI WshShell3_GetIDsOfNames ( IWshShell3 *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 1172 of file shell.c.

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}
@ IWshShell3_tid
Definition: wshom_private.h:36

◆ WshShell3_GetTypeInfo()

static HRESULT WINAPI WshShell3_GetTypeInfo ( IWshShell3 *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 1166 of file shell.c.

1167{
1168 TRACE("(%u %u %p)\n", iTInfo, lcid, ppTInfo);
1169 return get_typeinfo(IWshShell3_tid, ppTInfo);
1170}

◆ WshShell3_GetTypeInfoCount()

static HRESULT WINAPI WshShell3_GetTypeInfoCount ( IWshShell3 *  iface,
UINT pctinfo 
)
static

Definition at line 1159 of file shell.c.

1160{
1161 TRACE("(%p)\n", pctinfo);
1162 *pctinfo = 1;
1163 return S_OK;
1164}

◆ WshShell3_Invoke()

static HRESULT WINAPI WshShell3_Invoke ( IWshShell3 *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 1190 of file shell.c.

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}
static WshShellImpl WshShell3
Definition: shell.c:41
IWshShell3 IWshShell3_iface
Definition: shell.c:39

◆ WshShell3_LogEvent()

static HRESULT WINAPI WshShell3_LogEvent ( IWshShell3 *  iface,
VARIANT Type,
BSTR  Message,
BSTR  Target,
VARIANT_BOOL out_Success 
)
static

Definition at line 1733 of file shell.c.

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}
Type
Definition: Type.h:7
static const WCHAR Message[]
Definition: register.c:74
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306

◆ WshShell3_Popup()

static HRESULT WINAPI WshShell3_Popup ( IWshShell3 *  iface,
BSTR  text,
VARIANT seconds_to_wait,
VARIANT title,
VARIANT type,
int button 
)
static

Definition at line 1343 of file shell.c.

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}
#define WAIT_TIMEOUT
Definition: dderror.h:14
@ VT_I4
Definition: compat.h:2298
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
const WCHAR * text
Definition: package.c:1794
static DWORD WINAPI popup_thread_proc(void *arg)
Definition: shell.c:1333
#define INFINITE
Definition: serial.h:102
static TfClientId tid
#define FAILED(hr)
Definition: intsafe.h:51
DWORD button
Definition: button.c:166
static char title[]
Definition: ps.c:92
Definition: dhcpd.h:248
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
#define WM_QUIT
Definition: winuser.h:1651
DWORD WINAPI MsgWaitForMultipleObjects(_In_ DWORD nCount, _In_reads_opt_(nCount) CONST HANDLE *pHandles, _In_ BOOL fWaitAll, _In_ DWORD dwMilliseconds, _In_ DWORD dwWakeMask)
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ WshShell3_put_CurrentDirectory()

static HRESULT WINAPI WshShell3_put_CurrentDirectory ( IWshShell3 *  iface,
BSTR  dir 
)
static

Definition at line 1788 of file shell.c.

1789{
1790 TRACE("(%s)\n", debugstr_w(dir));
1791
1792 if (!dir)
1793 return E_INVALIDARG;
1794
1797
1798 return S_OK;
1799}
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2249

◆ WshShell3_QueryInterface()

static HRESULT WINAPI WshShell3_QueryInterface ( IWshShell3 *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1115 of file shell.c.

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}
#define WARN(fmt,...)
Definition: precomp.h:61
struct provideclassinfo classinfo
Definition: shell.c:38

◆ WshShell3_RegDelete()

static HRESULT WINAPI WshShell3_RegDelete ( IWshShell3 *  iface,
BSTR  Name 
)
static

Definition at line 1727 of file shell.c.

1728{
1729 FIXME("(%s): stub\n", debugstr_w(Name));
1730 return E_NOTIMPL;
1731}
LPWSTR Name
Definition: desk.c:124

◆ WshShell3_RegRead()

static HRESULT WINAPI WshShell3_RegRead ( IWshShell3 *  iface,
BSTR  name,
VARIANT value 
)
static

Definition at line 1502 of file shell.c.

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}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
struct _root root
#define ERROR_SUCCESS
Definition: deptool.c:10
LSTATUS WINAPI RegGetValueW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD dwFlags, LPDWORD pdwType, PVOID pvData, LPDWORD pcbData)
Definition: reg.c:1931
@ VT_ARRAY
Definition: compat.h:2341
@ VT_VARIANT
Definition: compat.h:2307
@ VT_UI1
Definition: compat.h:2311
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 HRESULT split_reg_path(const WCHAR *path, WCHAR **subkey, WCHAR **value)
Definition: shell.c:1468
static HKEY get_root_key(const WCHAR *path)
Definition: shell.c:1442
const GLdouble * v
Definition: gl.h:2040
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLuint GLfloat * val
Definition: glext.h:7180
int const JOCTET unsigned int datalen
Definition: jpeglib.h:1031
#define REG_SZ
Definition: layer.c:22
#define REG_BINARY
Definition: nt_native.h:1499
#define REG_MULTI_SZ
Definition: nt_native.h:1504
#define REG_NONE
Definition: nt_native.h:1495
#define REG_EXPAND_SZ
Definition: nt_native.h:1497
#define V_UI1(A)
Definition: oleauto.h:266
#define V_ARRAY(A)
Definition: oleauto.h:222
#define REG_DWORD
Definition: sdbapi.c:615
#define RRF_RT_ANY
Definition: winreg.h:66
unsigned char BYTE
Definition: xxhash.c:193

◆ WshShell3_RegWrite()

static HRESULT WINAPI WshShell3_RegWrite ( IWshShell3 *  iface,
BSTR  name,
VARIANT value,
VARIANT type 
)
static

Definition at line 1639 of file shell.c.

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}
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
#define DWORD
Definition: nt_native.h:44
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:215
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

◆ WshShell3_Release()

static ULONG WINAPI WshShell3_Release ( IWshShell3 *  iface)
static

Definition at line 1153 of file shell.c.

1154{
1155 TRACE("()\n");
1156 return 2;
1157}

◆ WshShell3_Run()

static HRESULT WINAPI WshShell3_Run ( IWshShell3 *  iface,
BSTR  cmd,
VARIANT style,
VARIANT wait,
DWORD exit_code 
)
static

Definition at line 1250 of file shell.c.

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}
Arabic default style
Definition: afstyles.h:94
#define ERR(fmt,...)
Definition: precomp.h:57
static WCHAR * split_command(BSTR cmd, WCHAR **params)
Definition: shell.c:1227
GLdouble s
Definition: gl.h:2039
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
static UINT exit_code
Definition: process.c:78
#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
Definition: fci.c:127
#define SW_SHOW
Definition: winuser.h:786

◆ WshShell3_SendKeys()

static HRESULT WINAPI WshShell3_SendKeys ( IWshShell3 *  iface,
BSTR  Keys,
VARIANT Wait 
)
static

Definition at line 1745 of file shell.c.

1746{
1747 FIXME("(%s %p): stub\n", debugstr_w(Keys), Wait);
1748 return E_NOTIMPL;
1749}

◆ WshShellFactory_CreateInstance()

HRESULT WINAPI WshShellFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)

Definition at line 1826 of file shell.c.

1827{
1828 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
1829
1832 return IWshShell3_QueryInterface(&WshShell3.IWshShell3_iface, riid, ppv);
1833}
static const IWshShell3Vtbl WshShell3Vtbl
Definition: shell.c:1801

◆ WshShortcut_AddRef()

static ULONG WINAPI WshShortcut_AddRef ( IWshShortcut *  iface)
static

Definition at line 770 of file shell.c.

771{
774 TRACE("(%p) ref = %d\n", This, ref);
775 return ref;
776}
static WshShortcut * impl_from_IWshShortcut(IWshShortcut *iface)
Definition: shell.c:80

◆ WshShortcut_Create()

static HRESULT WshShortcut_Create ( const WCHAR path,
IDispatch **  shortcut 
)
static

Definition at line 1080 of file shell.c.

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}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
static const IWshShortcutVtbl WshShortcutVtbl
Definition: shell.c:1052

Referenced by WshShell3_CreateShortcut().

◆ WshShortcut_get_Arguments()

static HRESULT WINAPI WshShortcut_get_Arguments ( IWshShortcut *  iface,
BSTR Arguments 
)
static

Definition at line 856 of file shell.c.

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}
#define INFOTIPSIZE
Definition: commctrl.h:124

◆ WshShortcut_get_Description()

static HRESULT WINAPI WshShortcut_get_Description ( IWshShortcut *  iface,
BSTR Description 
)
static

Definition at line 886 of file shell.c.

887{
889 FIXME("(%p)->(%p): stub\n", This, Description);
890 return E_NOTIMPL;
891}
static const WCHAR Description[]
Definition: oid.c:1266

◆ WshShortcut_get_FullName()

static HRESULT WINAPI WshShortcut_get_FullName ( IWshShortcut *  iface,
BSTR name 
)
static

Definition at line 849 of file shell.c.

850{
852 FIXME("(%p)->(%p): stub\n", This, name);
853 return E_NOTIMPL;
854}

◆ WshShortcut_get_Hotkey()

static HRESULT WINAPI WshShortcut_get_Hotkey ( IWshShortcut *  iface,
BSTR Hotkey 
)
static

Definition at line 900 of file shell.c.

901{
903 FIXME("(%p)->(%p): stub\n", This, Hotkey);
904 return E_NOTIMPL;
905}

◆ WshShortcut_get_IconLocation()

static HRESULT WINAPI WshShortcut_get_IconLocation ( IWshShortcut *  iface,
BSTR IconPath 
)
static

Definition at line 914 of file shell.c.

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}
static const WCHAR IconPath[]
Definition: install.c:51
#define swprintf
Definition: precomp.h:40

◆ WshShortcut_get_TargetPath()

static HRESULT WINAPI WshShortcut_get_TargetPath ( IWshShortcut *  iface,
BSTR Path 
)
static

Definition at line 976 of file shell.c.

977{
979 FIXME("(%p)->(%p): stub\n", This, Path);
980 return E_NOTIMPL;
981}
PRTL_UNICODE_STRING_BUFFER Path

◆ WshShortcut_get_WindowStyle()

static HRESULT WINAPI WshShortcut_get_WindowStyle ( IWshShortcut *  iface,
int ShowCmd 
)
static

Definition at line 990 of file shell.c.

991{
993 TRACE("(%p)->(%p)\n", This, ShowCmd);
994 return IShellLinkW_GetShowCmd(This->link, ShowCmd);
995}

◆ WshShortcut_get_WorkingDirectory()

static HRESULT WINAPI WshShortcut_get_WorkingDirectory ( IWshShortcut *  iface,
BSTR WorkingDirectory 
)
static

Definition at line 1004 of file shell.c.

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}

◆ WshShortcut_GetIDsOfNames()

static HRESULT WINAPI WshShortcut_GetIDsOfNames ( IWshShortcut *  iface,
REFIID  riid,
LPOLESTR rgszNames,
UINT  cNames,
LCID  lcid,
DISPID rgDispId 
)
static

Definition at line 809 of file shell.c.

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}
@ IWshShortcut_tid
Definition: wshom_private.h:37

◆ WshShortcut_GetTypeInfo()

static HRESULT WINAPI WshShortcut_GetTypeInfo ( IWshShortcut *  iface,
UINT  iTInfo,
LCID  lcid,
ITypeInfo **  ppTInfo 
)
static

Definition at line 802 of file shell.c.

803{
805 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
806 return get_typeinfo(IWshShortcut_tid, ppTInfo);
807}

◆ WshShortcut_GetTypeInfoCount()

static HRESULT WINAPI WshShortcut_GetTypeInfoCount ( IWshShortcut *  iface,
UINT pctinfo 
)
static

Definition at line 794 of file shell.c.

795{
797 TRACE("(%p)->(%p)\n", This, pctinfo);
798 *pctinfo = 1;
799 return S_OK;
800}

◆ WshShortcut_Invoke()

static HRESULT WINAPI WshShortcut_Invoke ( IWshShortcut *  iface,
DISPID  dispIdMember,
REFIID  riid,
LCID  lcid,
WORD  wFlags,
DISPPARAMS *  pDispParams,
VARIANT pVarResult,
EXCEPINFO *  pExcepInfo,
UINT puArgErr 
)
static

Definition at line 828 of file shell.c.

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}

◆ WshShortcut_Load()

static HRESULT WINAPI WshShortcut_Load ( IWshShortcut *  iface,
BSTR  PathLink 
)
static

Definition at line 1030 of file shell.c.

1031{
1033 FIXME("(%p)->(%s): stub\n", This, debugstr_w(PathLink));
1034 return E_NOTIMPL;
1035}

◆ WshShortcut_put_Arguments()

static HRESULT WINAPI WshShortcut_put_Arguments ( IWshShortcut *  iface,
BSTR  Arguments 
)
static

Definition at line 877 of file shell.c.

878{
880
881 TRACE("(%p)->(%s)\n", This, debugstr_w(Arguments));
882
883 return IShellLinkW_SetArguments(This->link, Arguments);
884}

◆ WshShortcut_put_Description()

static HRESULT WINAPI WshShortcut_put_Description ( IWshShortcut *  iface,
BSTR  Description 
)
static

Definition at line 893 of file shell.c.

894{
896 TRACE("(%p)->(%s)\n", This, debugstr_w(Description));
897 return IShellLinkW_SetDescription(This->link, Description);
898}

◆ WshShortcut_put_Hotkey()

static HRESULT WINAPI WshShortcut_put_Hotkey ( IWshShortcut *  iface,
BSTR  Hotkey 
)
static

Definition at line 907 of file shell.c.

908{
910 FIXME("(%p)->(%s): stub\n", This, debugstr_w(Hotkey));
911 return E_NOTIMPL;
912}

◆ WshShortcut_put_IconLocation()

static HRESULT WINAPI WshShortcut_put_IconLocation ( IWshShortcut *  iface,
BSTR  IconPath 
)
static

Definition at line 937 of file shell.c.

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}
#define iswspace(_c)
Definition: ctype.h:669
_Check_return_ long __cdecl wcstol(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)

◆ WshShortcut_put_RelativePath()

static HRESULT WINAPI WshShortcut_put_RelativePath ( IWshShortcut *  iface,
BSTR  rhs 
)
static

Definition at line 969 of file shell.c.

970{
972 FIXME("(%p)->(%s): stub\n", This, debugstr_w(rhs));
973 return E_NOTIMPL;
974}

◆ WshShortcut_put_TargetPath()

static HRESULT WINAPI WshShortcut_put_TargetPath ( IWshShortcut *  iface,
BSTR  Path 
)
static

Definition at line 983 of file shell.c.

984{
986 TRACE("(%p)->(%s)\n", This, debugstr_w(Path));
987 return IShellLinkW_SetPath(This->link, Path);
988}

◆ WshShortcut_put_WindowStyle()

static HRESULT WINAPI WshShortcut_put_WindowStyle ( IWshShortcut *  iface,
int  ShowCmd 
)
static

Definition at line 997 of file shell.c.

998{
1000 TRACE("(%p)->(%d)\n", This, ShowCmd);
1001 return IShellLinkW_SetShowCmd(This->link, ShowCmd);
1002}

◆ WshShortcut_put_WorkingDirectory()

static HRESULT WINAPI WshShortcut_put_WorkingDirectory ( IWshShortcut *  iface,
BSTR  WorkingDirectory 
)
static

Definition at line 1023 of file shell.c.

1024{
1026 TRACE("(%p)->(%s)\n", This, debugstr_w(WorkingDirectory));
1027 return IShellLinkW_SetWorkingDirectory(This->link, WorkingDirectory);
1028}

◆ WshShortcut_QueryInterface()

static HRESULT WINAPI WshShortcut_QueryInterface ( IWshShortcut *  iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 744 of file shell.c.

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}

◆ WshShortcut_Release()

static ULONG WINAPI WshShortcut_Release ( IWshShortcut *  iface)
static

Definition at line 778 of file shell.c.

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}

◆ WshShortcut_Save()

static HRESULT WINAPI WshShortcut_Save ( IWshShortcut *  iface)
static

Definition at line 1037 of file shell.c.

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}
const GUID IID_IPersistFile

Variable Documentation

◆ WshCollectionVtbl

const IWshCollectionVtbl WshCollectionVtbl
static
Initial value:
= {
}
static HRESULT WINAPI WshCollection_QueryInterface(IWshCollection *iface, REFIID riid, void **ppv)
Definition: shell.c:541
static HRESULT WINAPI WshCollection_Item(IWshCollection *iface, VARIANT *index, VARIANT *value)
Definition: shell.c:642
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 HRESULT WINAPI WshCollection_GetTypeInfo(IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:595
static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
Definition: shell.c:575
static HRESULT WINAPI WshCollection_get_length(IWshCollection *iface, LONG *count)
Definition: shell.c:699
static ULONG WINAPI WshCollection_AddRef(IWshCollection *iface)
Definition: shell.c:567
static HRESULT WINAPI WshCollection__NewEnum(IWshCollection *iface, IUnknown **Enum)
Definition: shell.c:706
static HRESULT WINAPI WshCollection_GetIDsOfNames(IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:602
static HRESULT WINAPI WshCollection_Count(IWshCollection *iface, LONG *count)
Definition: shell.c:692
static HRESULT WINAPI WshCollection_GetTypeInfoCount(IWshCollection *iface, UINT *pctinfo)
Definition: shell.c:587

Definition at line 713 of file shell.c.

Referenced by WshCollection_Create().

◆ WshEnvironmentVtbl

const IWshEnvironmentVtbl WshEnvironmentVtbl
static
Initial value:
= {
}
static HRESULT WINAPI WshEnvironment_GetTypeInfoCount(IWshEnvironment *iface, UINT *pctinfo)
Definition: shell.c:396
static HRESULT WINAPI WshEnvironment__NewEnum(IWshEnvironment *iface, IUnknown **penum)
Definition: shell.c:495
static HRESULT WINAPI WshEnvironment_GetTypeInfo(IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:404
static HRESULT WINAPI WshEnvironment_put_Item(IWshEnvironment *iface, BSTR name, BSTR value)
Definition: shell.c:474
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 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 HRESULT WINAPI WshEnvironment_Remove(IWshEnvironment *iface, BSTR name)
Definition: shell.c:502
static HRESULT WINAPI WshEnvironment_QueryInterface(IWshEnvironment *iface, REFIID riid, void **obj)
Definition: shell.c:350
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 WshEnvironment_GetIDsOfNames(IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:411
static HRESULT WINAPI WshEnvironment_Count(IWshEnvironment *iface, LONG *count)
Definition: shell.c:481

Definition at line 509 of file shell.c.

Referenced by WshEnvironment_Create().

◆ WshExecVtbl

const IWshExecVtbl WshExecVtbl
static
Initial value:
= {
}
static ULONG WINAPI WshExec_Release(IWshExec *iface)
Definition: shell.c:129
static HRESULT WINAPI WshExec_Terminate(IWshExec *iface)
Definition: shell.c:286
static HRESULT WINAPI WshExec_QueryInterface(IWshExec *iface, REFIID riid, void **obj)
Definition: shell.c:95
static HRESULT WINAPI WshExec_GetTypeInfo(IWshExec *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:152
static HRESULT WINAPI WshExec_get_StdIn(IWshExec *iface, ITextStream **stream)
Definition: shell.c:227
static HRESULT WINAPI WshExec_GetIDsOfNames(IWshExec *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:159
static HRESULT WINAPI WshExec_GetTypeInfoCount(IWshExec *iface, UINT *pctinfo)
Definition: shell.c:144
static HRESULT WINAPI WshExec_get_ExitCode(IWshExec *iface, DWORD *code)
Definition: shell.c:267
static HRESULT WINAPI WshExec_get_StdErr(IWshExec *iface, ITextStream **stream)
Definition: shell.c:245
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 WshExec_get_Status(IWshExec *iface, WshExecStatus *status)
Definition: shell.c:199
static HRESULT WINAPI WshExec_get_ProcessID(IWshExec *iface, DWORD *pid)
Definition: shell.c:254
static HRESULT WINAPI WshExec_get_StdOut(IWshExec *iface, ITextStream **stream)
Definition: shell.c:236

Definition at line 309 of file shell.c.

Referenced by WshExec_create().

◆ WshShell3

WshShellImpl WshShell3
static

◆ WshShell3Vtbl

const IWshShell3Vtbl WshShell3Vtbl
static
Initial value:
= {
}
static HRESULT WINAPI WshShell3_GetTypeInfoCount(IWshShell3 *iface, UINT *pctinfo)
Definition: shell.c:1159
static HRESULT WINAPI WshShell3_AppActivate(IWshShell3 *iface, VARIANT *App, VARIANT *Wait, VARIANT_BOOL *out_Success)
Definition: shell.c:1739
static HRESULT WINAPI WshShell3_RegDelete(IWshShell3 *iface, BSTR Name)
Definition: shell.c:1727
static HRESULT WINAPI WshShell3_get_CurrentDirectory(IWshShell3 *iface, BSTR *dir)
Definition: shell.c:1764
static ULONG WINAPI WshShell3_Release(IWshShell3 *iface)
Definition: shell.c:1153
static ULONG WINAPI WshShell3_AddRef(IWshShell3 *iface)
Definition: shell.c:1147
static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *value, VARIANT *type)
Definition: shell.c:1639
static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *wait, DWORD *exit_code)
Definition: shell.c:1250
static HRESULT WINAPI WshShell3_get_SpecialFolders(IWshShell3 *iface, IWshCollection **folders)
Definition: shell.c:1210
static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *Wait)
Definition: shell.c:1745
static HRESULT WINAPI WshShell3_GetTypeInfo(IWshShell3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:1166
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 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 HRESULT WINAPI WshShell3_GetIDsOfNames(IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:1172
static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec **ret)
Definition: shell.c:1751
static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch **Shortcut)
Definition: shell.c:1414
static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *type, IWshEnvironment **env)
Definition: shell.c:1216
static HRESULT WINAPI WshShell3_ExpandEnvironmentStrings(IWshShell3 *iface, BSTR Src, BSTR *Dst)
Definition: shell.c:1420
static HRESULT WINAPI WshShell3_put_CurrentDirectory(IWshShell3 *iface, BSTR dir)
Definition: shell.c:1788
static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, VARIANT *type, int *button)
Definition: shell.c:1343

Definition at line 1801 of file shell.c.

Referenced by WshShellFactory_CreateInstance().

◆ WshShortcutVtbl

const IWshShortcutVtbl WshShortcutVtbl
static
Initial value:
= {
}
static HRESULT WINAPI WshShortcut_get_WindowStyle(IWshShortcut *iface, int *ShowCmd)
Definition: shell.c:990
static HRESULT WINAPI WshShortcut_put_Hotkey(IWshShortcut *iface, BSTR Hotkey)
Definition: shell.c:907
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 WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR *WorkingDirectory)
Definition: shell.c:1004
static HRESULT WINAPI WshShortcut_put_WorkingDirectory(IWshShortcut *iface, BSTR WorkingDirectory)
Definition: shell.c:1023
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 WshShortcut_get_Description(IWshShortcut *iface, BSTR *Description)
Definition: shell.c:886
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 WshShortcut_GetIDsOfNames(IWshShortcut *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:809
static HRESULT WINAPI WshShortcut_get_TargetPath(IWshShortcut *iface, BSTR *Path)
Definition: shell.c:976
static HRESULT WINAPI WshShortcut_put_IconLocation(IWshShortcut *iface, BSTR IconPath)
Definition: shell.c:937
static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut *iface, BSTR *IconPath)
Definition: shell.c:914
static ULONG WINAPI WshShortcut_AddRef(IWshShortcut *iface)
Definition: shell.c:770
static HRESULT WINAPI WshShortcut_QueryInterface(IWshShortcut *iface, REFIID riid, void **ppv)
Definition: shell.c:744
static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
Definition: shell.c:778
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 HRESULT WINAPI WshShortcut_GetTypeInfo(IWshShortcut *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:802
static HRESULT WINAPI WshShortcut_put_Description(IWshShortcut *iface, BSTR Description)
Definition: shell.c:893
static HRESULT WINAPI WshShortcut_Save(IWshShortcut *iface)
Definition: shell.c:1037
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 WshShortcut_get_Hotkey(IWshShortcut *iface, BSTR *Hotkey)
Definition: shell.c:900

Definition at line 1052 of file shell.c.

Referenced by WshShortcut_Create().