[ros-diffs] [cwittich] 38907: sync ole32 winetest to wine 1.1.13

cwittich at svn.reactos.org cwittich at svn.reactos.org
Sun Jan 18 20:23:07 CET 2009


Author: cwittich
Date: Sun Jan 18 13:23:06 2009
New Revision: 38907

URL: http://svn.reactos.org/svn/reactos?rev=38907&view=rev
Log:
sync ole32 winetest to wine 1.1.13

Modified:
    trunk/rostests/winetests/ole32/compobj.c
    trunk/rostests/winetests/ole32/marshal.c
    trunk/rostests/winetests/ole32/moniker.c
    trunk/rostests/winetests/ole32/ole2.c
    trunk/rostests/winetests/ole32/storage32.c
    trunk/rostests/winetests/ole32/usrmarshal.c

Modified: trunk/rostests/winetests/ole32/compobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/compobj.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/compobj.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -29,6 +29,9 @@
 #include "shlguid.h"
 #include "urlmon.h" /* for CLSID_FileProtocol */
 
+#include "initguid.h"
+#include "ctxtcall.h"
+
 #include "wine/test.h"
 
 /* functions that are not present on all versions of Windows */
@@ -887,7 +890,7 @@
     ok(hr == S_OK, "CoGetClassObject on local server object registered in same "
        "thread should return S_OK instead of 0x%08x\n", hr);
 
-    thread = CreateThread(NULL, 0, revoke_class_object_thread, (LPVOID)cookie, 0, &tid);
+    thread = CreateThread(NULL, 0, revoke_class_object_thread, (LPVOID)(DWORD_PTR)cookie, 0, &tid);
     ok(thread != NULL, "CreateThread failed with error %d\n", GetLastError());
     WaitForSingleObject(thread, INFINITE);
     GetExitCodeThread(thread, &exitcode);
@@ -931,7 +934,7 @@
 
     ok(!is_module_loaded("urlmon.dll"), "urlmon.dll shouldn't be loaded\n");
 
-    hr = CoCreateInstance(&CLSID_FileProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
+    hr = CoCreateInstance(&CLSID_FileProtocol, NULL, CLSCTX_INPROC_SERVER, &IID_IInternetProtocol, (void **)&pUnk);
     if (hr == REGDB_E_CLASSNOTREG)
     {
         trace("IE not installed so can't run CoFreeUnusedLibraries test\n");
@@ -967,6 +970,7 @@
     HRESULT hr;
     ULONG refs;
     IComThreadingInfo *pComThreadingInfo;
+    IContextCallback *pContextCallback;
     APTTYPE apttype;
     THDTYPE thdtype;
 
@@ -996,6 +1000,15 @@
     refs = IComThreadingInfo_Release(pComThreadingInfo);
     ok(refs == 0, "pComThreadingInfo should have 0 refs instead of %d refs\n", refs);
 
+    hr = pCoGetObjectContext(&IID_IContextCallback, (void **)&pContextCallback);
+    ok_ole_success(hr, "CoGetObjectContext(ContextCallback)");
+
+    if (hr == S_OK)
+    {
+        refs = IContextCallback_Release(pContextCallback);
+        ok(refs == 0, "pContextCallback should have 0 refs instead of %d refs\n", refs);
+    }
+
     CoUninitialize();
 
     pCoInitializeEx(NULL, COINIT_MULTITHREADED);
@@ -1014,14 +1027,41 @@
     refs = IComThreadingInfo_Release(pComThreadingInfo);
     ok(refs == 0, "pComThreadingInfo should have 0 refs instead of %d refs\n", refs);
 
-    CoUninitialize();
+    hr = pCoGetObjectContext(&IID_IContextCallback, (void **)&pContextCallback);
+    ok_ole_success(hr, "CoGetObjectContext(ContextCallback)");
+
+    if (hr == S_OK)
+    {
+        refs = IContextCallback_Release(pContextCallback);
+        ok(refs == 0, "pContextCallback should have 0 refs instead of %d refs\n", refs);
+    }
+
+    CoUninitialize();
+}
+
+static void test_CoInitializeEx(void)
+{
+    HRESULT hr;
+
+    hr = pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+    ok(hr == S_OK, "CoInitializeEx failed with error 0x%08x\n", hr);
+
+    /* Calling OleInitialize for the first time should yield S_OK even with
+     * apartment already initialized by previous CoInitialize(Ex) calls. */
+    hr = OleInitialize(NULL);
+    todo_wine ok(hr == S_OK, "OleInitialize failed with error 0x%08x\n", hr);
+
+    /* Subsequent calls to OleInitialize should return S_FALSE */
+    hr = OleInitialize(NULL);
+    ok(hr == S_FALSE, "Expected S_FALSE, hr = 0x%08x\n", hr);
+
+    /* Cleanup */
+    CoUninitialize();
+    OleUninitialize();
 }
 
 START_TEST(compobj)
 {
-    skip("ROS-HACK: Skipping compobj tests\n");
-    return;
-
     HMODULE hOle32 = GetModuleHandle("ole32");
     pCoGetObjectContext = (void*)GetProcAddress(hOle32, "CoGetObjectContext");
     if (!(pCoInitializeEx = (void*)GetProcAddress(hOle32, "CoInitializeEx")))
@@ -1048,4 +1088,5 @@
     test_registered_object_thread_affinity();
     test_CoFreeUnusedLibraries();
     test_CoGetObjectContext();
-}
+    test_CoInitializeEx();
+}

