ReactOS 0.4.17-dev-966-gf06eace
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 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

HRESULT WINAPI DoOpenPipeStream (HANDLE pipe, IOMode mode, ITextStream **stream)
 
 WINE_DEFAULT_DEBUG_CHANNEL (wshom)
 
static WshCollection * impl_from_IWshCollection (IWshCollection *iface)
 
static WshShortcut * impl_from_IWshShortcut (IWshShortcut *iface)
 
static WshEnvironment * impl_from_IWshEnvironment (IWshEnvironment *iface)
 
static WshExecImpl * impl_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, int *pid)
 
static HRESULT WINAPI WshExec_get_ExitCode (IWshExec *iface, int *code)
 
static BOOL CALLBACK enum_thread_wnd_proc (HWND hwnd, LPARAM lParam)
 
static HRESULT WINAPI WshExec_Terminate (IWshExec *iface)
 
static HRESULT create_pipe (HANDLE *hread, HANDLE *hwrite)
 
static void close_pipe (HANDLE *hread, HANDLE *hwrite)
 
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)
 
HRESULT get_env_var (const WCHAR *name, BSTR *value)
 
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 WCHAR * split_command (BSTR cmd, WCHAR **params)
 
static HRESULT WINAPI WshShell3_Run (IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *wait, int *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

◆ close_pipe()

static void close_pipe ( HANDLE *  hread,
HANDLE *  hwrite 
)
static

Definition at line 358 of file shell.c.

359{
361 CloseHandle(*hwrite);
362 *hread = *hwrite = NULL;
363}
#define NULL
Definition: types.h:112
#define CloseHandle
Definition: compat.h:739
static HDC hread
Definition: opengl.c:36

Referenced by WshExec_create().

◆ create_pipe()

static HRESULT create_pipe ( HANDLE *  hread,
HANDLE *  hwrite 
)
static

Definition at line 344 of file shell.c.

345{
347
348 sa.nLength = sizeof(sa);
349 sa.bInheritHandle = TRUE;
350 sa.lpSecurityDescriptor = NULL;
351
352 *hread = *hwrite = NULL;
353 if (!CreatePipe(hread, hwrite, &sa, 0))
355 return S_OK;
356}
static struct sockaddr_in sa
Definition: adnsresfilter.c:69
#define TRUE
Definition: types.h:120
#define S_OK
Definition: intsafe.h:52
BOOL WINAPI CreatePipe(PHANDLE hReadPipe, PHANDLE hWritePipe, LPSECURITY_ATTRIBUTES lpPipeAttributes, DWORD nSize)
Definition: npipe.c:117
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
Definition: winerror.h:210

Referenced by WshExec_create().

◆ DoOpenPipeStream()

HRESULT WINAPI DoOpenPipeStream ( HANDLE  pipe,
IOMode  mode,
ITextStream **  stream 
)

Definition at line 966 of file filesystem.c.

967{
968 struct textstream *stream;
969
970 TRACE("%p, %d, %p.\n", pipe, mode, ret);
971
972 if (!(stream = calloc(1, sizeof(*stream))))
973 return E_OUTOFMEMORY;
974
975 stream->ITextStream_iface.lpVtbl = &pipestreamvtbl;
976 stream->ref = 1;
977 stream->mode = mode;
978 stream->file = pipe;
979
980 init_classinfo(&CLSID_TextStream, (IUnknown *)&stream->ITextStream_iface, &stream->classinfo);
981 *ret = &stream->ITextStream_iface;
982
983 return S_OK;
984}
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const ITextStreamVtbl pipestreamvtbl
Definition: filesystem.c:832
return ret
Definition: mutex.c:147
GLenum mode
Definition: glext.h:6217
#define calloc
Definition: rosglue.h:14
void init_classinfo(const GUID *guid, IUnknown *outer, struct provideclassinfo *classinfo)
Definition: scrrun.c:230
#define TRACE(s)
Definition: solgame.cpp:4
Definition: parse.h:23

Referenced by WshExec_create().

◆ enum_thread_wnd_proc()

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

Definition at line 294 of file shell.c.

295{
296 INT *count = (INT*)lParam;
297
298 (*count)++;
299 PostMessageW(hwnd, WM_CLOSE, 0, 0);
300 /* try to send it to all windows, even if failed for some */
301 return TRUE;
302}
LPARAM lParam
Definition: combotst.c:139
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WM_CLOSE
Definition: winuser.h:1649
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int32_t INT
Definition: typedefs.h:58
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by WshExec_Terminate().

◆ get_env_var()

HRESULT get_env_var ( const WCHAR *  name,
BSTR *  value 
)

Definition at line 546 of file shell.c.

547{
548 DWORD len;
549
551 if (len)
552 {
554 if (*value)
556 }
557 else
559
560 return *value ? S_OK : E_OUTOFMEMORY;
561}
#define GetEnvironmentVariableW(x, y, z)
Definition: compat.h:755
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:341
Definition: name.c:39
Definition: pdh_main.c:64

Referenced by WshEnvironment_get_Item(), and WshNetwork2_get_UserDomain().

◆ get_root_key()

static HKEY get_root_key ( const WCHAR *  path)
static

Definition at line 1528 of file shell.c.

1529{
1530 static const struct {
1531 const WCHAR full[20];
1532 const WCHAR abbrev[5];
1533 HKEY hkey;
1534 } rootkeys[] = {
1535 { L"HKEY_CURRENT_USER", L"HKCU", HKEY_CURRENT_USER },
1536 { L"HKEY_LOCAL_MACHINE", L"HKLM", HKEY_LOCAL_MACHINE },
1537 { L"HKEY_CLASSES_ROOT", L"HKCR", HKEY_CLASSES_ROOT },
1538 { L"HKEY_USERS", {0}, HKEY_USERS },
1539 { L"HKEY_CURRENT_CONFIG", {0}, HKEY_CURRENT_CONFIG }
1540 };
1541 int i;
1542
1543 for (i = 0; i < ARRAY_SIZE(rootkeys); i++) {
1544 if (!wcsncmp(path, rootkeys[i].full, lstrlenW(rootkeys[i].full)))
1545 return rootkeys[i].hkey;
1546 if (rootkeys[i].abbrev[0] && !wcsncmp(path, rootkeys[i].abbrev, lstrlenW(rootkeys[i].abbrev)))
1547 return rootkeys[i].hkey;
1548 }
1549
1550 return NULL;
1551}
#define ARRAY_SIZE(A)
Definition: main.h:20
#define lstrlenW
Definition: compat.h:750
_ACRTIMP int __cdecl wcsncmp(const wchar_t *, const wchar_t *, size_t)
Definition: wcs.c:523
#define L(x)
Definition: resources.c:13
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
short WCHAR
Definition: pedump.c:58
#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

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 1315 of file shell.c.

1316{
1317 return V_VT(arg) == VT_ERROR && V_ERROR(arg) == DISP_E_PARAMNOTFOUND;
1318}
@ 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 1420 of file shell.c.

1421{
1422 struct popup_thread_param *param = (struct popup_thread_param *)arg;
1423
1424 param->button = MessageBoxW(NULL, param->text, is_optional_argument(&param->title) ?
1425 L"Windows Script Host" : V_BSTR(&param->title), V_I4(&param->type));
1426 return 0;
1427}
static BOOL is_optional_argument(const VARIANT *arg)
Definition: shell.c:1315
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 1320 of file shell.c.

1321{
1322 WCHAR *ret, *ptr;
1323 BOOL in_quotes = FALSE;
1324
1325 if (!(ret = wcsdup(cmd))) return NULL;
1326
1327 *params = NULL;
1328 for (ptr = ret; *ptr; ptr++)
1329 {
1330 if (*ptr == '"') in_quotes = !in_quotes;
1331 else if (*ptr == ' ' && !in_quotes)
1332 {
1333 *ptr = 0;
1334 *params = ptr + 1;
1335 break;
1336 }
1337 }
1338
1339 return ret;
1340}
#define FALSE
Definition: types.h:117
static wchar_t * wcsdup(const wchar_t *str)
Definition: string.h:94
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 1554 of file shell.c.

1555{
1556 *value = NULL;
1557
1558 /* at least one separator should be present */
1559 *subkey = wcschr(path, '\\');
1560 if (!*subkey)
1562
1563 /* default value or not */
1564 if ((*subkey)[lstrlenW(*subkey)-1] == '\\') {
1565 (*subkey)++;
1566 *value = NULL;
1567 }
1568 else {
1569 *value = wcsrchr(*subkey, '\\');
1570 if (*value - *subkey > 1) {
1571 unsigned int len = *value - *subkey - 1;
1572 WCHAR *ret;
1573
1574 ret = malloc((len + 1)*sizeof(WCHAR));
1575 if (!ret)
1576 return E_OUTOFMEMORY;
1577
1578 memcpy(ret, *subkey + 1, len*sizeof(WCHAR));
1579 ret[len] = 0;
1580 *subkey = ret;
1581 }
1582 (*value)++;
1583 }
1584
1585 return S_OK;
1586}
#define malloc
Definition: debug_ros.c:4
#define wcschr
Definition: compat.h:17
#define wcsrchr
Definition: compat.h:16
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#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 803 of file shell.c.

804{
806 FIXME("(%p)->(%p): stub\n", This, Enum);
807 return E_NOTIMPL;
808}
#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:79

◆ WshCollection_AddRef()

static ULONG WINAPI WshCollection_AddRef ( IWshCollection *  iface)
static

Definition at line 668 of file shell.c.

669{
672
673 TRACE("%p, refcount %ld.\n", iface, ref);
674
675 return ref;
676}
#define InterlockedIncrement
Definition: armddk.h:53
long LONG
Definition: pedump.c:60
LONG ref
Definition: collection.c:58
Definition: send.c:48

◆ WshCollection_Count()

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

Definition at line 789 of file shell.c.

790{
792 FIXME("(%p)->(%p): stub\n", This, count);
793 return E_NOTIMPL;
794}

◆ WshCollection_Create()

static HRESULT WshCollection_Create ( IWshCollection **  collection)
static

Definition at line 824 of file shell.c.

825{
827
828 if (!(object = calloc(1, sizeof(*object))))
829 return E_OUTOFMEMORY;
830
831 object->IWshCollection_iface.lpVtbl = &WshCollectionVtbl;
832 object->ref = 1;
833
834 init_classinfo(&IID_IWshCollection, (IUnknown *)&object->IWshCollection_iface, &object->classinfo);
835 *collection = &object->IWshCollection_iface;
836
837 return S_OK;
838}
static const IWshCollectionVtbl WshCollectionVtbl
Definition: shell.c:810

Referenced by WshShell3_get_SpecialFolders().

◆ WshCollection_get_length()

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

Definition at line 796 of file shell.c.

797{
799 FIXME("(%p)->(%p): stub\n", This, count);
800 return E_NOTIMPL;
801}

◆ WshCollection_GetIDsOfNames()

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

Definition at line 705 of file shell.c.

707{
709 HRESULT hr;
710
711 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
712
714 if(SUCCEEDED(hr))
715 {
716 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
717 ITypeInfo_Release(typeinfo);
718 }
719
720 return hr;
721}
HRESULT get_typeinfo(enum type_id tid, ITypeInfo **ret)
Definition: apps.c:125
HRESULT hr
Definition: delayimp.cpp:582
LCID lcid
Definition: locale.c:5660
REFIID riid
Definition: atlbase.h:39
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define debugstr_guid
Definition: kernel32.h:35
@ 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 698 of file shell.c.

699{
700 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
701
702 return get_typeinfo(IWshCollection_tid, ppTInfo);
703}

◆ WshCollection_GetTypeInfoCount()

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

Definition at line 690 of file shell.c.

691{
693 TRACE("(%p)->(%p)\n", This, pctinfo);
694 *pctinfo = 1;
695 return S_OK;
696}

◆ 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 723 of file shell.c.

725{
727 HRESULT hr;
728
729 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
730 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
731
733 if(SUCCEEDED(hr))
734 {
735 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
736 ITypeInfo_Release(typeinfo);
737 }
738
739 return hr;
740}
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 742 of file shell.c.

743{
745 PIDLIST_ABSOLUTE pidl;
747 int kind = 0;
748 BSTR folder;
749 HRESULT hr;
750
751 TRACE("(%p)->(%s %p)\n", This, debugstr_variant(index), value);
752
753 if (V_VT(index) != VT_BSTR)
754 {
755 FIXME("only BSTR index supported, got %d\n", V_VT(index));
756 return E_NOTIMPL;
757 }
758
760 if (!wcsicmp(folder, L"Desktop"))
761 kind = CSIDL_DESKTOP;
762 else if (!wcsicmp(folder, L"AllUsersDesktop"))
764 else if (!wcsicmp(folder, L"AllUsersPrograms"))
766 else
767 {
768 FIXME("folder kind %s not supported\n", debugstr_w(folder));
769 return E_NOTIMPL;
770 }
771
772 hr = SHGetSpecialFolderLocation(NULL, kind, &pidl);
773 if (hr != S_OK) return hr;
774
775 if (SHGetPathFromIDListW(pidl, pathW))
776 {
777 V_VT(value) = VT_BSTR;
780 }
781 else
782 hr = E_FAIL;
783
784 CoTaskMemFree(pidl);
785
786 return hr;
787}
#define E_FAIL
Definition: ddrawi.h:102
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
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
HRESULT WINAPI SHGetSpecialFolderLocation(HWND hwndOwner, INT nFolder, LPITEMIDLIST *ppidl)
Definition: shellpath.c:3385
static const char * debugstr_variant(const VARIANT *var)
Definition: dom.c:505
GLuint index
Definition: glext.h:6031
#define debugstr_w
Definition: kernel32.h:32
static const WCHAR pathW[]
Definition: path.c:2368
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:240
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1496
#define CSIDL_COMMON_DESKTOPDIRECTORY
Definition: shlobj.h:2215
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2213
#define CSIDL_DESKTOP
Definition: shlobj.h:2191
Definition: fci.c:112

◆ WshCollection_QueryInterface()

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

Definition at line 642 of file shell.c.

643{
645
646 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
647
650 IsEqualGUID(riid, &IID_IWshCollection))
651 {
652 *ppv = iface;
653 }
655 {
656 *ppv = &This->classinfo.IProvideClassInfo_iface;
657 }
658 else {
659 FIXME("Unknown iface %s\n", debugstr_guid(riid));
660 *ppv = NULL;
661 return E_NOINTERFACE;
662 }
663
664 IUnknown_AddRef((IUnknown*)*ppv);
665 return S_OK;
666}
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 678 of file shell.c.

