67{
68 static const WCHAR notepadW[] = {
'n',
'o',
't',
'e',
'p',
'a',
'd',
'.',
'e',
'x',
'e',0};
69 static const WCHAR desktopW[] = {
'D',
'e',
's',
'k',
't',
'o',
'p',0};
70 static const WCHAR lnk1W[] = {
'f',
'i',
'l',
'e',
'.',
'l',
'n',
'k',0};
71 static const WCHAR pathW[] = {
'%',
'P',
'A',
'T',
'H',
'%',0};
72 static const WCHAR sysW[] = {
'S',
'Y',
'S',
'T',
'E',
'M',0};
73 static const WCHAR path2W[] = {
'P',
'A',
'T',
'H',0};
74 static const WCHAR dummydirW[] = {
'd',
'e',
'a',
'd',
'p',
'a',
'r',
'r',
'o',
't',0};
75 static const WCHAR emptyW[] = {
'e',
'm',
'p',
't',
'y',0};
76 static const WCHAR cmdexeW[] = {
'\\',
'c',
'm',
'd',
'.',
'e',
'x',
'e',0};
77 static const WCHAR testdirW[] = {
'w',
's',
'h',
'o',
'm',
' ',
't',
'e',
's',
't',
' ',
'd',
'i',
'r',0};
78 static const WCHAR paramsW[] =
79 {' ','/','c',' ','r','d',' ','/','s',' ','/','q',' ','c',':','\\','n','o','s','u','c','h','d','i','r',0};
80 static const WCHAR cmdW[] =
81 {'c','m','d','.','e','x','e',' ','/','c',' ','r','d',' ','/','s',' ','/','q',' ','c',':','\\',
82 'n','o','s','u','c','h','d','i','r',0};
83 static const WCHAR cmd2W[] =
84 {'"','c','m','d','.','e','x','e',' ','"',' ','/','c',' ','r','d',' ','/','s',' ','/','q',' ','c',':','\\',
85 'n','o','s','u','c','h','d','i','r',0};
88 IWshExec *shexec;
89 IWshShell3 *sh3;
91 IWshCollection *coll;
94 IFolderCollection *folders;
95 IWshShortcut *shcut;
98 TYPEATTR *tattr;
105
109
110 hr = IDispatch_QueryInterface(disp, &IID_IWshShell3, (
void**)&
shell);
113
114 hr = IDispatch_QueryInterface(disp, &IID_IDispatchEx, (
void**)&dispex);
116 IDispatch_Release(disp);
117
118 hr = IUnknown_QueryInterface(
shell, &IID_IWshShell3, (
void**)&sh3);
120
123
124 hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell, (
void**)&unk);
126 IUnknown_Release(unk);
127
128 hr = IWshShell3_QueryInterface(sh3, &IID_IWshShell2, (
void**)&unk);
130 IUnknown_Release(unk);
131
132 hr = IWshShell3_get_SpecialFolders(sh3, &coll);
135
136 hr = IWshCollection_QueryInterface(coll, &IID_IFolderCollection, (
void**)&folders);
138
139 hr = IWshCollection_QueryInterface(coll, &
IID_IDispatch, (
void**)&disp);
141
142 hr = IDispatch_GetTypeInfo(disp, 0, 0, &ti);
144
145 hr = ITypeInfo_GetTypeAttr(ti, &tattr);
147 ok(
IsEqualIID(&tattr->guid, &IID_IWshCollection),
"got wrong type guid\n");
148 ITypeInfo_ReleaseTypeAttr(ti, tattr);
149
150
155 dp.rgdispidNamedArgs =
NULL;
156 dp.cArgs = 1;
157 dp.cNamedArgs = 0;
160
161
163 hr = IWshCollection_Item(coll, &
arg, &
res);
169
170
172 hr = IWshShell3_CreateShortcut(sh3,
str, &shortcut);
175 hr = IDispatch_QueryInterface(shortcut, &IID_IWshShortcut, (
void**)&shcut);
178
179 hr = IWshShortcut_get_Arguments(shcut,
NULL);
181
182 hr = IWshShortcut_get_IconLocation(shcut,
NULL);
184
185 IWshShortcut_Release(shcut);
186 IDispatch_Release(shortcut);
187
188
189 hr = IWshShell3_ExpandEnvironmentStrings(sh3,
NULL,
NULL);
191
193 hr = IWshShell3_ExpandEnvironmentStrings(sh3,
str,
NULL);
196
199 hr = IWshShell3_get_Environment(sh3, &
arg, &
env);
202
206
212
213
217
225
226
234
235 IWshEnvironment_Release(
env);
236
241
245
246 retval = 10;
249 ok(retval == 10,
"got %u\n", retval);
250
251 retval = 10;
254 ok(retval == 10,
"got %u\n", retval);
255
256 retval = 10;
261 ok(retval == 10,
"got %u\n", retval);
263
266
267 retval = 0xdeadbeef;
273
274 retval = 0xdeadbeef;
280
285
286
292
297
298 retval = 0xdeadbeef;
304
308
309
310 if (0)
311 hr = IWshShell3_get_CurrentDirectory(sh3,
NULL);
312
314 hr = IWshShell3_get_CurrentDirectory(sh3, &
str);
316 ok(
str &&
str[0] != 0,
"got empty string\n");
319
320 hr = IWshShell3_put_CurrentDirectory(sh3,
NULL);
323
325 hr = IWshShell3_put_CurrentDirectory(sh3,
str);
328
330 hr = IWshShell3_put_CurrentDirectory(sh3,
str);
333
334
337
338 hr = IWshShell3_Exec(sh3,
NULL, &shexec);
340
342 hr = IWshShell3_Exec(sh3,
str, &shexec);
345
346 IWshCollection_Release(coll);
347 IDispatch_Release(disp);
348 IWshShell3_Release(sh3);
349 IUnknown_Release(
shell);
350}
void shell(int argc, const char *argv[])
static LPCWSTR LPCWSTR LPCWSTR env
BOOL WINAPI CopyFileW(IN LPCWSTR lpExistingFileName, IN LPCWSTR lpNewFileName, IN BOOL bFailIfExists)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
BOOL WINAPI CreateDirectoryW(IN LPCWSTR lpPathName, IN LPSECURITY_ATTRIBUTES lpSecurityAttributes)
BOOL WINAPI RemoveDirectoryW(IN LPCWSTR lpPathName)
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
DWORD WINAPI GetTempPathW(IN DWORD count, OUT LPWSTR path)
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
static const WCHAR desktopW[]
GLuint GLuint GLuint GLuint GLuint GLuint GLuint arg2
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR emptyW[]
const IID IID_IObjectWithSite
static const WCHAR sysW[]
static const WCHAR path2[]
struct stdole::DISPPARAMS DISPPARAMS
struct stdole::EXCEPINFO EXCEPINFO
#define DISPATCH_PROPERTYGET
#define IsEqualIID(riid1, riid2)
#define INVALID_FILE_ATTRIBUTES
#define DISP_E_MEMBERNOTFOUND
#define DISP_E_TYPEMISMATCH
#define test_provideclassinfo(a, b)
#define EXPECT_HR(hr, hr_exp)