Modified: trunk/rostests/winetests/ole32/marshal.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/marshal.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/marshal.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -2056,15 +2056,18 @@
 
     if (mshctx == MSHCTX_INPROC)
     {
-        DWORD expected_size = sizeof(DWORD) + sizeof(void *) + sizeof(DWORD) + sizeof(GUID);
+        DWORD expected_size = 3*sizeof(DWORD) + sizeof(GUID);
         ok(size == expected_size, "size should have been %d instead of %d\n", expected_size, size);
 
         ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%x, but got 0x%x for mshctx\n", mshlflags, *(DWORD *)marshal_data);
         marshal_data += sizeof(DWORD);
         ok(*(void **)marshal_data == ptr, "expected %p, but got %p for mshctx\n", ptr, *(void **)marshal_data);
         marshal_data += sizeof(void *);
-        ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data);
-        marshal_data += sizeof(DWORD);
+        if (sizeof(void*) == 4)
+        {
+            ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data);
+            marshal_data += sizeof(DWORD);
+        }
         trace("got guid data: {%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}\n",
             ((GUID *)marshal_data)->Data1, ((GUID *)marshal_data)->Data2, ((GUID *)marshal_data)->Data3,
             ((GUID *)marshal_data)->Data4[0], ((GUID *)marshal_data)->Data4[1], ((GUID *)marshal_data)->Data4[2], ((GUID *)marshal_data)->Data4[3],

Modified: trunk/rostests/winetests/ole32/moniker.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/moniker.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/moniker.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -1332,6 +1332,9 @@
     ok_ole_success(hr, CreateBindCtx);
 
     /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL);
+    ok(hr == E_NOTIMPL, "IMoniker_IsRunning should return E_NOTIMPL, not 0x%08x\n", hr);
+
     hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
     ok(hr == E_NOTIMPL, "IMoniker_IsRunning should return E_NOTIMPL, not 0x%08x\n", hr);
 
@@ -1461,6 +1464,10 @@
     ok_ole_success(hr, CreateBindCtx);
 
     /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL);
+    todo_wine
+    ok(hr == E_INVALIDARG, "IMoniker_IsRunning should return E_INVALIDARG, not 0x%08x\n", hr);
+
     hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
     ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08x\n", hr);
 
@@ -1593,6 +1600,10 @@
     ok_ole_success(hr, CreateBindCtx);
 
     /* IsRunning test */
+    hr = IMoniker_IsRunning(moniker, NULL, NULL, NULL);
+    todo_wine
+    ok(hr == E_INVALIDARG, "IMoniker_IsRunning should return E_INVALIDARG, not 0x%08x\n", hr);
+
     hr = IMoniker_IsRunning(moniker, bindctx, NULL, NULL);
     todo_wine
     ok(hr == S_FALSE, "IMoniker_IsRunning should return S_FALSE, not 0x%08x\n", hr);
@@ -1750,7 +1761,7 @@
     hr = IBindCtx_GetBindOptions(pBindCtx, (BIND_OPTS *)&bind_opts);
     ok_ole_success(hr, "IBindCtx_GetBindOptions");
     ok(bind_opts.cbStruct == sizeof(bind_opts) ||
-       bind_opts.cbStruct == 36, /* Vista */
+       bind_opts.cbStruct == sizeof(bind_opts) + sizeof(void*), /* Vista */
        "bind_opts.cbStruct was %d\n", bind_opts.cbStruct);
 
     bind_opts.cbStruct = sizeof(BIND_OPTS);

Modified: trunk/rostests/winetests/ole32/ole2.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/ole2.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/ole2.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -1384,7 +1384,6 @@
        hr);
 
     hr = IOleObject_GetMiscStatus(pObject, DVASPECT_CONTENT, &dwStatus);