679{
682 TRACE("%p, refcount %ld.\n", iface, ref);
683
684 if (!ref)
686
687 return ref;
688}
#define InterlockedDecrement
Definition: armddk.h:52
#define free
Definition: debug_ros.c:5

◆ WshEnvironment__NewEnum()

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

Definition at line 596 of file shell.c.

597{
599 FIXME("(%p)->(%p): stub\n", This, penum);
600 return E_NOTIMPL;
601}
static WshEnvironment * impl_from_IWshEnvironment(IWshEnvironment *iface)
Definition: shell.c:89

◆ WshEnvironment_AddRef()

static ULONG WINAPI WshEnvironment_AddRef ( IWshEnvironment *  iface)
static

Definition at line 474 of file shell.c.

475{
478 TRACE("%p, refcount %ld.\n", iface, ref);
479 return ref;
480}

◆ WshEnvironment_Count()

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

Definition at line 582 of file shell.c.

583{
585 FIXME("(%p)->(%p): stub\n", This, count);
586 return E_NOTIMPL;
587}

◆ WshEnvironment_Create()

static HRESULT WshEnvironment_Create ( IWshEnvironment **  env)
static

Definition at line 626 of file shell.c.

627{
629
630 if (!(object = calloc(1, sizeof(*object))))
631 return E_OUTOFMEMORY;
632
633 object->IWshEnvironment_iface.lpVtbl = &WshEnvironmentVtbl;
634 object->ref = 1;
635
636 init_classinfo(&IID_IWshEnvironment, (IUnknown *)&object->IWshEnvironment_iface, &object->classinfo);
637 *env = &object->IWshEnvironment_iface;
638
639 return S_OK;
640}
static LPCWSTR LPCWSTR LPCWSTR env
Definition: db.cpp:171
static const IWshEnvironmentVtbl WshEnvironmentVtbl
Definition: shell.c:610

Referenced by WshShell3_get_Environment().

◆ WshEnvironment_get_Item()

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

Definition at line 563 of file shell.c.

564{
566
567 TRACE("(%p)->(%s %p)\n", This, debugstr_w(name), value);
568
569 if (!value)
570 return E_POINTER;
571
572 return get_env_var(name, value);
573}
HRESULT get_env_var(const WCHAR *name, BSTR *value)
Definition: shell.c:546
#define E_POINTER
Definition: winerror.h:3480

◆ WshEnvironment_get_length()

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

Definition at line 589 of file shell.c.

590{
592 FIXME("(%p)->(%p): stub\n", This, len);
593 return E_NOTIMPL;
594}

◆ WshEnvironment_GetIDsOfNames()

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

Definition at line 509 of file shell.c.

511{
513 HRESULT hr;
514
515 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
516
518 if(SUCCEEDED(hr))
519 {
520 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
521 ITypeInfo_Release(typeinfo);
522 }
523
524 return hr;
525}
@ 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 502 of file shell.c.

