Author: akhaldi Date: Sat Mar 23 11:25:24 2013 New Revision: 58589
URL: http://svn.reactos.org/svn/reactos?rev=58589&view=rev Log: [OLEAUT32_WINETEST] * Sync with Wine 1.5.26.
Modified: trunk/rostests/winetests/oleaut32/dispatch.c trunk/rostests/winetests/oleaut32/olefont.c trunk/rostests/winetests/oleaut32/olepicture.c trunk/rostests/winetests/oleaut32/safearray.c trunk/rostests/winetests/oleaut32/test_reg.idl trunk/rostests/winetests/oleaut32/testlist.c trunk/rostests/winetests/oleaut32/tmarshal.c trunk/rostests/winetests/oleaut32/tmarshal.rc trunk/rostests/winetests/oleaut32/typelib.c trunk/rostests/winetests/oleaut32/usrmarshal.c trunk/rostests/winetests/oleaut32/varformat.c trunk/rostests/winetests/oleaut32/vartest.c trunk/rostests/winetests/oleaut32/vartype.c
Modified: trunk/rostests/winetests/oleaut32/dispatch.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/dispatc... ============================================================================== --- trunk/rostests/winetests/oleaut32/dispatch.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/dispatch.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -18,10 +18,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #include <wine/test.h> -#include <windef.h> -#include <winbase.h> -#include <oaidl.h> +//#include <windef.h> +//#include <winbase.h> +#include <winnls.h> +#include <ole2.h> +//#include <oaidl.h>
static const WCHAR szSunshine[] = {'S','u','n','s','h','i','n','e',0};
Modified: trunk/rostests/winetests/oleaut32/olefont.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olefont... ============================================================================== --- trunk/rostests/winetests/oleaut32/olefont.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/olefont.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -20,25 +20,30 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> -#include <stdio.h> -#include <math.h> -#include <float.h> +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> +//#include <stdio.h> +//#include <math.h> +//#include <float.h>
#define COBJMACROS
#include <wine/test.h> -#include <windef.h> -#include <winbase.h> -#include <winuser.h> +//#include <windef.h> +//#include <winbase.h> +//#include <winuser.h> #include <wingdi.h> -#include <winnls.h> -#include <winerror.h> -#include <winnt.h> -#include <initguid.h> -#include <wtypes.h> +//#include <winnls.h> +//#include <winerror.h> +//#include <winnt.h> +//#include <initguid.h> +//#include <wtypes.h> +#include <ole2.h> #include <olectl.h> -#include <ocidl.h> +//#include <ocidl.h>
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
Modified: trunk/rostests/winetests/oleaut32/olepicture.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/olepict... ============================================================================== --- trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/olepicture.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -19,28 +19,32 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> #include <stdio.h> -#include <math.h> -#include <float.h> +//#include <math.h> +//#include <float.h>
#define COBJMACROS #define CONST_VTABLE #define NONAMELESSUNION
-#include "wine/test.h" -#include <windef.h> -#include <winbase.h> -#include <winuser.h> +#include <wine/test.h> +//#include <windef.h> +//#include <winbase.h> +//#include <winuser.h> #include <wingdi.h> #include <winnls.h> -#include <winerror.h> -#include <winnt.h> - -#include <urlmon.h> -#include <wtypes.h> +//#include <winerror.h> +//#include <winnt.h> +#include <ole2.h> +//#include <urlmon.h> +//#include <wtypes.h> #include <olectl.h> -#include <objidl.h> +//#include <objidl.h>
#define expect_eq(expr, value, type, format) { type ret = (expr); ok((value) == ret, #expr " expected " format " got " format "\n", value, ret); }
Modified: trunk/rostests/winetests/oleaut32/safearray.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/safearr... ============================================================================== --- trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/safearray.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -19,25 +19,29 @@ * */
-#include <stdarg.h> +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> #include <stdio.h> -#include <math.h> -#include <float.h> +//#include <math.h> +//#include <float.h>
#define COBJMACROS #define CONST_VTABLE -#include "wine/test.h" -#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "wingdi.h" -#include "winnls.h" -#include "winsock.h" -#include "winerror.h" -#include "winnt.h" - -#include "wtypes.h" -#include "oleauto.h" +#include <wine/test.h> +//#include "windef.h" +//#include "winbase.h" +//#include "winuser.h" +//#include "wingdi.h" +//#include "winnls.h" +//#include "winsock.h" +//#include "winerror.h" +//#include "winnt.h" +#include <objbase.h> +//#include "wtypes.h" +#include <oleauto.h>
static HMODULE hOleaut32;
Modified: trunk/rostests/winetests/oleaut32/test_reg.idl URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/test_re... ============================================================================== --- trunk/rostests/winetests/oleaut32/test_reg.idl [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/test_reg.idl [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -127,4 +127,12 @@ interface Iole_from_disp; }
+ [ + uuid(f1b68c3b-02a3-4110-bc4c-cf9bc7e7f177) + ] + interface IInvokeTest : IDispatch + { + [propget, id(DISPID_VALUE)] + LONG test([in] LONG i); + } }
Modified: trunk/rostests/winetests/oleaut32/testlist.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/testlis... ============================================================================== --- trunk/rostests/winetests/oleaut32/testlist.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/testlist.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -1,10 +1,7 @@ /* Automatically generated file; DO NOT EDIT!! */
-#define WIN32_LEAN_AND_MEAN -#include <windows.h> - #define STANDALONE -#include "wine/test.h" +#include <wine/test.h>
extern void func_dispatch(void); extern void func_olefont(void);
Modified: trunk/rostests/winetests/oleaut32/tmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/tmarsha... ============================================================================== --- trunk/rostests/winetests/oleaut32/tmarshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/tmarshal.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -17,16 +17,25 @@ * */
+#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define COBJMACROS #define CONST_VTABLE
-#include <windows.h> -#include <ocidl.h> -#include <stdio.h> - -#include "wine/test.h" - -#include "tmarshal.h" +//#include <windows.h> +#include <stdarg.h> +#include <windef.h> +#include <winbase.h> +#include <winnls.h> +#include <ole2.h> +//#include <ocidl.h> +//#include <stdio.h> + +#include <wine/test.h> + +#include <tmarshal.h> #include "tmarshal_dispids.h"
static HRESULT (WINAPI *pVarAdd)(LPVARIANT,LPVARIANT,LPVARIANT);
Modified: trunk/rostests/winetests/oleaut32/tmarshal.rc URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/tmarsha... ============================================================================== --- trunk/rostests/winetests/oleaut32/tmarshal.rc [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/tmarshal.rc [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -18,14 +18,14 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include "windef.h" -#include "winbase.h" -#include "winuser.h" -#include "winnls.h" +#include <windef.h> +//#include "winbase.h" +//#include "winuser.h" +//#include "winnls.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
-#include "wine/wine_common_ver.rc" +#include <wine/wine_common_ver.rc>
/* @makedep: tmarshal.tlb */ 1 TYPELIB tmarshal.tlb
Modified: trunk/rostests/winetests/oleaut32/typelib.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/typelib... ============================================================================== --- trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/typelib.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -19,20 +19,28 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define COBJMACROS +#define CONST_VTABLE
#include <wine/test.h> -#include <stdarg.h> +//#include <stdarg.h> #include <stdio.h>
-#include "windef.h" -#include "winbase.h" -#include "oleauto.h" -#include "ocidl.h" -#include "shlwapi.h" -#include "tmarshal.h" - -#include "test_reg.h" +//#include "windef.h" +//#include "winbase.h" +#include <winnls.h> +#include <winreg.h> +#include <objbase.h> +#include <oleauto.h> +//#include "ocidl.h" +//#include "shlwapi.h" +#include <tmarshal.h> + +#include <test_reg.h>
#define expect_eq(expr, value, type, format) { type _ret = (expr); ok((value) == _ret, #expr " expected " format " got " format "\n", value, _ret); } #define expect_int(expr, value) expect_eq(expr, (int)(value), int, "%d") @@ -63,6 +71,74 @@ static WCHAR wszguid[] = {'g','u','i','d',0};
static const int is_win64 = sizeof(void *) > sizeof(int); + +static HRESULT WINAPI invoketest_QueryInterface(IInvokeTest *iface, REFIID riid, void **ret) +{ + if (IsEqualIID(riid, &IID_IUnknown) || + IsEqualIID(riid, &IID_IDispatch) || + IsEqualIID(riid, &IID_IInvokeTest)) + { + *ret = iface; + return S_OK; + } + + return E_NOINTERFACE; +} + +static ULONG WINAPI invoketest_AddRef(IInvokeTest *iface) +{ + return 2; +} + +static ULONG WINAPI invoketest_Release(IInvokeTest *iface) +{ + return 1; +} + +static HRESULT WINAPI invoketest_GetTypeInfoCount(IInvokeTest *iface, UINT *cnt) +{ + ok(0, "unexpected call\n"); + *cnt = 0; + return E_NOTIMPL; +} + +static HRESULT WINAPI invoketest_GetTypeInfo(IInvokeTest *iface, UINT index, LCID lcid, ITypeInfo **ti) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI invoketest_GetIDsOfNames(IInvokeTest *iface, REFIID riid, LPOLESTR *names, + UINT cnt, LCID lcid, DISPID *dispid) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static HRESULT WINAPI invoketest_Invoke(IInvokeTest *iface, DISPID dispid, REFIID riid, + LCID lcid, WORD flags, DISPPARAMS *dispparams, VARIANT *res, EXCEPINFO *ei, UINT *argerr) +{ + ok(0, "unexpected call\n"); + return E_NOTIMPL; +} + +static LONG WINAPI invoketest_get_test(IInvokeTest *iface, LONG i) +{ + return i+1; +} + +static const IInvokeTestVtbl invoketestvtbl = { + invoketest_QueryInterface, + invoketest_AddRef, + invoketest_Release, + invoketest_GetTypeInfoCount, + invoketest_GetTypeInfo, + invoketest_GetIDsOfNames, + invoketest_Invoke, + invoketest_get_test +}; + +static IInvokeTest invoketest = { &invoketestvtbl };
static void init_function_pointers(void) { @@ -534,6 +610,27 @@ SysFreeString(methdata[3].szName); }
+static const char *create_test_typelib(int res_no) +{ + static char filename[MAX_PATH]; + HANDLE file; + HRSRC res; + void *ptr; + DWORD written; + + GetTempFileNameA( ".", "tlb", 0, filename ); + file = CreateFile( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); + ok( file != INVALID_HANDLE_VALUE, "file creation failed\n" ); + if (file == INVALID_HANDLE_VALUE) return NULL; + res = FindResource( GetModuleHandle(0), MAKEINTRESOURCE(res_no), "TYPELIB" ); + ok( res != 0, "couldn't find resource\n" ); + ptr = LockResource( LoadResource( GetModuleHandle(0), res )); + WriteFile( file, ptr, SizeofResource( GetModuleHandle(0), res ), &written, NULL ); + ok( written == SizeofResource( GetModuleHandle(0), res ), "couldn't write resource\n" ); + CloseHandle( file ); + return filename; +} + static void test_TypeInfo(void) { ITypeLib *pTypeLib; @@ -549,9 +646,11 @@ DISPID dispidMember; DISPPARAMS dispparams; GUID bogusguid = {0x806afb4f,0x13f7,0x42d2,{0x89,0x2c,0x6c,0x97,0xc3,0x6a,0x36,0xc1}}; - VARIANT var; - UINT count; + VARIANT var, res, args[2]; + UINT count, i; TYPEKIND kind; + const char *filenameA; + WCHAR filename[MAX_PATH];
hr = LoadTypeLib(wszStdOle2, &pTypeLib); ok_ole_success(hr, LoadTypeLib); @@ -714,6 +813,53 @@
ITypeInfo_Release(pTypeInfo); ITypeLib_Release(pTypeLib); + + filenameA = create_test_typelib(3); + MultiByteToWideChar(CP_ACP, 0, filenameA, -1, filename, MAX_PATH); + hr = LoadTypeLib(filename, &pTypeLib); + ok(hr == S_OK, "got 0x%08x\n", hr); + + hr = ITypeLib_GetTypeInfoOfGuid(pTypeLib, &IID_IInvokeTest, &pTypeInfo); + ok(hr == S_OK, "got 0x%08x\n", hr); + + dispparams.cArgs = 1; + dispparams.cNamedArgs = 0; + dispparams.rgdispidNamedArgs = NULL; + dispparams.rgvarg = args; + + V_VT(&args[0]) = VT_I4; + V_I4(&args[0]) = 0; + + V_VT(&res) = VT_EMPTY; + + i = 0; + V_VT(&res) = VT_EMPTY; + V_I4(&res) = 0; + /* call propget with DISPATCH_METHOD|DISPATCH_PROPERTYGET flags */ + hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, DISPID_VALUE, DISPATCH_METHOD|DISPATCH_PROPERTYGET, + &dispparams, &res, NULL, &i); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok(V_VT(&res) == VT_I4, "got %d\n", V_VT(&res)); + ok(V_I4(&res) == 1, "got %d\n", V_I4(&res)); + + i = 0; + /* call propget with DISPATCH_METHOD flags */ + hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, DISPID_VALUE, DISPATCH_METHOD, + &dispparams, &res, NULL, &i); + ok(hr == DISP_E_MEMBERNOTFOUND, "got 0x%08x, %d\n", hr, i); + + i = 0; + V_VT(&res) = VT_EMPTY; + V_I4(&res) = 0; + hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, DISPID_VALUE, DISPATCH_PROPERTYGET, + &dispparams, &res, NULL, &i); + ok(hr == S_OK, "got 0x%08x, %d\n", hr, i); + ok(V_VT(&res) == VT_I4, "got %d\n", V_VT(&res)); + ok(V_I4(&res) == 1, "got %d\n", V_I4(&res)); + + ITypeInfo_Release(pTypeInfo); + ITypeLib_Release(pTypeLib); + DeleteFileA(filenameA); }
static int WINAPI int_func( int a0, int a1, int a2, int a3, int a4 ) @@ -782,6 +928,11 @@ ok( (*(void ***)inst)[3] == inst_func, "wrong ptr %p\n", inst ); ok( a == 3, "wrong arg %x\n", a ); return a * 2; +} + +static HRESULT WINAPI ret_false_func(void) +{ + return S_FALSE; }
static const void *vtable[] = { NULL, NULL, NULL, inst_func }; @@ -899,6 +1050,17 @@ ok( res == S_OK, "DispCallFunc failed %x\n", res ); ok( V_VT(&result) == VT_I4, "wrong result type %d\n", V_VT(&result) ); ok( V_I4(&result) == 6, "wrong result %08x\n", V_I4(&result) ); + + memset( &result, 0xcc, sizeof(result) ); + res = DispCallFunc(NULL, (ULONG_PTR)ret_false_func, CC_STDCALL, VT_ERROR, 0, NULL, NULL, &result); + ok(res == S_OK, "DispCallFunc failed: %08x\n", res); + ok(V_VT(&result) == VT_ERROR, "V_VT(result) = %u\n", V_VT(&result)); + ok(V_ERROR(&result) == S_FALSE, "V_ERROR(result) = %08x\n", V_ERROR(&result)); + + memset( &result, 0xcc, sizeof(result) ); + res = DispCallFunc(NULL, (ULONG_PTR)ret_false_func, CC_STDCALL, VT_HRESULT, 0, NULL, NULL, &result); + ok(res == E_INVALIDARG, "DispCallFunc failed: %08x\n", res); + ok(V_VT(&result) == 0xcccc, "V_VT(result) = %u\n", V_VT(&result)); }
/* RegDeleteTreeW from dlls/advapi32/registry.c */ @@ -2722,27 +2884,6 @@
#endif
-static const char *create_test_typelib(int res_no) -{ - static char filename[MAX_PATH]; - HANDLE file; - HRSRC res; - void *ptr; - DWORD written; - - GetTempFileNameA( ".", "tlb", 0, filename ); - file = CreateFile( filename, GENERIC_READ|GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, 0 ); - ok( file != INVALID_HANDLE_VALUE, "file creation failed\n" ); - if (file == INVALID_HANDLE_VALUE) return NULL; - res = FindResource( GetModuleHandle(0), MAKEINTRESOURCE(res_no), "TYPELIB" ); - ok( res != 0, "couldn't find resource\n" ); - ptr = LockResource( LoadResource( GetModuleHandle(0), res )); - WriteFile( file, ptr, SizeofResource( GetModuleHandle(0), res ), &written, NULL ); - ok( written == SizeofResource( GetModuleHandle(0), res ), "couldn't write resource\n" ); - CloseHandle( file ); - return filename; -} - static void test_create_typelib_lcid(LCID lcid) { char filename[MAX_PATH]; @@ -2813,7 +2954,7 @@ { TYPEKIND kind; WORD flags; - } attrs[11] = + } attrs[12] = { { TKIND_INTERFACE, 0 }, { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE }, @@ -2825,7 +2966,8 @@ { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE | TYPEFLAG_FDUAL }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, - { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE } + { TKIND_DISPATCH, TYPEFLAG_FDISPATCHABLE }, + { TKIND_INTERFACE, TYPEFLAG_FDISPATCHABLE } };
trace("Starting %s typelib registration tests\n", @@ -2857,7 +2999,7 @@ ok(hr == S_OK, "got %08x\n", hr);
count = ITypeLib_GetTypeInfoCount(typelib); - ok(count == 11, "got %d\n", count); + ok(count == 12, "got %d\n", count);
for(i = 0; i < count; i++) {
Modified: trunk/rostests/winetests/oleaut32/usrmarshal.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/usrmars... ============================================================================== --- trunk/rostests/winetests/oleaut32/usrmarshal.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/usrmarshal.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -18,17 +18,22 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define COBJMACROS #define CONST_VTABLE
#include <stdarg.h>
-#include "windef.h" -#include "winbase.h" -#include "objbase.h" -#include "propidl.h" /* for LPSAFEARRAY_User* routines */ - -#include "wine/test.h" +#include <windef.h> +#include <winbase.h> +#include <ole2.h> +//#include "objbase.h" +//#include "propidl.h" /* for LPSAFEARRAY_User* routines */ + +#include <wine/test.h>
#if (__STDC__ && !defined(_FORCENAMELESSUNION)) || defined(NONAMELESSUNION) # define V_U2(A) ((A)->n1.n2)
Modified: trunk/rostests/winetests/oleaut32/varformat.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/varform... ============================================================================== --- trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/varformat.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -19,23 +19,27 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> -#include <stdio.h> -#include <math.h> -#include <float.h> - -#include "windef.h" -#include "winbase.h" -#include "winsock.h" -#include "wine/test.h" -#include "winuser.h" -#include "wingdi.h" -#include "winnls.h" -#include "winerror.h" -#include "winnt.h" - -#include "wtypes.h" -#include "oleauto.h" +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> +//#include <stdio.h> +//#include <math.h> +//#include <float.h> + +//#include "windef.h" +//#include "winbase.h" +//#include "winsock.h" +#include <wine/test.h> +//#include "winuser.h" +//#include "wingdi.h" +#include <winnls.h> +//#include "winerror.h" +//#include "winnt.h" +#include <objbase.h> +//#include "wtypes.h" +#include <oleauto.h>
static HMODULE hOleaut32;
Modified: trunk/rostests/winetests/oleaut32/vartest.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartest... ============================================================================== --- trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartest.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -19,25 +19,29 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
-#include <stdarg.h> +#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + +//#include <stdarg.h> #include <stdio.h> #include <math.h> #include <float.h>
#define CONST_VTABLE
-#include "windef.h" -#include "winbase.h" -#include "winsock.h" -#include "wine/test.h" -#include "winuser.h" -#include "wingdi.h" -#include "winnls.h" -#include "winerror.h" -#include "winnt.h" - -#include "wtypes.h" -#include "oleauto.h" +//#include "windef.h" +//#include "winbase.h" +//#include "winsock.h" +#include <wine/test.h> +//#include "winuser.h" +//#include "wingdi.h" +#include <winnls.h> +//#include "winerror.h" +//#include "winnt.h" +#include <objbase.h> +//#include "wtypes.h" +#include <oleauto.h>
static HMODULE hOleaut32;
Modified: trunk/rostests/winetests/oleaut32/vartype.c URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/oleaut32/vartype... ============================================================================== --- trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] (original) +++ trunk/rostests/winetests/oleaut32/vartype.c [iso-8859-1] Sat Mar 23 11:25:24 2013 @@ -18,10 +18,16 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */
+#define WIN32_NO_STATUS +#define _INC_WINDOWS +#define COM_NO_WINDOWS_H + #define CONST_VTABLE
-#include "wine/test.h" -#include "oleauto.h" +#include <wine/test.h> +#include <winnls.h> +#include <objbase.h> +#include <oleauto.h> #include <math.h>
/* Some Visual C++ versions choke on __uint64 to float conversions. @@ -4951,7 +4957,8 @@ BSTR_DATE(365.25, "12/30/1900 6:00:00 AM"); BSTR_DATE(1461.0, "12/31/1903"); BSTR_DATE(1461.5, "12/31/1903 12:00:00 PM"); - todo_wine { BSTR_DATE(-657434.0, "1/1/100"); } + BSTR_DATE(-49192.24, "4/24/1765 5:45:36 AM"); + BSTR_DATE(-657434.0, "1/1/100"); BSTR_DATE(2958465.0, "12/31/9999");
#undef BSTR_DATE @@ -6072,12 +6079,55 @@ SysFreeString(bstr); }
+/* This tests assumes an empty cache, so it needs to be ran early in the test. */ +static void test_bstr_cache(void) +{ + BSTR str, str2, strs[20]; + unsigned i; + + static const WCHAR testW[] = {'t','e','s','t',0}; + + str = SysAllocString(testW); + /* This should put the string into cache */ + SysFreeString(str); + /* The string is in cache, this won't touch it */ + SysFreeString(str); + + ok(SysStringLen(str) == 4, "unexpected len\n"); + ok(!lstrcmpW(str, testW), "string changed\n"); + + str2 = SysAllocString(testW); + ok(str == str2, "str != str2\n"); + SysFreeString(str2); + + /* Fill the bucket with cached entries. */ + for(i=0; i < sizeof(strs)/sizeof(*strs); i++) + strs[i] = SysAllocStringLen(NULL, 24); + for(i=0; i < sizeof(strs)/sizeof(*strs); i++) + SysFreeString(strs[i]); + + /* Following allocation will be made from cache */ + str = SysAllocStringLen(NULL, 24); + ok(str == strs[0], "str != strs[0]\n"); + + /* Smaller buffers may also use larget cached buffers */ + str2 = SysAllocStringLen(NULL, 16); + ok(str2 == strs[1], "str2 != strs[1]\n"); + + SysFreeString(str); + SysFreeString(str2); + SysFreeString(str); + SysFreeString(str2); +} + START_TEST(vartype) { hOleaut32 = GetModuleHandleA("oleaut32.dll");
trace("LCIDs: System=0x%08x, User=0x%08x\n", GetSystemDefaultLCID(), GetUserDefaultLCID()); + + test_bstr_cache();
test_VarI1FromI2(); test_VarI1FromI4();