-    todo_wine
     ok(hr == REGDB_E_CLASSNOTREG, "IOleObject_GetMiscStatus should have returned REGDB_E_CLASSNOTREG instead of 0x%08x\n", hr);
 
     hr = IOleObject_GetUserClassID(pObject, &clsid);

Modified: trunk/rostests/winetests/ole32/storage32.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/storage32.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/storage32.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -803,6 +803,56 @@
     DeleteFileW(filename);
 }
 
+static void test_writeclassstg(void)
+{
+    static const WCHAR szPrefix[] = { 's','t','g',0 };
+    static const WCHAR szDot[] = { '.',0 };
+    WCHAR filename[MAX_PATH];
+    IStorage *stg = NULL;
+    HRESULT r;
+    CLSID temp_cls;
+
+    if(!GetTempFileNameW(szDot, szPrefix, 0, filename))
+        return;
+
+    DeleteFileW(filename);
+
+    /* create the file */
+    r = StgCreateDocfile( filename, STGM_CREATE | STGM_SHARE_EXCLUSIVE |
+                            STGM_READWRITE, 0, &stg);
+    ok(r==S_OK, "StgCreateDocfile failed\n");
+
+    r = ReadClassStg( NULL, NULL );
+    ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r);
+
+    r = ReadClassStg( stg, NULL );
+    ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r);
+
+    temp_cls.Data1 = 0xdeadbeef;
+    r = ReadClassStg( stg, &temp_cls );
+    ok(r == S_OK, "ReadClassStg failed with 0x%08X\n", r);
+
+    ok(IsEqualCLSID(&temp_cls, &CLSID_NULL), "ReadClassStg returned wrong clsid\n");
+
+    r = WriteClassStg( NULL, NULL );
+    ok(r == E_INVALIDARG, "WriteClassStg should return E_INVALIDARG instead of 0x%08X\n", r);
+
+    r = WriteClassStg( stg, NULL );
+    ok(r == STG_E_INVALIDPOINTER, "WriteClassStg should return STG_E_INVALIDPOINTER instead of 0x%08X\n", r);
+
+    r = WriteClassStg( stg, &test_stg_cls );
+    ok( r == S_OK, "WriteClassStg failed with 0x%08X\n", r);
+
+    r = ReadClassStg( stg, &temp_cls );
+    ok( r == S_OK, "ReadClassStg failed with 0x%08X\n", r);
+    ok(IsEqualCLSID(&temp_cls, &test_stg_cls), "ReadClassStg returned wrong clsid\n");
+
+    r = IStorage_Release( stg );
+    ok (r == 0, "storage not released\n");
+
+    DeleteFileW(filename);
+}
+
 static void test_streamenum(void)
 {
     static const WCHAR szPrefix[] = { 's','t','g',0 };
@@ -1229,4 +1279,5 @@
     test_transact();
     test_ReadClassStm();
     test_access();
-}
+    test_writeclassstg();
+}

Modified: trunk/rostests/winetests/ole32/usrmarshal.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/ole32/usrmarshal.c?rev=38907&r1=38906&r2=38907&view=diff
==============================================================================
--- trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/ole32/usrmarshal.c [iso-8859-1] Sun Jan 18 13:23:06 2009
@@ -33,6 +33,17 @@
 unsigned char * __RPC_USER HMETAFILE_UserMarshal(ULONG *, unsigned char *, HMETAFILE *);
 unsigned char * __RPC_USER HMETAFILE_UserUnmarshal(ULONG *, unsigned char *, HMETAFILE *);
 void __RPC_USER HMETAFILE_UserFree(ULONG *, HMETAFILE *);
+
+ULONG __RPC_USER HENHMETAFILE_UserSize(ULONG *, ULONG, HENHMETAFILE *);
+unsigned char * __RPC_USER HENHMETAFILE_UserMarshal  (ULONG *, unsigned char *, HENHMETAFILE *);
+unsigned char * __RPC_USER HENHMETAFILE_UserUnmarshal(ULONG *, unsigned char *, HENHMETAFILE *);
+void  __RPC_USER HENHMETAFILE_UserFree(ULONG *, HENHMETAFILE *);
+
+ULONG __RPC_USER HMETAFILEPICT_UserSize(ULONG *, ULONG, HMETAFILEPICT *);
+unsigned char * __RPC_USER HMETAFILEPICT_UserMarshal  (ULONG *, unsigned char *, HMETAFILEPICT *);
+unsigned char * __RPC_USER HMETAFILEPICT_UserUnmarshal(ULONG *, unsigned char *, HMETAFILEPICT *);
+void __RPC_USER HMETAFILEPICT_UserFree(ULONG *, HMETAFILEPICT *);
+
 
 static const char cf_marshaled[] =
 {



More information about the Ros-diffs mailing list