503{
504 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
505
506 return get_typeinfo(IWshEnvironment_tid, ppTInfo);
507}

◆ WshEnvironment_GetTypeInfoCount()

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

Definition at line 494 of file shell.c.

495{
497 TRACE("(%p)->(%p)\n", This, pctinfo);
498 *pctinfo = 1;
499 return S_OK;
500}

◆ 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 527 of file shell.c.

529{
531 HRESULT hr;
532
533 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
534 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
535
537 if(SUCCEEDED(hr))
538 {
539 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
540 ITypeInfo_Release(typeinfo);
541 }
542
543 return hr;
544}

◆ WshEnvironment_put_Item()

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

Definition at line 575 of file shell.c.

576{
578 FIXME("(%p)->(%s %s): stub\n", This, debugstr_w(name), debugstr_w(value));
579 return E_NOTIMPL;
580}

◆ WshEnvironment_QueryInterface()

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

Definition at line 448 of file shell.c.

449{
451
452 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
453
456 IsEqualGUID(riid, &IID_IWshEnvironment))
457 {
458 *obj = iface;
459 }
461 {
462 *obj = &This->classinfo.IProvideClassInfo_iface;
463 }
464 else {
465 FIXME("Unknown iface %s\n", debugstr_guid(riid));
466 *obj = NULL;
467 return E_NOINTERFACE;
468 }
469
470 IUnknown_AddRef((IUnknown*)*obj);
471 return S_OK;
472}

◆ WshEnvironment_Release()

static ULONG WINAPI WshEnvironment_Release ( IWshEnvironment *  iface)
static

Definition at line 482 of file shell.c.

483{
486 TRACE("%p, refcount %ld.\n", iface, ref);
487
488 if (!ref)
489 free(This);
490
491 return ref;
492}

◆ WshEnvironment_Remove()

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

Definition at line 603 of file shell.c.

604{
606 FIXME("(%p)->(%s): stub\n", This, debugstr_w(name));
607 return E_NOTIMPL;
608}

◆ WshExec_AddRef()

static ULONG WINAPI WshExec_AddRef ( IWshExec *  iface)
static

Definition at line 125 of file shell.c.

126{
129 TRACE("%p, refcount %ld.\n", iface, ref);
130 return ref;
131}
static WshExecImpl * impl_from_IWshExec(IWshExec *iface)
Definition: shell.c:94

◆ WshExec_create()

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

Definition at line 365 of file shell.c.

366{
367 HANDLE stdout_read, stdout_write;
368 HANDLE stderr_read, stderr_write;
369 HANDLE stdin_read, stdin_write;
370 STARTUPINFOW si = {0};
372 HRESULT hr;
373
374 *ret = NULL;
375
376 if (!(object = calloc(1, sizeof(*object))))
377 return E_OUTOFMEMORY;
378
379 object->IWshExec_iface.lpVtbl = &WshExecVtbl;
380 object->ref = 1;
381 init_classinfo(&CLSID_WshExec, (IUnknown *)&object->IWshExec_iface, &object->classinfo);
382
383 if (FAILED(hr = create_pipe(&stdin_read, &stdin_write)))
384 {
385 WARN("Failed to create stdin pipe.\n");
386 goto failed;
387 }
388
389 if (FAILED(hr = create_pipe(&stdout_read, &stdout_write)))
390 {
391 close_pipe(&stdin_read, &stdin_write);
392 WARN("Failed to create stdout pipe.\n");
393 goto failed;
394 }
395
396 if (FAILED(hr = create_pipe(&stderr_read, &stderr_write)))
397 {
398 close_pipe(&stdin_read, &stdin_write);
399 close_pipe(&stdout_read, &stdout_write);
400 WARN("Failed to create stderr pipe.\n");
401 goto failed;
402 }
403
404 if (SUCCEEDED(hr))
405 {
409 }
410
411 if (SUCCEEDED(hr))
412 hr = DoOpenPipeStream(stdin_write, ForWriting, &object->stdin_stream);
413 if (SUCCEEDED(hr))
414 hr = DoOpenPipeStream(stdout_read, ForReading, &object->stdout_stream);
415 if (SUCCEEDED(hr))
416 hr = DoOpenPipeStream(stderr_read, ForReading, &object->stderr_stream);
417
418 si.cb = sizeof(si);
419 si.hStdError = stderr_write;
420 si.hStdOutput = stdout_write;
421 si.hStdInput = stdin_read;
422 si.dwFlags = STARTF_USESTDHANDLES;
423
424 if (SUCCEEDED(hr))
425 {
426 if (!CreateProcessW(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &object->info))
428 }
429
430 CloseHandle(stderr_write);
431 CloseHandle(stdout_write);
432 CloseHandle(stdin_read);
433
434 if (SUCCEEDED(hr))
435 {
436 *ret = &object->IWshExec_iface;
437
438 return S_OK;
439 }
440
441failed:
442
443 IWshExec_Release(&object->IWshExec_iface);
444
445 return hr;
446}
#define WARN(fmt,...)
Definition: precomp.h:61
BOOL WINAPI SetHandleInformation(IN HANDLE hObject, IN DWORD dwMask, IN DWORD dwFlags)
Definition: handle.c:78
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:4491
static const IWshExecVtbl WshExecVtbl
Definition: shell.c:327
static HRESULT create_pipe(HANDLE *hread, HANDLE *hwrite)
Definition: shell.c:344
static void close_pipe(HANDLE *hread, HANDLE *hwrite)
Definition: shell.c:358
HRESULT WINAPI DoOpenPipeStream(HANDLE pipe, IOMode mode, ITextStream **stream)
Definition: filesystem.c:966
#define FAILED(hr)
Definition: intsafe.h:51
static SYSTEM_INFO si
Definition: virtual.c:39
#define HANDLE_FLAG_INHERIT
Definition: winbase.h:289
#define STARTF_USESTDHANDLES
Definition: winbase.h:476

Referenced by WshShell3_Exec().

◆ WshExec_get_ExitCode()

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

Definition at line 285 of file shell.c.

286{
288
289 FIXME("(%p)->(%p): stub\n", This, code);
290
291 return E_NOTIMPL;
292}
Definition: inflate.c:139

◆ WshExec_get_ProcessID()

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

Definition at line 272 of file shell.c.

273{
275
276 TRACE("(%p)->(%p)\n", This, pid);
277
278 if (!pid)
279 return E_INVALIDARG;
280
281 *pid = This->info.dwProcessId;
282 return S_OK;
283}
#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 208 of file shell.c.

209{
211 DWORD code;
212
213 TRACE("(%p)->(%p)\n", This, status);
214
215 if (!status)
216 return E_INVALIDARG;
217
218 if (!GetExitCodeProcess(This->info.hProcess, &code))
220
221 switch (code)
222 {
223 case 0:
225 break;
226 case STILL_ACTIVE:
228 break;
229 default:
230 *status = WshFailed;
231 }
232
233 return S_OK;
234}
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1215
#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 260 of file shell.c.

261{
262 WshExecImpl *exec = impl_from_IWshExec(iface);
263
264 TRACE("%p, %p.\n", iface, stream);
265
266 *stream = exec->stderr_stream;
267 ITextStream_AddRef(*stream);
268
269 return S_OK;
270}
ITextStream * stderr_stream
Definition: shell.c:76

◆ WshExec_get_StdIn()

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

Definition at line 236 of file shell.c.

237{
238 WshExecImpl *exec = impl_from_IWshExec(iface);
239
240 TRACE("%p, %p.\n", iface, stream);
241
242 *stream = exec->stdin_stream;
243 ITextStream_AddRef(*stream);
244
245 return S_OK;
246}
ITextStream * stdin_stream
Definition: shell.c:74

◆ WshExec_get_StdOut()

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

Definition at line 248 of file shell.c.

249{
250 WshExecImpl *exec = impl_from_IWshExec(iface);
251
252 TRACE("%p, %p.\n", iface, stream);
253
254 *stream = exec->stdout_stream;
255 ITextStream_AddRef(*stream);
256
257 return S_OK;
258}
ITextStream * stdout_stream
Definition: shell.c:75

◆ WshExec_GetIDsOfNames()

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

Definition at line 171 of file shell.c.

173{
175 HRESULT hr;
176
177 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
178
180 if(SUCCEEDED(hr))
181 {
182 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
183 ITypeInfo_Release(typeinfo);
184 }
185
186 return hr;
187}
@ 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 164 of file shell.c.

165{
166 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
167
168 return get_typeinfo(IWshExec_tid, ppTInfo);
169}

◆ WshExec_GetTypeInfoCount()

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

Definition at line 156 of file shell.c.

157{
159 TRACE("(%p)->(%p)\n", This, pctinfo);
160 *pctinfo = 1;
161 return S_OK;
162}

