ReactOS  0.4.14-dev-297-g23e575c
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 
59 DEFINE_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 
71 static const GUID CLSID_TestObj =
72  {0x178fc166,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}};
73 
74 static const char *script_name;
76 
77 static int strcmp_wa(LPCWSTR strw, const char *stra)
78 {
79  WCHAR buf[512];
80  MultiByteToWideChar(CP_ACP, 0, stra, -1, buf, ARRAY_SIZE(buf));
81  return lstrcmpW(strw, buf);
82 }
83 
84 static 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 
95 static BSTR a2bstr(const char *str)
96 {
97  BSTR ret;
98  int len;
99 
100  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
102  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
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")) {
152  rgDispId[i] = DISPID_TESTOBJ_REPORTSUCCESS;
153  }else if(!strcmp_wa(rgszNames[i], "wscriptFullName")) {
154  rgDispId[i] = DISPID_TESTOBJ_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 
170 static 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))
187  msg = V_VARIANTREF(msg);
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 
289 static 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 
333 static const IClassFactoryVtbl ClassFactoryVtbl = {
339 };
340 
342 
343 static 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;
364  WaitForSingleObject(pi.hProcess, INFINITE);
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 
376 static 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);
398  CloseHandle(file);
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 
408 static 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 
435 static 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 
461 static BOOL register_activex(void)
462 {
463  DWORD regid;
464  HRESULT hres;
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");
486  CoUninitialize();
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 
503  CoUninitialize();
504 }
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:24
static int argc
Definition: ServiceArgs.c:12
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 REFIID
Definition: guiddef.h:118
#define TRUE
Definition: types.h:120
#define DISPID_TESTOBJ_WSCRIPTPATH
Definition: run.c:65
#define CloseHandle
Definition: compat.h:398
#define E_NOINTERFACE
Definition: winerror.h:2364
#define DISPID_TESTOBJ_WSCRIPTSCRIPTNAME
Definition: run.c:66
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
Definition: run.c:134
LOCAL int expr(arg_t *ap, int *altp)
Definition: match.c:512
#define ERROR_SUCCESS
Definition: deptool.c:10
static WCHAR fullName[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1902
#define CLEAR_CALLED(func)
Definition: run.c:38
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: run.c:322
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
Definition: oleaut.c:342
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
static const GUID CLSID_TestObj
Definition: run.c:71
REFIID riid
Definition: precomp.h:44
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
Definition: run.c:128
char * wine_dbgstr_w(const wchar_t *wstr)
Definition: atltest.h:87
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
Definition: proc.c:1168
#define CP_ACP
Definition: compat.h:99
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
Definition: lstring.c:170
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
REFIID LPVOID * ppv
Definition: atlbase.h:39
static IClassFactory testobj_cf
Definition: run.c:341
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
Definition: reg.c:4968
DWORD LCID
Definition: nls.h:13
OLECHAR * BSTR
Definition: compat.h:1934
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
BOOL WINAPI EnumResourceNamesA(HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfun, LONG_PTR lparam)
Definition: res.c:285
#define argv
Definition: mplay32.c:18
char * LPSTR
Definition: xmlstorage.h:182
static LPOLESTR
Definition: stg_prop.c:27
#define E_FAIL
Definition: ddrawi.h:102
Definition: query.h:86
static BOOL register_activex(void)
Definition: run.c:461
static int init
Definition: wintirpc.c:33
#define regid
Definition: ecma_167.h:64
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
Definition: path.c:992
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: run.c:301
#define sprintf(buf, format,...)
Definition: sprintf.c:55
static int strcmp_wa(LPCWSTR strw, const char *stra)
Definition: run.c:77
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
#define DEFINE_EXPECT(func)
Definition: run.c:32
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
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static IDispatchVtbl testobj_vtbl
Definition: run.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GENERIC_WRITE
Definition: nt_native.h:90
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: run.c:317
#define CHECK_CALLED(func)
Definition: run.c:53
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
const WCHAR * str
static const IClassFactoryVtbl ClassFactoryVtbl
Definition: run.c:333
static HANDLE wscript_process
Definition: run.c:75
#define GetModuleFileNameExW(w, x, y, z)
Definition: compat.h:571
smooth NULL
Definition: ftsmooth.c:416
char ext[3]
Definition: mkdosfs.c:358
BSTR WINAPI SysAllocString(LPCOLESTR str)
Definition: oleaut.c:241
script
Definition: msipriv.h:374
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
Definition: delete.c:24
static IDispatch testobj
Definition: run.c:299
const char * LPCSTR
Definition: xmlstorage.h:183
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:1177
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
Definition: run.c:123
static UINT exit_code
Definition: process.c:78
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
Definition: run.c:118
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
#define trace
Definition: atltest.h:70
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static BOOL WINAPI test_enum_proc(HMODULE module, LPCSTR type, LPSTR name, LONG_PTR param)
Definition: run.c:413
const GUID IID_IUnknown
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: run.c:312
static BSTR a2bstr(const char *str)
Definition: run.c:95
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:4742
GLfloat param
Definition: glext.h:5796
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
const char file[]
Definition: icontest.c:11
#define SET_EXPECT(func)
Definition: run.c:35
#define V_BOOL(A)
Definition: oleauto.h:224
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
int winetest_get_mainargs(char ***pargv)
static DWORD pi
Definition: protocol.c:150
const GUID IID_IDispatch
int ret
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
static const WCHAR * mystrrchr(const WCHAR *str, WCHAR ch)
Definition: run.c:84
#define V_VT(A)
Definition: oleauto.h:211
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: run.c:328
#define V_BSTR(A)
Definition: oleauto.h:226
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
Definition: run.c:435
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:519
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
Definition: reg.c:1222
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
Definition: run.c:141
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
Definition: compobj.c:2897
struct stdole::EXCEPINFO EXCEPINFO
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define S_OK
Definition: intsafe.h:59
#define CREATE_ALWAYS
Definition: disk.h:72
#define DISPID_TESTOBJ_TRACE
Definition: run.c:62
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
#define ARRAY_SIZE(a)
Definition: main.h:24
#define CHECK_EXPECT(func)
Definition: run.c:47
#define ok(value,...)
Definition: atltest.h:57
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static void run_simple_script(const char *script, DWORD expected_exit_code)
Definition: run.c:408
#define DISPID_TESTOBJ_OK
Definition: run.c:61
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
#define MultiByteToWideChar
Definition: compat.h:100
static LPCWSTR file_name
Definition: protocol.c:146
#define DISPID_TESTOBJ_WSCRIPTSCRIPTFULLNAME
Definition: run.c:67
#define skip(...)
Definition: atltest.h:64
#define msg(x)
Definition: auth_time.c:54
START_TEST(run)
Definition: run.c:3321
#define TESTOBJ_CLSID
Definition: run.c:69
Definition: name.c:36
GLuint res
Definition: glext.h:9613
struct stdole::DISPPARAMS DISPPARAMS
unsigned int ULONG
Definition: retypes.h:1
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
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define DISPID_TESTOBJ_REPORTSUCCESS
Definition: run.c:63
#define V_VARIANTREF(A)
Definition: oleauto.h:283
#define DISPID_TESTOBJ_WSCRIPTFULLNAME
Definition: run.c:64
#define CreateFileA(a, b, c, d, e, f, g)
Definition: compat.h:399
static const char * script_name
Definition: run.c:74
static void run_script_file(const char *file_name, DWORD expected_exit_code)
Definition: run.c:343
#define INFINITE
Definition: serial.h:102
static BOOL init_registry(BOOL init)
Definition: run.c:456
const GUID IID_IClassFactory
static const char * strw(LPCWSTR x)
Definition: actctx.c:49
#define win_skip
Definition: test.h:141
struct task_struct * current
Definition: linux.c:32
Definition: fci.c:126
#define REG_SZ
Definition: layer.c:22