ole32/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
3aa87091f0
commit
a74217447c
|
@ -1,4 +1,3 @@
|
|||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
||||
TESTDLL = ole32.dll
|
||||
IMPORTS = oleaut32 ole32 user32 uuid gdi32 advapi32
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -101,30 +101,30 @@ static void test_olestream(void)
|
|||
ole_stream_header_t header;
|
||||
|
||||
hr = create_storage(&stg);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
hr = IStorage_OpenStream(stg, olestream, NULL, STGM_SHARE_EXCLUSIVE | STGM_READ, 0, &stm);
|
||||
ok(hr == STG_E_FILENOTFOUND, "got %08x\n", hr);
|
||||
ok(hr == STG_E_FILENOTFOUND, "got %08lx\n", hr);
|
||||
|
||||
hr = OleCreateDefaultHandler(&non_existent_class, 0, &IID_IOleObject, (void**)&ole_obj);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
hr = IOleObject_QueryInterface(ole_obj, &IID_IPersistStorage, (void**)&persist);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
hr = IPersistStorage_InitNew(persist, stg);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
hr = IStorage_OpenStream(stg, olestream, NULL, STGM_SHARE_EXCLUSIVE | STGM_READ, 0, &stm);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
hr = IStream_Read(stm, &header, sizeof(header), &read);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(read == sizeof(header), "read %d\n", read);
|
||||
ok(header.version == 0x02000001, "got version %08x\n", header.version);
|
||||
ok(header.flags == 0x0, "got flags %08x\n", header.flags);
|
||||
ok(header.link_update_opt == 0x0, "got link update option %08x\n", header.link_update_opt);
|
||||
ok(header.res == 0x0, "got reserved %08x\n", header.res);
|
||||
ok(header.moniker_size == 0x0, "got moniker size %08x\n", header.moniker_size);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
ok(read == sizeof(header), "read %ld\n", read);
|
||||
ok(header.version == 0x02000001, "got version %08lx\n", header.version);
|
||||
ok(header.flags == 0x0, "got flags %08lx\n", header.flags);
|
||||
ok(header.link_update_opt == 0x0, "got link update option %08lx\n", header.link_update_opt);
|
||||
ok(header.res == 0x0, "got reserved %08lx\n", header.res);
|
||||
ok(header.moniker_size == 0x0, "got moniker size %08lx\n", header.moniker_size);
|
||||
|
||||
IStream_Release(stm);
|
||||
|
||||
|
@ -247,17 +247,17 @@ static void test_default_handler_run(void)
|
|||
|
||||
hres = CoRegisterClassObject(&test_server_clsid, (IUnknown*)&ClassFactory,
|
||||
CLSCTX_INPROC_SERVER, 0, &class_reg);
|
||||
ok(hres == S_OK, "CoRegisterClassObject failed: %x\n", hres);
|
||||
ok(hres == S_OK, "CoRegisterClassObject failed: %lx\n", hres);
|
||||
|
||||
hres = OleCreateDefaultHandler(&test_server_clsid, NULL, &IID_IUnknown, (void**)&unk);
|
||||
ok(hres == S_OK, "OleCreateDefaultHandler failed: %x\n", hres);
|
||||
ok(hres == S_OK, "OleCreateDefaultHandler failed: %lx\n", hres);
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&ro);
|
||||
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %x\n", hres);
|
||||
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %lx\n", hres);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
hres = IRunnableObject_Run(ro, NULL);
|
||||
ok(hres == REGDB_E_CLASSNOTREG, "Run returned: %x, expected REGDB_E_CLASSNOTREG\n", hres);
|
||||
ok(hres == REGDB_E_CLASSNOTREG, "Run returned: %lx, expected REGDB_E_CLASSNOTREG\n", hres);
|
||||
IRunnableObject_Release(ro);
|
||||
|
||||
SET_EXPECT(CF_QueryInterface_IMarshal);
|
||||
|
@ -266,28 +266,28 @@ static void test_default_handler_run(void)
|
|||
|
||||
hres = CoRegisterClassObject(&test_server_clsid, (IUnknown*)&ClassFactory,
|
||||
CLSCTX_LOCAL_SERVER, 0, &class_reg);
|
||||
ok(hres == S_OK, "CoRegisterClassObject failed: %x\n", hres);
|
||||
ok(hres == S_OK, "CoRegisterClassObject failed: %lx\n", hres);
|
||||
|
||||
hres = OleCreateDefaultHandler(&test_server_clsid, NULL, &IID_IUnknown, (void**)&unk);
|
||||
ok(hres == S_OK, "OleCreateDefaultHandler failed: %x\n", hres);
|
||||
ok(hres == S_OK, "OleCreateDefaultHandler failed: %lx\n", hres);
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IOleObject, (void**)&oleobj);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %x\n", hres);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IOleObject) failed: %lx\n", hres);
|
||||
|
||||
hres = IOleObject_QueryInterface(oleobj, &IID_IPersistStorage, (void**)&persist);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IPersistStorage) failed: %x\n", hres);
|
||||
ok(hres == S_OK, "QueryInterface(IID_IPersistStorage) failed: %lx\n", hres);
|
||||
IPersistStorage_Release(persist);
|
||||
IOleObject_Release(oleobj);
|
||||
|
||||
hres = IUnknown_QueryInterface(unk, &IID_IRunnableObject, (void**)&ro);
|
||||
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %x\n", hres);
|
||||
ok(hres == S_OK, "QueryInterface(IRunnableObject) failed: %lx\n", hres);
|
||||
IUnknown_Release(unk);
|
||||
|
||||
SET_EXPECT(CF_QueryInterface_ClassFactory);
|
||||
SET_EXPECT(CF_CreateInstance);
|
||||
hres = IRunnableObject_Run(ro, NULL);
|
||||
todo_wine
|
||||
ok(hres == S_OK, "Run failed: %x\n", hres);
|
||||
ok(hres == S_OK, "Run failed: %lx\n", hres);
|
||||
CHECK_CALLED(CF_QueryInterface_ClassFactory);
|
||||
CHECK_CALLED(CF_CreateInstance);
|
||||
IRunnableObject_Release(ro);
|
||||
|
@ -297,7 +297,7 @@ static void test_default_handler_run(void)
|
|||
hres = CoCreateInstance(&test_server_clsid, NULL, CLSCTX_LOCAL_SERVER,
|
||||
&IID_IOleObject, (void**)&oleobj);
|
||||
todo_wine
|
||||
ok(hres == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %x\n", hres);
|
||||
ok(hres == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %lx\n", hres);
|
||||
todo_wine
|
||||
CHECK_NOT_CALLED(CF_QueryInterface_ClassFactory);
|
||||
todo_wine
|
||||
|
|
|
@ -89,7 +89,7 @@ static HRESULT check_expect_(enum method func, DWORD expect_param, DWORD *set_pa
|
|||
if (call_ptr->method == func) break;
|
||||
} while ((++call_ptr)->method != end_seq);
|
||||
|
||||
ok_( file, line )( expect_param == call_ptr->expect_param, "%s: unexpected param %08x expected %08x\n",
|
||||
ok_( file, line )( expect_param == call_ptr->expect_param, "%s: unexpected param %08lx expected %08lx\n",
|
||||
method_names[func], expect_param, call_ptr->expect_param );
|
||||
if (set_param) *set_param = call_ptr->set_param;
|
||||
hr = call_ptr->set_ret;
|
||||
|
@ -263,7 +263,7 @@ static int droptarget_refs;
|
|||
static int test_reentrance;
|
||||
|
||||
/* helper macros to make tests a bit leaner */
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
|
||||
|
||||
static HRESULT WINAPI DropTarget_QueryInterface(IDropTarget* iface, REFIID riid,
|
||||
void** ppvObject)
|
||||
|
@ -430,7 +430,7 @@ static HRESULT WINAPI EnumFORMATETC_Next(IEnumFORMATETC *iface,
|
|||
static FORMATETC format = { CF_TEXT, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
|
||||
HRESULT hr = check_expect(EnumFMT_Next, 0, NULL);
|
||||
|
||||
ok(celt == 1, "celt = %d\n", celt);
|
||||
ok(celt == 1, "celt = %ld\n", celt);
|
||||
ok(rgelt != NULL, "rgelt == NULL\n");
|
||||
ok(pceltFetched == NULL, "pceltFetched != NULL\n");
|
||||
|
||||
|
@ -624,18 +624,18 @@ static void test_Register_Revoke(void)
|
|||
hr = RegisterDragDrop(hwnd, &DropTarget);
|
||||
ok(hr == E_OUTOFMEMORY ||
|
||||
broken(hr == CO_E_NOTINITIALIZED), /* NT4 */
|
||||
"RegisterDragDrop without OLE initialized should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
|
||||
"RegisterDragDrop without OLE initialized should have returned E_OUTOFMEMORY instead of 0x%08lx\n", hr);
|
||||
|
||||
OleInitialize(NULL);
|
||||
|
||||
hr = RegisterDragDrop(hwnd, NULL);
|
||||
ok(hr == E_INVALIDARG, "RegisterDragDrop with NULL IDropTarget * should return E_INVALIDARG instead of 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "RegisterDragDrop with NULL IDropTarget * should return E_INVALIDARG instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = RegisterDragDrop(NULL, &DropTarget);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = RegisterDragDrop((HWND)0xdeadbeef, &DropTarget);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with garbage hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RegisterDragDrop with garbage hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
|
||||
|
||||
ok(droptarget_refs == 0, "DropTarget refs should be zero not %d\n", droptarget_refs);
|
||||
hr = RegisterDragDrop(hwnd, &DropTarget);
|
||||
|
@ -646,7 +646,7 @@ static void test_Register_Revoke(void)
|
|||
ok(prop == &DropTarget, "expected IDropTarget pointer %p, got %p\n", &DropTarget, prop);
|
||||
|
||||
hr = RegisterDragDrop(hwnd, &DropTarget);
|
||||
ok(hr == DRAGDROP_E_ALREADYREGISTERED, "RegisterDragDrop with already registered hwnd should return DRAGDROP_E_ALREADYREGISTERED instead of 0x%08x\n", hr);
|
||||
ok(hr == DRAGDROP_E_ALREADYREGISTERED, "RegisterDragDrop with already registered hwnd should return DRAGDROP_E_ALREADYREGISTERED instead of 0x%08lx\n", hr);
|
||||
|
||||
ok(droptarget_refs >= 1, "DropTarget refs should be at least one\n");
|
||||
OleUninitialize();
|
||||
|
@ -662,7 +662,7 @@ static void test_Register_Revoke(void)
|
|||
}
|
||||
|
||||
hr = RevokeDragDrop(NULL);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RevokeDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08x\n", hr);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "RevokeDragDrop with NULL hwnd should return DRAGDROP_E_INVALIDHWND instead of 0x%08lx\n", hr);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
|
||||
|
@ -674,12 +674,12 @@ static void test_Register_Revoke(void)
|
|||
NULL, NULL, NULL);
|
||||
|
||||
hr = RegisterDragDrop(hwnd, &DropTarget);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
DestroyWindow(hwnd);
|
||||
|
||||
hr = RevokeDragDrop(hwnd);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "got 0x%08x\n", hr);
|
||||
ok(hr == DRAGDROP_E_INVALIDHWND, "got 0x%08lx\n", hr);
|
||||
|
||||
OleUninitialize();
|
||||
}
|
||||
|
@ -698,32 +698,32 @@ static void test_DoDragDrop(void)
|
|||
ok(IsWindow(hwnd), "failed to create window\n");
|
||||
|
||||
hr = OleInitialize(NULL);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = RegisterDragDrop(hwnd, &DropTarget);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
/* incomplete arguments set */
|
||||
hr = DoDragDrop(NULL, NULL, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(NULL, &DropSource, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(&DataObject, NULL, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(NULL, NULL, 0, &effect);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(&DataObject, &DropSource, 0, NULL);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(NULL, &DropSource, 0, &effect);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = DoDragDrop(&DataObject, NULL, 0, &effect);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "got 0x%08lx\n", hr);
|
||||
|
||||
ShowWindow(hwnd, SW_SHOW);
|
||||
GetWindowRect(hwnd, &rect);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
|
||||
|
||||
static const CLSID CLSID_WineTest =
|
||||
{ /* 9474ba1a-258b-490b-bc13-516e9239ace0 */
|
||||
|
@ -101,17 +101,17 @@ static void test_error_info(void)
|
|||
IErrorInfo_Release(pErrorInfo);
|
||||
|
||||
hr = GetErrorInfo(0, &pErrorInfo);
|
||||
ok(hr == S_FALSE, "GetErrorInfo should have returned S_FALSE instead of 0x%08x\n", hr);
|
||||
ok(hr == S_FALSE, "GetErrorInfo should have returned S_FALSE instead of 0x%08lx\n", hr);
|
||||
ok(!pErrorInfo, "pErrorInfo should be set to NULL\n");
|
||||
|
||||
hr = SetErrorInfo(0, NULL);
|
||||
ok_ole_success(hr, "SetErrorInfo");
|
||||
|
||||
hr = GetErrorInfo(0xdeadbeef, &pErrorInfo);
|
||||
ok(hr == E_INVALIDARG, "GetErrorInfo should have returned E_INVALIDARG instead of 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "GetErrorInfo should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = SetErrorInfo(0xdeadbeef, NULL);
|
||||
ok(hr == E_INVALIDARG, "SetErrorInfo should have returned E_INVALIDARG instead of 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "SetErrorInfo should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
|
||||
}
|
||||
|
||||
START_TEST(errorinfo)
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include "wine/test.h"
|
||||
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error %#08lx\n", hr)
|
||||
|
||||
static char const * const *expected_method_list;
|
||||
|
||||
|
@ -56,7 +56,7 @@ static void test_streamonhglobal(void)
|
|||
HRESULT hr;
|
||||
|
||||
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
|
||||
ok(hr == S_OK, "Failed to create a stream, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to create a stream, hr %#lx.\n", hr);
|
||||
|
||||
ull.QuadPart = sizeof(data);
|
||||
hr = IStream_SetSize(pStream, ull);
|
||||
|
@ -72,7 +72,7 @@ static void test_streamonhglobal(void)
|
|||
/* should return S_OK, not S_FALSE */
|
||||
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
|
||||
ok_ole_success(hr, "IStream_Read");
|
||||
ok(read == sizeof(data), "IStream_Read returned read %d\n", read);
|
||||
ok(read == sizeof(data), "IStream_Read returned read %ld\n", read);
|
||||
|
||||
/* ignores HighPart */
|
||||
ull.u.HighPart = -1;
|
||||
|
@ -93,8 +93,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- invalid seek argument */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -102,9 +102,9 @@ static void test_streamonhglobal(void)
|
|||
ll.u.HighPart = 0;
|
||||
ll.u.LowPart = 123;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_END+1, &ull);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should not have changed HighPart, got %d\n", ull.u.HighPart);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should not have changed HighPart, got %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid position argument (seek to beginning) */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -113,8 +113,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid position argument (seek to end) */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -123,8 +123,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_END, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- ignore HighPart in the move value (seek from current position) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -138,8 +138,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- ignore HighPart in the move value (seek to beginning) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -153,8 +153,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0, "should have set LowPart to 0 instead of %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- invalid LowPart value (seek before start of stream) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -167,9 +167,9 @@ static void test_streamonhglobal(void)
|
|||
ll.u.HighPart = 0;
|
||||
ll.u.LowPart = 0x80000000;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid LowPart value (seek to start of stream) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -183,8 +183,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = -(DWORD)sizeof(data);
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0, "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0, "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- invalid LowPart value (seek to start of stream-1) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -197,9 +197,9 @@ static void test_streamonhglobal(void)
|
|||
ll.u.HighPart = 0;
|
||||
ll.u.LowPart = -(DWORD)sizeof(data)-1;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid LowPart value (seek forward to 0x80000000) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -213,8 +213,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0x80000000 - sizeof(data);
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0x80000000, "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0x80000000, "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- invalid LowPart value (seek to beginning) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -227,9 +227,9 @@ static void test_streamonhglobal(void)
|
|||
ll.u.HighPart = 0;
|
||||
ll.u.LowPart = 0x80000000;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08x\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %d\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(hr == STG_E_SEEKERROR, "IStream_Seek should have returned STG_E_SEEKERROR instead of 0x%08lx\n", hr);
|
||||
ok(ull.u.LowPart == sizeof(data), "LowPart set to %ld\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid LowPart value (seek to beginning) */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -238,8 +238,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0x7FFFFFFF;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_SET, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- valid LowPart value (seek from current position) */
|
||||
ll.u.HighPart = 0;
|
||||
|
@ -253,8 +253,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 0x7FFFFFFF;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08x\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0x7FFFFFFF, "should have set LowPart to 0x7FFFFFFF instead of %08lx\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- second seek allows you to go past 0x7FFFFFFF size */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -263,8 +263,8 @@ static void test_streamonhglobal(void)
|
|||
ll.u.LowPart = 9;
|
||||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08lx\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
/* IStream_Seek -- seek wraps position/size on integer overflow, but not on win8 */
|
||||
ull.u.HighPart = 0xCAFECAFE;
|
||||
|
@ -274,10 +274,10 @@ static void test_streamonhglobal(void)
|
|||
hr = IStream_Seek(pStream, ll, STREAM_SEEK_CUR, &ull);
|
||||
ok(hr == S_OK || hr == STG_E_SEEKERROR /* win8 */, "IStream_Seek\n");
|
||||
if (SUCCEEDED(hr))
|
||||
ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08x\n", ull.u.LowPart);
|
||||
ok(ull.u.LowPart == 0x00000007, "should have set LowPart to 0x00000007 instead of %08lx\n", ull.u.LowPart);
|
||||
else
|
||||
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08x\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %d\n", ull.u.HighPart);
|
||||
ok(ull.u.LowPart == 0x80000008, "should have set LowPart to 0x80000008 instead of %08lx\n", ull.u.LowPart);
|
||||
ok(ull.u.HighPart == 0, "should have set HighPart to 0 instead of %ld\n", ull.u.HighPart);
|
||||
|
||||
hr = IStream_Commit(pStream, STGC_DEFAULT);
|
||||
ok_ole_success(hr, "IStream_Commit");
|
||||
|
@ -286,18 +286,18 @@ static void test_streamonhglobal(void)
|
|||
ok_ole_success(hr, "IStream_Revert");
|
||||
|
||||
hr = IStream_LockRegion(pStream, ull, ull, LOCK_WRITE);
|
||||
ok(hr == STG_E_INVALIDFUNCTION, "IStream_LockRegion should have returned STG_E_INVALIDFUNCTION instead of 0x%08x\n", hr);
|
||||
ok(hr == STG_E_INVALIDFUNCTION, "IStream_LockRegion should have returned STG_E_INVALIDFUNCTION instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IStream_Stat(pStream, &statstg, STATFLAG_DEFAULT);
|
||||
ok_ole_success(hr, "IStream_Stat");
|
||||
ok(statstg.type == STGTY_STREAM, "statstg.type should have been STGTY_STREAM instead of %d\n", statstg.type);
|
||||
ok(statstg.type == STGTY_STREAM, "statstg.type should have been STGTY_STREAM instead of %ld\n", statstg.type);
|
||||
|
||||
/* test OOM condition */
|
||||
ull.u.HighPart = -1;
|
||||
ull.u.LowPart = -1;
|
||||
hr = IStream_SetSize(pStream, ull);
|
||||
ok(hr == E_OUTOFMEMORY || broken(hr == S_OK), /* win9x */
|
||||
"IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
|
||||
"IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08lx\n", hr);
|
||||
|
||||
IStream_Release(pStream);
|
||||
}
|
||||
|
@ -437,15 +437,15 @@ static void test_copyto(void)
|
|||
|
||||
hr = IStream_Write(pStream, szHello, sizeof(szHello), &written);
|
||||
ok_ole_success(hr, "IStream_Write");
|
||||
ok(written == sizeof(szHello), "only %d bytes written\n", written);
|
||||
ok(written == sizeof(szHello), "only %ld bytes written\n", written);
|
||||
|
||||
hr = IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
|
||||
ok_ole_success(hr, "IStream_Seek");
|
||||
|
||||
cb.QuadPart = sizeof(szHello);
|
||||
hr = IStream_CopyTo(pStream, &Test_Stream, cb, &ullRead, &ullWritten);
|
||||
ok(ullWritten.QuadPart == 5, "ullWritten was %d instead\n", (ULONG)ullWritten.QuadPart);
|
||||
ok(ullRead.QuadPart == sizeof(szHello), "only %d bytes read\n", (ULONG)ullRead.QuadPart);
|
||||
ok(ullWritten.QuadPart == 5, "ullWritten was %ld instead\n", (ULONG)ullWritten.QuadPart);
|
||||
ok(ullRead.QuadPart == sizeof(szHello), "only %ld bytes read\n", (ULONG)ullRead.QuadPart);
|
||||
ok_ole_success(hr, "IStream_CopyTo");
|
||||
|
||||
ok(!*expected_method_list, "Method sequence starting from %s not called\n", *expected_method_list);
|
||||
|
@ -480,7 +480,7 @@ static void test_freed_hglobal(void)
|
|||
ULONG read, written;
|
||||
|
||||
hglobal = GlobalAlloc(GMEM_DDESHARE|GMEM_NODISCARD|GMEM_MOVEABLE, strlen(teststring) + 1);
|
||||
ok(hglobal != NULL, "GlobalAlloc failed with error %d\n", GetLastError());
|
||||
ok(hglobal != NULL, "GlobalAlloc failed with error %ld\n", GetLastError());
|
||||
p = GlobalLock(hglobal);
|
||||
strcpy(p, teststring);
|
||||
GlobalUnlock(hglobal);
|
||||
|
@ -493,7 +493,7 @@ static void test_freed_hglobal(void)
|
|||
ok(!strcmp(buffer, teststring), "buffer data %s differs\n", buffer);
|
||||
ok(read == sizeof(teststring) ||
|
||||
broken(read == ((sizeof(teststring) + 3) & ~3)), /* win9x rounds the size */
|
||||
"read should be sizeof(teststring) instead of %d\n", read);
|
||||
"read should be sizeof(teststring) instead of %ld\n", read);
|
||||
|
||||
GlobalFree(hglobal);
|
||||
|
||||
|
@ -502,15 +502,15 @@ static void test_freed_hglobal(void)
|
|||
hr = IStream_Read(pStream, buffer, sizeof(buffer), &read);
|
||||
ok_ole_success(hr, "IStream_Read");
|
||||
ok(buffer[0] == 0, "buffer data should be untouched\n");
|
||||
ok(read == 0, "read should be 0 instead of %d\n", read);
|
||||
ok(read == 0, "read should be 0 instead of %ld\n", read);
|
||||
|
||||
ull.QuadPart = sizeof(buffer);
|
||||
hr = IStream_SetSize(pStream, ull);
|
||||
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08x\n", hr);
|
||||
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IStream_Write(pStream, buffer, sizeof(buffer), &written);
|
||||
ok(hr == E_OUTOFMEMORY, "IStream_Write with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08x\n", hr);
|
||||
ok(written == 0, "written should be 0 instead of %d\n", written);
|
||||
ok(hr == E_OUTOFMEMORY, "IStream_Write with invalid HGLOBAL should return E_OUTOFMEMORY instead of 0x%08lx\n", hr);
|
||||
ok(written == 0, "written should be 0 instead of %ld\n", written);
|
||||
|
||||
IStream_Release(pStream);
|
||||
}
|
||||
|
@ -526,21 +526,21 @@ static void stream_info(IStream *stream, HGLOBAL *hmem, int *size, int *pos)
|
|||
*size = *pos = -1;
|
||||
|
||||
hr = GetHGlobalFromStream(stream, hmem);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
memset(&stat, 0x55, sizeof(stat));
|
||||
hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(stat.type == STGTY_STREAM, "unexpected %#x\n", stat.type);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
ok(stat.type == STGTY_STREAM, "unexpected %#lx\n", stat.type);
|
||||
ok(!stat.pwcsName, "unexpected %p\n", stat.pwcsName);
|
||||
ok(IsEqualIID(&stat.clsid, &GUID_NULL), "unexpected %s\n", wine_dbgstr_guid(&stat.clsid));
|
||||
ok(!stat.cbSize.HighPart, "unexpected %#x\n", stat.cbSize.HighPart);
|
||||
ok(!stat.cbSize.HighPart, "unexpected %#lx\n", stat.cbSize.HighPart);
|
||||
*size = stat.cbSize.LowPart;
|
||||
|
||||
offset.QuadPart = 0;
|
||||
hr = IStream_Seek(stream, offset, STREAM_SEEK_CUR, &newpos);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(!newpos.HighPart, "unexpected %#x\n", newpos.HighPart);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
ok(!newpos.HighPart, "unexpected %#lx\n", newpos.HighPart);
|
||||
*pos = newpos.LowPart;
|
||||
}
|
||||
|
||||
|
@ -559,13 +559,13 @@ static void test_IStream_Clone(void)
|
|||
orig_hmem = GlobalAlloc(GMEM_MOVEABLE, 0);
|
||||
ok(orig_hmem != 0, "unexpected %p\n", orig_hmem);
|
||||
hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
hr = GetHGlobalFromStream(stream, NULL);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#lx\n", hr);
|
||||
|
||||
hr = GetHGlobalFromStream(NULL, &hmem);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem == orig_hmem, "handles should match\n");
|
||||
|
@ -573,10 +573,10 @@ static void test_IStream_Clone(void)
|
|||
ok(pos == 0, "unexpected %d\n", pos);
|
||||
|
||||
hr = IStream_Clone(stream, &clone);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
hr = IStream_Write(stream, hello, sizeof(hello), NULL);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem == orig_hmem, "handles should match\n");
|
||||
|
@ -590,12 +590,12 @@ static void test_IStream_Clone(void)
|
|||
|
||||
buf[0] = 0;
|
||||
hr = IStream_Read(clone, buf, sizeof(buf), NULL);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
ok(!strcmp(buf, hello), "wrong stream contents\n");
|
||||
|
||||
newsize.QuadPart = 0x8000;
|
||||
hr = IStream_SetSize(stream, newsize);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem == orig_hmem, "handles should match\n");
|
||||
|
@ -614,10 +614,10 @@ static void test_IStream_Clone(void)
|
|||
orig_hmem = GlobalAlloc(GMEM_FIXED, 1);
|
||||
ok(orig_hmem != 0, "unexpected %p\n", orig_hmem);
|
||||
hr = CreateStreamOnHGlobal(orig_hmem, TRUE, &stream);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
hr = IStream_Clone(stream, &clone);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem == orig_hmem, "handles should match\n");
|
||||
|
@ -631,7 +631,7 @@ static void test_IStream_Clone(void)
|
|||
|
||||
newsize.QuadPart = 0x8000;
|
||||
hr = IStream_SetSize(stream, newsize);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem != 0, "unexpected %p\n", hmem);
|
||||
|
@ -649,10 +649,10 @@ static void test_IStream_Clone(void)
|
|||
|
||||
/* test Release of cloned stream */
|
||||
hr = CreateStreamOnHGlobal(0, TRUE, &stream);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
hr = IStream_Clone(stream, &clone);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(stream, &hmem, &size, &pos);
|
||||
ok(hmem != 0, "unexpected %p\n", hmem);
|
||||
|
@ -669,7 +669,7 @@ static void test_IStream_Clone(void)
|
|||
|
||||
newsize.QuadPart = 0x8000;
|
||||
hr = IStream_SetSize(clone, newsize);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(clone, &hmem_clone, &size, &pos);
|
||||
ok(hmem_clone == hmem, "handles should match\n");
|
||||
|
@ -677,7 +677,7 @@ static void test_IStream_Clone(void)
|
|||
ok(pos == 0, "unexpected %d\n", pos);
|
||||
|
||||
hr = IStream_Write(clone, hello, sizeof(hello), NULL);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
stream_info(clone, &hmem_clone, &size, &pos);
|
||||
ok(hmem_clone == hmem, "handles should match\n");
|
||||
|
@ -686,11 +686,11 @@ static void test_IStream_Clone(void)
|
|||
|
||||
offset.QuadPart = 0;
|
||||
hr = IStream_Seek(clone, offset, STREAM_SEEK_SET, NULL);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
|
||||
buf[0] = 0;
|
||||
hr = IStream_Read(clone, buf, sizeof(buf), NULL);
|
||||
ok(hr == S_OK, "unexpected %#x\n", hr);
|
||||
ok(hr == S_OK, "unexpected %#lx\n", hr);
|
||||
ok(!strcmp(buf, hello), "wrong stream contents\n");
|
||||
|
||||
stream_info(clone, &hmem_clone, &size, &pos);
|
||||
|
|
|
@ -67,11 +67,11 @@ static const GUID CLSID_ft_unmarshaler_1809 = {0x00000359, 0x0000, 0x0000, {0xc0
|
|||
static HRESULT (WINAPI *pDllGetClassObject)(REFCLSID,REFIID,LPVOID);
|
||||
|
||||
/* helper macros to make tests a bit leaner */
|
||||
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %d\n", cLocks)
|
||||
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %d\n", cLocks)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error 0x%08x\n", hr)
|
||||
#define ok_more_than_one_lock() ok(cLocks > 0, "Number of locks should be > 0, but actually is %ld\n", cLocks)
|
||||
#define ok_no_locks() ok(cLocks == 0, "Number of locks should be 0, but actually is %ld\n", cLocks)
|
||||
#define ok_ole_success(hr, func) ok(hr == S_OK, #func " failed with error %#08lx\n", hr)
|
||||
#define ok_non_zero_external_conn() do {if (with_external_conn) ok(external_connections, "got no external connections\n");} while(0);
|
||||
#define ok_zero_external_conn() do {if (with_external_conn) ok(!external_connections, "got %d external connections\n", external_connections);} while(0);
|
||||
#define ok_zero_external_conn() do {if (with_external_conn) ok(!external_connections, "got %ld external connections\n", external_connections);} while(0);
|
||||
#define ok_last_release_closes(b) do {if (with_external_conn) ok(last_release_closes == b, "got %d expected %d\n", last_release_closes, b);} while(0);
|
||||
|
||||
#define OBJREF_SIGNATURE (0x574f454d)
|
||||
|
@ -490,8 +490,8 @@ static HRESULT WINAPI RpcStubBuffer_Invoke(IRpcStubBuffer *iface, RPCOLEMESSAGE
|
|||
CHECK_EXPECT(Invoke);
|
||||
|
||||
hr = IRpcChannelBuffer_GetDestCtx(_pRpcChannelBuffer, &dest_context, &dest_context_data);
|
||||
ok(hr == S_OK, "GetDestCtx failed: %08x\n", hr);
|
||||
ok(dest_context == MSHCTX_INPROC, "desc_context = %x\n", dest_context);
|
||||
ok(hr == S_OK, "GetDestCtx failed: %08lx\n", hr);
|
||||
ok(dest_context == MSHCTX_INPROC, "desc_context = %lx\n", dest_context);
|
||||
ok(!dest_context_data, "desc_context_data = %p\n", dest_context_data);
|
||||
|
||||
return IRpcStubBuffer_Invoke(This->buffer, _prpcmsg, _pRpcChannelBuffer);
|
||||
|
@ -580,7 +580,7 @@ static HRESULT WINAPI PSFactoryBuffer_CreateStub(IPSFactoryBuffer *iface, REFIID
|
|||
stub->ref = 1;
|
||||
|
||||
hr = IPSFactoryBuffer_CreateStub(ps_factory_buffer, riid, server, &stub->buffer);
|
||||
ok(hr == S_OK, "CreateStub failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "CreateStub failed: %08lx\n", hr);
|
||||
|
||||
*ppStub = &stub->IRpcStubBuffer_iface;
|
||||
return S_OK;
|
||||
|
@ -625,7 +625,7 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
|
|||
if(data->register_object) {
|
||||
hr = CoRegisterClassObject(data->register_clsid, data->register_object,
|
||||
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®istration_key);
|
||||
ok(hr == S_OK, "CoRegisterClassObject failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "CoRegisterClassObject failed: %08lx\n", hr);
|
||||
}
|
||||
|
||||
if (data->filter)
|
||||
|
@ -698,7 +698,7 @@ static void release_host_object(DWORD tid, WPARAM wp)
|
|||
static void end_host_object(DWORD tid, HANDLE thread)
|
||||
{
|
||||
BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0);
|
||||
ok(ret, "PostThreadMessage failed with error %d\n", GetLastError());
|
||||
ok(ret, "PostThreadMessage failed with error %ld\n", GetLastError());
|
||||
/* be careful of races - don't return until hosting thread has terminated */
|
||||
ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" );
|
||||
CloseHandle(thread);
|
||||
|
@ -714,7 +714,7 @@ static void test_no_marshaler(void)
|
|||
hr = CreateStreamOnHGlobal(NULL, TRUE, &pStream);
|
||||
ok_ole_success(hr, CreateStreamOnHGlobal);
|
||||
hr = CoMarshalInterface(pStream, &IID_IWineTest, (IUnknown*)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
||||
ok(hr == E_NOINTERFACE, "CoMarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "CoMarshalInterface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
|
||||
|
||||
IStream_Release(pStream);
|
||||
}
|
||||
|
@ -815,7 +815,7 @@ static void test_marshal_and_unmarshal_invalid(void)
|
|||
if (pProxy)
|
||||
{
|
||||
hr = IClassFactory_CreateInstance(pProxy, NULL, &IID_IUnknown, &dummy);
|
||||
ok(hr == RPC_E_DISCONNECTED, "Remote call should have returned RPC_E_DISCONNECTED, instead of 0x%08x\n", hr);
|
||||
ok(hr == RPC_E_DISCONNECTED, "Remote call should have returned RPC_E_DISCONNECTED, instead of 0x%08lx\n", hr);
|
||||
|
||||
IClassFactory_Release(pProxy);
|
||||
}
|
||||
|
@ -848,7 +848,7 @@ static void test_same_apartment_unmarshal_failure(void)
|
|||
ok_ole_success(hr, IStream_Seek);
|
||||
|
||||
hr = CoUnmarshalInterface(pStream, &IID_IParseDisplayName, (void **)&pProxy);
|
||||
ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "CoUnmarshalInterface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
|
||||
|
||||
ok_no_locks();
|
||||
ok_zero_external_conn();
|
||||
|
@ -1078,7 +1078,7 @@ static void test_proxy_marshal_and_unmarshal_weak(void)
|
|||
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
|
||||
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy2);
|
||||
todo_wine
|
||||
ok(hr == CO_E_OBJNOTREG, "CoUnmarshalInterface should return CO_E_OBJNOTREG instead of 0x%08x\n", hr);
|
||||
ok(hr == CO_E_OBJNOTREG, "CoUnmarshalInterface should return CO_E_OBJNOTREG instead of 0x%08lx\n", hr);
|
||||
|
||||
ok_no_locks();
|
||||
ok_zero_external_conn();
|
||||
|
@ -1119,7 +1119,7 @@ static void test_proxy_marshal_and_unmarshal_strong(void)
|
|||
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
|
||||
/* marshal the proxy */
|
||||
hr = CoMarshalInterface(pStream, &IID_IClassFactory, pProxy, MSHCTX_INPROC, NULL, MSHLFLAGS_TABLESTRONG);
|
||||
ok(hr == S_OK, "Got hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Got hr %#lx.\n", hr);
|
||||
|
||||
ok_more_than_one_lock();
|
||||
ok_non_zero_external_conn();
|
||||
|
@ -1227,10 +1227,10 @@ static void test_marshal_proxy_apartment_shutdown(void)
|
|||
ok_last_release_closes(TRUE);
|
||||
|
||||
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&unk);
|
||||
ok(hr == CO_E_OBJNOTCONNECTED, "got %#x\n", hr);
|
||||
ok(hr == CO_E_OBJNOTCONNECTED, "got %#lx\n", hr);
|
||||
|
||||
ref = IClassFactory_Release(proxy);
|
||||
ok(!ref, "got %d refs\n", ref);
|
||||
ok(!ref, "got %ld refs\n", ref);
|
||||
|
||||
ok_no_locks();
|
||||
|
||||
|
@ -1320,22 +1320,22 @@ static void test_marshal_channel_buffer(void)
|
|||
|
||||
hr = CoRegisterClassObject(&CLSID_WineTestPSFactoryBuffer, (IUnknown *)&PSFactoryBuffer,
|
||||
CLSCTX_INPROC_SERVER, REGCLS_MULTIPLEUSE, ®istration_key);
|
||||
ok(hr == S_OK, "CoRegisterClassObject failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "CoRegisterClassObject failed: %08lx\n", hr);
|
||||
|
||||
hr = CoRegisterPSClsid(&IID_IOleWindow, &CLSID_WineTestPSFactoryBuffer);
|
||||
ok(hr == S_OK, "CoRegisterPSClsid failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "CoRegisterPSClsid failed: %08lx\n", hr);
|
||||
|
||||
SET_EXPECT(CreateStub);
|
||||
SET_EXPECT(CreateProxy);
|
||||
hr = IUnknown_QueryInterface(proxy, &IID_IOleWindow, (void**)&ole_window);
|
||||
ok(hr == S_OK, "Could not get IOleWindow iface: %08x\n", hr);
|
||||
ok(hr == S_OK, "Could not get IOleWindow iface: %08lx\n", hr);
|
||||
CHECK_CALLED(CreateStub);
|
||||
CHECK_CALLED(CreateProxy);
|
||||
|
||||
SET_EXPECT(Invoke);
|
||||
SET_EXPECT(GetWindow);
|
||||
hr = IOleWindow_GetWindow(ole_window, &hwnd);
|
||||
ok(hr == S_OK, "GetWindow failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "GetWindow failed: %08lx\n", hr);
|
||||
ok((DWORD)(DWORD_PTR)hwnd == 0xdeadbeef, "hwnd = %p\n", hwnd);
|
||||
CHECK_CALLED(Invoke);
|
||||
CHECK_CALLED(GetWindow);
|
||||
|
@ -1348,7 +1348,7 @@ static void test_marshal_channel_buffer(void)
|
|||
CHECK_CALLED(Disconnect);
|
||||
|
||||
hr = CoRevokeClassObject(registration_key);
|
||||
ok(hr == S_OK, "CoRevokeClassObject failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "CoRevokeClassObject failed: %08lx\n", hr);
|
||||
|
||||
end_host_object(tid, thread);
|
||||
}
|
||||
|
@ -1414,8 +1414,8 @@ static HRESULT WINAPI CustomMarshal_MarshalInterface(IMarshal *iface, IStream *s
|
|||
|
||||
hr = IStream_Stat(stream, &stat, STATFLAG_DEFAULT);
|
||||
ok_ole_success(hr, IStream_Stat);
|
||||
ok(U(stat.cbSize).LowPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).LowPart);
|
||||
ok(U(stat.cbSize).HighPart == 0, "stream is not empty (%d)\n", U(stat.cbSize).HighPart);
|
||||
ok(U(stat.cbSize).LowPart == 0, "stream is not empty (%ld)\n", U(stat.cbSize).LowPart);
|
||||
ok(U(stat.cbSize).HighPart == 0, "stream is not empty (%ld)\n", U(stat.cbSize).HighPart);
|
||||
|
||||
hr = CoGetStandardMarshal(riid, (IUnknown*)iface,
|
||||
dwDestContext, NULL, mshlflags, &std_marshal);
|
||||
|
@ -1511,7 +1511,7 @@ static void test_StdMarshal_custom_marshaling(void)
|
|||
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
||||
ok_ole_success(hr, CoGetMarshalSizeMax);
|
||||
CHECK_CALLED(CustomMarshal_GetMarshalSizeMax);
|
||||
ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF));
|
||||
ok(size == sizeof(OBJREF), "size = %ld, expected %d\n", size, (int)sizeof(OBJREF));
|
||||
}
|
||||
|
||||
static void test_DfMarshal_custom_marshaling(void)
|
||||
|
@ -1540,17 +1540,17 @@ static void test_DfMarshal_custom_marshaling(void)
|
|||
size = FIELD_OFFSET(OBJREF, u_objref.u_custom.pData);
|
||||
hr = IStream_Read(stream, &objref, size, &read);
|
||||
ok_ole_success(hr, IStream_Read);
|
||||
ok(read == size, "read = %d, expected %d\n", read, size);
|
||||
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n",
|
||||
ok(read == size, "read = %ld, expected %ld\n", read, size);
|
||||
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %lx\n",
|
||||
objref.signature);
|
||||
ok(objref.flags == OBJREF_CUSTOM, "objref.flags = %x\n", objref.flags);
|
||||
ok(objref.flags == OBJREF_CUSTOM, "objref.flags = %lx\n", objref.flags);
|
||||
ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n",
|
||||
wine_dbgstr_guid(&objref.iid));
|
||||
ok(IsEqualIID(&objref.u_objref.u_custom.clsid, &CLSID_DfMarshal),
|
||||
"custom.clsid = %s\n", wine_dbgstr_guid(&objref.u_objref.u_custom.clsid));
|
||||
ok(!objref.u_objref.u_custom.cbExtension, "custom.cbExtension = %d\n",
|
||||
ok(!objref.u_objref.u_custom.cbExtension, "custom.cbExtension = %ld\n",
|
||||
objref.u_objref.u_custom.cbExtension);
|
||||
ok(!objref.u_objref.u_custom.size, "custom.size = %d\n",
|
||||
ok(!objref.u_objref.u_custom.size, "custom.size = %ld\n",
|
||||
objref.u_objref.u_custom.size);
|
||||
|
||||
IStream_Release(stream);
|
||||
|
@ -1560,7 +1560,7 @@ static void test_DfMarshal_custom_marshaling(void)
|
|||
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
||||
ok_ole_success(hr, CoGetMarshalSizeMax);
|
||||
CHECK_CALLED(CustomMarshal_GetMarshalSizeMax);
|
||||
ok(size == sizeof(OBJREF), "size = %d, expected %d\n", size, (int)sizeof(OBJREF));
|
||||
ok(size == sizeof(OBJREF), "size = %ld, expected %d\n", size, (int)sizeof(OBJREF));
|
||||
}
|
||||
|
||||
static void test_CoGetStandardMarshal(void)
|
||||
|
@ -1593,7 +1593,7 @@ static void test_CoGetStandardMarshal(void)
|
|||
hr = CoGetMarshalSizeMax(&read, &IID_IUnknown, &Test_Unknown,
|
||||
MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
||||
ok_ole_success(hr, CoGetMarshalSizeMax);
|
||||
ok(size == read, "IMarshal_GetMarshalSizeMax size = %d, expected %d\n", size, read);
|
||||
ok(size == read, "IMarshal_GetMarshalSizeMax size = %ld, expected %ld\n", size, read);
|
||||
|
||||
hr = IMarshal_MarshalInterface(marshal, stream, &IID_IUnknown,
|
||||
&Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
|
||||
|
@ -1604,15 +1604,15 @@ static void test_CoGetStandardMarshal(void)
|
|||
size = FIELD_OFFSET(OBJREF, u_objref.u_standard.saResAddr.aStringArray);
|
||||
hr = IStream_Read(stream, &objref, size, &read);
|
||||
ok_ole_success(hr, IStream_Read);
|
||||
ok(read == size, "read = %d, expected %d\n", read, size);
|
||||
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %x\n",
|
||||
ok(read == size, "read = %ld, expected %ld\n", read, size);
|
||||
ok(objref.signature == OBJREF_SIGNATURE, "objref.signature = %lx\n",
|
||||
objref.signature);
|
||||
ok(objref.flags == OBJREF_STANDARD, "objref.flags = %x\n", objref.flags);
|
||||
ok(objref.flags == OBJREF_STANDARD, "objref.flags = %lx\n", objref.flags);
|
||||
ok(IsEqualIID(&objref.iid, &IID_IUnknown), "objref.iid = %s\n",
|
||||
wine_dbgstr_guid(&objref.iid));
|
||||
stdobjref = &objref.u_objref.u_standard.std;
|
||||
ok(stdobjref->flags == 0, "stdobjref.flags = %d\n", stdobjref->flags);
|
||||
ok(stdobjref->cPublicRefs == 5, "stdobjref.cPublicRefs = %d\n",
|
||||
ok(stdobjref->flags == 0, "stdobjref.flags = %ld\n", stdobjref->flags);
|
||||
ok(stdobjref->cPublicRefs == 5, "stdobjref.cPublicRefs = %ld\n",
|
||||
stdobjref->cPublicRefs);
|
||||
dualstringarr = &objref.u_objref.u_standard.saResAddr;
|
||||
ok(dualstringarr->wNumEntries == 0, "dualstringarr.wNumEntries = %d\n",
|
||||
|
@ -1978,7 +1978,7 @@ static void test_tableweak_marshal_releasedata2(void)
|
|||
todo_wine
|
||||
{
|
||||
ok(hr == CO_E_OBJNOTREG,
|
||||
"CoUnmarshalInterface should have failed with CO_E_OBJNOTREG, but returned 0x%08x instead\n",
|
||||
"CoUnmarshalInterface should have failed with CO_E_OBJNOTREG, but returned 0x%08lx instead\n",
|
||||
hr);
|
||||
}
|
||||
IStream_Release(pStream);
|
||||
|
@ -2389,7 +2389,7 @@ static void test_disconnect_stub(void)
|
|||
ok_non_zero_external_conn();
|
||||
|
||||
hr = CoDisconnectObject(NULL, 0);
|
||||
ok( hr == E_INVALIDARG, "wrong status %x\n", hr );
|
||||
ok( hr == E_INVALIDARG, "wrong status %lx\n", hr );
|
||||
}
|
||||
|
||||
/* tests failure case of a same-thread marshal and unmarshal twice */
|
||||
|
@ -2422,7 +2422,7 @@ static void test_normal_marshal_and_unmarshal_twice(void)
|
|||
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
|
||||
hr = CoUnmarshalInterface(pStream, &IID_IClassFactory, (void **)&pProxy2);
|
||||
ok(hr == CO_E_OBJNOTCONNECTED,
|
||||
"CoUnmarshalInterface should have failed with error CO_E_OBJNOTCONNECTED for double unmarshal, instead of 0x%08x\n", hr);
|
||||
"CoUnmarshalInterface should have failed with error CO_E_OBJNOTCONNECTED for double unmarshal, instead of 0x%08lx\n", hr);
|
||||
|
||||
IStream_Release(pStream);
|
||||
|
||||
|
@ -2451,14 +2451,14 @@ static void test_hresult_marshaling(void)
|
|||
hr = IStream_Read(pStream, &hr_marshaled, sizeof(HRESULT), NULL);
|
||||
ok_ole_success(hr, IStream_Read);
|
||||
|
||||
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08x instead\n", hr_marshaled);
|
||||
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08lx instead\n", hr_marshaled);
|
||||
|
||||
hr_marshaled = 0;
|
||||
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
|
||||
hr = CoUnmarshalHresult(pStream, &hr_marshaled);
|
||||
ok_ole_success(hr, CoUnmarshalHresult);
|
||||
|
||||
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08x instead\n", hr_marshaled);
|
||||
ok(hr_marshaled == E_DEADBEEF, "Didn't marshal HRESULT as expected: got value 0x%08lx instead\n", hr_marshaled);
|
||||
|
||||
IStream_Release(pStream);
|
||||
}
|
||||
|
@ -2472,15 +2472,15 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
|
|||
IUnknown * proxy = NULL;
|
||||
|
||||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
|
||||
todo_wine ok(hr == CO_E_NOTINITIALIZED, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == CO_E_NOTINITIALIZED, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = IClassFactory_QueryInterface(cf, &IID_IMultiQI, (LPVOID *)&proxy);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IUnknown_Release(proxy);
|
||||
|
||||
hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
|
||||
if (SUCCEEDED(hr))
|
||||
IUnknown_Release(proxy);
|
||||
|
||||
|
@ -2489,11 +2489,11 @@ static DWORD CALLBACK bad_thread_proc(LPVOID p)
|
|||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
|
||||
if (proxy) IUnknown_Release(proxy);
|
||||
ok(hr == RPC_E_WRONG_THREAD,
|
||||
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08x\n",
|
||||
"COM should have failed with RPC_E_WRONG_THREAD on using proxy from wrong apartment, but instead returned 0x%08lx\n",
|
||||
hr);
|
||||
|
||||
hr = IClassFactory_QueryInterface(cf, &IID_IStream, (LPVOID *)&proxy);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == RPC_E_WRONG_THREAD, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* now be really bad and release the proxy from the wrong apartment */
|
||||
IClassFactory_Release(cf);
|
||||
|
@ -2653,7 +2653,7 @@ static void test_message_filter(void)
|
|||
ok_more_than_one_lock();
|
||||
|
||||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (LPVOID*)&proxy);
|
||||
ok(hr == RPC_E_CALL_REJECTED, "Call should have returned RPC_E_CALL_REJECTED, but return 0x%08x instead\n", hr);
|
||||
ok(hr == RPC_E_CALL_REJECTED, "Call should have returned RPC_E_CALL_REJECTED, but return 0x%08lx instead\n", hr);
|
||||
if (proxy) IUnknown_Release(proxy);
|
||||
proxy = NULL;
|
||||
|
||||
|
@ -2690,7 +2690,7 @@ static void test_bad_marshal_stream(void)
|
|||
|
||||
/* try to read beyond end of stream */
|
||||
hr = CoReleaseMarshalData(pStream);
|
||||
ok(hr == STG_E_READFAULT, "Should have failed with STG_E_READFAULT, but returned 0x%08x instead\n", hr);
|
||||
ok(hr == STG_E_READFAULT, "Should have failed with STG_E_READFAULT, but returned 0x%08lx instead\n", hr);
|
||||
|
||||
/* now release for real */
|
||||
IStream_Seek(pStream, ullZero, STREAM_SEEK_SET, NULL);
|
||||
|
@ -2821,16 +2821,16 @@ static void test_proxybuffer(REFIID riid)
|
|||
/* release our reference to the outer unknown object - the PS factory
|
||||
* buffer will have AddRef's it in the CreateProxy call */
|
||||
refs = IUnknown_Release(&pUnkOuter->IUnknown_iface);
|
||||
ok(refs == 1, "Ref count of outer unknown should have been 1 instead of %d\n", refs);
|
||||
ok(refs == 1, "Ref count of outer unknown should have been 1 instead of %ld\n", refs);
|
||||
|
||||
/* Not checking return, unreliable on native. Maybe it leaks references? */
|
||||
IPSFactoryBuffer_Release(psfb);
|
||||
|
||||
refs = IUnknown_Release((IUnknown *)lpvtbl);
|
||||
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
|
||||
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
|
||||
|
||||
refs = IRpcProxyBuffer_Release(proxy);
|
||||
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
|
||||
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
|
||||
}
|
||||
|
||||
static void test_stubbuffer(REFIID riid)
|
||||
|
@ -2862,7 +2862,7 @@ static void test_stubbuffer(REFIID riid)
|
|||
ok_no_locks();
|
||||
|
||||
refs = IRpcStubBuffer_Release(stub);
|
||||
ok(refs == 0, "Ref-count leak of %d on IRpcProxyBuffer\n", refs);
|
||||
ok(refs == 0, "Ref-count leak of %ld on IRpcProxyBuffer\n", refs);
|
||||
}
|
||||
|
||||
static HWND hwnd_app;
|
||||
|
@ -2925,7 +2925,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
|
|||
/* note the use of the magic IID_IWineTest value to tell remote thread
|
||||
* to try to send a message back to us */
|
||||
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IWineTest, (void **)&object);
|
||||
ok(hr == S_FALSE, "expected S_FALSE, got %d\n", hr);
|
||||
ok(hr == S_FALSE, "expected S_FALSE, got %ld\n", hr);
|
||||
|
||||
IClassFactory_Release(proxy);
|
||||
|
||||
|
@ -2965,7 +2965,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
|
|||
* WM_QUIT message doesn't stop the call from succeeding */
|
||||
PostMessageA(hwnd, WM_QUIT, 0, 0);
|
||||
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&object);
|
||||
ok(hr == S_FALSE, "IClassFactory_CreateInstance returned 0x%08x, expected S_FALSE\n", hr);
|
||||
ok(hr == S_FALSE, "IClassFactory_CreateInstance returned 0x%08lx, expected S_FALSE\n", hr);
|
||||
|
||||
IClassFactory_Release(proxy);
|
||||
|
||||
|
@ -2997,7 +2997,7 @@ static LRESULT CALLBACK window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM l
|
|||
* messages should fail */
|
||||
hr = IClassFactory_CreateInstance(proxy, NULL, &IID_IUnknown, (void **)&object);
|
||||
ok(hr == RPC_E_CANTCALLOUT_ININPUTSYNCCALL,
|
||||
"COM call during processing of sent message should return RPC_E_CANTCALLOUT_ININPUTSYNCCALL instead of 0x%08x\n", hr);
|
||||
"COM call during processing of sent message should return RPC_E_CANTCALLOUT_ININPUTSYNCCALL instead of 0x%08lx\n", hr);
|
||||
|
||||
IClassFactory_Release(proxy);
|
||||
|
||||
|
@ -3153,15 +3153,15 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void *
|
|||
if (mshctx == MSHCTX_INPROC)
|
||||
{
|
||||
DWORD expected_size = round_global_size(3*sizeof(DWORD) + sizeof(GUID));
|
||||
ok(size == expected_size, "expected size %u, got %u\n", expected_size, size);
|
||||
ok(size == expected_size, "expected size %lu, got %lu\n", expected_size, size);
|
||||
|
||||
ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%x, but got 0x%x for mshctx\n", mshlflags, *(DWORD *)marshal_data);
|
||||
ok(*(DWORD *)marshal_data == mshlflags, "expected 0x%lx, but got 0x%lx 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 *);
|
||||
if (sizeof(void*) == 4 && size >= 3*sizeof(DWORD))
|
||||
{
|
||||
ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%x\n", *(DWORD *)marshal_data);
|
||||
ok(*(DWORD *)marshal_data == 0, "expected 0x0, but got 0x%lx\n", *(DWORD *)marshal_data);
|
||||
marshal_data += sizeof(DWORD);
|
||||
}
|
||||
if (size >= 3*sizeof(DWORD) + sizeof(GUID) && winetest_debug > 1)
|
||||
|
@ -3171,7 +3171,7 @@ static void test_freethreadedmarshaldata(IStream *pStream, MSHCTX mshctx, void *
|
|||
}
|
||||
else
|
||||
{
|
||||
ok(size > sizeof(DWORD), "size should have been > sizeof(DWORD), not %d\n", size);
|
||||
ok(size > sizeof(DWORD), "size should have been > sizeof(DWORD), not %ld\n", size);
|
||||
ok(*(DWORD *)marshal_data == 0x574f454d /* MEOW */,
|
||||
"marshal data should be filled by standard marshal and start with MEOW signature\n");
|
||||
}
|
||||
|
@ -3206,8 +3206,8 @@ static void test_freethreadedmarshaler(void)
|
|||
expected_size = sizeof(DWORD) /* flags */ + sizeof(UINT64) + sizeof(GUID);
|
||||
hr = IMarshal_GetMarshalSizeMax(pFTMarshal, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_INPROC,
|
||||
NULL, MSHLFLAGS_NORMAL, &size);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(size == expected_size, "Unexpected marshal size %u, expected %u.\n", size, expected_size);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
ok(size == expected_size, "Unexpected marshal size %lu, expected %lu.\n", size, expected_size);
|
||||
|
||||
hr = IMarshal_GetUnmarshalClass(pFTMarshal, &IID_IClassFactory,
|
||||
&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL, &clsid);
|
||||
|
@ -3357,10 +3357,10 @@ static HRESULT reg_unreg_wine_test_class(BOOL Register)
|
|||
skip("Not authorized to modify the Classes key\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %d\n", error);
|
||||
ok(error == ERROR_SUCCESS, "RegCreateKeyEx failed with error %ld\n", error);
|
||||
if (error != ERROR_SUCCESS) hr = E_FAIL;
|
||||
error = RegSetValueExA(hkey, NULL, 0, REG_SZ, (const unsigned char *)"\"ole32.dll\"", strlen("\"ole32.dll\"") + 1);
|
||||
ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %d\n", error);
|
||||
ok(error == ERROR_SUCCESS, "RegSetValueEx failed with error %ld\n", error);
|
||||
if (error != ERROR_SUCCESS) hr = E_FAIL;
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
@ -3388,7 +3388,7 @@ static void test_inproc_handler(void)
|
|||
if (SUCCEEDED(hr))
|
||||
{
|
||||
hr = IUnknown_QueryInterface(pObject, &IID_IWineTest, (void **)&pObject2);
|
||||
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface on handler for invalid interface returned 0x%08x instead of E_NOINTERFACE\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface on handler for invalid interface returned 0x%08lx instead of E_NOINTERFACE\n", hr);
|
||||
|
||||
/* it's a handler as it supports IOleObject */
|
||||
hr = IUnknown_QueryInterface(pObject, &IID_IOleObject, (void **)&pObject2);
|
||||
|
@ -3481,7 +3481,7 @@ static void test_handler_marshaling(void)
|
|||
ok_more_than_one_lock();
|
||||
|
||||
hr = IUnknown_QueryInterface(pProxy, &IID_IWineTest, (void **)&pObject);
|
||||
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface with unknown IID should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "IUnknown_QueryInterface with unknown IID should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
|
||||
|
||||
/* it's a handler as it supports IOleObject */
|
||||
hr = IUnknown_QueryInterface(pProxy, &IID_IOleObject, (void **)&pObject);
|
||||
|
@ -3541,7 +3541,7 @@ static void test_client_security(void)
|
|||
if (SUCCEEDED(IClassFactory_QueryInterface(pProxy, &IID_IRemUnknown, (void **)&pProxy2)))
|
||||
{
|
||||
hr = IUnknown_QueryInterface(pProxy2, &IID_IUnknown, (void **)&pUnknown2);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
ok(pUnknown1 == pUnknown2, "both proxy's IUnknowns should be the same - %p, %p\n", pUnknown1, pUnknown2);
|
||||
IUnknown_Release(pUnknown2);
|
||||
|
@ -3559,7 +3559,7 @@ static void test_client_security(void)
|
|||
todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket (all NULLs)");
|
||||
|
||||
hr = IClientSecurity_QueryBlanket(pCliSec, (IUnknown *)pMarshal, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_QueryBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_QueryBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IClientSecurity_QueryBlanket(pCliSec, (IUnknown *)pProxy, &dwAuthnSvc, &dwAuthzSvc, &pServerPrincName, &dwAuthnLevel, &dwImpLevel, &pAuthInfo, &dwCapabilities);
|
||||
todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket");
|
||||
|
@ -3568,13 +3568,13 @@ static void test_client_security(void)
|
|||
todo_wine ok_ole_success(hr, "IClientSecurity_SetBlanket");
|
||||
|
||||
hr = IClassFactory_CreateInstance(pProxy, NULL, &IID_IWineTest, &pv);
|
||||
ok(hr == E_NOINTERFACE, "COM call should have succeeded instead of returning 0x%08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "COM call should have succeeded instead of returning 0x%08lx\n", hr);
|
||||
|
||||
hr = IClientSecurity_SetBlanket(pCliSec, (IUnknown *)pMarshal, dwAuthnSvc, dwAuthzSvc, pServerPrincName, dwAuthnLevel, dwImpLevel, pAuthInfo, dwCapabilities);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_SetBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08x\n", hr);
|
||||
todo_wine ok(hr == E_NOINTERFACE, "IClientSecurity_SetBlanket with local interface should have returned E_NOINTERFACE instead of 0x%08lx\n", hr);
|
||||
|
||||
hr = IClientSecurity_SetBlanket(pCliSec, (IUnknown *)pProxy, 0xdeadbeef, dwAuthzSvc, pServerPrincName, dwAuthnLevel, dwImpLevel, pAuthInfo, dwCapabilities);
|
||||
todo_wine ok(hr == E_INVALIDARG, "IClientSecurity_SetBlanke with invalid dwAuthnSvc should have returned E_INVALIDARG instead of 0x%08x\n", hr);
|
||||
todo_wine ok(hr == E_INVALIDARG, "IClientSecurity_SetBlanke with invalid dwAuthnSvc should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
|
||||
|
||||
CoTaskMemFree(pServerPrincName);
|
||||
|
||||
|
@ -3647,12 +3647,12 @@ static HRESULT WINAPI local_server_GetClassID(IPersist *iface, CLSID *clsid)
|
|||
|
||||
/* Test calling CoDisconnectObject within a COM call */
|
||||
hr = CoDisconnectObject((IUnknown *)iface, 0);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
/* Initialize and uninitialize the apartment to show that we
|
||||
* remain in the autojoined mta */
|
||||
hr = CoInitializeEx( NULL, COINIT_MULTITHREADED );
|
||||
ok( hr == S_FALSE, "got %08x\n", hr );
|
||||
ok( hr == S_FALSE, "got %08lx\n", hr );
|
||||
CoUninitialize();
|
||||
|
||||
return S_OK;
|
||||
|
@ -3798,7 +3798,7 @@ static HANDLE create_target_process(const char *arg)
|
|||
winetest_get_mainargs( &argv );
|
||||
sprintf(cmdline, "\"%s\" %s %s", argv[0], argv[1], arg);
|
||||
ret = CreateProcessA(argv[0], cmdline, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
|
||||
ok(ret, "CreateProcess failed with error: %u\n", GetLastError());
|
||||
ok(ret, "CreateProcess failed with error: %lu\n", GetLastError());
|
||||
if (pi.hThread) CloseHandle(pi.hThread);
|
||||
return pi.hProcess;
|
||||
}
|
||||
|
@ -3830,7 +3830,7 @@ static void test_local_server(void)
|
|||
* class in the registry */
|
||||
hr = CoGetClassObject(&CLSID_WineOOPTest, CLSCTX_INPROC_SERVER,
|
||||
NULL, &IID_IClassFactory, (LPVOID*)&cf);
|
||||
todo_wine ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == REGDB_E_CLASSNOTREG, "Got hr %#lx.\n", hr);
|
||||
|
||||
/* Resume the object suspended above ... */
|
||||
hr = CoResumeClassObjects();
|
||||
|
@ -3865,7 +3865,7 @@ static void test_local_server(void)
|
|||
/* try to connect again after SCM has suspended registered class objects */
|
||||
hr = CoGetClassObject(&CLSID_WineOOPTest, CLSCTX_INPROC_SERVER | CLSCTX_LOCAL_SERVER, NULL,
|
||||
&IID_IClassFactory, (LPVOID*)&cf);
|
||||
todo_wine ok(hr == CO_E_SERVER_STOPPING || hr == REGDB_E_CLASSNOTREG /* Win10 1709+ */, "Got hr %#x.\n", hr);
|
||||
todo_wine ok(hr == CO_E_SERVER_STOPPING || hr == REGDB_E_CLASSNOTREG /* Win10 1709+ */, "Got hr %#lx.\n", hr);
|
||||
|
||||
hr = CoRevokeClassObject(cookie);
|
||||
ok_ole_success(hr, CoRevokeClassObject);
|
||||
|
@ -3873,7 +3873,7 @@ static void test_local_server(void)
|
|||
CloseHandle(heventShutdown);
|
||||
|
||||
process = create_target_process("-Embedding");
|
||||
ok(process != NULL, "couldn't start local server process, error was %d\n", GetLastError());
|
||||
ok(process != NULL, "couldn't start local server process, error was %ld\n", GetLastError());
|
||||
|
||||
ready_event = CreateEventA(NULL, FALSE, FALSE, "Wine COM Test Ready Event");
|
||||
ok( !WaitForSingleObject(ready_event, 10000), "wait timed out\n" );
|
||||
|
@ -3922,7 +3922,7 @@ static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
|
|||
IClassFactory *cf;
|
||||
|
||||
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
|
||||
ok(hr == CO_E_NOTINITIALIZED, "Got hr %#x.\n", hr);
|
||||
ok(hr == CO_E_NOTINITIALIZED, "Got hr %#lx.\n", hr);
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
|
@ -3952,10 +3952,10 @@ static void test_globalinterfacetable(void)
|
|||
cLocks = 0;
|
||||
|
||||
hr = pDllGetClassObject(&CLSID_StdGlobalInterfaceTable, &IID_IClassFactory, (void**)&cf);
|
||||
ok(hr == S_OK, "got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "got 0x%08lx\n", hr);
|
||||
|
||||
hr = IClassFactory_QueryInterface(cf, &IID_IGlobalInterfaceTable, (void**)&object);
|
||||
ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "got 0x%08lx\n", hr);
|
||||
|
||||
IClassFactory_Release(cf);
|
||||
|
||||
|
@ -3963,14 +3963,14 @@ static void test_globalinterfacetable(void)
|
|||
ok_ole_success(hr, CoCreateInstance);
|
||||
|
||||
ref = IGlobalInterfaceTable_AddRef(git);
|
||||
ok(ref == 1, "ref=%d\n", ref);
|
||||
ok(ref == 1, "ref=%ld\n", ref);
|
||||
ref = IGlobalInterfaceTable_AddRef(git);
|
||||
ok(ref == 1, "ref=%d\n", ref);
|
||||
ok(ref == 1, "ref=%ld\n", ref);
|
||||
|
||||
ref = IGlobalInterfaceTable_Release(git);
|
||||
ok(ref == 1, "ref=%d\n", ref);
|
||||
ok(ref == 1, "ref=%ld\n", ref);
|
||||
ref = IGlobalInterfaceTable_Release(git);
|
||||
ok(ref == 1, "ref=%d\n", ref);
|
||||
ok(ref == 1, "ref=%ld\n", ref);
|
||||
|
||||
hr = IGlobalInterfaceTable_RegisterInterfaceInGlobal(git, (IUnknown *)&Test_ClassFactory, &IID_IClassFactory, &cookie);
|
||||
ok_ole_success(hr, IGlobalInterfaceTable_RegisterInterfaceInGlobal);
|
||||
|
@ -4012,7 +4012,7 @@ static void test_globalinterfacetable(void)
|
|||
IGlobalInterfaceTable_Release(git);
|
||||
|
||||
hr = CoGetClassObject(&CLSID_StdGlobalInterfaceTable, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void **)&cf);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IClassFactory_Release(cf);
|
||||
}
|
||||
|
||||
|
@ -4027,77 +4027,77 @@ static void test_manualresetevent(void)
|
|||
HRESULT hr;
|
||||
|
||||
hr = pDllGetClassObject(&CLSID_ManualResetEvent, &IID_IClassFactory, (void **)&factory);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IClassFactory_Release(factory);
|
||||
|
||||
hr = CoGetClassObject(&CLSID_ManualResetEvent, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void **)&factory);
|
||||
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
|
||||
IClassFactory_Release(factory);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&punk);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
ok(!!punk, "Got NULL.\n");
|
||||
IUnknown_Release(punk);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_ISynchronize, (void**)&psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
ok(!!psync1, "Got NULL.\n");
|
||||
|
||||
hr = ISynchronize_Wait(psync1, 0, 5);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
|
||||
|
||||
hr = ISynchronize_Reset(psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Signal(psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Wait(psync1, 0, 5);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Wait(psync1, 0, 5);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Reset(psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Wait(psync1, 0, 5);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
|
||||
|
||||
hr = CoCreateInstance(&CLSID_ManualResetEvent, NULL, CLSCTX_INPROC_SERVER, &IID_ISynchronize, (void**)&psync2);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
ok(!!psync2, "Got NULL.\n");
|
||||
ok(psync1 != psync2, "psync1 == psync2.\n");
|
||||
|
||||
hr = ISynchronize_QueryInterface(psync2, &IID_ISynchronizeHandle, (void**)&sync_handle);
|
||||
ok(hr == S_OK, "QueryInterface(IID_ISynchronizeHandle) failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface(IID_ISynchronizeHandle) failed: %08lx\n", hr);
|
||||
|
||||
handle = NULL;
|
||||
hr = ISynchronizeHandle_GetHandle(sync_handle, &handle);
|
||||
ok(hr == S_OK, "GetHandle failed: %08x\n", hr);
|
||||
ok(hr == S_OK, "GetHandle failed: %08lx\n", hr);
|
||||
ok(handle != NULL && handle != INVALID_HANDLE_VALUE, "handle = %p\n", handle);
|
||||
|
||||
ISynchronizeHandle_Release(sync_handle);
|
||||
|
||||
hr = ISynchronize_Wait(psync2, 0, 5);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
|
||||
|
||||
hr = ISynchronize_Reset(psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Reset(psync2);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Signal(psync1);
|
||||
ok(hr == S_OK, "Got 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Got 0x%08lx\n", hr);
|
||||
hr = ISynchronize_Wait(psync2, 0, 5);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08x\n", hr);
|
||||
ok(hr == RPC_S_CALLPENDING, "Got 0x%08lx\n", hr);
|
||||
|
||||
ref = ISynchronize_AddRef(psync1);
|
||||
ok(ref == 2, "Got ref: %d\n", ref);
|
||||
ok(ref == 2, "Got ref: %ld\n", ref);
|
||||
ref = ISynchronize_AddRef(psync1);
|
||||
ok(ref == 3, "Got ref: %d\n", ref);
|
||||
ok(ref == 3, "Got ref: %ld\n", ref);
|
||||
ref = ISynchronize_Release(psync1);
|
||||
ok(ref == 2, "Got nonzero ref: %d\n", ref);
|
||||
ok(ref == 2, "Got nonzero ref: %ld\n", ref);
|
||||
ref = ISynchronize_Release(psync2);
|
||||
ok(!ref, "Got nonzero ref: %d\n", ref);
|
||||
ok(!ref, "Got nonzero ref: %ld\n", ref);
|
||||
ref = ISynchronize_Release(psync1);
|
||||
ok(ref == 1, "Got nonzero ref: %d\n", ref);
|
||||
ok(ref == 1, "Got nonzero ref: %ld\n", ref);
|
||||
ref = ISynchronize_Release(psync1);
|
||||
ok(!ref, "Got nonzero ref: %d\n", ref);
|
||||
ok(!ref, "Got nonzero ref: %ld\n", ref);
|
||||
}
|
||||
|
||||
static DWORD CALLBACK implicit_mta_unmarshal_proc(void *param)
|
||||
|
@ -4120,7 +4120,7 @@ static DWORD CALLBACK implicit_mta_unmarshal_proc(void *param)
|
|||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
|
||||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void **)&proxy);
|
||||
ok(hr == RPC_E_WRONG_THREAD, "got %#x\n", hr);
|
||||
ok(hr == RPC_E_WRONG_THREAD, "got %#lx\n", hr);
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
|
@ -4150,7 +4150,7 @@ static DWORD CALLBACK implicit_mta_use_proc(void *param)
|
|||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
|
||||
hr = IClassFactory_CreateInstance(cf, NULL, &IID_IUnknown, (void **)&proxy);
|
||||
ok(hr == RPC_E_WRONG_THREAD, "got %#x\n", hr);
|
||||
ok(hr == RPC_E_WRONG_THREAD, "got %#lx\n", hr);
|
||||
|
||||
CoUninitialize();
|
||||
return 0;
|
||||
|
@ -4301,8 +4301,8 @@ static void WINAPI TestChannelHook_ClientGetSize(
|
|||
|
||||
if (info->cbSize == sizeof(*info))
|
||||
{
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
|
||||
ok(!info->pObject, "pObject should be NULL\n");
|
||||
if (method == 3)
|
||||
causality = info->uCausality;
|
||||
|
@ -4328,8 +4328,8 @@ static void WINAPI TestChannelHook_ClientFillBuffer(
|
|||
|
||||
if (info->cbSize == sizeof(*info))
|
||||
{
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
|
||||
ok(!info->pObject, "pObject should be NULL\n");
|
||||
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
|
||||
}
|
||||
|
@ -4351,12 +4351,12 @@ static void WINAPI TestChannelHook_ClientNotify(
|
|||
{
|
||||
SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
|
||||
|
||||
if (winetest_debug > 1) trace("IChannelHook::ClientNotify(hr %#x)\n", hrFault);
|
||||
if (winetest_debug > 1) trace("IChannelHook::ClientNotify(hr %#lx)\n", hrFault);
|
||||
|
||||
if (info->cbSize == sizeof(*info))
|
||||
{
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
|
||||
todo_wine {
|
||||
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
|
||||
}
|
||||
|
@ -4380,13 +4380,13 @@ static void WINAPI TestChannelHook_ServerNotify(
|
|||
|
||||
if (info->cbSize == sizeof(*info))
|
||||
{
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
|
||||
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
|
||||
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
|
||||
}
|
||||
|
||||
ok(cbDataSize == 1, "cbDataSize should have been 1 instead of %d\n", cbDataSize);
|
||||
ok(cbDataSize == 1, "cbDataSize should have been 1 instead of %ld\n", cbDataSize);
|
||||
ok(*(unsigned char *)pDataBuffer == 0xcc, "pDataBuffer should have contained 0xcc instead of 0x%x\n", *(unsigned char *)pDataBuffer);
|
||||
ok(IsEqualGUID(uExtent, &EXTENTID_WineTest), "uExtent wasn't correct\n");
|
||||
}
|
||||
|
@ -4400,12 +4400,12 @@ static void WINAPI TestChannelHook_ServerGetSize(
|
|||
{
|
||||
SChannelHookCallInfo *info = (SChannelHookCallInfo *)riid;
|
||||
|
||||
if (winetest_debug > 1) trace("IChannelHook::ServerGetSize(iid %s, hr %#x)\n", debugstr_guid(riid), hrFault);
|
||||
if (winetest_debug > 1) trace("IChannelHook::ServerGetSize(iid %s, hr %#lx)\n", debugstr_guid(riid), hrFault);
|
||||
|
||||
if (info->cbSize == sizeof(*info))
|
||||
{
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%x instead of 0x%x\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %d should be %d\n", info->iMethod, method);
|
||||
ok(info->dwServerPid == GetCurrentProcessId(), "dwServerPid was 0x%lx instead of 0x%lx\n", info->dwServerPid, GetCurrentProcessId());
|
||||
ok(info->iMethod == method, "iMethod was %ld should be %d\n", info->iMethod, method);
|
||||
ok(info->pObject != NULL, "pObject shouldn't be NULL\n");
|
||||
ok(IsEqualGUID(&info->uCausality, &causality), "causality wasn't correct\n");
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -114,7 +114,7 @@ static ULONG WINAPI UnknownImpl_AddRef(IUnknown *iface)
|
|||
|
||||
InterlockedIncrement(&obj_ref);
|
||||
|
||||
trace("server: unknown_AddRef: %p, ref %u\n", iface, ref);
|
||||
trace("server: unknown_AddRef: %p, ref %lu\n", iface, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ static ULONG WINAPI UnknownImpl_Release(IUnknown *iface)
|
|||
|
||||
InterlockedDecrement(&obj_ref);
|
||||
|
||||
trace("server: unknown_Release: %p, ref %u\n", iface, ref);
|
||||
trace("server: unknown_Release: %p, ref %lu\n", iface, ref);
|
||||
if (ref == 0) HeapFree(GetProcessHeap(), 0, This);
|
||||
return ref;
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ static ULONG WINAPI ClassFactoryImpl_AddRef(IClassFactory *iface)
|
|||
|
||||
InterlockedIncrement(&class_ref);
|
||||
|
||||
trace("server: factory_AddRef: %p, ref %u\n", iface, ref);
|
||||
trace("server: factory_AddRef: %p, ref %lu\n", iface, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ static ULONG WINAPI ClassFactoryImpl_Release(IClassFactory *iface)
|
|||
|
||||
InterlockedDecrement(&class_ref);
|
||||
|
||||
trace("server: factory_Release: %p, ref %u\n", iface, ref);
|
||||
trace("server: factory_Release: %p, ref %lu\n", iface, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ static HRESULT WINAPI ClassFactoryImpl_LockServer(IClassFactory *iface, BOOL loc
|
|||
{
|
||||
ULONG ref = lock ? InterlockedIncrement(&server_locks) : InterlockedDecrement(&server_locks);
|
||||
|
||||
trace("server: factory_LockServer: %p,%d, ref %u\n", iface, lock, ref);
|
||||
trace("server: factory_LockServer: %p,%d, ref %lu\n", iface, lock, ref);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -238,7 +238,7 @@ static void ole_server(void)
|
|||
HRESULT hr;
|
||||
DWORD key;
|
||||
|
||||
trace("server: starting %u\n", GetCurrentProcessId());
|
||||
trace("server: starting %lu\n", GetCurrentProcessId());
|
||||
|
||||
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
if (hr == S_OK)
|
||||
|
@ -251,9 +251,9 @@ static void ole_server(void)
|
|||
HANDLE done_event, init_done_event;
|
||||
|
||||
done_event = OpenEventA(SYNCHRONIZE, FALSE, "ole_server_done_event");
|
||||
ok(done_event != 0, "server: OpenEvent error %d\n", GetLastError());
|
||||
ok(done_event != 0, "server: OpenEvent error %ld\n", GetLastError());
|
||||
init_done_event = OpenEventA(EVENT_MODIFY_STATE, FALSE, "ole_server_init_done_event");
|
||||
ok(init_done_event != 0, "server: OpenEvent error %d\n", GetLastError());
|
||||
ok(init_done_event != 0, "server: OpenEvent error %ld\n", GetLastError());
|
||||
|
||||
SetEvent(init_done_event);
|
||||
|
||||
|
@ -261,9 +261,9 @@ static void ole_server(void)
|
|||
WaitForSingleObject(done_event, INFINITE);
|
||||
|
||||
/* 1 remainining class ref is supposed to be cleared by CoRevokeClassObject */
|
||||
ok(class_ref == 1, "expected 1 class refs, got %d\n", class_ref);
|
||||
ok(!obj_ref, "expected 0 object refs, got %d\n", obj_ref);
|
||||
ok(!server_locks, "expected 0 server locks, got %d\n", server_locks);
|
||||
ok(class_ref == 1, "expected 1 class refs, got %ld\n", class_ref);
|
||||
ok(!obj_ref, "expected 0 object refs, got %ld\n", obj_ref);
|
||||
ok(!server_locks, "expected 0 server locks, got %ld\n", server_locks);
|
||||
|
||||
CloseHandle(done_event);
|
||||
CloseHandle(init_done_event);
|
||||
|
@ -280,7 +280,7 @@ static void ole_server(void)
|
|||
trace("server: ret CoUninitialize\n");
|
||||
}
|
||||
|
||||
trace("server: exiting %u\n", GetCurrentProcessId());
|
||||
trace("server: exiting %lu\n", GetCurrentProcessId());
|
||||
}
|
||||
|
||||
/******************************* OLE client *******************************/
|
||||
|
@ -303,12 +303,12 @@ static BOOL register_server(const char *server, BOOL inproc_handler)
|
|||
if (ret == ERROR_SUCCESS)
|
||||
{
|
||||
ret = RegSetValueA(root, "LocalServer32", REG_SZ, server_path, strlen(server_path));
|
||||
ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
|
||||
ok(ret == ERROR_SUCCESS, "RegSetValue error %lu\n", ret);
|
||||
|
||||
if (inproc_handler)
|
||||
{
|
||||
ret = RegSetValueA(root, "InprocHandler32", REG_SZ, "ole32.dll", 9);
|
||||
ok(ret == ERROR_SUCCESS, "RegSetValue error %u\n", ret);
|
||||
ok(ret == ERROR_SUCCESS, "RegSetValue error %lu\n", ret);
|
||||
}
|
||||
|
||||
RegCloseKey(root);
|
||||
|
@ -332,11 +332,11 @@ static void unregister_server(void)
|
|||
if (ret == ERROR_SUCCESS)
|
||||
{
|
||||
ret = RegDeleteKeyA(root, "InprocHandler32");
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
|
||||
ret = RegDeleteKeyA(root, "LocalServer32");
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
|
||||
ret = RegDeleteKeyA(root, "");
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %u\n", ret);
|
||||
ok(ret == ERROR_SUCCESS, "RegDeleteKey error %lu\n", ret);
|
||||
RegCloseKey(root);
|
||||
}
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ static HANDLE start_server(const char *argv0)
|
|||
|
||||
sprintf(cmdline, "\"%s\" ole_server -server", argv0);
|
||||
ret = CreateProcessA(argv0, cmdline, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi);
|
||||
ok(ret, "CreateProcess(%s) error %d\n", cmdline, GetLastError());
|
||||
ok(ret, "CreateProcess(%s) error %ld\n", cmdline, GetLastError());
|
||||
if (!ret) return 0;
|
||||
|
||||
CloseHandle(pi.hThread);
|
||||
|
@ -390,9 +390,9 @@ START_TEST(ole_server)
|
|||
argc = winetest_get_mainargs(&argv);
|
||||
|
||||
done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_done_event");
|
||||
ok(done_event != 0, "CreateEvent error %d\n", GetLastError());
|
||||
ok(done_event != 0, "CreateEvent error %ld\n", GetLastError());
|
||||
init_done_event = CreateEventA(NULL, TRUE, FALSE, "ole_server_init_done_event");
|
||||
ok(init_done_event != 0, "CreateEvent error %d\n", GetLastError());
|
||||
ok(init_done_event != 0, "CreateEvent error %ld\n", GetLastError());
|
||||
|
||||
if (argc > 2)
|
||||
{
|
||||
|
@ -428,10 +428,10 @@ START_TEST(ole_server)
|
|||
WaitForSingleObject(init_done_event, 5000);
|
||||
|
||||
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
|
||||
ok(hr == S_OK, "OleInitialize error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleInitialize error %#lx\n", hr);
|
||||
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
|
||||
ok(hr == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %#x\n", hr);
|
||||
ok(hr == REGDB_E_CLASSNOTREG, "expected REGDB_E_CLASSNOTREG, got %#lx\n", hr);
|
||||
|
||||
if (!register_server(argv[0], TRUE))
|
||||
{
|
||||
|
@ -443,13 +443,13 @@ START_TEST(ole_server)
|
|||
trace("call CoCreateInstance(&IID_NULL)\n");
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_NULL, (void **)&unknown);
|
||||
trace("ret CoCreateInstance(&IID_NULL)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
/* in-process handler supports IID_IUnknown starting from Vista */
|
||||
trace("call CoCreateInstance(&IID_IUnknown)\n");
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_HANDLER, &IID_IUnknown, (void **)&unknown);
|
||||
trace("ret CoCreateInstance(&IID_IUnknown)\n");
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* XP,win2000 and earlier */, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
|
||||
ok(hr == S_OK || broken(hr == REGDB_E_CLASSNOTREG) /* XP,win2000 and earlier */, "CoCreateInstance(IID_IUnknown) error %#lx\n", hr);
|
||||
if (hr != S_OK)
|
||||
{
|
||||
win_skip("In-process handler doesn't support IID_IUnknown on this platform\n");
|
||||
|
@ -459,92 +459,92 @@ START_TEST(ole_server)
|
|||
trace("call CoCreateInstance(&IID_IOleObject)\n");
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IOleObject, (void **)&oleobj);
|
||||
trace("ret CoCreateInstance(&IID_IOleObject)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
|
||||
hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
|
||||
trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
|
||||
ok(hr == S_OK, "QueryInterface(&IID_IRunnableObject) error %#x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface(&IID_IRunnableObject) error %#lx\n", hr);
|
||||
|
||||
ret = IRunnableObject_IsRunning(runobj);
|
||||
ok(!ret, "expected 0, got %d\n", ret);
|
||||
ok(!ret, "expected 0, got %ld\n", ret);
|
||||
|
||||
trace("call OleRun\n");
|
||||
hr = OleRun(unknown);
|
||||
trace("ret OleRun\n");
|
||||
todo_wine
|
||||
ok(hr == S_OK, "OleRun error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleRun error %#lx\n", hr);
|
||||
|
||||
ret = IRunnableObject_IsRunning(runobj);
|
||||
todo_wine
|
||||
ok(ret == 1, "expected 1, got %d\n", ret);
|
||||
ok(ret == 1, "expected 1, got %ld\n", ret);
|
||||
|
||||
trace("call IRunnableObject_Release\n");
|
||||
ret = IRunnableObject_Release(runobj);
|
||||
trace("ret IRunnableObject_Release\n");
|
||||
ok(ret == 1, "expected ref 1, got %u\n", ret);
|
||||
ok(ret == 1, "expected ref 1, got %lu\n", ret);
|
||||
|
||||
trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
|
||||
hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
|
||||
trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
|
||||
ok(hr == S_OK, "QueryInterface(&IID_IOleObject) error %#x\n", hr);
|
||||
ok(hr == S_OK, "QueryInterface(&IID_IOleObject) error %#lx\n", hr);
|
||||
|
||||
trace("call IOleObject_Release\n");
|
||||
ret = IOleObject_Release(oleobj);
|
||||
trace("ret IOleObject_Release\n");
|
||||
ok(ret == 1, "expected ref 1, got %u\n", ret);
|
||||
ok(ret == 1, "expected ref 1, got %lu\n", ret);
|
||||
|
||||
trace("call IUnknown_Release\n");
|
||||
ret = IUnknown_Release(unknown);
|
||||
trace("ret IUnknown_Release\n");
|
||||
ok(!ret, "expected ref 0, got %u\n", ret);
|
||||
ok(!ret, "expected ref 0, got %lu\n", ret);
|
||||
|
||||
test_local_server:
|
||||
/* local server supports IID_IUnknown */
|
||||
trace("call CoCreateInstance(&IID_IUnknown)\n");
|
||||
hr = CoCreateInstance(&clsid, NULL, CLSCTX_LOCAL_SERVER, &IID_IUnknown, (void **)&unknown);
|
||||
trace("ret CoCreateInstance(&IID_IUnknown)\n");
|
||||
ok(hr == S_OK, "CoCreateInstance(IID_IUnknown) error %#x\n", hr);
|
||||
ok(hr == S_OK, "CoCreateInstance(IID_IUnknown) error %#lx\n", hr);
|
||||
|
||||
trace("call IUnknown_QueryInterface(&IID_IRunnableObject)\n");
|
||||
hr = IUnknown_QueryInterface(unknown, &IID_IRunnableObject, (void **)&runobj);
|
||||
trace("ret IUnknown_QueryInterface(&IID_IRunnableObject)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
trace("call OleRun\n");
|
||||
hr = OleRun(unknown);
|
||||
trace("ret OleRun\n");
|
||||
ok(hr == S_OK, "OleRun error %#x\n", hr);
|
||||
ok(hr == S_OK, "OleRun error %#lx\n", hr);
|
||||
|
||||
trace("call IUnknown_QueryInterface(&IID_IOleObject)\n");
|
||||
hr = IUnknown_QueryInterface(unknown, &IID_IOleObject, (void **)&oleobj);
|
||||
trace("ret IUnknown_QueryInterface(&IID_IOleObject)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
trace("call IUnknown_Release\n");
|
||||
ret = IUnknown_Release(unknown);
|
||||
trace("ret IUnknown_Release\n");
|
||||
ok(!ret, "expected ref 0, got %u\n", ret);
|
||||
ok(!ret, "expected ref 0, got %lu\n", ret);
|
||||
|
||||
trace("call CoGetClassObject(&IID_IClassFactory)\n");
|
||||
hr = CoGetClassObject(&clsid, CLSCTX_LOCAL_SERVER, NULL, &IID_IClassFactory, (void **)&factory);
|
||||
trace("ret CoGetClassObject(&IID_IClassFactory)\n");
|
||||
ok(hr == S_OK, "CoGetClassObject error %#x\n", hr);
|
||||
ok(hr == S_OK, "CoGetClassObject error %#lx\n", hr);
|
||||
|
||||
trace("call IClassFactory_CreateInstance(&IID_NULL)\n");
|
||||
hr = IClassFactory_CreateInstance(factory, NULL, &IID_NULL, (void **)&oleobj);
|
||||
trace("ret IClassFactory_CreateInstance(&IID_NULL)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
trace("call IClassFactory_CreateInstance(&IID_IOleObject)\n");
|
||||
hr = IClassFactory_CreateInstance(factory, NULL, &IID_IOleObject, (void **)&oleobj);
|
||||
trace("ret IClassFactory_CreateInstance(&IID_IOleObject)\n");
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#x\n", hr);
|
||||
ok(hr == E_NOINTERFACE, "expected E_NOINTERFACE, got %#lx\n", hr);
|
||||
|
||||
trace("call IClassFactory_Release\n");
|
||||
ret = IClassFactory_Release(factory);
|
||||
trace("ret IClassFactory_Release\n");
|
||||
ok(!ret, "expected ref 0, got %u\n", ret);
|
||||
ok(!ret, "expected ref 0, got %lu\n", ret);
|
||||
|
||||
trace("signalling termination\n");
|
||||
SetEvent(done_event);
|
||||
|
@ -557,7 +557,7 @@ test_local_server:
|
|||
|
||||
if (info->child_failures)
|
||||
{
|
||||
trace("%d failures in child process\n", info->child_failures);
|
||||
trace("%ld failures in child process\n", info->child_failures);
|
||||
winetest_add_failures(info->child_failures);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -162,17 +162,17 @@ static void expect(HRESULT hr, VARTYPE vt, BOOL copy, int line)
|
|||
if(flags == PROP_INV)
|
||||
{
|
||||
if (copy && (vt & VT_VECTOR))
|
||||
ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line);
|
||||
ok(hr == DISP_E_BADVARTYPE || hr == STG_E_INVALIDPARAMETER, "%s (%s): got %08lx (line %d)\n", wine_vtypes[idx], modifier, hr, line);
|
||||
else
|
||||
ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08x (line %d)\n", wine_vtypes[idx], modifier, hr, line);
|
||||
ok(hr == (copy ? DISP_E_BADVARTYPE : STG_E_INVALIDPARAMETER), "%s (%s): got %08lx (line %d)\n", wine_vtypes[idx], modifier, hr, line);
|
||||
}
|
||||
else if(flags == PROP_V0)
|
||||
ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr);
|
||||
ok(hr == S_OK, "%s (%s): got %08lx\n", wine_vtypes[idx], modifier, hr);
|
||||
else todo_wine_if(flags & PROP_TODO)
|
||||
{
|
||||
if(hr != S_OK)
|
||||
win_skip("%s (%s): unsupported\n", wine_vtypes[idx], modifier);
|
||||
else ok(hr == S_OK, "%s (%s): got %08x\n", wine_vtypes[idx], modifier, hr);
|
||||
else ok(hr == S_OK, "%s (%s): got %08lx\n", wine_vtypes[idx], modifier, hr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,9 +186,9 @@ static void test_validtypes(void)
|
|||
|
||||
memset(&propvar, 0x55, sizeof(propvar));
|
||||
hr = PropVariantClear(&propvar);
|
||||
ok(hr == STG_E_INVALIDPARAMETER, "expected STG_E_INVALIDPARAMETER, got %08x\n", hr);
|
||||
ok(hr == STG_E_INVALIDPARAMETER, "expected STG_E_INVALIDPARAMETER, got %08lx\n", hr);
|
||||
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#x/%#x\n",
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "expected 0, got %#lx/%#lx\n",
|
||||
U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(valid_types); i++)
|
||||
|
@ -212,7 +212,7 @@ static void test_validtypes(void)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
|
||||
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#x/%#x, got %#x/%#x\n",
|
||||
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#lx/%#lx, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart,
|
||||
U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ static void test_validtypes(void)
|
|||
hr = PropVariantClear(&propvar);
|
||||
expect(hr, vt, FALSE, __LINE__);
|
||||
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
|
||||
|
||||
memset(&propvar, 0x55, sizeof(propvar));
|
||||
|
@ -236,7 +236,7 @@ static void test_validtypes(void)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
|
||||
ok(U(copy).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
|
||||
ok(U(copy).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
|
||||
i, U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
|
||||
}
|
||||
else
|
||||
|
@ -247,7 +247,7 @@ static void test_validtypes(void)
|
|||
hr = PropVariantClear(&propvar);
|
||||
expect(hr, vt, FALSE, __LINE__);
|
||||
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
|
||||
|
||||
memset(&propvar, 0x55, sizeof(propvar));
|
||||
|
@ -260,7 +260,7 @@ static void test_validtypes(void)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
|
||||
ok(!U(copy).caub.cElems, "%u: expected 0, got %d\n", i, U(copy).caub.cElems);
|
||||
ok(!U(copy).caub.cElems, "%u: expected 0, got %ld\n", i, U(copy).caub.cElems);
|
||||
ok(!U(copy).caub.pElems, "%u: expected NULL, got %p\n", i, U(copy).caub.pElems);
|
||||
}
|
||||
else
|
||||
|
@ -271,7 +271,7 @@ static void test_validtypes(void)
|
|||
hr = PropVariantClear(&propvar);
|
||||
expect(hr, vt, FALSE, __LINE__);
|
||||
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
|
||||
|
||||
memset(&propvar, 0x55, sizeof(propvar));
|
||||
|
@ -283,7 +283,7 @@ static void test_validtypes(void)
|
|||
if (hr == S_OK)
|
||||
{
|
||||
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
|
||||
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#x/%#x, got %#x/%#x\n",
|
||||
ok(U(copy).uhVal.QuadPart == U(propvar).uhVal.QuadPart, "%u: expected %#lx/%#lx, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart,
|
||||
U(copy).uhVal.u.LowPart, U(copy).uhVal.u.HighPart);
|
||||
}
|
||||
|
@ -295,7 +295,7 @@ static void test_validtypes(void)
|
|||
hr = PropVariantClear(&propvar);
|
||||
expect(hr, vt, FALSE, __LINE__);
|
||||
ok(propvar.vt == 0, "expected 0, got %d\n", propvar.vt);
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#x/%#x\n",
|
||||
ok(U(propvar).uhVal.QuadPart == 0, "%u: expected 0, got %#lx/%#lx\n",
|
||||
i, U(propvar).uhVal.u.LowPart, U(propvar).uhVal.u.HighPart);
|
||||
}
|
||||
}
|
||||
|
@ -371,14 +371,14 @@ static void test_copy(void)
|
|||
propvarSrc.vt = VT_BSTR;
|
||||
U(propvarSrc).bstrVal = SysAllocStringLen(L"Test Str\0ing", 12);
|
||||
hr = PropVariantCopy(&propvarDst, &propvarSrc);
|
||||
ok(hr == S_OK, "Failed to copy propvar, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to copy propvar, hr %#lx.\n", hr);
|
||||
ok(SysStringLen(U(propvarDst).bstrVal) == 8, "Unexpected copy length.\n");
|
||||
ok(SysStringLen(U(propvarSrc).bstrVal) == 12, "Unexpected source length.\n");
|
||||
ok(!lstrcmpW(U(propvarSrc).bstrVal, U(propvarDst).bstrVal), "BSTR not copied properly\n");
|
||||
hr = PropVariantClear(&propvarSrc);
|
||||
ok(hr == S_OK, "Failed to clear propvar, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to clear propvar, hr %#lx.\n", hr);
|
||||
hr = PropVariantClear(&propvarDst);
|
||||
ok(hr == S_OK, "Failed to clear propvar, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to clear propvar, hr %#lx.\n", hr);
|
||||
|
||||
propvarSrc.vt = VT_LPWSTR;
|
||||
U(propvarSrc).pwszVal = wszTestString;
|
||||
|
@ -401,12 +401,12 @@ static void test_copy(void)
|
|||
propvarSrc.vt = VT_UNKNOWN;
|
||||
U(propvarSrc).punkVal = &unk_obj.IUnknown_iface;
|
||||
hr = PropVariantCopy(&propvarDst, &propvarSrc);
|
||||
ok(hr == S_OK, "PropVariantCopy(...VT_UNKNOWN...) failed: 0x%08x.\n", hr);
|
||||
ok(hr == S_OK, "PropVariantCopy(...VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
|
||||
ok(U(propvarDst).punkVal == &unk_obj.IUnknown_iface, "Got wrong IUnknown pointer\n");
|
||||
ok(unk_obj.ref == 2, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(unk_obj.ref == 2, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
hr = PropVariantClear(&propvarDst);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_UNKNOWN...) failed: 0x%08x.\n", hr);
|
||||
ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
|
||||
ok(unk_obj.ref == 1, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
memset(&propvarSrc, 0, sizeof(propvarSrc));
|
||||
|
||||
sabound.lLbound = 0;
|
||||
|
@ -416,19 +416,19 @@ static void test_copy(void)
|
|||
SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface);
|
||||
saindex = 1;
|
||||
SafeArrayPutElement(sa, &saindex, &unk_obj.IUnknown_iface);
|
||||
ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(unk_obj.ref == 3, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
|
||||
propvarSrc.vt = VT_ARRAY | VT_UNKNOWN;
|
||||
U(propvarSrc).parray = sa;
|
||||
hr = PropVariantCopy(&propvarDst, &propvarSrc);
|
||||
ok(hr == S_OK, "PropVariantCopy(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
|
||||
ok(unk_obj.ref == 5, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(hr == S_OK, "PropVariantCopy(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
|
||||
ok(unk_obj.ref == 5, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
hr = PropVariantClear(&propvarDst);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
|
||||
ok(unk_obj.ref == 3, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
|
||||
ok(unk_obj.ref == 3, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
hr = PropVariantClear(&propvarSrc);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08x.\n", hr);
|
||||
ok(unk_obj.ref == 1, "got wrong refcount: %d.\n", unk_obj.ref);
|
||||
ok(hr == S_OK, "PropVariantClear(...VT_ARRAY|VT_UNKNOWN...) failed: 0x%08lx.\n", hr);
|
||||
ok(unk_obj.ref == 1, "got wrong refcount: %ld.\n", unk_obj.ref);
|
||||
memset(&propvarSrc, 0, sizeof(propvarSrc));
|
||||
}
|
||||
|
||||
|
@ -570,7 +570,7 @@ static void test_propertytovariant(void)
|
|||
|
||||
ok(ret == 0, "StgConvertPropertyToVariant returned %i\n", ret);
|
||||
ok(propvar.vt == VT_I4, "unexpected vt %x\n", propvar.vt);
|
||||
ok(U(propvar).lVal == 0xfeabcdef, "unexpected lVal %x\n", U(propvar).lVal);
|
||||
ok(U(propvar).lVal == 0xfeabcdef, "unexpected lVal %lx\n", U(propvar).lVal);
|
||||
|
||||
ret = pStgConvertPropertyToVariant((SERIALIZEDPROPERTYVALUE*)serialized_bstr_wc,
|
||||
CP_WINUNICODE, &propvar, &allocator);
|
||||
|
@ -622,7 +622,7 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == NULL, "got nonnull propvalue\n");
|
||||
todo_wine ok(len == 8, "unexpected length %d\n", len);
|
||||
todo_wine ok(len == 8, "unexpected length %ld\n", len);
|
||||
|
||||
if (len == 0xdeadbeef)
|
||||
{
|
||||
|
@ -635,7 +635,7 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
|
||||
ok(len == 8, "unexpected length %d\n", len);
|
||||
ok(len == 8, "unexpected length %ld\n", len);
|
||||
ok(!memcmp(propvalue, serialized_i4, 8), "got wrong data\n");
|
||||
|
||||
propvar.vt = VT_EMPTY;
|
||||
|
@ -645,9 +645,9 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
|
||||
ok(len == 4 || broken(len == 0) /* before Vista */, "unexpected length %d\n", len);
|
||||
ok(len == 4 || broken(len == 0) /* before Vista */, "unexpected length %ld\n", len);
|
||||
if (len) ok(!memcmp(propvalue, serialized_empty, 4), "got wrong data\n");
|
||||
else ok(propvalue->dwType == 0xdeadbeef, "unexpected type %d\n", propvalue->dwType);
|
||||
else ok(propvalue->dwType == 0xdeadbeef, "unexpected type %ld\n", propvalue->dwType);
|
||||
|
||||
propvar.vt = VT_NULL;
|
||||
len = 20;
|
||||
|
@ -655,7 +655,7 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
|
||||
ok(len == 4, "unexpected length %d\n", len);
|
||||
ok(len == 4, "unexpected length %ld\n", len);
|
||||
ok(!memcmp(propvalue, serialized_null, 4), "got wrong data\n");
|
||||
|
||||
test_string_bstr = SysAllocString(test_string);
|
||||
|
@ -667,7 +667,7 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
|
||||
ok(len == 20, "unexpected length %d\n", len);
|
||||
ok(len == 20, "unexpected length %ld\n", len);
|
||||
ok(!memcmp(propvalue, serialized_bstr_wc, 20), "got wrong data\n");
|
||||
|
||||
len = 20;
|
||||
|
@ -675,7 +675,7 @@ static void test_varianttoproperty(void)
|
|||
0, FALSE, 0);
|
||||
|
||||
ok(propvalue == own_propvalue, "unexpected propvalue %p\n", propvalue);
|
||||
ok(len == 16, "unexpected length %d\n", len);
|
||||
ok(len == 16, "unexpected length %ld\n", len);
|
||||
ok(!memcmp(propvalue, serialized_bstr_mb, 16), "got wrong data\n");
|
||||
|
||||
SysFreeString(test_string_bstr);
|
||||
|
|
|
@ -59,34 +59,34 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
|
||||
hr = StgCreateDocfile(filename,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
|
||||
|
||||
if(propSetStorage)
|
||||
{
|
||||
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(*propSetStorage,
|
||||
&FMTID_SummaryInformation, NULL, PROPSETFLAG_ANSI,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
|
||||
&propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IStorage_CreateStream(storage, szSummaryInfo,
|
||||
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream);
|
||||
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgCreatePropStg((IUnknown *)stream, &FMTID_SummaryInformation,
|
||||
NULL, PROPSETFLAG_ANSI, 0, &propertyStorage);
|
||||
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08lx\n", hr);
|
||||
}
|
||||
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 0, NULL, NULL, 0);
|
||||
ok(hr == S_OK, "WriteMultiple with 0 args failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple with 0 args failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, NULL, NULL, 0);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
|
||||
/* test setting one that I can't set */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
|
@ -95,7 +95,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
U(var).lVal = 1;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == STG_E_INVALIDPARAMETER,
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
|
||||
|
||||
/* test setting one by name with an invalid propidNameFirst */
|
||||
spec.ulKind = PRSPEC_LPWSTR;
|
||||
|
@ -103,7 +103,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
|
||||
PID_DICTIONARY);
|
||||
ok(hr == STG_E_INVALIDPARAMETER,
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
|
||||
|
||||
/* test setting behavior (case-sensitive) */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
|
@ -111,14 +111,14 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
U(var).lVal = 1;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == STG_E_INVALIDPARAMETER,
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
|
||||
|
||||
/* set one by value.. */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
U(var).lVal = 1;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
/* set one by name */
|
||||
spec.ulKind = PRSPEC_LPWSTR;
|
||||
|
@ -126,7 +126,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
U(var).lVal = 2;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
|
||||
PID_FIRST_USABLE);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
/* set a string value */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
|
@ -134,7 +134,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
var.vt = VT_LPSTR;
|
||||
U(var).pszVal = val;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
/* set a clipboard value */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
|
@ -145,35 +145,35 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
clipdata.pClipData = clipcontent;
|
||||
U(var).pclipdata = &clipdata;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
|
||||
/* check reading */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 0, NULL, NULL);
|
||||
ok(hr == S_FALSE, "ReadMultiple with 0 args failed: 0x%08x\n", hr);
|
||||
ok(hr == S_FALSE, "ReadMultiple with 0 args failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, NULL, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
/* read by propid */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I4 && U(var).lVal == 1,
|
||||
"Didn't get expected type or value for property (got type %d, value %d)\n",
|
||||
"Didn't get expected type or value for property (got type %d, value %ld)\n",
|
||||
var.vt, U(var).lVal);
|
||||
/* read by name */
|
||||
spec.ulKind = PRSPEC_LPWSTR;
|
||||
U(spec).lpwstr = propName;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I4 && U(var).lVal == 2,
|
||||
"Didn't get expected type or value for property (got type %d, value %d)\n",
|
||||
"Didn't get expected type or value for property (got type %d, value %ld)\n",
|
||||
var.vt, U(var).lVal);
|
||||
/* read string value */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PIDSI_AUTHOR;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_LPSTR && !lstrcmpA(U(var).pszVal, val),
|
||||
"Didn't get expected type or value for property (got type %d, value %s)\n",
|
||||
var.vt, U(var).pszVal);
|
||||
|
@ -183,7 +183,7 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PIDSI_THUMBNAIL;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_CF, "variant type wrong\n");
|
||||
ok(U(var).pclipdata->ulClipFmt == CF_ENHMETAFILE,
|
||||
"clipboard type wrong\n");
|
||||
|
@ -195,54 +195,54 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
|
||||
/* check deleting */
|
||||
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 0, NULL);
|
||||
ok(hr == S_OK, "DeleteMultiple with 0 args failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "DeleteMultiple with 0 args failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
/* contrary to what the docs say, you can't delete the dictionary */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_DICTIONARY;
|
||||
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
|
||||
ok(hr == STG_E_INVALIDPARAMETER,
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
|
||||
/* now delete the first value.. */
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
hr = IPropertyStorage_DeleteMultiple(propertyStorage, 1, &spec);
|
||||
ok(hr == S_OK, "DeleteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "DeleteMultiple failed: 0x%08lx\n", hr);
|
||||
/* and check that it's no longer readable */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08x\n", hr);
|
||||
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
|
||||
|
||||
/* check reverting */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_Revert(propertyStorage);
|
||||
ok(hr == S_OK, "Revert failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Revert failed: 0x%08lx\n", hr);
|
||||
/* now check that it's still not there */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08x\n", hr);
|
||||
ok(hr == S_FALSE, "Expected S_FALSE, got 0x%08lx\n", hr);
|
||||
/* set an integer value again */
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
var.vt = VT_I4;
|
||||
U(var).lVal = 1;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* commit it */
|
||||
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
|
||||
/* set it to a string value */
|
||||
var.vt = VT_LPSTR;
|
||||
U(var).pszVal = val;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* revert it */
|
||||
hr = IPropertyStorage_Revert(propertyStorage);
|
||||
ok(hr == S_OK, "Revert failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Revert failed: 0x%08lx\n", hr);
|
||||
/* Oddly enough, there's no guarantee that a successful revert actually
|
||||
* implies the value wasn't saved. Maybe transactional mode needs to be
|
||||
* used for that?
|
||||
|
@ -256,40 +256,40 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
/* now open it again */
|
||||
hr = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
|
||||
NULL, 0, &storage);
|
||||
ok(hr == S_OK, "StgOpenStorage failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgOpenStorage failed: 0x%08lx\n", hr);
|
||||
|
||||
if(propSetStorage)
|
||||
{
|
||||
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Open(*propSetStorage, &FMTID_SummaryInformation,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08lx\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IStorage_OpenStream(storage, szSummaryInfo,
|
||||
0, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
|
||||
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgOpenPropStg((IUnknown *)stream, &FMTID_SummaryInformation,
|
||||
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
|
||||
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08lx\n", hr);
|
||||
}
|
||||
|
||||
/* check properties again */
|
||||
spec.ulKind = PRSPEC_LPWSTR;
|
||||
U(spec).lpwstr = propName;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I4 && U(var).lVal == 2,
|
||||
"Didn't get expected type or value for property (got type %d, value %d)\n",
|
||||
"Didn't get expected type or value for property (got type %d, value %ld)\n",
|
||||
var.vt, U(var).lVal);
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PIDSI_AUTHOR;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_LPSTR && !lstrcmpA(U(var).pszVal, val),
|
||||
"Didn't get expected type or value for property (got type %d, value %s)\n",
|
||||
var.vt, U(var).pszVal);
|
||||
|
@ -305,28 +305,28 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
/* Test creating a property set storage with a random GUID */
|
||||
hr = StgCreateDocfile(filename,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
|
||||
|
||||
if(propSetStorage)
|
||||
{
|
||||
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(*propSetStorage,
|
||||
&anyOldGuid, NULL, PROPSETFLAG_ANSI,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
|
||||
&propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IStorage_CreateStream(storage, szSummaryInfo,
|
||||
STGM_CREATE | STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, 0, &stream);
|
||||
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IStorage_CreateStream failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgCreatePropStg((IUnknown *)stream, &anyOldGuid, NULL,
|
||||
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
|
||||
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropStg failed: 0x%08lx\n", hr);
|
||||
}
|
||||
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
|
@ -334,10 +334,10 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
var.vt = VT_I4;
|
||||
U(var).lVal = 1;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertyStorage_Commit(propertyStorage, STGC_DEFAULT);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "Commit failed: 0x%08lx\n", hr);
|
||||
|
||||
IPropertyStorage_Release(propertyStorage);
|
||||
if(propSetStorage) IPropertySetStorage_Release(*propSetStorage);
|
||||
|
@ -347,35 +347,35 @@ static void testPropsHelper(IPropertySetStorage **propSetStorage)
|
|||
/* now open it again */
|
||||
hr = StgOpenStorage(filename, NULL, STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
|
||||
NULL, 0, &storage);
|
||||
ok(hr == S_OK, "StgOpenStorage failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgOpenStorage failed: 0x%08lx\n", hr);
|
||||
|
||||
if(propSetStorage)
|
||||
{
|
||||
hr = StgCreatePropSetStg(storage, 0, propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Open(*propSetStorage, &anyOldGuid,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Open failed: 0x%08lx\n", hr);
|
||||
}
|
||||
else
|
||||
{
|
||||
hr = IStorage_OpenStream(storage, szSummaryInfo,
|
||||
0, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, 0, &stream);
|
||||
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IStorage_OpenStream failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgOpenPropStg((IUnknown *)stream, &anyOldGuid,
|
||||
PROPSETFLAG_DEFAULT, 0, &propertyStorage);
|
||||
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgOpenPropStg failed: 0x%08lx\n", hr);
|
||||
}
|
||||
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_FIRST_USABLE;
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
|
||||
ok(var.vt == VT_I4 && U(var).lVal == 1,
|
||||
"Didn't get expected type or value for property (got type %d, value %d)\n",
|
||||
"Didn't get expected type or value for property (got type %d, value %ld)\n",
|
||||
var.vt, U(var).lVal);
|
||||
|
||||
IPropertyStorage_Release(propertyStorage);
|
||||
|
@ -413,42 +413,42 @@ static void testCodepage(void)
|
|||
|
||||
hr = StgCreateDocfile(fileName,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgCreatePropSetStg(storage, 0, &propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(propSetStorage,
|
||||
&FMTID_SummaryInformation, NULL, PROPSETFLAG_DEFAULT,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
|
||||
&propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
|
||||
|
||||
PropVariantInit(&var);
|
||||
spec.ulKind = PRSPEC_PROPID;
|
||||
U(spec).propid = PID_CODEPAGE;
|
||||
/* check code page before it's been explicitly set */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I2 && U(var).iVal == 1200,
|
||||
"Didn't get expected type or value for property\n");
|
||||
/* Set the code page to ascii */
|
||||
var.vt = VT_I2;
|
||||
U(var).iVal = 1252;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* check code page */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I2 && U(var).iVal == 1252,
|
||||
"Didn't get expected type or value for property\n");
|
||||
/* Set code page to Unicode */
|
||||
U(var).iVal = 1200;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* check code page */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I2 && U(var).iVal == 1200,
|
||||
"Didn't get expected type or value for property\n");
|
||||
/* Set a string value */
|
||||
|
@ -457,9 +457,9 @@ static void testCodepage(void)
|
|||
var.vt = VT_LPSTR;
|
||||
U(var).pszVal = aval;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, "hi"),
|
||||
"Didn't get expected type or value for property\n");
|
||||
PropVariantClear(&var);
|
||||
|
@ -471,9 +471,9 @@ static void testCodepage(void)
|
|||
var.vt = VT_LPSTR;
|
||||
U(var).pszVal = (LPSTR)wval;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, "h"),
|
||||
"Didn't get expected type or value for property\n");
|
||||
PropVariantClear(&var);
|
||||
|
@ -485,7 +485,7 @@ static void testCodepage(void)
|
|||
U(var).iVal = 1200;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == STG_E_INVALIDPARAMETER,
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08x\n", hr);
|
||||
"Expected STG_E_INVALIDPARAMETER, got 0x%08lx\n", hr);
|
||||
|
||||
IPropertyStorage_Release(propertyStorage);
|
||||
IPropertySetStorage_Release(propSetStorage);
|
||||
|
@ -496,28 +496,28 @@ static void testCodepage(void)
|
|||
/* same tests, but with PROPSETFLAG_ANSI */
|
||||
hr = StgCreateDocfile(fileName,
|
||||
STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreateDocfile failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = StgCreatePropSetStg(storage, 0, &propSetStorage);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "StgCreatePropSetStg failed: 0x%08lx\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(propSetStorage,
|
||||
&FMTID_SummaryInformation, NULL, PROPSETFLAG_ANSI,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE,
|
||||
&propertyStorage);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "IPropertySetStorage_Create failed: 0x%08lx\n", hr);
|
||||
|
||||
/* check code page before it's been explicitly set */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I2, "Didn't get expected type for property (%u)\n", var.vt);
|
||||
/* Set code page to Unicode */
|
||||
U(var).iVal = 1200;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* check code page */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_I2 && U(var).iVal == 1200,
|
||||
"Didn't get expected type or value for property\n");
|
||||
/* This test is commented out for documentation. It fails under Wine,
|
||||
|
@ -529,7 +529,7 @@ static void testCodepage(void)
|
|||
/* Set code page to 950 (Traditional Chinese) */
|
||||
U(var).iVal = 950;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* Try writing an invalid string: lead byte 0x81 is unused in Traditional
|
||||
* Chinese.
|
||||
*/
|
||||
|
@ -538,10 +538,10 @@ static void testCodepage(void)
|
|||
var.vt = VT_LPSTR;
|
||||
U(var).pszVal = (LPSTR)strVal;
|
||||
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "WriteMultiple failed: 0x%08lx\n", hr);
|
||||
/* Check returned string */
|
||||
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "ReadMultiple failed: 0x%08lx\n", hr);
|
||||
ok(var.vt == VT_LPSTR && !strcmp(U(var).pszVal, (LPCSTR)strVal),
|
||||
"Didn't get expected type or value for property\n");
|
||||
}
|
||||
|
@ -568,57 +568,57 @@ static void testFmtId(void)
|
|||
HRESULT hr;
|
||||
|
||||
hr = FmtIdToPropStgName(NULL, name);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
hr = FmtIdToPropStgName(&FMTID_SummaryInformation, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
hr = FmtIdToPropStgName(&FMTID_SummaryInformation, name);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(name, szSummaryInfo, (lstrlenW(szSummaryInfo) + 1) *
|
||||
sizeof(WCHAR)), "Got wrong name for FMTID_SummaryInformation\n");
|
||||
hr = FmtIdToPropStgName(&FMTID_DocSummaryInformation, name);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(name, szDocSummaryInfo, (lstrlenW(szDocSummaryInfo) + 1) *
|
||||
sizeof(WCHAR)), "Got wrong name for FMTID_DocSummaryInformation\n");
|
||||
hr = FmtIdToPropStgName(&FMTID_UserDefinedProperties, name);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(name, szDocSummaryInfo, (lstrlenW(szDocSummaryInfo) + 1) *
|
||||
sizeof(WCHAR)), "Got wrong name for FMTID_DocSummaryInformation\n");
|
||||
hr = FmtIdToPropStgName(&IID_IPropertySetStorage, name);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "FmtIdToPropStgName failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(name, szIID_IPropSetStg, (lstrlenW(szIID_IPropSetStg) + 1) *
|
||||
sizeof(WCHAR)), "Got wrong name for IID_IPropertySetStorage\n");
|
||||
|
||||
/* test args first */
|
||||
hr = PropStgNameToFmtId(NULL, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
hr = PropStgNameToFmtId(NULL, &fmtid);
|
||||
ok(hr == STG_E_INVALIDNAME, "Expected STG_E_INVALIDNAME, got 0x%08x\n",
|
||||
ok(hr == STG_E_INVALIDNAME, "Expected STG_E_INVALIDNAME, got 0x%08lx\n",
|
||||
hr);
|
||||
hr = PropStgNameToFmtId(szDocSummaryInfo, NULL);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08x\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Expected E_INVALIDARG, got 0x%08lx\n", hr);
|
||||
/* test the known format IDs */
|
||||
hr = PropStgNameToFmtId(szSummaryInfo, &fmtid);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(&fmtid, &FMTID_SummaryInformation, sizeof(fmtid)),
|
||||
"Got unexpected FMTID, expected FMTID_SummaryInformation\n");
|
||||
hr = PropStgNameToFmtId(szDocSummaryInfo, &fmtid);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(&fmtid, &FMTID_DocSummaryInformation, sizeof(fmtid)),
|
||||
"Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
|
||||
/* test another GUID */
|
||||
hr = PropStgNameToFmtId(szIID_IPropSetStg, &fmtid);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(&fmtid, &IID_IPropertySetStorage, sizeof(fmtid)),
|
||||
"Got unexpected FMTID, expected IID_IPropertySetStorage\n");
|
||||
/* now check case matching */
|
||||
CharUpperW(szDocSummaryInfo + 1);
|
||||
hr = PropStgNameToFmtId(szDocSummaryInfo, &fmtid);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(&fmtid, &FMTID_DocSummaryInformation, sizeof(fmtid)),
|
||||
"Got unexpected FMTID, expected FMTID_DocSummaryInformation\n");
|
||||
CharUpperW(szIID_IPropSetStg + 1);
|
||||
hr = PropStgNameToFmtId(szIID_IPropSetStg, &fmtid);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08x\n", hr);
|
||||
ok(hr == S_OK, "PropStgNameToFmtId failed: 0x%08lx\n", hr);
|
||||
ok(!memcmp(&fmtid, &IID_IPropertySetStorage, sizeof(fmtid)),
|
||||
"Got unexpected FMTID, expected IID_IPropertySetStorage\n");
|
||||
}
|
||||
|
@ -639,91 +639,91 @@ static void test_propertyset_storage_enum(void)
|
|||
ok(ret, "Failed to get temporary file name.\n");
|
||||
|
||||
hr = StgCreateDocfile(filename, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, &storage);
|
||||
ok(hr == S_OK, "Failed to crate storage, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to crate storage, hr %#lx.\n", hr);
|
||||
|
||||
hr = StgCreatePropSetStg(storage, 0, &ps_storage);
|
||||
ok(hr == S_OK, "Failed to create property set storage, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to create property set storage, hr %#lx.\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(ps_storage, &FMTID_SummaryInformation, &IID_IUnknown, PROPSETFLAG_ANSI,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE, &prop_storage);
|
||||
ok(hr == S_OK, "Failed to create property storage, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to create property storage, hr %#lx.\n", hr);
|
||||
|
||||
hr = IPropertyStorage_Stat(prop_storage, &psstg);
|
||||
ok(hr == S_OK, "Failed to get prop storage stats, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to get prop storage stats, hr %#lx.\n", hr);
|
||||
todo_wine
|
||||
ok(IsEqualCLSID(&psstg.clsid, &IID_IUnknown), "Unexpected storage clsid %s.\n", wine_dbgstr_guid(&psstg.clsid));
|
||||
|
||||
hr = IPropertySetStorage_Enum(ps_storage, NULL);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Enum(ps_storage, &ps_enum);
|
||||
ok(hr == S_OK, "Failed to get enum object, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to get enum object, hr %#lx.\n", hr);
|
||||
|
||||
memset(&psstg, 0, sizeof(psstg));
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
ok(fetched == 1, "Unexpected fetched count.\n");
|
||||
ok(IsEqualCLSID(&psstg.fmtid, &FMTID_SummaryInformation), "Unexpected fmtid %s.\n",
|
||||
wine_dbgstr_guid(&psstg.fmtid));
|
||||
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#x / %#x.\n",
|
||||
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#lx / %#lx.\n",
|
||||
psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
|
||||
|
||||
memset(&ftime, 0, sizeof(ftime));
|
||||
ftime.dwLowDateTime = 1;
|
||||
hr = IPropertyStorage_SetTimes(prop_storage, NULL, NULL, &ftime);
|
||||
todo_wine
|
||||
ok(hr == S_OK, "Failed to set storage times, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to set storage times, hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
|
||||
memset(&psstg, 0, sizeof(psstg));
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
ok(fetched == 1, "Unexpected fetched count.\n");
|
||||
ok(IsEqualCLSID(&psstg.fmtid, &FMTID_SummaryInformation), "Unexpected fmtid %s.\n",
|
||||
wine_dbgstr_guid(&psstg.fmtid));
|
||||
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#x / %#x.\n",
|
||||
ok(psstg.mtime.dwHighDateTime == 0 && psstg.mtime.dwLowDateTime == 0, "Unexpected mtime %#lx / %#lx.\n",
|
||||
psstg.mtime.dwHighDateTime, psstg.mtime.dwLowDateTime);
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_FALSE, "Unexpected hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Unexpected hr %#lx.\n", hr);
|
||||
|
||||
hr = IPropertySetStorage_Create(ps_storage, &FMTID_SummaryInformation, &IID_IUnknown, PROPSETFLAG_ANSI,
|
||||
STGM_READWRITE | STGM_CREATE | STGM_SHARE_EXCLUSIVE, &prop_storage2);
|
||||
ok(hr == S_OK, "Failed to create property storage, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to create property storage, hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
ok(fetched == 1, "Unexpected fetched count.\n");
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
|
||||
/* Skipping. */
|
||||
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 2);
|
||||
todo_wine
|
||||
ok(hr == S_FALSE, "Failed to skip, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to skip, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
todo_wine
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 1);
|
||||
ok(hr == S_OK, "Failed to skip, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to skip, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
todo_wine
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
|
||||
hr = IEnumSTATPROPSETSTG_Reset(ps_enum);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#x.\n", hr);
|
||||
ok(hr == S_OK, "Failed to reset enumerator, hr %#lx.\n", hr);
|
||||
todo_wine {
|
||||
hr = IEnumSTATPROPSETSTG_Skip(ps_enum, 0);
|
||||
ok(hr == S_FALSE, "Failed to skip, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to skip, hr %#lx.\n", hr);
|
||||
hr = IEnumSTATPROPSETSTG_Next(ps_enum, 1, &psstg, &fetched);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#x.\n", hr);
|
||||
ok(hr == S_FALSE, "Failed to get enum item, hr %#lx.\n", hr);
|
||||
}
|
||||
IEnumSTATPROPSETSTG_Release(ps_enum);
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -110,11 +110,11 @@ static DWORD CALLBACK host_object_proc(LPVOID p)
|
|||
IMessageFilter * prev_filter = NULL;
|
||||
hr = CoRegisterMessageFilter(data->filter, &prev_filter);
|
||||
if (prev_filter) IMessageFilter_Release(prev_filter);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
}
|
||||
|
||||
hr = CoMarshalInterface(data->stream, &data->iid, data->object, MSHCTX_INPROC, NULL, data->marshal_flags);
|
||||
ok(hr == S_OK, "got %08x\n", hr);
|
||||
ok(hr == S_OK, "got %08lx\n", hr);
|
||||
|
||||
/* force the message queue to be created before signaling parent thread */
|
||||
PeekMessageA(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
|
||||
|
@ -164,7 +164,7 @@ static DWORD start_host_object2(IStream *stream, REFIID riid, IUnknown *object,
|
|||
static void end_host_object(DWORD tid, HANDLE thread)
|
||||
{
|
||||
BOOL ret = PostThreadMessageA(tid, WM_QUIT, 0, 0);
|
||||
ok(ret, "PostThreadMessage failed with error %d\n", GetLastError());
|
||||
ok(ret, "PostThreadMessage failed with error %ld\n", GetLastError());
|
||||
/* be careful of races - don't return until hosting thread has terminated */
|
||||
ok( !WaitForSingleObject(thread, 10000), "wait timed out\n" );
|
||||
CloseHandle(thread);
|
||||
|
@ -196,19 +196,19 @@ static void test_marshal_CLIPFORMAT(void)
|
|||
size = CLIPFORMAT_UserSize(&umcb.Flags, 1, &cf);
|
||||
ok(size == 12 + sizeof(cf_marshaled) ||
|
||||
broken(size == 16 + sizeof(cf_marshaled)), /* win64 adds 4 extra (unused) bytes */
|
||||
"CLIPFORMAT: Wrong size %d\n", size);
|
||||
"CLIPFORMAT: Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
memset( buffer, 0xcc, size );
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = CLIPFORMAT_UserMarshal(&umcb.Flags, buffer + 1, &cf);
|
||||
ok(buffer_end == buffer + 12 + sizeof(cf_marshaled), "got %p buffer %p\n", buffer_end, buffer);
|
||||
ok(*(LONG *)(buffer + 4) == WDT_REMOTE_CALL, "CLIPFORMAT: Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(LONG *)(buffer + 0));
|
||||
ok(*(DWORD *)(buffer + 8) == cf, "CLIPFORMAT: Marshaled value should be 0x%04x instead of 0x%04x\n", cf, *(DWORD *)(buffer + 4));
|
||||
ok(*(LONG *)(buffer + 4) == WDT_REMOTE_CALL, "CLIPFORMAT: Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(LONG *)(buffer + 0));
|
||||
ok(*(DWORD *)(buffer + 8) == cf, "CLIPFORMAT: Marshaled value should be 0x%04x instead of 0x%04lx\n", cf, *(DWORD *)(buffer + 4));
|
||||
ok(!memcmp(buffer + 12, cf_marshaled, min( sizeof(cf_marshaled), size-12 )), "Marshaled data differs\n");
|
||||
if (size > sizeof(cf_marshaled) + 12) /* make sure the extra bytes are not used */
|
||||
for (i = sizeof(cf_marshaled) + 12; i < size; i++)
|
||||
ok( buffer[i] == 0xcc, "buffer offset %u has been set to %x\n", i, buffer[i] );
|
||||
ok( buffer[i] == 0xcc, "buffer offset %lu has been set to %x\n", i, buffer[i] );
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = CLIPFORMAT_UserUnmarshal(&umcb.Flags, buffer + 1, &cf2);
|
||||
|
@ -233,15 +233,15 @@ static void test_marshal_HWND(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = HWND_UserSize(&umcb.Flags, 1, &hwnd);
|
||||
ok(size == 4 + sizeof(*wirehwnd), "Wrong size %d\n", size);
|
||||
ok(size == 4 + sizeof(*wirehwnd), "Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HWND_UserMarshal(&umcb.Flags, buffer + 1, &hwnd);
|
||||
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehwnd = (wireHWND)(buffer + 4);
|
||||
ok(wirehwnd->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehwnd->fContext);
|
||||
ok(wirehwnd->u.hInproc == (LONG_PTR)hwnd, "Marshaled value should be %p instead of %x\n", hwnd, wirehwnd->u.hRemote);
|
||||
ok(wirehwnd->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehwnd->fContext);
|
||||
ok(wirehwnd->u.hInproc == (LONG_PTR)hwnd, "Marshaled value should be %p instead of %lx\n", hwnd, wirehwnd->u.hRemote);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HWND_UserUnmarshal(&umcb.Flags, buffer + 1, &hwnd2);
|
||||
|
@ -270,12 +270,12 @@ static void test_marshal_HGLOBAL(void)
|
|||
size = HGLOBAL_UserSize(&umcb.Flags, 0, &hglobal);
|
||||
/* native is poorly programmed and allocates 4/8 bytes more than it needs to
|
||||
* here - Wine doesn't have to emulate that */
|
||||
ok((size == 8) || broken(size == 12) || broken(size == 16), "Size should be 8, instead of %d\n", size);
|
||||
ok((size == 8) || broken(size == 12) || broken(size == 16), "Size should be 8, instead of %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
HGLOBAL_UserMarshal(&umcb.Flags, buffer, &hglobal);
|
||||
wirehglobal = buffer;
|
||||
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)wirehglobal);
|
||||
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)wirehglobal);
|
||||
wirehglobal += sizeof(ULONG);
|
||||
ok(*(ULONG *)wirehglobal == 0, "buffer+4 should be HGLOBAL\n");
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
|
@ -305,20 +305,20 @@ static void test_marshal_HGLOBAL(void)
|
|||
ok(size == expected_size ||
|
||||
broken(size == expected_size + 4) ||
|
||||
broken(size == expected_size + 8),
|
||||
"%d: got size %d\n", block_size, size);
|
||||
"%ld: got size %ld\n", block_size, size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
HGLOBAL_UserMarshal(&umcb.Flags, buffer, &hglobal);
|
||||
wirehglobal = buffer;
|
||||
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)wirehglobal);
|
||||
ok(*(ULONG *)wirehglobal == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)wirehglobal);
|
||||
wirehglobal += sizeof(ULONG);
|
||||
ok(*(ULONG *)wirehglobal == (ULONG)(ULONG_PTR)hglobal, "buffer+0x4 should be HGLOBAL\n");
|
||||
wirehglobal += sizeof(ULONG);
|
||||
ok(*(ULONG *)wirehglobal == actual_size, "%d: buffer+0x8 %08x\n", block_size, *(ULONG *)wirehglobal);
|
||||
ok(*(ULONG *)wirehglobal == actual_size, "%ld: buffer+0x8 %08lx\n", block_size, *(ULONG *)wirehglobal);
|
||||
wirehglobal += sizeof(ULONG);
|
||||
ok(*(ULONG *)wirehglobal == (ULONG)(ULONG_PTR)hglobal, "buffer+0xc should be HGLOBAL\n");
|
||||
wirehglobal += sizeof(ULONG);
|
||||
ok(*(ULONG *)wirehglobal == actual_size, "%d: buffer+0x10 %08x\n", block_size, *(ULONG *)wirehglobal);
|
||||
ok(*(ULONG *)wirehglobal == actual_size, "%ld: buffer+0x10 %08lx\n", block_size, *(ULONG *)wirehglobal);
|
||||
wirehglobal += sizeof(ULONG);
|
||||
for (i = 0; i < block_size; i++)
|
||||
ok(wirehglobal[i] == i, "buffer+0x%x should be %d\n", 0x10 + i, i);
|
||||
|
@ -357,21 +357,21 @@ static void test_marshal_HENHMETAFILE(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = HENHMETAFILE_UserSize(&umcb.Flags, 1, &hemf);
|
||||
ok(size > 24, "size should be at least 24 bytes, not %d\n", size);
|
||||
ok(size > 24, "size should be at least 24 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = HENHMETAFILE_UserMarshal(&umcb.Flags, buffer + 1, &hemf);
|
||||
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehemf = buffer + 4;
|
||||
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
wirehemf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
wirehemf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0x8 should be size - 0x14 instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0x8 should be size - 0x14 instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
wirehemf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0xc should be size - 0x14 instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == (size - 0x14), "wirestgm + 0xc should be size - 0x14 instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
wirehemf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehemf == EMR_HEADER, "wirestgm + 0x10 should be EMR_HEADER instead of %d\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == EMR_HEADER, "wirestgm + 0x10 should be EMR_HEADER instead of %ld\n", *(DWORD *)wirehemf);
|
||||
/* ... rest of data not tested - refer to tests for GetEnhMetaFileBits
|
||||
* at this point */
|
||||
|
||||
|
@ -389,15 +389,15 @@ static void test_marshal_HENHMETAFILE(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = HENHMETAFILE_UserSize(&umcb.Flags, 1, &hemf);
|
||||
ok(size == 12, "size should be 12 bytes, not %d\n", size);
|
||||
ok(size == 12, "size should be 12 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = HENHMETAFILE_UserMarshal(&umcb.Flags, buffer + 1, &hemf);
|
||||
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehemf = buffer + 4;
|
||||
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
wirehemf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08x\n", *(DWORD *)wirehemf);
|
||||
ok(*(DWORD *)wirehemf == (DWORD)(DWORD_PTR)hemf, "wirestgm + 0x4 should be hemf instead of 0x%08lx\n", *(DWORD *)wirehemf);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = HENHMETAFILE_UserUnmarshal(&umcb.Flags, buffer + 1, &hemf2);
|
||||
|
@ -431,20 +431,20 @@ static void test_marshal_HMETAFILE(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = HMETAFILE_UserSize(&umcb.Flags, 0, &hmf);
|
||||
ok(size > 20, "size should be at least 20 bytes, not %d\n", size);
|
||||
ok(size > 20, "size should be at least 20 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
HMETAFILE_UserMarshal(&umcb.Flags, buffer, &hmf);
|
||||
wirehmf = buffer;
|
||||
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0x8 should be size - 0x10 instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0x8 should be size - 0x10 instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0xc should be size - 0x10 instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == (size - 0x10), "wirestgm + 0xc should be size - 0x10 instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
ok(*(WORD *)wirehmf == 1, "wirestgm + 0x10 should be 1 instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(WORD *)wirehmf == 1, "wirestgm + 0x10 should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
/* ... rest of data not tested - refer to tests for GetMetaFileBits
|
||||
* at this point */
|
||||
|
@ -460,14 +460,14 @@ static void test_marshal_HMETAFILE(void)
|
|||
hmf = NULL;
|
||||
|
||||
size = HMETAFILE_UserSize(&umcb.Flags, 0, &hmf);
|
||||
ok(size == 8, "size should be 8 bytes, not %d\n", size);
|
||||
ok(size == 8, "size should be 8 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
HMETAFILE_UserMarshal(&umcb.Flags, buffer, &hmf);
|
||||
wirehmf = buffer;
|
||||
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmf);
|
||||
ok(*(DWORD *)wirehmf == (DWORD)(DWORD_PTR)hmf, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmf);
|
||||
wirehmf += sizeof(DWORD);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -503,36 +503,36 @@ static void test_marshal_HMETAFILEPICT(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = HMETAFILEPICT_UserSize(&umcb.Flags, 1, &hmfp);
|
||||
ok(size > 24, "size should be at least 24 bytes, not %d\n", size);
|
||||
ok(size > 24, "size should be at least 24 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = HMETAFILEPICT_UserMarshal(&umcb.Flags, buffer + 1, &hmfp);
|
||||
wirehmfp = buffer + 4;
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == MM_ISOTROPIC, "wirestgm + 0x8 should be MM_ISOTROPIC instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == MM_ISOTROPIC, "wirestgm + 0x8 should be MM_ISOTROPIC instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == 1, "wirestgm + 0xc should be 1 instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == 1, "wirestgm + 0xc should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == 2, "wirestgm + 0x10 should be 2 instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == 2, "wirestgm + 0x10 should be 2 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == USER_MARSHAL_PTR_PREFIX, "wirestgm + 0x14 should be \"User\" instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == USER_MARSHAL_PTR_PREFIX, "wirestgm + 0x14 should be \"User\" instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x18 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x18 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
pmfp = GlobalLock(hmfp);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)pmfp->hMF, "wirestgm + 0x1c should be pmfp->hMF instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)pmfp->hMF, "wirestgm + 0x1c should be pmfp->hMF instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
GlobalUnlock(hmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
/* Note use (buffer_end - buffer) instead of size here, because size is an
|
||||
* overestimate with native */
|
||||
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x20 should be size - 0x34 instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x20 should be size - 0x34 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x24 should be size - 0x34 instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == (buffer_end - buffer - 0x2c), "wirestgm + 0x24 should be size - 0x34 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(WORD *)wirehmfp == 1, "wirehmfp + 0x28 should be 1 instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(WORD *)wirehmfp == 1, "wirehmfp + 0x28 should be 1 instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
/* ... rest of data not tested - refer to tests for GetMetaFileBits
|
||||
* at this point */
|
||||
|
||||
|
@ -552,15 +552,15 @@ static void test_marshal_HMETAFILEPICT(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = HMETAFILEPICT_UserSize(&umcb.Flags, 1, &hmfp);
|
||||
ok(size == 12, "size should be 12 bytes, not %d\n", size);
|
||||
ok(size == 12, "size should be 12 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = HMETAFILEPICT_UserMarshal(&umcb.Flags, buffer + 1, &hmfp);
|
||||
ok(buffer_end == buffer + size, "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehmfp = buffer + 4;
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == WDT_REMOTE_CALL, "wirestgm + 0x0 should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08x\n", *(DWORD *)wirehmfp);
|
||||
ok(*(DWORD *)wirehmfp == (DWORD)(DWORD_PTR)hmfp, "wirestgm + 0x4 should be hmf instead of 0x%08lx\n", *(DWORD *)wirehmfp);
|
||||
wirehmfp += sizeof(DWORD);
|
||||
|
||||
hmfp2 = NULL;
|
||||
|
@ -702,7 +702,7 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
|
|||
unk = NULL;
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, umcb_ctx);
|
||||
size = WdtpInterfacePointer_UserSize(&umcb.Flags, ctx, 0, unk, &IID_IUnknown);
|
||||
ok(size == 0, "size should be 0 bytes, not %d\n", size);
|
||||
ok(size == 0, "size should be 0 bytes, not %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown);
|
||||
ok(buffer_end == buffer, "buffer_end %p buffer %p\n", buffer_end, buffer);
|
||||
|
@ -721,23 +721,23 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
|
|||
marshal_size = pos.u.LowPart;
|
||||
marshal_data = GlobalLock(h);
|
||||
todo_wine
|
||||
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
|
||||
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, umcb_ctx);
|
||||
size = WdtpInterfacePointer_UserSize(&umcb.Flags, ctx, 0, unk, &IID_IUnknown);
|
||||
ok(size >= marshal_size + 2 * sizeof(DWORD), "marshal size %x got %x\n", marshal_size, size);
|
||||
ok(size >= marshal_size + 2 * sizeof(DWORD), "marshal size %lx got %lx\n", marshal_size, size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, umcb_ctx);
|
||||
buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown);
|
||||
todo_wine
|
||||
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
|
||||
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
|
||||
wireip = buffer;
|
||||
|
||||
ok(buffer_end == buffer + marshal_size + 2 * sizeof(DWORD), "buffer_end %p buffer %p\n", buffer_end, buffer);
|
||||
|
||||
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x0 should be %x instead of %x\n", marshal_size, *(DWORD *)wireip);
|
||||
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x0 should be %lx instead of %lx\n", marshal_size, *(DWORD *)wireip);
|
||||
wireip += sizeof(DWORD);
|
||||
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x4 should be %x instead of %x\n", marshal_size, *(DWORD *)wireip);
|
||||
ok(*(DWORD *)wireip == marshal_size, "wireip + 0x4 should be %lx instead of %lx\n", marshal_size, *(DWORD *)wireip);
|
||||
wireip += sizeof(DWORD);
|
||||
|
||||
ok(!memcmp(marshal_data, wireip, marshal_size), "buffer mismatch\n");
|
||||
|
@ -756,8 +756,8 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx, BOOL client,
|
|||
|
||||
WdtpInterfacePointer_UserUnmarshal(&umcb.Flags, buffer, &unk2, &IID_IUnknown);
|
||||
ok(unk2 != NULL, "IUnknown object didn't unmarshal properly\n");
|
||||
ok(Test_Unknown.refs == 2, "got %d\n", Test_Unknown.refs);
|
||||
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
|
||||
ok(Test_Unknown.refs == 2, "got %ld\n", Test_Unknown.refs);
|
||||
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC);
|
||||
IUnknown_Release(unk2);
|
||||
|
@ -820,14 +820,14 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
|
||||
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
|
||||
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
|
||||
ok(buffer_end - buffer == expect_buffer_end - expect_buffer, "buffer size mismatch\n");
|
||||
ok(*(DWORD*)buffer == TYMED_NULL, "got %08x\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) != 0, "got %08x\n", *((DWORD*)buffer+1));
|
||||
ok(*(DWORD*)buffer == TYMED_NULL, "got %08lx\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) != 0, "got %08lx\n", *((DWORD*)buffer+1));
|
||||
ok(!memcmp(buffer+8, expect_buffer + 8, expect_buffer_end - expect_buffer - 8), "buffer mismatch\n");
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -842,9 +842,9 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
|
||||
|
||||
ok(med2.tymed == TYMED_NULL, "got tymed %x\n", med2.tymed);
|
||||
ok(med2.tymed == TYMED_NULL, "got tymed %lx\n", med2.tymed);
|
||||
ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n");
|
||||
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
|
||||
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -858,7 +858,7 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
STGMEDIUM_UserFree(&umcb.Flags, &med2);
|
||||
|
||||
ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs);
|
||||
ok(Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, expect_buffer);
|
||||
|
||||
|
@ -887,16 +887,16 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
|
||||
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
|
||||
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
memset(buffer, 0xcc, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
|
||||
ok(buffer_end - buffer == expect_buffer_end - expect_buffer, "buffer size mismatch\n");
|
||||
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) != 0, "got %08x\n", *((DWORD*)buffer+1));
|
||||
ok(*((DWORD*)buffer+2) != 0, "got %08x\n", *((DWORD*)buffer+2));
|
||||
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08lx\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) != 0, "got %08lx\n", *((DWORD*)buffer+1));
|
||||
ok(*((DWORD*)buffer+2) != 0, "got %08lx\n", *((DWORD*)buffer+2));
|
||||
ok(!memcmp(buffer + 12, expect_buffer + 12, (buffer_end - buffer) - 12), "buffer mismatch\n");
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -912,11 +912,11 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
|
||||
|
||||
ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed);
|
||||
ok(med2.tymed == TYMED_ISTREAM, "got tymed %lx\n", med2.tymed);
|
||||
ok(U(med2).pstm != NULL, "Incorrectly unmarshalled\n");
|
||||
ok(med2.pUnkForRelease != NULL, "Incorrectly unmarshalled\n");
|
||||
ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs);
|
||||
ok(Test_Unknown2.refs == 0, "got %d\n", Test_Unknown2.refs);
|
||||
ok(Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs);
|
||||
ok(Test_Unknown2.refs == 0, "got %ld\n", Test_Unknown2.refs);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -930,8 +930,8 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
STGMEDIUM_UserFree(&umcb.Flags, &med2);
|
||||
|
||||
ok(Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs);
|
||||
ok(Test_Stream.refs == 1, "got %d\n", Test_Stream.refs);
|
||||
ok(Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs);
|
||||
ok(Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, expect_buffer);
|
||||
|
||||
|
@ -946,16 +946,16 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
size = STGMEDIUM_UserSize(&umcb.Flags, 0, &med);
|
||||
ok(size == expect_size, "size %d should be %d bytes\n", size, expect_size);
|
||||
ok(size == expect_size, "size %ld should be %ld bytes\n", size, expect_size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
memset(buffer, 0xcc, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
buffer_end = STGMEDIUM_UserMarshal(&umcb.Flags, buffer, &med);
|
||||
ok(buffer_end - buffer == expect_size, "buffer size mismatch\n");
|
||||
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08x\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) == 0, "got %08x\n", *((DWORD*)buffer+1));
|
||||
ok(*((DWORD*)buffer+2) == 0, "got %08x\n", *((DWORD*)buffer+2));
|
||||
ok(*(DWORD*)buffer == TYMED_ISTREAM, "got %08lx\n", *(DWORD*)buffer);
|
||||
ok(*((DWORD*)buffer+1) == 0, "got %08lx\n", *((DWORD*)buffer+1));
|
||||
ok(*((DWORD*)buffer+2) == 0, "got %08lx\n", *((DWORD*)buffer+2));
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_DIFFERENTMACHINE);
|
||||
umcb.pStubMsg->IsClient = client;
|
||||
|
@ -970,11 +970,11 @@ static void marshal_STGMEDIUM(BOOL client, BOOL in, BOOL out)
|
|||
|
||||
STGMEDIUM_UserUnmarshal(&umcb.Flags, buffer, &med2);
|
||||
|
||||
ok(med2.tymed == TYMED_ISTREAM, "got tymed %x\n", med2.tymed);
|
||||
ok(med2.tymed == TYMED_ISTREAM, "got tymed %lx\n", med2.tymed);
|
||||
ok(U(med2).pstm == NULL, "Incorrectly unmarshalled\n");
|
||||
ok(med2.pUnkForRelease == &Test_Unknown2.IUnknown_iface, "Incorrectly unmarshalled\n");
|
||||
ok(Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs);
|
||||
ok(Test_Unknown2.refs == 1, "got %d\n", Test_Unknown2.refs);
|
||||
ok(Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs);
|
||||
ok(Test_Unknown2.refs == 1, "got %ld\n", Test_Unknown2.refs);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buffer);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_DIFFERENTMACHINE);
|
||||
|
@ -1011,12 +1011,12 @@ static void test_marshal_SNB(void)
|
|||
snb = NULL;
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = SNB_UserSize(&umcb.Flags, 3, &snb);
|
||||
ok(size == 16, "Size should be 16, instead of %d\n", size);
|
||||
ok(size == 16, "Size should be 16, instead of %ld\n", size);
|
||||
|
||||
/* NULL block */
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = SNB_UserSize(&umcb.Flags, 0, &snb);
|
||||
ok(size == 12, "Size should be 12, instead of %d\n", size);
|
||||
ok(size == 12, "Size should be 12, instead of %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
|
@ -1024,9 +1024,9 @@ static void test_marshal_SNB(void)
|
|||
ok(mbuf == buffer + size, "got %p, %p\n", mbuf, buffer + size);
|
||||
|
||||
wiresnb = (RemSNB*)buffer;
|
||||
ok(wiresnb->ulCntStr == 0, "got %u\n", wiresnb->ulCntStr);
|
||||
ok(wiresnb->ulCntChar == 0, "got %u\n", wiresnb->ulCntChar);
|
||||
ok(*(ULONG*)wiresnb->rgString == 0, "got %u\n", *(ULONG*)wiresnb->rgString);
|
||||
ok(wiresnb->ulCntStr == 0, "got %lu\n", wiresnb->ulCntStr);
|
||||
ok(wiresnb->ulCntChar == 0, "got %lu\n", wiresnb->ulCntChar);
|
||||
ok(*(ULONG*)wiresnb->rgString == 0, "got %lu\n", *(ULONG*)wiresnb->rgString);
|
||||
|
||||
snb2 = NULL;
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
|
@ -1054,17 +1054,17 @@ static void test_marshal_SNB(void)
|
|||
snb = (SNB)src;
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = SNB_UserSize(&umcb.Flags, 0, &snb);
|
||||
ok(size == 38, "Size should be 38, instead of %d\n", size);
|
||||
ok(size == 38, "Size should be 38, instead of %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
SNB_UserMarshal(&umcb.Flags, buffer, &snb);
|
||||
|
||||
wiresnb = (RemSNB*)buffer;
|
||||
ok(wiresnb->ulCntStr == 13, "got %u\n", wiresnb->ulCntStr);
|
||||
ok(wiresnb->ulCntChar == 2, "got %u\n", wiresnb->ulCntChar);
|
||||
ok(wiresnb->ulCntStr == 13, "got %lu\n", wiresnb->ulCntStr);
|
||||
ok(wiresnb->ulCntChar == 2, "got %lu\n", wiresnb->ulCntChar);
|
||||
/* payload length is stored one more time, as ULONG */
|
||||
ok(*(ULONG*)wiresnb->rgString == wiresnb->ulCntStr, "got %u\n", *(ULONG*)wiresnb->rgString);
|
||||
ok(*(ULONG*)wiresnb->rgString == wiresnb->ulCntStr, "got %lu\n", *(ULONG*)wiresnb->rgString);
|
||||
dataW = &wiresnb->rgString[2];
|
||||
ok(!lstrcmpW(dataW, str1W), "marshalled string 0: %s\n", wine_dbgstr_w(dataW));
|
||||
dataW += ARRAY_SIZE(str1W);
|
||||
|
@ -1106,15 +1106,15 @@ static void test_marshal_HDC(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = HDC_UserSize(&umcb.Flags, 1, &hdc);
|
||||
ok(size == 4 + sizeof(*wirehdc), "Wrong size %d\n", size);
|
||||
ok(size == 4 + sizeof(*wirehdc), "Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HDC_UserMarshal(&umcb.Flags, buffer + 1, &hdc);
|
||||
ok(buffer_end == buffer + 4 + sizeof(*wirehdc), "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehdc = (wireHDC)(buffer + 4);
|
||||
ok(wirehdc->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehdc->fContext);
|
||||
ok(wirehdc->u.hInproc == (LONG_PTR)hdc, "Marshaled value should be %p instead of %x\n", hdc, wirehdc->u.hRemote);
|
||||
ok(wirehdc->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehdc->fContext);
|
||||
ok(wirehdc->u.hInproc == (LONG_PTR)hdc, "Marshaled value should be %p instead of %lx\n", hdc, wirehdc->u.hRemote);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HDC_UserUnmarshal(&umcb.Flags, buffer + 1, &hdc2);
|
||||
|
@ -1143,15 +1143,15 @@ static void test_marshal_HICON(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = HICON_UserSize(&umcb.Flags, 1, &hIcon);
|
||||
ok(size == 4 + sizeof(*wirehicon), "Wrong size %d\n", size);
|
||||
ok(size == 4 + sizeof(*wirehicon), "Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HICON_UserMarshal(&umcb.Flags, buffer + 1, &hIcon);
|
||||
ok(buffer_end == buffer + 4 + sizeof(*wirehicon), "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehicon = (wireHICON)(buffer + 4);
|
||||
ok(wirehicon->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehicon->fContext);
|
||||
ok(wirehicon->u.hInproc == (LONG_PTR)hIcon, "Marshaled value should be %p instead of %x\n", hIcon, wirehicon->u.hRemote);
|
||||
ok(wirehicon->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehicon->fContext);
|
||||
ok(wirehicon->u.hInproc == (LONG_PTR)hIcon, "Marshaled value should be %p instead of %lx\n", hIcon, wirehicon->u.hRemote);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HICON_UserUnmarshal(&umcb.Flags, buffer + 1, &hIcon2);
|
||||
|
@ -1184,15 +1184,15 @@ static void test_marshal_HBRUSH(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_LOCAL);
|
||||
size = HBRUSH_UserSize(&umcb.Flags, 1, &hBrush);
|
||||
ok(size == 4 + sizeof(*wirehbrush), "Wrong size %d\n", size);
|
||||
ok(size == 4 + sizeof(*wirehbrush), "Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HBRUSH_UserMarshal(&umcb.Flags, buffer + 1, &hBrush);
|
||||
ok(buffer_end == buffer + 4 + sizeof(*wirehbrush), "got %p buffer %p\n", buffer_end, buffer);
|
||||
wirehbrush = (wireHBRUSH)(buffer + 4);
|
||||
ok(wirehbrush->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", wirehbrush->fContext);
|
||||
ok(wirehbrush->u.hInproc == (LONG_PTR)hBrush, "Marshaled value should be %p instead of %x\n", hBrush, wirehbrush->u.hRemote);
|
||||
ok(wirehbrush->fContext == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", wirehbrush->fContext);
|
||||
ok(wirehbrush->u.hInproc == (LONG_PTR)hBrush, "Marshaled value should be %p instead of %lx\n", hBrush, wirehbrush->u.hRemote);
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HBRUSH_UserUnmarshal(&umcb.Flags, buffer + 1, &hBrush2);
|
||||
|
@ -1226,13 +1226,13 @@ static void test_marshal_HBITMAP(void)
|
|||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, NULL, 0, MSHCTX_INPROC);
|
||||
size = HBITMAP_UserSize(&umcb.Flags, 1, &hBitmap);
|
||||
ok(size == 0xc, "Wrong size %d\n", size);
|
||||
ok(size == 0xc, "Wrong size %ld\n", size);
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size + 4);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_INPROC);
|
||||
buffer_end = HBITMAP_UserMarshal(&umcb.Flags, buffer + 1, &hBitmap);
|
||||
ok(buffer_end == buffer + 0xc, "HBITMAP_UserMarshal() returned wrong size %d\n", (LONG)(buffer_end - buffer));
|
||||
ok(*(ULONG *)(buffer + 0x4) == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08x\n", *(ULONG *)(buffer + 0x8));
|
||||
ok(buffer_end == buffer + 0xc, "HBITMAP_UserMarshal() returned wrong size %ld\n", (LONG)(buffer_end - buffer));
|
||||
ok(*(ULONG *)(buffer + 0x4) == WDT_INPROC_CALL, "Context should be WDT_INPROC_CALL instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08lx\n", *(ULONG *)(buffer + 0x8));
|
||||
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_INPROC);
|
||||
HBITMAP_UserUnmarshal(&umcb.Flags, buffer + 1, &hBitmap2);
|
||||
|
@ -1246,15 +1246,15 @@ static void test_marshal_HBITMAP(void)
|
|||
size = HBITMAP_UserSize(&umcb.Flags, 1, &hBitmap);
|
||||
ok(size == 0x10 + header_size + bitmap_size ||
|
||||
broken(size == 0x14 + header_size + bitmap_size), /* Windows adds 4 extra (unused) bytes */
|
||||
"Wrong size %d\n", size);
|
||||
"Wrong size %ld\n", size);
|
||||
|
||||
buffer = HeapAlloc(GetProcessHeap(), 0, size + 4);
|
||||
init_user_marshal_cb(&umcb, &stub_msg, &rpc_msg, buffer, size, MSHCTX_LOCAL);
|
||||
buffer_end = HBITMAP_UserMarshal(&umcb.Flags, buffer + 1, &hBitmap);
|
||||
ok(buffer_end == buffer + 0x10 + header_size + bitmap_size, "HBITMAP_UserMarshal() returned wrong size %d\n", (LONG)(buffer_end - buffer));
|
||||
ok(*(ULONG *)(buffer + 0x4) == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08x\n", *(ULONG *)buffer);
|
||||
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(*(ULONG *)(buffer + 0xc) == (ULONG)(ULONG_PTR)bitmap_size, "wirestgm + 0x8 should be bitmap size instead of 0x%08x\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(buffer_end == buffer + 0x10 + header_size + bitmap_size, "HBITMAP_UserMarshal() returned wrong size %ld\n", (LONG)(buffer_end - buffer));
|
||||
ok(*(ULONG *)(buffer + 0x4) == WDT_REMOTE_CALL, "Context should be WDT_REMOTE_CALL instead of 0x%08lx\n", *(ULONG *)buffer);
|
||||
ok(*(ULONG *)(buffer + 0x8) == (ULONG)(ULONG_PTR)hBitmap, "wirestgm + 0x4 should be bitmap handle instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(*(ULONG *)(buffer + 0xc) == (ULONG)(ULONG_PTR)bitmap_size, "wirestgm + 0x8 should be bitmap size instead of 0x%08lx\n", *(ULONG *)(buffer + 0x4));
|
||||
ok(!memcmp(buffer + 0x10, bitmap, header_size), "buffer mismatch\n");
|
||||
ok(!memcmp(buffer + 0x10 + header_size, bmp_bits, bitmap_size), "buffer mismatch\n");
|
||||
|
||||
|
@ -1347,12 +1347,12 @@ static void test_GetDataHere_Proxy(void)
|
|||
STGMEDIUM med;
|
||||
|
||||
hr = CreateStreamOnHGlobal( NULL, TRUE, &stm );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %08lx\n", hr );
|
||||
tid = start_host_object2( stm, &IID_IDataObject, (IUnknown *)&obj.IDataObject_iface, MSHLFLAGS_NORMAL, NULL, &thread );
|
||||
|
||||
IStream_Seek( stm, zero, STREAM_SEEK_SET, NULL );
|
||||
hr = CoUnmarshalInterface( stm, &IID_IDataObject, (void **)&data );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %08lx\n", hr );
|
||||
IStream_Release( stm );
|
||||
|
||||
Test_Stream.refs = 1;
|
||||
|
@ -1368,33 +1368,33 @@ static void test_GetDataHere_Proxy(void)
|
|||
|
||||
fmt.tymed = med.tymed = TYMED_NULL;
|
||||
hr = IDataObject_GetDataHere( data, &fmt, &med );
|
||||
ok( hr == DV_E_TYMED, "got %08x\n", hr );
|
||||
ok( hr == DV_E_TYMED, "got %08lx\n", hr );
|
||||
|
||||
for (fmt.tymed = TYMED_HGLOBAL; fmt.tymed <= TYMED_ENHMF; fmt.tymed <<= 1)
|
||||
{
|
||||
med.tymed = fmt.tymed;
|
||||
hr = IDataObject_GetDataHere( data, &fmt, &med );
|
||||
ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08x for tymed %d\n", hr, fmt.tymed );
|
||||
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
|
||||
ok( hr == (fmt.tymed <= TYMED_ISTORAGE ? S_OK : DV_E_TYMED), "got %08lx for tymed %ld\n", hr, fmt.tymed );
|
||||
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
|
||||
}
|
||||
|
||||
fmt.tymed = TYMED_ISTREAM;
|
||||
med.tymed = TYMED_ISTORAGE;
|
||||
hr = IDataObject_GetDataHere( data, &fmt, &med );
|
||||
ok( hr == DV_E_TYMED, "got %08x\n", hr );
|
||||
ok( hr == DV_E_TYMED, "got %08lx\n", hr );
|
||||
|
||||
fmt.tymed = med.tymed = TYMED_ISTREAM;
|
||||
U(med).pstm = &Test_Stream.IStream_iface;
|
||||
med.pUnkForRelease = &Test_Unknown.IUnknown_iface;
|
||||
|
||||
hr = IDataObject_GetDataHere( data, &fmt, &med );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %08lx\n", hr );
|
||||
|
||||
ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" );
|
||||
ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" );
|
||||
|
||||
ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs );
|
||||
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
|
||||
ok( Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs );
|
||||
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
|
||||
|
||||
fmt.cfFormat = 2;
|
||||
fmt.tymed = med.tymed = TYMED_ISTREAM;
|
||||
|
@ -1402,14 +1402,14 @@ static void test_GetDataHere_Proxy(void)
|
|||
med.pUnkForRelease = &Test_Unknown.IUnknown_iface;
|
||||
|
||||
hr = IDataObject_GetDataHere( data, &fmt, &med );
|
||||
ok( hr == S_OK, "got %08x\n", hr );
|
||||
ok( hr == S_OK, "got %08lx\n", hr );
|
||||
|
||||
ok( U(med).pstm == &Test_Stream.IStream_iface, "stm changed\n" );
|
||||
ok( med.pUnkForRelease == &Test_Unknown.IUnknown_iface, "punk changed\n" );
|
||||
|
||||
ok( Test_Stream.refs == 1, "got %d\n", Test_Stream.refs );
|
||||
ok( Test_Unknown.refs == 1, "got %d\n", Test_Unknown.refs );
|
||||
ok( Test_Stream2.refs == 0, "got %d\n", Test_Stream2.refs );
|
||||
ok( Test_Stream.refs == 1, "got %ld\n", Test_Stream.refs );
|
||||
ok( Test_Unknown.refs == 1, "got %ld\n", Test_Unknown.refs );
|
||||
ok( Test_Stream2.refs == 0, "got %ld\n", Test_Stream2.refs );
|
||||
|
||||
IDataObject_Release( data );
|
||||
end_host_object( tid, thread );
|
||||
|
|
Loading…
Reference in New Issue