◆ 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 189 of file shell.c.

191{
193 HRESULT hr;
194
195 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
196 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
197
199 if(SUCCEEDED(hr))
200 {
201 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
202 ITypeInfo_Release(typeinfo);
203 }
204
205 return hr;
206}

◆ WshExec_QueryInterface()

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

Definition at line 99 of file shell.c.

100{
102
103 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), obj);
104
106 IsEqualGUID(riid, &IID_IWshExec) ||
108 {
109 *obj = iface;
110 }
112 {
113 *obj = &This->classinfo.IProvideClassInfo_iface;
114 }
115 else {
116 FIXME("Unknown iface %s\n", debugstr_guid(riid));
117 *obj = NULL;
118 return E_NOINTERFACE;
119 }
120
121 IUnknown_AddRef((IUnknown *)*obj);
122 return S_OK;
123}

◆ WshExec_Release()

static ULONG WINAPI WshExec_Release ( IWshExec *  iface)
static

Definition at line 133 of file shell.c.

134{
135 WshExecImpl *exec = impl_from_IWshExec(iface);
137
138 TRACE("%p, refcount %ld.\n", iface, ref);
139
140 if (!ref)
141 {
142 CloseHandle(exec->info.hThread);
144 if (exec->stdin_stream)
145 ITextStream_Release(exec->stdin_stream);
146 if (exec->stdout_stream)
147 ITextStream_Release(exec->stdout_stream);
148 if (exec->stderr_stream)
149 ITextStream_Release(exec->stderr_stream);
150 free(exec);
151 }
152
153 return ref;
154}
PROCESS_INFORMATION info
Definition: shell.c:73
LONG ref
Definition: shell.c:72

◆ WshExec_Terminate()

static HRESULT WINAPI WshExec_Terminate ( IWshExec *  iface)
static

Definition at line 304 of file shell.c.

305{
307 BOOL ret, kill = FALSE;
308 INT count = 0;
309
310 TRACE("(%p)\n", This);
311
313 if (ret && count) {
314 /* manual testing shows that it waits 2 seconds before forcing termination */
315 if (WaitForSingleObject(This->info.hProcess, 2000) != WAIT_OBJECT_0)
316 kill = TRUE;
317 }
318 else
319 kill = TRUE;
320
321 if (kill)
322 TerminateProcess(This->info.hProcess, 0);
323
324 return S_OK;
325}
BOOL WINAPI TerminateProcess(IN HANDLE hProcess, IN UINT uExitCode)
Definition: proc.c:1425
static BOOL CALLBACK enum_thread_wnd_proc(HWND hwnd, LPARAM lParam)
Definition: shell.c:294
LONG_PTR LPARAM
Definition: minwindef.h:175
BOOL WINAPI EnumThreadWindows(_In_ DWORD, _In_ WNDENUMPROC, _In_ LPARAM)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define WAIT_OBJECT_0
Definition: winbase.h:383

◆ WshShell3_AddRef()

static ULONG WINAPI WshShell3_AddRef ( IWshShell3 *  iface)
static

Definition at line 1239 of file shell.c.

1240{
1241 TRACE("()\n");
1242 return 2;
1243}

◆ WshShell3_AppActivate()

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

Definition at line 1820 of file shell.c.

1821{
1822 FIXME("(%s %s %p): stub\n", debugstr_variant(App), debugstr_variant(Wait), out_Success);
1823 return E_NOTIMPL;
1824}
_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 1500 of file shell.c.

1501{
1502 TRACE("(%s %p)\n", debugstr_w(PathLink), Shortcut);
1503 return WshShortcut_Create(PathLink, Shortcut);
1504}
static HRESULT WshShortcut_Create(const WCHAR *path, IDispatch **shortcut)
Definition: shell.c:1173

◆ WshShell3_Exec()

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

Definition at line 1832 of file shell.c.

1833{
1834 BSTR expandedcmd;
1835 HRESULT hr;
1836
1837 TRACE("(%s %p)\n", debugstr_w(command), ret);
1838
1839 if (!ret)
1840 return E_POINTER;
1841
1842 if (!command)
1843 return DISP_E_EXCEPTION;
1844
1845 hr = WshShell3_ExpandEnvironmentStrings(iface, command, &expandedcmd);
1846 if (FAILED(hr))
1847 return hr;
1848
1849 hr = WshExec_create(expandedcmd, ret);
1850 SysFreeString(expandedcmd);
1851 return hr;
1852}
static HRESULT WshExec_create(BSTR command, IWshExec **ret)
Definition: shell.c:365
static HRESULT WINAPI WshShell3_ExpandEnvironmentStrings(IWshShell3 *iface, BSTR Src, BSTR *Dst)
Definition: shell.c:1506
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:273
#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 1506 of file shell.c.

1507{
1508 DWORD ret;
1509
1510 TRACE("(%s %p)\n", debugstr_w(Src), Dst);
1511
1512 if (!Src || !Dst) return E_POINTER;
1513
1516 if (!*Dst) return E_OUTOFMEMORY;
1517
1518 if (ExpandEnvironmentStringsW(Src, *Dst, ret))
1519 return S_OK;
1520 else
1521 {
1523 *Dst = NULL;
1525 }
1526}
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:492
#define Dst
Definition: mesh.h:153

Referenced by WshShell3_Exec().

◆ WshShell3_get_CurrentDirectory()

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

Definition at line 1854 of file shell.c.

1855{
1856 DWORD ret;
1857
1858 TRACE("(%p)\n", dir);
1859
1861 if (!ret)
1863
1865 if (!*dir)
1866 return E_OUTOFMEMORY;
1867
1869 if (!ret) {
1871 *dir = NULL;
1873 }
1874
1875 return S_OK;
1876}
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 1309 of file shell.c.

1310{
1311 FIXME("(%s %p): semi-stub\n", debugstr_variant(type), env);
1312 return WshEnvironment_Create(env);
1313}
static HRESULT WshEnvironment_Create(IWshEnvironment **env)
Definition: shell.c:626
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 1303 of file shell.c.

1304{
1305 TRACE("(%p)\n", folders);
1306 return WshCollection_Create(folders);
1307}
static HRESULT WshCollection_Create(IWshCollection **collection)
Definition: shell.c:824

◆ WshShell3_GetIDsOfNames()

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

Definition at line 1265 of file shell.c.

