ReactOS 0.4.15-dev-7942-gd23573b
run.c
Go to the documentation of this file.
1/*
2 * Copyright 2011 Jacek Caban for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19#include <stdio.h>
20
21#define COBJMACROS
22#define CONST_VTABLE
23
24#define PSAPI_VERSION 1
25#include <initguid.h>
26#include <windows.h>
27#include <psapi.h>
28#include <oaidl.h>
29
30#include "wine/test.h"
31
32#define DEFINE_EXPECT(func) \
33 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
34
35#define SET_EXPECT(func) \
36 expect_ ## func = TRUE
37
38#define CLEAR_CALLED(func) \
39 expect_ ## func = called_ ## func = FALSE
40
41#define CHECK_EXPECT2(func) \
42 do { \
43 ok(expect_ ##func, "unexpected call " #func "\n"); \
44 called_ ## func = TRUE; \
45 }while(0)
46
47#define CHECK_EXPECT(func) \
48 do { \
49 CHECK_EXPECT2(func); \
50 expect_ ## func = FALSE; \
51 }while(0)
52
53#define CHECK_CALLED(func) \
54 do { \
55 ok(called_ ## func, "expected " #func "\n"); \
56 expect_ ## func = called_ ## func = FALSE; \
57 }while(0)
58
59DEFINE_EXPECT(reportSuccess);
60
61#define DISPID_TESTOBJ_OK 10000
62#define DISPID_TESTOBJ_TRACE 10001
63#define DISPID_TESTOBJ_REPORTSUCCESS 10002
64#define DISPID_TESTOBJ_WSCRIPTFULLNAME 10003
65#define DISPID_TESTOBJ_WSCRIPTPATH 10004
66#define DISPID_TESTOBJ_WSCRIPTSCRIPTNAME 10005
67#define DISPID_TESTOBJ_WSCRIPTSCRIPTFULLNAME 10006
68
69#define TESTOBJ_CLSID "{178fc166-f585-4e24-9c13-4bb7faf80646}"
70
71static const GUID CLSID_TestObj =
72 {0x178fc166,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}};
73
74static const char *script_name;
76
77static int strcmp_wa(LPCWSTR strw, const char *stra)
78{
79 WCHAR buf[512];
81 return lstrcmpW(strw, buf);
82}
83
84static const WCHAR* mystrrchr(const WCHAR *str, WCHAR ch)
85{
86 const WCHAR *pos = NULL, *current = str;
87 while(*current != 0) {
88 if(*current == ch)
89 pos = current;
90 ++current;
91 }
92 return pos;
93}
94
95static BSTR a2bstr(const char *str)
96{
97 BSTR ret;
98 int len;
99
100 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
103
104 return ret;
105}
106
108{
110 *ppv = iface;
111 return S_OK;
112 }
113
114 *ppv = NULL;
115 return E_NOINTERFACE;
116}
117
119{
120 return 2;
121}
122
124{
125 return 1;
126}
127
129{
130 ok(0, "unexpected call\n");
131 return E_NOTIMPL;
132}
133
135 LCID lcid, ITypeInfo **ppTInfo)
136{
137 ok(0, "unexpected call\n");
138 return E_NOTIMPL;
139}
140
142 LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
143{
144 unsigned i;
145
146 for(i=0; i<cNames; i++) {
147 if(!strcmp_wa(rgszNames[i], "ok")) {
148 rgDispId[i] = DISPID_TESTOBJ_OK;
149 }else if(!strcmp_wa(rgszNames[i], "trace")) {
150 rgDispId[i] = DISPID_TESTOBJ_TRACE;
151 }else if(!strcmp_wa(rgszNames[i], "reportSuccess")) {
153 }else if(!strcmp_wa(rgszNames[i], "wscriptFullName")) {
155 }else if(!strcmp_wa(rgszNames[i], "wscriptPath")) {
156 rgDispId[i] = DISPID_TESTOBJ_WSCRIPTPATH;
157 }else if(!strcmp_wa(rgszNames[i], "wscriptScriptName")) {
159 }else if(!strcmp_wa(rgszNames[i], "wscriptScriptFullName")) {
161 }else {
162 ok(0, "unexpected name %s\n", wine_dbgstr_w(rgszNames[i]));
163 return DISP_E_UNKNOWNNAME;
164 }
165 }
166
167 return S_OK;
168}
169
170static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
171 WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
172{
173 switch(dispIdMember) {
174 case DISPID_TESTOBJ_OK: {
175 VARIANT *expr, *msg;
176
177 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
178 ok(pdp->cArgs == 2, "cArgs = %d\n", pdp->cArgs);
179 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
180
181 expr = pdp->rgvarg+1;
182 if(V_VT(expr) == (VT_VARIANT|VT_BYREF))
184
185 msg = pdp->rgvarg;
186 if(V_VT(msg) == (VT_VARIANT|VT_BYREF))
188
189 ok(V_VT(msg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(msg));
190 ok(V_VT(expr) == VT_BOOL, "V_VT(psp->rgvargs+1) = %d\n", V_VT(expr));
191 ok(V_BOOL(expr), "%s: %s\n", script_name, wine_dbgstr_w(V_BSTR(msg)));
192 if(pVarResult)
193 V_VT(pVarResult) = VT_EMPTY;
194 break;
195 }
197 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
198 ok(pdp->cArgs == 1, "cArgs = %d\n", pdp->cArgs);
199 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
200 ok(V_VT(pdp->rgvarg) == VT_BSTR, "V_VT(psp->rgvargs) = %d\n", V_VT(pdp->rgvarg));
201 trace("%s: %s\n", script_name, wine_dbgstr_w(V_BSTR(pdp->rgvarg)));
202 if(pVarResult)
203 V_VT(pVarResult) = VT_EMPTY;
204 break;
206 CHECK_EXPECT(reportSuccess);
207
208 ok(wFlags == INVOKE_FUNC, "wFlags = %x\n", wFlags);
209 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
210 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
211 if(pVarResult)
212 V_VT(pVarResult) = VT_EMPTY;
213 break;
215 {
217 DWORD res;
218
219 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
220 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
221 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
222 V_VT(pVarResult) = VT_BSTR;
224 if(res == 0)
225 return E_FAIL;
226 if(!(V_BSTR(pVarResult) = SysAllocString(fullName)))
227 return E_OUTOFMEMORY;
228 break;
229 }
231 {
232 WCHAR fullPath[MAX_PATH];
233 DWORD res;
234 const WCHAR *pos;
235
236 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
237 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
238 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
239 V_VT(pVarResult) = VT_BSTR;
240 res = GetModuleFileNameExW(wscript_process, NULL, fullPath, ARRAY_SIZE(fullPath));
241 if(res == 0)
242 return E_FAIL;
243 pos = mystrrchr(fullPath, '\\');
244 if(!(V_BSTR(pVarResult) = SysAllocStringLen(fullPath, pos-fullPath)))
245 return E_OUTOFMEMORY;
246 break;
247 }
249 {
250 char fullPath[MAX_PATH];
251 char *pos;
252 long res;
253
254 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
255 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
256 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
257 V_VT(pVarResult) = VT_BSTR;
258 res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, &pos);
259 if(!res || res > sizeof(fullPath))
260 return E_FAIL;
261 if(!(V_BSTR(pVarResult) = a2bstr(pos)))
262 return E_OUTOFMEMORY;
263 break;
264 }
266 {
267 char fullPath[MAX_PATH];
268 long res;
269
270 ok(wFlags == INVOKE_PROPERTYGET, "wFlags = %x\n", wFlags);
271 ok(pdp->cArgs == 0, "cArgs = %d\n", pdp->cArgs);
272 ok(!pdp->cNamedArgs, "cNamedArgs = %d\n", pdp->cNamedArgs);
273 V_VT(pVarResult) = VT_BSTR;
274 res = GetFullPathNameA(script_name, sizeof(fullPath), fullPath, NULL);
275 if(!res || res > sizeof(fullPath))
276 return E_FAIL;
277 if(!(V_BSTR(pVarResult) = a2bstr(fullPath)))
278 return E_OUTOFMEMORY;
279 break;
280 }
281 default:
282 ok(0, "unexpected dispIdMember %d\n", dispIdMember);
283 return E_NOTIMPL;
284 }
285
286 return S_OK;
287}
288
289static IDispatchVtbl testobj_vtbl = {
297};
298
300
302{
304 *ppv = iface;
305 return S_OK;
306 }
307
308 *ppv = NULL;
309 return E_NOINTERFACE;
310}
311
313{
314 return 2;
315}
316
318{
319 return 1;
320}
321
323{
324 ok(!outer, "outer = %p\n", outer);
325 return IDispatch_QueryInterface(&testobj, riid, ppv);
326}
327
329{
330 return S_OK;
331}
332
333static const IClassFactoryVtbl ClassFactoryVtbl = {
339};
340
342
343static void run_script_file(const char *file_name, DWORD expected_exit_code)
344{
345 char command[MAX_PATH];
346 STARTUPINFOA si = {sizeof(si)};
349 BOOL bres;
350
352 sprintf(command, "wscript.exe %s arg1 2 ar3", file_name);
353
354 SET_EXPECT(reportSuccess);
355
356 bres = CreateProcessA(NULL, command, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
357 if(!bres) {
358 win_skip("script.exe is not available\n");
359 CLEAR_CALLED(reportSuccess);
360 return;
361 }
362
363 wscript_process = pi.hProcess;
365
366 bres = GetExitCodeProcess(pi.hProcess, &exit_code);
367 ok(bres, "GetExitCodeProcess failed: %u\n", GetLastError());
368 ok(exit_code == expected_exit_code, "exit_code = %u, expected %u\n", exit_code, expected_exit_code);
369
370 CloseHandle(pi.hThread);
371 CloseHandle(pi.hProcess);
372
373 CHECK_CALLED(reportSuccess);
374}
375
376static void run_script(const char *name, const char *script_data, size_t script_size, DWORD expected_exit_code)
377{
378 char file_name[MAX_PATH];
379 const char *ext;
380 HANDLE file;
381 DWORD size;
382 BOOL res;
383
384 ext = strrchr(name, '.');
385 ok(ext != NULL, "no script extension\n");
386 if(!ext)
387 return;
388
389 sprintf(file_name, "test%s", ext);
390
393 ok(file != INVALID_HANDLE_VALUE, "CreateFile failed: %u\n", GetLastError());
395 return;
396
397 res = WriteFile(file, script_data, script_size, &size, NULL);
399 ok(res, "Could not write to file: %u\n", GetLastError());
400 if(!res)
401 return;
402
403 run_script_file(file_name, expected_exit_code);
404
406}
407
408static void run_simple_script(const char *script, DWORD expected_exit_code)
409{
410 run_script("simple.js", script, strlen(script), expected_exit_code);
411}
412
414{
415 const char *script_data;
416 DWORD script_size;
417 HRSRC src;
418
419 trace("running %s test...\n", name);
420
422 ok(src != NULL, "Could not find resource %s: %u\n", name, GetLastError());
423 if(!src)
424 return TRUE;
425
426 script_data = LoadResource(NULL, src);
427 script_size = SizeofResource(NULL, src);
428 while(script_size && !script_data[script_size-1])
429 script_size--;
430
431 run_script(name, script_data, script_size, 0);
432 return TRUE;
433}
434
435static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
436{
437 HKEY hkey;
438 DWORD res;
439
440 if(!init) {
442 return TRUE;
443 }
444
446 if(res != ERROR_SUCCESS)
447 return FALSE;
448
449 if(def_value)
450 res = RegSetValueA(hkey, NULL, REG_SZ, def_value, strlen(def_value));
451
452 RegCloseKey(hkey);
453 return res == ERROR_SUCCESS;
454}
455
457{
458 return init_key("Wine.Test\\CLSID", TESTOBJ_CLSID, init);
459}
460
462{
463 DWORD regid;
465
466 if(!init_registry(TRUE)) {
468 return FALSE;
469 }
470
472 CLSCTX_SERVER, REGCLS_MULTIPLEUSE, &regid);
473 ok(hres == S_OK, "Could not register script engine: %08x\n", hres);
474 return TRUE;
475}
476
478{
479 char **argv;
480 int argc;
481
483
484 if(!register_activex()) {
485 skip("Could not register ActiveX object.\n");
487 return;
488 }
489
491 if(argc > 2) {
492 run_script_file(argv[2], 0);
493 }else {
494 EnumResourceNamesA(NULL, "TESTSCRIPT", test_enum_proc, 0);
495
496 run_simple_script("var winetest = new ActiveXObject('Wine.Test');\n"
497 "winetest.reportSuccess();\n"
498 "WScript.Quit(3);\n"
499 "winetest.ok(false, 'not quit?');\n", 3);
500}
501
504}
static int argc
Definition: ServiceArgs.c:12
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define trace
Definition: atltest.h:70
#define ok(value,...)
Definition: atltest.h:57
#define skip(...)
Definition: atltest.h:64
#define START_TEST(x)
Definition: atltest.h:75
#define msg(x)
Definition: auth_time.c:54
#define ARRAY_SIZE(A)
Definition: main.h:33
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define RegCloseKey(hKey)
Definition: registry.h:49
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1179
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
Definition: reg.c:4954
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1224
static WCHAR fullName[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1902
#define CloseHandle
Definition: compat.h:739
#define GetModuleFileNameExW(w, x, y, z)
Definition: compat.h:922
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:740
OLECHAR * BSTR
Definition: compat.h:2293
#define MAX_PATH
Definition: compat.h:34
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define MultiByteToWideChar
Definition: compat.h:110
@ VT_BSTR
Definition: compat.h:2303
@ VT_BYREF
Definition: compat.h:2342
@ VT_VARIANT
Definition: compat.h:2307
@ VT_BOOL
Definition: compat.h:2306
@ VT_EMPTY
Definition: compat.h:2295
static const WCHAR *const ext[]
Definition: module.c:53
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
Definition: path.c:993
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation)
Definition: proc.c:4741
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
BOOL WINAPI EnumResourceNamesA(HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfun, LONG_PTR lparam)
Definition: res.c:285
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define INFINITE
Definition: serial.h:102
#define regid
Definition: ecma_167.h:64
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLenum src
Definition: glext.h:6340
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLfloat param
Definition: glext.h:5796
GLenum GLsizei len
Definition: glext.h:6722
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
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define S_OK
Definition: intsafe.h:52
#define wine_dbgstr_w
Definition: kernel32.h:34
#define REG_SZ
Definition: layer.c:22
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
struct task_struct * current
Definition: linux.c:32
#define CREATE_ALWAYS
Definition: disk.h:72
#define sprintf(buf, format,...)
Definition: sprintf.c:55
HRESULT hres
Definition: protocol.c:465
#define SET_EXPECT(func)
Definition: run.c:58
#define CHECK_EXPECT(func)
Definition: run.c:67
#define DEFINE_EXPECT(func)
Definition: run.c:55
static BSTR a2bstr(const char *str)
Definition: run.c:207
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:219
#define CHECK_CALLED(func)
Definition: run.c:73
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
static UINT exit_code
Definition: process.c:78
static LPOLESTR
Definition: stg_prop.c:27
static refpint_t pi[]
Definition: server.c:96
static VARIANTARG static DISPID
Definition: ordinal.c:52
static LPCWSTR file_name
Definition: protocol.c:147
#define CLEAR_CALLED(func)
Definition: run.c:88
#define DISPID_TESTOBJ_WSCRIPTFULLNAME
Definition: run.c:64
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: run.c:322
#define DISPID_TESTOBJ_REPORTSUCCESS
Definition: run.c:63
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: run.c:328
#define DISPID_TESTOBJ_WSCRIPTSCRIPTNAME
Definition: run.c:66
static IClassFactory testobj_cf
Definition: run.c:341
static const WCHAR * mystrrchr(const WCHAR *str, WCHAR ch)
Definition: run.c:84
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
Definition: run.c:128
static const GUID CLSID_TestObj
Definition: run.c:71
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: run.c:333
static BOOL init_registry(BOOL init)
Definition: run.c:456
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
Definition: run.c:123
static void run_simple_script(const char *script, DWORD expected_exit_code)
Definition: run.c:408
static const char * script_name
Definition: run.c:74
static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
Definition: run.c:170
#define DISPID_TESTOBJ_TRACE
Definition: run.c:62
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: run.c:317
static IDispatchVtbl testobj_vtbl
Definition: run.c:289
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
Definition: run.c:435
#define DISPID_TESTOBJ_OK
Definition: run.c:61
#define DISPID_TESTOBJ_WSCRIPTSCRIPTFULLNAME
Definition: run.c:67
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: run.c:301
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: run.c:134
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
Definition: run.c:118
static void run_script_file(const char *file_name, DWORD expected_exit_code)
Definition: run.c:343
static HANDLE wscript_process
Definition: run.c:75
#define TESTOBJ_CLSID
Definition: run.c:69
static IDispatch testobj
Definition: run.c:299
static void run_script(const char *name, const char *script_data, size_t script_size, DWORD expected_exit_code)
Definition: run.c:376
static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
Definition: run.c:107
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: run.c:312
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: run.c:141
static BOOL register_activex(void)
Definition: run.c:461
static BOOL WINAPI test_enum_proc(HMODULE module, LPCSTR type, LPSTR name, LONG_PTR param)
Definition: run.c:413
#define DISPID_TESTOBJ_WSCRIPTPATH
Definition: run.c:65
#define argv
Definition: mplay32.c:18
script
Definition: msipriv.h:383
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
#define GENERIC_WRITE
Definition: nt_native.h:90
@ REGCLS_MULTIPLEUSE
Definition: objbase.h:393
@ COINIT_MULTITHREADED
Definition: objbase.h:279
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:238
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:339
#define V_BOOL(A)
Definition: oleauto.h:224
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define V_VT(A)
Definition: oleauto.h:211
#define V_BSTR(A)
Definition: oleauto.h:226
const GUID IID_IDispatch
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
const WCHAR * str
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
DWORD LCID
Definition: nls.h:13
#define win_skip
Definition: test.h:160
int winetest_get_mainargs(char ***pargv)
Definition: query.h:87
Definition: fci.c:127
Definition: name.c:39
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
uint32_t ULONG
Definition: typedefs.h:59
int ret
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
static int init
Definition: wintirpc.c:33
const char * LPCSTR
Definition: xmlstorage.h:183
char * LPSTR
Definition: xmlstorage.h:182
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185