24#define PSAPI_VERSION 1
32#define DEFINE_EXPECT(func) \
33 static BOOL expect_ ## func = FALSE, called_ ## func = FALSE
35#define SET_EXPECT(func) \
36 expect_ ## func = TRUE
38#define CLEAR_CALLED(func) \
39 expect_ ## func = called_ ## func = FALSE
41#define CHECK_EXPECT2(func) \
43 ok(expect_ ##func, "unexpected call " #func "\n"); \
44 called_ ## func = TRUE; \
47#define CHECK_EXPECT(func) \
49 CHECK_EXPECT2(func); \
50 expect_ ## func = FALSE; \
53#define CHECK_CALLED(func) \
55 ok(called_ ## func, "expected " #func "\n"); \
56 expect_ ## func = called_ ## func = FALSE; \
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
69#define TESTOBJ_CLSID "{178fc166-f585-4e24-9c13-4bb7faf80646}"
72 {0x178fc166,0xf585,0x4e24,{0x9c,0x13,0x4b,0xb7,0xfa,0xf8,0x06,0x46}};
130 ok(0,
"unexpected call\n");
137 ok(0,
"unexpected call\n");
146 for(
i=0;
i<cNames;
i++) {
151 }
else if(!
strcmp_wa(rgszNames[
i],
"reportSuccess")) {
153 }
else if(!
strcmp_wa(rgszNames[
i],
"wscriptFullName")) {
155 }
else if(!
strcmp_wa(rgszNames[
i],
"wscriptPath")) {
157 }
else if(!
strcmp_wa(rgszNames[
i],
"wscriptScriptName")) {
159 }
else if(!
strcmp_wa(rgszNames[
i],
"wscriptScriptFullName")) {
173 switch(dispIdMember) {
178 ok(pdp->cArgs == 2,
"cArgs = %d\n", pdp->cArgs);
179 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
181 expr = pdp->rgvarg+1;
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));
209 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
210 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
220 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
221 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
237 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
238 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
255 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
256 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
259 if(!
res ||
res >
sizeof(fullPath))
271 ok(pdp->cArgs == 0,
"cArgs = %d\n", pdp->cArgs);
272 ok(!pdp->cNamedArgs,
"cNamedArgs = %d\n", pdp->cNamedArgs);
275 if(!
res ||
res >
sizeof(fullPath))
282 ok(0,
"unexpected dispIdMember %d\n", dispIdMember);
324 ok(!outer,
"outer = %p\n", outer);
358 win_skip(
"script.exe is not available\n");
368 ok(
exit_code == expected_exit_code,
"exit_code = %u, expected %u\n",
exit_code, expected_exit_code);
376static void run_script(
const char *
name,
const char *script_data,
size_t script_size,
DWORD expected_exit_code)
385 ok(
ext !=
NULL,
"no script extension\n");
415 const char *script_data;
428 while(script_size && !script_data[script_size-1])
473 ok(
hres ==
S_OK,
"Could not register script engine: %08x\n",
hres);
485 skip(
"Could not register ActiveX object.\n");
497 "winetest.reportSuccess();\n"
499 "winetest.ok(false, 'not quit?');\n", 3);
ACPI_SIZE strlen(const char *String)
const GUID IID_IClassFactory
#define RegCloseKey(hKey)
LONG WINAPI RegCreateKeyA(HKEY hKey, LPCSTR lpSubKey, PHKEY phkResult)
LONG WINAPI RegSetValueA(HKEY hKeyOriginal, LPCSTR lpSubKey, DWORD dwType, LPCSTR lpData, DWORD cbData)
LONG WINAPI RegDeleteKeyA(_In_ HKEY hKey, _In_ LPCSTR lpSubKey)
static WCHAR fullName[MAX_STRING_RESOURCE_LEN]
#define GetModuleFileNameExW(w, x, y, z)
#define INVALID_HANDLE_VALUE
#define CreateFileA(a, b, c, d, e, f, g)
#define FILE_ATTRIBUTE_NORMAL
#define MultiByteToWideChar
static const WCHAR *const ext[]
BOOL WINAPI DeleteFileA(IN LPCSTR lpFileName)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
DWORD WINAPI GetFullPathNameA(IN LPCSTR lpFileName, IN DWORD nBufferLength, OUT LPSTR lpBuffer, OUT LPSTR *lpFilePart)
BOOL WINAPI GetExitCodeProcess(IN HANDLE hProcess, IN LPDWORD lpExitCode)
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)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
BOOL WINAPI EnumResourceNamesA(HMODULE hmod, LPCSTR type, ENUMRESNAMEPROCA lpfun, LONG_PTR lparam)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI CoRegisterClassObject(REFCLSID rclsid, LPUNKNOWN pUnk, DWORD dwClsContext, DWORD flags, LPDWORD lpdwRegister)
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
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
struct task_struct * current
#define sprintf(buf, format,...)
#define CHECK_EXPECT(func)
#define DEFINE_EXPECT(func)
static BSTR a2bstr(const char *str)
static int strcmp_wa(LPCWSTR strw, const char *stra)
#define CHECK_CALLED(func)
static const char * strw(LPCWSTR x)
static VARIANTARG static DISPID
#define CLEAR_CALLED(func)
#define DISPID_TESTOBJ_WSCRIPTFULLNAME
static HRESULT WINAPI ClassFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
#define DISPID_TESTOBJ_REPORTSUCCESS
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
#define DISPID_TESTOBJ_WSCRIPTSCRIPTNAME
static IClassFactory testobj_cf
static const WCHAR * mystrrchr(const WCHAR *str, WCHAR ch)
static HRESULT WINAPI Dispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
static const GUID CLSID_TestObj
static const IClassFactoryVtbl ClassFactoryVtbl
static BOOL init_registry(BOOL init)
static ULONG WINAPI Dispatch_Release(IDispatch *iface)
static void run_simple_script(const char *script, DWORD expected_exit_code)
static const char * script_name
static HRESULT WINAPI Dispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pdp, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
#define DISPID_TESTOBJ_TRACE
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
static IDispatchVtbl testobj_vtbl
static BOOL init_key(const char *key_name, const char *def_value, BOOL init)
#define DISPID_TESTOBJ_OK
#define DISPID_TESTOBJ_WSCRIPTSCRIPTFULLNAME
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
static HRESULT WINAPI Dispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
static ULONG WINAPI Dispatch_AddRef(IDispatch *iface)
static void run_script_file(const char *file_name, DWORD expected_exit_code)
static HANDLE wscript_process
static void run_script(const char *name, const char *script_data, size_t script_size, DWORD expected_exit_code)
static HRESULT WINAPI Dispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
static HRESULT WINAPI Dispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
static BOOL register_activex(void)
static BOOL WINAPI test_enum_proc(HMODULE module, LPCSTR type, LPSTR name, LONG_PTR param)
#define DISPID_TESTOBJ_WSCRIPTPATH
BSTR WINAPI SysAllocString(LPCOLESTR str)
BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
#define IsEqualGUID(rguid1, rguid2)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
int winetest_get_mainargs(char ***pargv)
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
DWORD WINAPI GetLastError(void)
_In_ DWORD _Out_ _In_ WORD wFlags
#define DISP_E_UNKNOWNNAME
#define HKEY_CLASSES_ROOT