1267{
1269 HRESULT hr;
1270
1271 TRACE("%s, %p, %u, %lx, %p.\n", debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
1272
1274 if(SUCCEEDED(hr))
1275 {
1276 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
1277 ITypeInfo_Release(typeinfo);
1278 }
1279
1280 return hr;
1281}
@ 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 1258 of file shell.c.

1259{
1260 TRACE("%u, %lx, %p.\n", iTInfo, lcid, ppTInfo);
1261
1262 return get_typeinfo(IWshShell3_tid, ppTInfo);
1263}

◆ WshShell3_GetTypeInfoCount()

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

Definition at line 1251 of file shell.c.

1252{
1253 TRACE("(%p)\n", pctinfo);
1254 *pctinfo = 1;
1255 return S_OK;
1256}

◆ 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 1283 of file shell.c.

1285{
1287 HRESULT hr;
1288
1289 TRACE("%ld, %s, %lx, %d, %p, %p, %p, %p.\n", dispIdMember, debugstr_guid(riid),
1290 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
1291
1293 if(SUCCEEDED(hr))
1294 {
1295 hr = ITypeInfo_Invoke(typeinfo, &WshShell3.IWshShell3_iface, dispIdMember, wFlags,
1296 pDispParams, pVarResult, pExcepInfo, puArgErr);
1297 ITypeInfo_Release(typeinfo);
1298 }
1299
1300 return hr;
1301}
static WshShellImpl WshShell3
Definition: shell.c:42
IWshShell3 IWshShell3_iface
Definition: shell.c:40

◆ WshShell3_LogEvent()

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

Definition at line 1814 of file shell.c.

1815{
1816 FIXME("(%s %s %s %p): stub\n", debugstr_variant(Type), debugstr_w(Message), debugstr_w(Target), out_Success);
1817 return E_NOTIMPL;
1818}
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 1429 of file shell.c.

1431{
1433 DWORD tid, status;
1435 HANDLE hthread;
1436 HRESULT hr;
1437
1438 TRACE("(%s %s %s %s %p)\n", debugstr_w(text), debugstr_variant(seconds_to_wait), debugstr_variant(title),
1440
1441 if (!seconds_to_wait || !title || !type || !button)
1442 return E_POINTER;
1443
1445 if (!is_optional_argument(seconds_to_wait))
1446 {
1447 hr = VariantChangeType(&timeout, seconds_to_wait, 0, VT_I4);
1448 if (FAILED(hr))
1449 return hr;
1450 }
1451#ifdef __REACTOS__
1452 else
1453 {
1455 }
1456#endif
1457
1458 VariantInit(&param.type);
1460 {
1461 hr = VariantChangeType(&param.type, type, 0, VT_I4);
1462 if (FAILED(hr))
1463 return hr;
1464 }
1465#ifdef __REACTOS__
1466 else
1467 {
1468 VariantChangeType(&param.type, &param.type, 0, VT_I4);
1469 }
1470#endif
1471
1473 param.title = *title;
1474 else
1475 {
1476 VariantInit(&param.title);
1477 hr = VariantChangeType(&param.title, title, 0, VT_BSTR);
1478 if (FAILED(hr))
1479 return hr;
1480 }
1481
1482 param.text = text;
1483 param.button = -1;
1484 hthread = CreateThread(NULL, 0, popup_thread_proc, &param, 0, &tid);
1485 status = MsgWaitForMultipleObjects(1, &hthread, FALSE, V_I4(&timeout) ? V_I4(&timeout) * 1000: INFINITE, 0);
1486 if (status == WAIT_TIMEOUT)
1487 {
1489 MsgWaitForMultipleObjects(1, &hthread, FALSE, INFINITE, 0);
1490 param.button = -1;
1491 }
1492 *button = param.button;
1493
1494 VariantClear(&param.title);
1495 CloseHandle(hthread);
1496
1497 return S_OK;
1498}
#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:1826
static DWORD WINAPI popup_thread_proc(void *arg)
Definition: shell.c:1420
#define INFINITE
Definition: serial.h:102
static TfClientId tid
DWORD button
Definition: button.c:166
static char title[]
Definition: ps.c:92
#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)
Definition: dhcpd.h:248
HRESULT WINAPI DECLSPEC_HOTPATCH VariantChangeType(VARIANTARG *pvargDest, const VARIANTARG *pvargSrc, USHORT wFlags, VARTYPE vt)
Definition: variant.c:939
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
Definition: variant.c:626
void WINAPI VariantInit(VARIANTARG *pVarg)
Definition: variant.c:547

◆ WshShell3_put_CurrentDirectory()

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

Definition at line 1878 of file shell.c.

1879{
1880 TRACE("(%s)\n", debugstr_w(dir));
1881
1882 if (!dir)
1883 return E_INVALIDARG;
1884
1887
1888 return S_OK;
1889}
BOOL WINAPI SetCurrentDirectoryW(IN LPCWSTR lpPathName)
Definition: path.c:2267

◆ WshShell3_QueryInterface()

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

Definition at line 1207 of file shell.c.

1208{
1209 TRACE("(%s, %p)\n", debugstr_guid(riid), ppv);
1210
1211 *ppv = NULL;
1212
1214 IsEqualGUID(riid, &IID_IWshShell3) ||
1215 IsEqualGUID(riid, &IID_IWshShell2) ||
1216 IsEqualGUID(riid, &IID_IWshShell) ||
1218 {
1219 *ppv = iface;
1220 }
1221 else if (IsEqualGUID(riid, &IID_IDispatchEx))
1222 {
1223 return E_NOINTERFACE;
1224 }
1226 {
1227 *ppv = &WshShell3.classinfo.IProvideClassInfo_iface;
1228 }
1229 else
1230 {
1231 WARN("unknown iface %s\n", debugstr_guid(riid));
1232 return E_NOINTERFACE;
1233 }
1234
1235 IUnknown_AddRef((IUnknown *)*ppv);
1236 return S_OK;
1237}
struct provideclassinfo classinfo
Definition: shell.c:39

◆ WshShell3_RegDelete()

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

Definition at line 1808 of file shell.c.

1809{
1810 FIXME("(%s): stub\n", debugstr_w(Name));
1811 return E_NOTIMPL;
1812}
LPWSTR Name
Definition: desk.c:124

◆ WshShell3_RegRead()

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

Definition at line 1588 of file shell.c.

1589{
1591 WCHAR *subkey, *val;
1592 HRESULT hr;
1593 HKEY root;
1594
1595 TRACE("(%s %p)\n", debugstr_w(name), value);
1596
1597 if (!name || !value)
1598 return E_POINTER;
1599
1601 if (!root)
1603
1604 hr = split_reg_path(name, &subkey, &val);
1605 if (FAILED(hr))
1606 return hr;
1607
1608 type = REG_NONE;
1609 datalen = 0;
1610 ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, NULL, &datalen);
1611 if (ret == ERROR_SUCCESS) {
1612 void *data;
1613
1614 data = malloc(datalen);
1615 if (!data) {
1616 hr = E_OUTOFMEMORY;
1617 goto fail;
1618 }
1619
1620 ret = RegGetValueW(root, subkey, val, RRF_RT_ANY, &type, data, &datalen);
1621 if (ret) {
1622 free(data);
1624 goto fail;
1625 }
1626
1627 switch (type) {
1628 case REG_SZ:
1629 case REG_EXPAND_SZ:
1630 V_VT(value) = VT_BSTR;
1632 if (!V_BSTR(value))
1633 hr = E_OUTOFMEMORY;
1634 break;
1635 case REG_DWORD:
1636 V_VT(value) = VT_I4;
1637 V_I4(value) = *(DWORD*)data;
1638 break;
1639 case REG_BINARY:
1640 {
1641 BYTE *ptr = (BYTE*)data;
1642 SAFEARRAYBOUND bound;
1643 unsigned int i;
1644 SAFEARRAY *sa;
1645 VARIANT *v;
1646
1647 bound.lLbound = 0;
1648 bound.cElements = datalen;
1649 sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
1650 if (!sa)
1651 break;
1652
1653 hr = SafeArrayAccessData(sa, (void**)&v);
1654 if (FAILED(hr)) {
1656 break;
1657 }
1658
1659 for (i = 0; i < datalen; i++) {
1660 V_VT(&v[i]) = VT_UI1;
1661 V_UI1(&v[i]) = ptr[i];
1662 }
1664
1666 V_ARRAY(value) = sa;
1667 break;
1668 }
1669 case REG_MULTI_SZ:
1670 {
1671 WCHAR *ptr = (WCHAR*)data;
1672 SAFEARRAYBOUND bound;
1673 SAFEARRAY *sa;
1674 VARIANT *v;
1675
1676 /* get element count first */
1677 bound.lLbound = 0;
1678 bound.cElements = 0;
1679 while (*ptr) {
1680 bound.cElements++;
1681 ptr += lstrlenW(ptr)+1;
1682 }
1683
1684 sa = SafeArrayCreate(VT_VARIANT, 1, &bound);
1685 if (!sa)
1686 break;
1687
1688 hr = SafeArrayAccessData(sa, (void**)&v);
1689 if (FAILED(hr)) {
1691 break;
1692 }
1693
1694 ptr = (WCHAR*)data;
1695 while (*ptr) {
1696 V_VT(v) = VT_BSTR;
1698 ptr += lstrlenW(ptr)+1;
1699 v++;
1700 }
1701
1704 V_ARRAY(value) = sa;
1705 break;
1706 }
1707 default:
1708 FIXME("value type %ld not supported\n", type);
1709 hr = E_FAIL;
1710 };
1711
1712 free(data);
1713 if (FAILED(hr))
1715 }
1716 else
1718
1719fail:
1720 if (val)
1721 free(subkey);
1722 return hr;
1723}
#define REG_SZ
Definition: layer.c:22
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:1554
static HKEY get_root_key(const WCHAR *path)
Definition: shell.c:1528
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:1033
#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 1725 of file shell.c.

1726{
1727 DWORD regtype, data_len;
1728 WCHAR *subkey, *val;
1729 const BYTE *data;
1730 HRESULT hr;
1731 HKEY root;
1732 VARIANT v;
1733 LONG ret;
1734
1736
1737 if (!name || !value || !type)
1738 return E_POINTER;
1739
1741 if (!root)
1743
1744 /* value type */
1746 regtype = REG_SZ;
1747 else {
1748 if (V_VT(type) != VT_BSTR)
1749 return E_INVALIDARG;
1750
1751 if (!wcscmp(V_BSTR(type), L"REG_SZ"))
1752 regtype = REG_SZ;
1753 else if (!wcscmp(V_BSTR(type), L"REG_DWORD"))
1754 regtype = REG_DWORD;
1755 else if (!wcscmp(V_BSTR(type), L"REG_EXPAND_SZ"))
1756 regtype = REG_EXPAND_SZ;
1757 else if (!wcscmp(V_BSTR(type), L"REG_BINARY"))
1758 regtype = REG_BINARY;
1759 else {
1760 FIXME("unrecognized value type %s\n", debugstr_w(V_BSTR(type)));
1761 return E_FAIL;
1762 }
1763 }
1764
1765 /* it's always a string or a DWORD */
1766 VariantInit(&v);
1767 switch (regtype)
1768 {
1769 case REG_SZ:
1770 case REG_EXPAND_SZ:
1772 if (hr == S_OK) {
1773 data = (BYTE*)V_BSTR(&v);
1774 data_len = SysStringByteLen(V_BSTR(&v)) + sizeof(WCHAR);
1775 }
1776 break;
1777 case REG_DWORD:
1778 case REG_BINARY:
1779 hr = VariantChangeType(&v, value, 0, VT_I4);
1780 data = (BYTE*)&V_I4(&v);
1781 data_len = sizeof(DWORD);
1782 break;
1783 default:
1784 FIXME("unexpected regtype %ld\n", regtype);
1785 return E_FAIL;
1786 };
1787
1788 if (FAILED(hr)) {
1789 FIXME("failed to convert value, regtype %ld, %#lx.\n", regtype, hr);
1790 return hr;
1791 }
1792
1793 hr = split_reg_path(name, &subkey, &val);
1794 if (FAILED(hr))
1795 goto fail;
1796
1797 ret = RegSetKeyValueW(root, subkey, val, regtype, data, data_len);
1798 if (ret)
1800
1801fail:
1802 VariantClear(&v);
1803 if (val)
1804 free(subkey);
1805 return hr;
1806}
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
_ACRTIMP int __cdecl wcscmp(const wchar_t *, const wchar_t *)
Definition: wcs.c:1977
#define DWORD
Definition: nt_native.h:44
UINT WINAPI SysStringByteLen(BSTR str)
Definition: oleaut.c:217

◆ WshShell3_Release()

static ULONG WINAPI WshShell3_Release ( IWshShell3 *  iface)
static

Definition at line 1245 of file shell.c.

1246{
1247 TRACE("()\n");
1248 return 2;
1249}

◆ WshShell3_Run()

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

Definition at line 1342 of file shell.c.

1343{
1345 int waitforprocess, show;
1346 WCHAR *file, *params;
1347 VARIANT v;
1348 HRESULT hr;
1349 BOOL ret;
1350
1351 TRACE("(%s %s %s %p)\n", debugstr_w(cmd), debugstr_variant(style), debugstr_variant(wait), exit_code);
1352
1353 if (!style || !wait || !exit_code)
1354 return E_POINTER;
1355
1357 show = SW_SHOWNORMAL;
1358 else {
1359 VariantInit(&v);
1360 hr = VariantChangeType(&v, style, 0, VT_I4);
1361 if (FAILED(hr))
1362 return hr;
1363
1364 show = V_I4(&v);
1365 }
1366
1367 if (is_optional_argument(wait))
1368 waitforprocess = 0;
1369 else {
1370 VariantInit(&v);
1371 hr = VariantChangeType(&v, wait, 0, VT_I4);
1372 if (FAILED(hr))
1373 return hr;
1374
1375 waitforprocess = V_I4(&v);
1376 }
1377
1378 if (!(file = split_command(cmd, &params))) return E_OUTOFMEMORY;
1379
1380 memset(&info, 0, sizeof(info));
1381 info.cbSize = sizeof(info);
1382 info.fMask = SEE_MASK_FLAG_NO_UI;
1383 info.fMask |= waitforprocess ? SEE_MASK_NOASYNC | SEE_MASK_NOCLOSEPROCESS : SEE_MASK_DEFAULT;
1384 info.lpFile = file;
1385 info.lpParameters = params;
1386 info.nShow = show;
1387
1389 free(file);
1390 if (!ret)
1391 {
1392 TRACE("ShellExecute failed, %ld\n", GetLastError());
1394 }
1395 else
1396 {
1397 if (waitforprocess)
1398 {
1399 DWORD code;
1401 GetExitCodeProcess(info.hProcess, &code);
1402 CloseHandle(info.hProcess);
1403 *exit_code = code;
1404 }
1405 else
1406 *exit_code = 0;
1407
1408 }
1409 return S_OK;
1410}
static WCHAR * split_command(BSTR cmd, WCHAR **params)
Definition: shell.c:1320
static UINT exit_code
Definition: process.c:80
#define SW_SHOWNORMAL
Definition: winuser.h:781
#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
#define SEE_MASK_FLAG_NO_UI
Definition: shellapi.h:38
BOOL WINAPI DECLSPEC_HOTPATCH ShellExecuteExW(LPSHELLEXECUTEINFOW sei)
Definition: shlexec.cpp:2732
Definition: fci.c:123
Definition: style.c:91

◆ WshShell3_SendKeys()

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

Definition at line 1826 of file shell.c.

1827{
1828 FIXME("(%s %p): stub\n", debugstr_w(Keys), Wait);
1829 return E_NOTIMPL;
1830}

◆ WshShellFactory_CreateInstance()

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

Definition at line 1916 of file shell.c.

1917{
1918 TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
1919
1922 return IWshShell3_QueryInterface(&WshShell3.IWshShell3_iface, riid, ppv);
1923}
static const IWshShell3Vtbl WshShell3Vtbl
Definition: shell.c:1891
static IUnknown * outer
Definition: compobj.c:82

◆ WshShortcut_AddRef()

static ULONG WINAPI WshShortcut_AddRef ( IWshShortcut *  iface)
static

Definition at line 867 of file shell.c.

868{
871 TRACE("%p, refcount %ld.\n", iface, ref);
872 return ref;
873}
static WshShortcut * impl_from_IWshShortcut(IWshShortcut *iface)
Definition: shell.c:84

◆ WshShortcut_Create()

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

Definition at line 1173 of file shell.c.

1174{
1176 HRESULT hr;
1177
1178 *shortcut = NULL;
1179
1180 if (!(object = calloc(1, sizeof(*object))))
1181 return E_OUTOFMEMORY;
1182
1183 object->IWshShortcut_iface.lpVtbl = &WshShortcutVtbl;
1184 object->ref = 1;
1185
1186 hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, &IID_IShellLinkW, (void **)&object->link);
1187 if (FAILED(hr))
1188 {
1189 free(object);
1190 return hr;
1191 }
1192
1193 object->path_link = wcsdup(path);
1194 if (!object->path_link)
1195 {
1196 IShellLinkW_Release(object->link);
1197 free(object);
1198 return E_OUTOFMEMORY;
1199 }
1200
1201 init_classinfo(&IID_IWshShortcut, (IUnknown *)&object->IWshShortcut_iface, &object->classinfo);
1202 *shortcut = (IDispatch *)&object->IWshShortcut_iface;
1203
1204 return S_OK;
1205}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
static const IWshShortcutVtbl WshShortcutVtbl
Definition: shell.c:1145

Referenced by WshShell3_CreateShortcut().

◆ WshShortcut_get_Arguments()

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

Definition at line 950 of file shell.c.

951{
953 WCHAR buffW[INFOTIPSIZE];
954 HRESULT hr;
955
956 TRACE("(%p)->(%p)\n", This, Arguments);
957
958 if (!Arguments)
959 return E_POINTER;
960
961 *Arguments = NULL;
962
963 hr = IShellLinkW_GetArguments(This->link, buffW, ARRAY_SIZE(buffW));
964 if (FAILED(hr))
965 return hr;
966
967 *Arguments = SysAllocString(buffW);
968 return *Arguments ? S_OK : E_OUTOFMEMORY;
969}
#define INFOTIPSIZE
Definition: commctrl.h:124

◆ WshShortcut_get_Description()

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

Definition at line 980 of file shell.c.

981{
983 FIXME("(%p)->(%p): stub\n", This, Description);
984 return E_NOTIMPL;
985}
_Must_inspect_result_ _In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_opt_ LPGUID _In_opt_ HANDLE _In_opt_ ULONG _In_opt_ ULONG _In_opt_ ULONG _In_opt_ PLARGE_INTEGER _In_opt_ PUNICODE_STRING Description
Definition: nttmapi.h:425

◆ WshShortcut_get_FullName()

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

Definition at line 943 of file shell.c.

944{
946 FIXME("(%p)->(%p): stub\n", This, name);
947 return E_NOTIMPL;
948}

◆ WshShortcut_get_Hotkey()

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

Definition at line 994 of file shell.c.

995{
997 FIXME("(%p)->(%p): stub\n", This, Hotkey);
998 return E_NOTIMPL;
999}

◆ WshShortcut_get_IconLocation()

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

Definition at line 1008 of file shell.c.

1009{
1011 WCHAR buffW[MAX_PATH], pathW[MAX_PATH];
1012 INT icon = 0;
1013 HRESULT hr;
1014
1015 TRACE("(%p)->(%p)\n", This, IconPath);
1016
1017 if (!IconPath)
1018 return E_POINTER;
1019
1020 hr = IShellLinkW_GetIconLocation(This->link, buffW, ARRAY_SIZE(buffW), &icon);
1021 if (FAILED(hr)) return hr;
1022
1023 swprintf(pathW, ARRAY_SIZE(pathW), L"%s, %d", buffW, icon);
1025 if (!*IconPath) return E_OUTOFMEMORY;
1026
1027 return S_OK;
1028}
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 1069 of file shell.c.

1070{
1072 FIXME("(%p)->(%p): stub\n", This, Path);
1073 return E_NOTIMPL;
1074}
PRTL_UNICODE_STRING_BUFFER Path

◆ WshShortcut_get_WindowStyle()

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

Definition at line 1083 of file shell.c.

1084{
1086 TRACE("(%p)->(%p)\n", This, ShowCmd);
1087 return IShellLinkW_GetShowCmd(This->link, ShowCmd);
1088}

◆ WshShortcut_get_WorkingDirectory()

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

Definition at line 1097 of file shell.c.

1098{
1100 WCHAR buffW[MAX_PATH];
1101 HRESULT hr;
1102
1103 TRACE("(%p)->(%p)\n", This, WorkingDirectory);
1104
1105 if (!WorkingDirectory)
1106 return E_POINTER;
1107
1108 *WorkingDirectory = NULL;
1109 hr = IShellLinkW_GetWorkingDirectory(This->link, buffW, ARRAY_SIZE(buffW));
1110 if (FAILED(hr)) return hr;
1111
1112 *WorkingDirectory = SysAllocString(buffW);
1113 return *WorkingDirectory ? S_OK : E_OUTOFMEMORY;
1114}

◆ WshShortcut_GetIDsOfNames()

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

Definition at line 906 of file shell.c.

908{
910 HRESULT hr;
911
912 TRACE("%p, %s, %p, %u, %lx, %p.\n", iface, debugstr_guid(riid), rgszNames, cNames, lcid, rgDispId);
913
915 if(SUCCEEDED(hr))
916 {
917 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
918 ITypeInfo_Release(typeinfo);
919 }
920
921 return hr;
922}
@ 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 899 of file shell.c.

900{
901 TRACE("%p, %u, %lx, %p.\n", iface, iTInfo, lcid, ppTInfo);
902
903 return get_typeinfo(IWshShortcut_tid, ppTInfo);
904}

◆ WshShortcut_GetTypeInfoCount()

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

Definition at line 891 of file shell.c.

892{
894 TRACE("(%p)->(%p)\n", This, pctinfo);
895 *pctinfo = 1;
896 return S_OK;
897}

◆ 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 924 of file shell.c.

926{
928 HRESULT hr;
929
930 TRACE("%p, %ld, %s, %lx, %d, %p, %p, %p, %p.\n", iface, dispIdMember, debugstr_guid(riid),
931 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
932
934 if(SUCCEEDED(hr))
935 {
936 hr = ITypeInfo_Invoke(typeinfo, iface, dispIdMember, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
937 ITypeInfo_Release(typeinfo);
938 }
939
940 return hr;
941}

◆ WshShortcut_Load()

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

Definition at line 1123 of file shell.c.

1124{
1126 FIXME("(%p)->(%s): stub\n", This, debugstr_w(PathLink));
1127 return E_NOTIMPL;
1128}

◆ WshShortcut_put_Arguments()

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

Definition at line 971 of file shell.c.

972{
974
975 TRACE("(%p)->(%s)\n", This, debugstr_w(Arguments));
976
977 return IShellLinkW_SetArguments(This->link, Arguments);
978}

◆ WshShortcut_put_Description()

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

Definition at line 987 of file shell.c.

988{
990 TRACE("(%p)->(%s)\n", This, debugstr_w(Description));
991 return IShellLinkW_SetDescription(This->link, Description);
992}

◆ WshShortcut_put_Hotkey()

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

Definition at line 1001 of file shell.c.

1002{
1004 FIXME("(%p)->(%s): stub\n", This, debugstr_w(Hotkey));
1005 return E_NOTIMPL;
1006}

◆ WshShortcut_put_IconLocation()

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

Definition at line 1030 of file shell.c.

1031{
1033 HRESULT hr;
1034 WCHAR *ptr;
1035 BSTR path;
1036 INT icon;
1037
1038 TRACE("(%p)->(%s)\n", This, debugstr_w(IconPath));
1039
1040 /* scan for icon id */
1041 ptr = wcsrchr(IconPath, ',');
1042 if (!ptr)
1043 {
1044 WARN("icon index not found\n");
1045 return E_FAIL;
1046 }
1047
1049
1050 /* skip spaces if any */
1051 while (iswspace(*++ptr))
1052 ;
1053
1054 icon = wcstol(ptr, NULL, 10);
1055
1056 hr = IShellLinkW_SetIconLocation(This->link, path, icon);
1058
1059 return hr;
1060}
_ACRTIMP __msvcrt_long __cdecl wcstol(const wchar_t *, wchar_t **, int)
Definition: wcs.c:2752
#define iswspace(_c)
Definition: ctype.h:669

◆ WshShortcut_put_RelativePath()

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

Definition at line 1062 of file shell.c.

1063{
1065 FIXME("(%p)->(%s): stub\n", This, debugstr_w(rhs));
1066 return E_NOTIMPL;
1067}

◆ WshShortcut_put_TargetPath()

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

Definition at line 1076 of file shell.c.

1077{
1079 TRACE("(%p)->(%s)\n", This, debugstr_w(Path));
1080 return IShellLinkW_SetPath(This->link, Path);
1081}

◆ WshShortcut_put_WindowStyle()

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

Definition at line 1090 of file shell.c.

1091{
1093 TRACE("(%p)->(%d)\n", This, ShowCmd);
1094 return IShellLinkW_SetShowCmd(This->link, ShowCmd);
1095}

◆ WshShortcut_put_WorkingDirectory()

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

Definition at line 1116 of file shell.c.

1117{
1119 TRACE("(%p)->(%s)\n", This, debugstr_w(WorkingDirectory));
1120 return IShellLinkW_SetWorkingDirectory(This->link, WorkingDirectory);
1121}

◆ WshShortcut_QueryInterface()

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

Definition at line 841 of file shell.c.

842{
844
845 TRACE("(%p)->(%s, %p)\n", This, debugstr_guid(riid), ppv);
846
849 IsEqualGUID(riid, &IID_IWshShortcut))
850 {
851 *ppv = iface;
852 }
854 {
855 *ppv = &This->classinfo.IProvideClassInfo_iface;
856 }
857 else {
858 FIXME("Unknown iface %s\n", debugstr_guid(riid));
859 *ppv = NULL;
860 return E_NOINTERFACE;
861 }
862
863 IUnknown_AddRef((IUnknown*)*ppv);
864 return S_OK;
865}

◆ WshShortcut_Release()

static ULONG WINAPI WshShortcut_Release ( IWshShortcut *  iface)
static

Definition at line 875 of file shell.c.

876{
879 TRACE("%p, refcount %ld.\n", iface, ref);
880
881 if (!ref)
882 {
883 IShellLinkW_Release(This->link);
884 free(This->path_link);
885 free(This);
886 }
887
888 return ref;
889}

◆ WshShortcut_Save()

static HRESULT WINAPI WshShortcut_Save ( IWshShortcut *  iface)
static

Definition at line 1130 of file shell.c.

1131{
1134 HRESULT hr;
1135
1136 TRACE("(%p)\n", This);
1137
1138 IShellLinkW_QueryInterface(This->link, &IID_IPersistFile, (void**)&file);
1139 hr = IPersistFile_Save(file, This->path_link, TRUE);
1140 IPersistFile_Release(file);
1141
1142 return hr;
1143}
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:642
static HRESULT WINAPI WshCollection_Item(IWshCollection *iface, VARIANT *index, VARIANT *value)
Definition: shell.c:742
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:723
static HRESULT WINAPI WshCollection_GetTypeInfo(IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:698
static ULONG WINAPI WshCollection_Release(IWshCollection *iface)
Definition: shell.c:678
static HRESULT WINAPI WshCollection_get_length(IWshCollection *iface, LONG *count)
Definition: shell.c:796
static ULONG WINAPI WshCollection_AddRef(IWshCollection *iface)
Definition: shell.c:668
static HRESULT WINAPI WshCollection__NewEnum(IWshCollection *iface, IUnknown **Enum)
Definition: shell.c:803
static HRESULT WINAPI WshCollection_GetIDsOfNames(IWshCollection *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:705
static HRESULT WINAPI WshCollection_Count(IWshCollection *iface, LONG *count)
Definition: shell.c:789
static HRESULT WINAPI WshCollection_GetTypeInfoCount(IWshCollection *iface, UINT *pctinfo)
Definition: shell.c:690

Definition at line 810 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:494
static HRESULT WINAPI WshEnvironment__NewEnum(IWshEnvironment *iface, IUnknown **penum)
Definition: shell.c:596
static HRESULT WINAPI WshEnvironment_GetTypeInfo(IWshEnvironment *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:502
static HRESULT WINAPI WshEnvironment_put_Item(IWshEnvironment *iface, BSTR name, BSTR value)
Definition: shell.c:575
static HRESULT WINAPI WshEnvironment_get_length(IWshEnvironment *iface, LONG *len)
Definition: shell.c:589
static HRESULT WINAPI WshEnvironment_get_Item(IWshEnvironment *iface, BSTR name, BSTR *value)
Definition: shell.c:563
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:527
static HRESULT WINAPI WshEnvironment_Remove(IWshEnvironment *iface, BSTR name)
Definition: shell.c:603
static HRESULT WINAPI WshEnvironment_QueryInterface(IWshEnvironment *iface, REFIID riid, void **obj)
Definition: shell.c:448
static ULONG WINAPI WshEnvironment_Release(IWshEnvironment *iface)
Definition: shell.c:482
static ULONG WINAPI WshEnvironment_AddRef(IWshEnvironment *iface)
Definition: shell.c:474
static HRESULT WINAPI WshEnvironment_GetIDsOfNames(IWshEnvironment *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:509
static HRESULT WINAPI WshEnvironment_Count(IWshEnvironment *iface, LONG *count)
Definition: shell.c:582

Definition at line 610 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:133
static HRESULT WINAPI WshExec_Terminate(IWshExec *iface)
Definition: shell.c:304
static HRESULT WINAPI WshExec_QueryInterface(IWshExec *iface, REFIID riid, void **obj)
Definition: shell.c:99
static HRESULT WINAPI WshExec_GetTypeInfo(IWshExec *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:164
static HRESULT WINAPI WshExec_get_ExitCode(IWshExec *iface, int *code)
Definition: shell.c:285
static HRESULT WINAPI WshExec_get_StdIn(IWshExec *iface, ITextStream **stream)
Definition: shell.c:236
static HRESULT WINAPI WshExec_GetIDsOfNames(IWshExec *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:171
static HRESULT WINAPI WshExec_GetTypeInfoCount(IWshExec *iface, UINT *pctinfo)
Definition: shell.c:156
static HRESULT WINAPI WshExec_get_StdErr(IWshExec *iface, ITextStream **stream)
Definition: shell.c:260
static HRESULT WINAPI WshExec_get_ProcessID(IWshExec *iface, int *pid)
Definition: shell.c:272
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:189
static ULONG WINAPI WshExec_AddRef(IWshExec *iface)
Definition: shell.c:125
static HRESULT WINAPI WshExec_get_Status(IWshExec *iface, WshExecStatus *status)
Definition: shell.c:208
static HRESULT WINAPI WshExec_get_StdOut(IWshExec *iface, ITextStream **stream)
Definition: shell.c:248

Definition at line 327 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:1251
static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, VARIANT *wait, int *exit_code)
Definition: shell.c:1342
static HRESULT WINAPI WshShell3_AppActivate(IWshShell3 *iface, VARIANT *App, VARIANT *Wait, VARIANT_BOOL *out_Success)
Definition: shell.c:1820
static HRESULT WINAPI WshShell3_RegDelete(IWshShell3 *iface, BSTR Name)
Definition: shell.c:1808
static HRESULT WINAPI WshShell3_get_CurrentDirectory(IWshShell3 *iface, BSTR *dir)
Definition: shell.c:1854
static ULONG WINAPI WshShell3_Release(IWshShell3 *iface)
Definition: shell.c:1245
static ULONG WINAPI WshShell3_AddRef(IWshShell3 *iface)
Definition: shell.c:1239
static HRESULT WINAPI WshShell3_RegWrite(IWshShell3 *iface, BSTR name, VARIANT *value, VARIANT *type)
Definition: shell.c:1725
static HRESULT WINAPI WshShell3_get_SpecialFolders(IWshShell3 *iface, IWshCollection **folders)
Definition: shell.c:1303
static HRESULT WINAPI WshShell3_SendKeys(IWshShell3 *iface, BSTR Keys, VARIANT *Wait)
Definition: shell.c:1826
static HRESULT WINAPI WshShell3_GetTypeInfo(IWshShell3 *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:1258
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:1283
static HRESULT WINAPI WshShell3_QueryInterface(IWshShell3 *iface, REFIID riid, void **ppv)
Definition: shell.c:1207
static HRESULT WINAPI WshShell3_LogEvent(IWshShell3 *iface, VARIANT *Type, BSTR Message, BSTR Target, VARIANT_BOOL *out_Success)
Definition: shell.c:1814
static HRESULT WINAPI WshShell3_RegRead(IWshShell3 *iface, BSTR name, VARIANT *value)
Definition: shell.c:1588
static HRESULT WINAPI WshShell3_GetIDsOfNames(IWshShell3 *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:1265
static HRESULT WINAPI WshShell3_Exec(IWshShell3 *iface, BSTR command, IWshExec **ret)
Definition: shell.c:1832
static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch **Shortcut)
Definition: shell.c:1500
static HRESULT WINAPI WshShell3_get_Environment(IWshShell3 *iface, VARIANT *type, IWshEnvironment **env)
Definition: shell.c:1309
static HRESULT WINAPI WshShell3_put_CurrentDirectory(IWshShell3 *iface, BSTR dir)
Definition: shell.c:1878
static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, VARIANT *type, int *button)
Definition: shell.c:1429

Definition at line 1891 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:1083
static HRESULT WINAPI WshShortcut_put_Hotkey(IWshShortcut *iface, BSTR Hotkey)
Definition: shell.c:1001
static HRESULT WINAPI WshShortcut_put_Arguments(IWshShortcut *iface, BSTR Arguments)
Definition: shell.c:971
static HRESULT WINAPI WshShortcut_get_Arguments(IWshShortcut *iface, BSTR *Arguments)
Definition: shell.c:950
static HRESULT WINAPI WshShortcut_get_WorkingDirectory(IWshShortcut *iface, BSTR *WorkingDirectory)
Definition: shell.c:1097
static HRESULT WINAPI WshShortcut_put_WorkingDirectory(IWshShortcut *iface, BSTR WorkingDirectory)
Definition: shell.c:1116
static HRESULT WINAPI WshShortcut_put_RelativePath(IWshShortcut *iface, BSTR rhs)
Definition: shell.c:1062
static HRESULT WINAPI WshShortcut_put_TargetPath(IWshShortcut *iface, BSTR Path)
Definition: shell.c:1076
static HRESULT WINAPI WshShortcut_get_Description(IWshShortcut *iface, BSTR *Description)
Definition: shell.c:980
static HRESULT WINAPI WshShortcut_put_WindowStyle(IWshShortcut *iface, int ShowCmd)
Definition: shell.c:1090
static HRESULT WINAPI WshShortcut_Load(IWshShortcut *iface, BSTR PathLink)
Definition: shell.c:1123
static HRESULT WINAPI WshShortcut_GetIDsOfNames(IWshShortcut *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: shell.c:906
static HRESULT WINAPI WshShortcut_get_TargetPath(IWshShortcut *iface, BSTR *Path)
Definition: shell.c:1069
static HRESULT WINAPI WshShortcut_put_IconLocation(IWshShortcut *iface, BSTR IconPath)
Definition: shell.c:1030
static HRESULT WINAPI WshShortcut_get_IconLocation(IWshShortcut *iface, BSTR *IconPath)
Definition: shell.c:1008
static ULONG WINAPI WshShortcut_AddRef(IWshShortcut *iface)
Definition: shell.c:867
static HRESULT WINAPI WshShortcut_QueryInterface(IWshShortcut *iface, REFIID riid, void **ppv)
Definition: shell.c:841
static ULONG WINAPI WshShortcut_Release(IWshShortcut *iface)
Definition: shell.c:875
static HRESULT WINAPI WshShortcut_get_FullName(IWshShortcut *iface, BSTR *name)
Definition: shell.c:943
static HRESULT WINAPI WshShortcut_GetTypeInfoCount(IWshShortcut *iface, UINT *pctinfo)
Definition: shell.c:891
static HRESULT WINAPI WshShortcut_GetTypeInfo(IWshShortcut *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: shell.c:899
static HRESULT WINAPI WshShortcut_put_Description(IWshShortcut *iface, BSTR Description)
Definition: shell.c:987
static HRESULT WINAPI WshShortcut_Save(IWshShortcut *iface)
Definition: shell.c:1130
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:924
static HRESULT WINAPI WshShortcut_get_Hotkey(IWshShortcut *iface, BSTR *Hotkey)
Definition: shell.c:994

Definition at line 1145 of file shell.c.

Referenced by WshShortcut_Create().