Commit 9d2a804f authored by Michael Ploujnikov's avatar Michael Ploujnikov Committed by Alexandre Julliard

ole32/tests: Win64 printf format warning fixes.

parent 1c16d833
......@@ -5,7 +5,6 @@ VPATH = @srcdir@
TESTDLL = ole32.dll
IMPORTS = oleaut32 ole32 user32 gdi32 kernel32
EXTRALIBS = -luuid
EXTRADEFS = -DWINE_NO_LONG_AS_INT
CTESTS = \
clipboard.c \
......
......@@ -256,7 +256,7 @@ static HRESULT WINAPI DataObjectImpl_EnumFormatEtc(IDataObject* iface, DWORD dwD
DataObjectImpl *This = (DataObjectImpl*)iface;
if(dwDirection != DATADIR_GET) {
ok(0, "unexpected direction %ld\n", dwDirection);
ok(0, "unexpected direction %d\n", dwDirection);
return E_NOTIMPL;
}
return EnumFormatImpl_Create(This->fmtetc, This->fmtetc_cnt, ppenumFormatEtc);
......@@ -322,11 +322,11 @@ static void test_set_clipboard(void)
ULONG ref;
LPDATAOBJECT data1, data2;
hr = DataObjectImpl_CreateText("data1", &data1);
ok(SUCCEEDED(hr), "Failed to create data1 object: %ld\n", hr);
ok(SUCCEEDED(hr), "Failed to create data1 object: %d\n", hr);
if(FAILED(hr))
return;
hr = DataObjectImpl_CreateText("data2", &data2);
ok(SUCCEEDED(hr), "Failed to create data2 object: %ld\n", hr);
ok(SUCCEEDED(hr), "Failed to create data2 object: %d\n", hr);
if(FAILED(hr))
return;
......@@ -345,9 +345,9 @@ static void test_set_clipboard(void)
ok(OleSetClipboard(NULL) == S_OK, "failed to clear clipboard\n");
ref = IDataObject_Release(data1);
ok(ref == 0, "expected data1 ref=0, got %ld\n", ref);
ok(ref == 0, "expected data1 ref=0, got %d\n", ref);
ref = IDataObject_Release(data2);
ok(ref == 0, "expected data2 ref=0, got %ld\n", ref);
ok(ref == 0, "expected data2 ref=0, got %d\n", ref);
}
......
......@@ -33,7 +33,7 @@
/* functions that are not present on all versions of Windows */
HRESULT (WINAPI * pCoInitializeEx)(LPVOID lpReserved, DWORD dwCoInit);
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08lx\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
static const CLSID CLSID_non_existent = { 0x12345678, 0x1234, 0x1234, { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0 } };
static const CLSID CLSID_CDeviceMoniker = { 0x4315d437, 0x5b8c, 0x11d0, { 0xbd, 0x3b, 0x00, 0xa0, 0xc9, 0x11, 0xce, 0x86 } };
......@@ -63,7 +63,7 @@ static void test_ProgIDFromCLSID(void)
{
LPWSTR progid;
HRESULT hr = ProgIDFromCLSID(&CLSID_CDeviceMoniker, &progid);
ok(hr == S_OK, "ProgIDFromCLSID failed with error 0x%08lx\n", hr);
ok(hr == S_OK, "ProgIDFromCLSID failed with error 0x%08x\n", hr);
if (hr == S_OK)
{
ok(!lstrcmpiW(progid, devicedotone), "Didn't get expected prog ID\n");
......@@ -72,18 +72,18 @@ static void test_ProgIDFromCLSID(void)
progid = (LPWSTR)0xdeadbeef;
hr = ProgIDFromCLSID(&CLSID_non_existent, &progid);
ok(hr == REGDB_E_CLASSNOTREG, "ProgIDFromCLSID returned %08lx\n", hr);
ok(hr == REGDB_E_CLASSNOTREG, "ProgIDFromCLSID returned %08x\n", hr);
ok(progid == NULL, "ProgIDFromCLSID returns with progid %p\n", progid);
hr = ProgIDFromCLSID(&CLSID_CDeviceMoniker, NULL);
ok(hr == E_INVALIDARG, "ProgIDFromCLSID should return E_INVALIDARG instead of 0x%08lx\n", hr);
ok(hr == E_INVALIDARG, "ProgIDFromCLSID should return E_INVALIDARG instead of 0x%08x\n", hr);
}
static void test_CLSIDFromProgID(void)
{
CLSID clsid;
HRESULT hr = CLSIDFromProgID(devicedotone, &clsid);
ok(hr == S_OK, "CLSIDFromProgID failed with error 0x%08lx\n", hr);
ok(hr == S_OK, "CLSIDFromProgID failed with error 0x%08x\n", hr);
ok(IsEqualCLSID(&clsid, &CLSID_CDeviceMoniker), "clsid wasn't equal to CLSID_CDeviceMoniker\n");
hr = CLSIDFromString((LPOLESTR)devicedotone, &clsid);
......@@ -93,14 +93,14 @@ static void test_CLSIDFromProgID(void)
/* test some failure cases */
hr = CLSIDFromProgID(wszNonExistent, NULL);
ok(hr == E_INVALIDARG, "CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
ok(hr == E_INVALIDARG, "CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08x\n", hr);
hr = CLSIDFromProgID(NULL, &clsid);
ok(hr == E_INVALIDARG, "CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
ok(hr == E_INVALIDARG, "CLSIDFromProgID should have returned E_INVALIDARG instead of 0x%08x\n", hr);
memset(&clsid, 0xcc, sizeof(clsid));
hr = CLSIDFromProgID(wszNonExistent, &clsid);
ok(hr == CO_E_CLASSSTRING, "CLSIDFromProgID on nonexistent ProgID should have returned CO_E_CLASSSTRING instead of 0x%08lx\n", hr);
ok(hr == CO_E_CLASSSTRING, "CLSIDFromProgID on nonexistent ProgID should have returned CO_E_CLASSSTRING instead of 0x%08x\n", hr);
ok(IsEqualCLSID(&clsid, &CLSID_NULL), "CLSIDFromProgID should have set clsid to all-zeros on failure\n");
}
......@@ -121,7 +121,7 @@ static void test_CoCreateInstance(void)
REFCLSID rclsid = &CLSID_MyComputer;
IUnknown *pUnk = (IUnknown *)0xdeadbeef;
HRESULT hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
ok(pUnk == NULL, "CoCreateInstance should have changed the passed in pointer to NULL, instead of %p\n", pUnk);
OleInitialize(NULL);
......@@ -131,18 +131,18 @@ static void test_CoCreateInstance(void)
OleUninitialize();
hr = CoCreateInstance(rclsid, NULL, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void **)&pUnk);
ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "CoCreateInstance should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
}
static void test_CoGetClassObject(void)
{
IUnknown *pUnk = (IUnknown *)0xdeadbeef;
HRESULT hr = CoGetClassObject(&CLSID_MyComputer, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void **)&pUnk);
ok(hr == CO_E_NOTINITIALIZED, "CoGetClassObject should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "CoGetClassObject should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
ok(pUnk == NULL, "CoGetClassObject should have changed the passed in pointer to NULL, instead of %p\n", pUnk);
hr = CoGetClassObject(&CLSID_MyComputer, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, NULL);
ok(hr == E_INVALIDARG, "CoGetClassObject should have returned E_INVALIDARG instead of 0x%08lx\n", hr);
ok(hr == E_INVALIDARG, "CoGetClassObject should have returned E_INVALIDARG instead of 0x%08x\n", hr);
}
static ATOM register_dummy_class(void)
......@@ -258,7 +258,7 @@ static void test_CoRegisterMessageFilter(void)
prev_filter = (IMessageFilter *)0xdeadbeef;
hr = CoRegisterMessageFilter(&MessageFilter, &prev_filter);
ok(hr == CO_E_NOT_SUPPORTED,
"CoRegisterMessageFilter should have failed with CO_E_NOT_SUPPORTED instead of 0x%08lx\n",
"CoRegisterMessageFilter should have failed with CO_E_NOT_SUPPORTED instead of 0x%08x\n",
hr);
ok(prev_filter == (IMessageFilter *)0xdeadbeef,
"prev_filter should have been set to %p\n", prev_filter);
......@@ -395,7 +395,7 @@ static void test_CoRegisterPSClsid(void)
CLSID clsid;
hr = CoRegisterPSClsid(&IID_IWineTest, &CLSID_WineTestPSFactoryBuffer);
ok(hr == CO_E_NOTINITIALIZED, "CoRegisterPSClsid should have returened CO_E_NOTINITIALIZED instead of 0x%08lx\n", hr);
ok(hr == CO_E_NOTINITIALIZED, "CoRegisterPSClsid should have returened CO_E_NOTINITIALIZED instead of 0x%08x\n", hr);
pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
......@@ -410,7 +410,7 @@ static void test_CoRegisterPSClsid(void)
ok_ole_success(hr, "CreateStreamOnHGlobal");
hr = CoMarshalInterface(stream, &IID_IWineTest, (IUnknown *)&Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08lx\n", hr);
ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr);
IStream_Release(stream);
hr = CoRevokeClassObject(dwRegistrationKey);
......@@ -421,7 +421,7 @@ static void test_CoRegisterPSClsid(void)
pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = CoGetPSClsid(&IID_IWineTest, &clsid);
ok(hr == REGDB_E_IIDNOTREG, "CoGetPSClsid should have returned REGDB_E_IIDNOTREG instead of 0x%08lx\n", hr);
ok(hr == REGDB_E_IIDNOTREG, "CoGetPSClsid should have returned REGDB_E_IIDNOTREG instead of 0x%08x\n", hr);
CoUninitialize();
}
......@@ -433,7 +433,7 @@ static void test_CoGetPSClsid(void)
hr = CoGetPSClsid(&IID_IClassFactory, &clsid);
ok(hr == CO_E_NOTINITIALIZED,
"CoGetPSClsid should have returned CO_E_NOTINITIALIZED instead of 0x%08lx\n",
"CoGetPSClsid should have returned CO_E_NOTINITIALIZED instead of 0x%08x\n",
hr);
pCoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
......@@ -443,12 +443,12 @@ static void test_CoGetPSClsid(void)
hr = CoGetPSClsid(&IID_IWineTest, &clsid);
ok(hr == REGDB_E_IIDNOTREG,
"CoGetPSClsid for random IID returned 0x%08lx instead of REGDB_E_IIDNOTREG\n",
"CoGetPSClsid for random IID returned 0x%08x instead of REGDB_E_IIDNOTREG\n",
hr);
hr = CoGetPSClsid(&IID_IClassFactory, NULL);
ok(hr == E_INVALIDARG,
"CoGetPSClsid for null clsid returned 0x%08lx instead of E_INVALIDARG\n",
"CoGetPSClsid for null clsid returned 0x%08x instead of E_INVALIDARG\n",
hr);
CoUninitialize();
......
......@@ -28,7 +28,7 @@
#include "wine/test.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08lx\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
static void test_streamonhglobal(IStream *pStream)
{
......@@ -54,7 +54,7 @@ static void test_streamonhglobal(IStream *pStream)
/* 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 %ld\n", read);
ok(read == sizeof(data), "IStream_Read returned read %d\n", read);
/* ignores HighPart */
ull.HighPart = -1;
......@@ -69,18 +69,18 @@ static void test_streamonhglobal(IStream *pStream)
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%08lx\n", hr);
ok(hr == STG_E_INVALIDFUNCTION, "IStream_LockRegion should have returned STG_E_INVALIDFUNCTION instead of 0x%08x\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 %ld\n", statstg.type);
ok(statstg.type == STGTY_STREAM, "statstg.type should have been STGTY_STREAM instead of %d\n", statstg.type);
/* test OOM condition */
ull.HighPart = -1;
ull.LowPart = -1;
hr = IStream_SetSize(pStream, ull);
todo_wine {
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08lx\n", hr);
ok(hr == E_OUTOFMEMORY, "IStream_SetSize with large size should have returned E_OUTOFMEMORY instead of 0x%08x\n", hr);
}
}
......
......@@ -29,7 +29,7 @@
#include "wine/test.h"
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08lx\n", hr)
#define ok_ole_success(hr, func) ok(hr == S_OK, func " failed with error 0x%08x\n", hr)
static IPersistStorage OleObjectPersistStg;
static IOleCache *cache;
......
......@@ -167,7 +167,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expected_result = (valid_types[i].simple <= version ? TRUE : FALSE);
ok(expected_result == !(hr == STG_E_INVALIDPARAMETER),
"PropVariantClear(%s) should have returned 0x%08lx, but returned 0x%08lx\n",
"PropVariantClear(%s) should have returned 0x%08x, but returned 0x%08x\n",
wine_vtypes[i],
expected_result ? S_OK : STG_E_INVALIDPARAMETER, hr);
......@@ -175,7 +175,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expected_result = (valid_types[i].with_array <= version ? TRUE : FALSE);
ok(expected_result == !(hr == STG_E_INVALIDPARAMETER),
"PropVariantClear(%s|VT_ARRAY) should have returned 0x%08lx, but returned 0x%08lx\n",
"PropVariantClear(%s|VT_ARRAY) should have returned 0x%08x, but returned 0x%08x\n",
wine_vtypes[i],
expected_result ? S_OK : STG_E_INVALIDPARAMETER, hr);
......@@ -183,7 +183,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expected_result = (valid_types[i].with_vector <= version ? TRUE : FALSE);
ok(expected_result == !(hr == STG_E_INVALIDPARAMETER),
"PropVariantClear(%s|VT_VECTOR) should have returned 0x%08lx, but returned 0x%08lx\n",
"PropVariantClear(%s|VT_VECTOR) should have returned 0x%08x, but returned 0x%08x\n",
wine_vtypes[i],
expected_result ? S_OK : STG_E_INVALIDPARAMETER, hr);
......@@ -191,7 +191,7 @@ static void test_validtypes(void)
hr = PropVariantClear(&propvar);
expected_result = (valid_types[i].byref <= version ? TRUE : FALSE);
ok(expected_result == !(hr == STG_E_INVALIDPARAMETER),
"PropVariantClear(%s|VT_BYREF) should have returned 0x%08lx, but returned 0x%08lx\n",
"PropVariantClear(%s|VT_BYREF) should have returned 0x%08x, but returned 0x%08x\n",
wine_vtypes[i],
expected_result ? S_OK : STG_E_INVALIDPARAMETER, hr);
}
......
......@@ -253,7 +253,7 @@ static void test_storage_stream(void)
r = IStorage_CreateStream(stg, NULL, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, 0, &stm );
ok(r==STG_E_INVALIDNAME, "IStorage->CreateStream wrong error\n");
r = IStorage_CreateStream(stg, longname, STGM_SHARE_EXCLUSIVE | STGM_READWRITE, 0, 0, &stm );
ok(r==STG_E_INVALIDNAME, "IStorage->CreateStream wrong error, got %ld GetLastError()=%ld\n", r, GetLastError());
ok(r==STG_E_INVALIDNAME, "IStorage->CreateStream wrong error, got %d GetLastError()=%d\n", r, GetLastError());
r = IStorage_CreateStream(stg, stmname, STGM_READWRITE, 0, 0, &stm );
ok(r==STG_E_INVALIDFLAG, "IStorage->CreateStream wrong error\n");
r = IStorage_CreateStream(stg, stmname, STGM_READ, 0, 0, &stm );
......@@ -391,7 +391,7 @@ static void test_open_storage(void)
/* try opening a nonexistent file - it should create it */
stgm = STGM_DIRECT | STGM_SHARE_EXCLUSIVE | STGM_READWRITE;
r = StgOpenStorage( filename, NULL, stgm, NULL, 0, &stg);
ok(r==S_OK, "StgOpenStorage failed: 0x%08lx\n", r);
ok(r==S_OK, "StgOpenStorage failed: 0x%08x\n", r);
if (r==S_OK) IStorage_Release(stg);
ok(is_existing_file(filename), "StgOpenStorage didn't create a file\n");
DeleteFileW(filename);
......@@ -696,10 +696,10 @@ static void test_storage_refcount(void)
ok (r == STG_E_REVERTED, "stat should fail\n");
r = IStream_Write( stm, "Test string", strlen("Test string"), NULL);
ok (r == STG_E_REVERTED, "IStream_Write should return STG_E_REVERTED instead of 0x%08lx\n", r);
ok (r == STG_E_REVERTED, "IStream_Write should return STG_E_REVERTED instead of 0x%08x\n", r);
r = IStream_Read( stm, buffer, sizeof(buffer), NULL);
ok (r == STG_E_REVERTED, "IStream_Read should return STG_E_REVERTED instead of 0x%08lx\n", r);
ok (r == STG_E_REVERTED, "IStream_Read should return STG_E_REVERTED instead of 0x%08x\n", r);
r = IStream_Release(stm);
ok (r == 0, "stream not released\n");
......@@ -707,21 +707,21 @@ static void test_storage_refcount(void)
/* tests that STGM_PRIORITY doesn't prevent readwrite access from other
* StgOpenStorage calls in transacted mode */
r = StgOpenStorage( filename, NULL, STGM_PRIORITY, NULL, 0, &stgprio);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08lx\n", r);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08x\n", r);
todo_wine {
/* non-transacted mode read/write fails */
r = StgOpenStorage( filename, NULL, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, NULL, 0, &stg);
ok(r==STG_E_LOCKVIOLATION, "StgOpenStorage should return STG_E_LOCKVIOLATION instead of 0x%08lx\n", r);
ok(r==STG_E_LOCKVIOLATION, "StgOpenStorage should return STG_E_LOCKVIOLATION instead of 0x%08x\n", r);
}
/* non-transacted mode read-only succeeds */
r = StgOpenStorage( filename, NULL, STGM_SHARE_DENY_WRITE|STGM_READ, NULL, 0, &stg);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08lx\n", r);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08x\n", r);
IStorage_Release(stg);
r = StgOpenStorage( filename, NULL, STGM_TRANSACTED|STGM_SHARE_DENY_WRITE|STGM_READWRITE, NULL, 0, &stg);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08lx\n", r);
ok(r==S_OK, "StgOpenStorage failed with error 0x%08x\n", r);
if(stg)
{
static const WCHAR stgname[] = { ' ',' ',' ','2','9',0 };
......@@ -732,40 +732,40 @@ static void test_storage_refcount(void)
STATSTG statstg;
r = IStorage_Stat( stg, &statstg, STATFLAG_NONAME );
ok(r == S_OK, "Stat should have succeded instead of returning 0x%08lx\n", r);
ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %ld\n", statstg.type);
ok(U(statstg.cbSize).LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %ld\n", U(statstg.cbSize).LowPart);
ok(U(statstg.cbSize).HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %ld\n", U(statstg.cbSize).HighPart);
ok(r == S_OK, "Stat should have succeded instead of returning 0x%08x\n", r);
ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %d\n", statstg.type);
ok(U(statstg.cbSize).LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %d\n", U(statstg.cbSize).LowPart);
ok(U(statstg.cbSize).HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %d\n", U(statstg.cbSize).HighPart);
ok(statstg.grfMode == (STGM_TRANSACTED|STGM_SHARE_DENY_WRITE|STGM_READWRITE),
"Statstg grfMode should have been 0x10022 instead of 0x%lx\n", statstg.grfMode);
ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %ld\n", statstg.grfLocksSupported);
"Statstg grfMode should have been 0x10022 instead of 0x%x\n", statstg.grfMode);
ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %d\n", statstg.grfLocksSupported);
ok(IsEqualCLSID(&statstg.clsid, &test_stg_cls), "Statstg clsid is not test_stg_cls\n");
ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %ld\n", statstg.grfStateBits);
ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %ld\n", statstg.reserved);
ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %d\n", statstg.grfStateBits);
ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %d\n", statstg.reserved);
r = IStorage_CreateStorage( stg, stgname, STGM_SHARE_EXCLUSIVE, 0, 0, &stg2 );
ok(r == S_OK, "CreateStorage should have succeeded instead of returning 0x%08lx\n", r);
ok(r == S_OK, "CreateStorage should have succeeded instead of returning 0x%08x\n", r);
r = IStorage_Stat( stg2, &statstg, STATFLAG_DEFAULT );
ok(r == S_OK, "Stat should have succeded instead of returning 0x%08lx\n", r);
ok(r == S_OK, "Stat should have succeded instead of returning 0x%08x\n", r);
ok(!lstrcmpW(statstg.pwcsName, stgname),
"Statstg pwcsName should have been the name the storage was created with\n");
ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %ld\n", statstg.type);
ok(U(statstg.cbSize).LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %ld\n", U(statstg.cbSize).LowPart);
ok(U(statstg.cbSize).HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %ld\n", U(statstg.cbSize).HighPart);
ok(statstg.type == STGTY_STORAGE, "Statstg type should have been STGTY_STORAGE instead of %d\n", statstg.type);
ok(U(statstg.cbSize).LowPart == 0, "Statstg cbSize.LowPart should have been 0 instead of %d\n", U(statstg.cbSize).LowPart);
ok(U(statstg.cbSize).HighPart == 0, "Statstg cbSize.HighPart should have been 0 instead of %d\n", U(statstg.cbSize).HighPart);
ok(statstg.grfMode == STGM_SHARE_EXCLUSIVE,
"Statstg grfMode should have been STGM_SHARE_EXCLUSIVE instead of 0x%lx\n", statstg.grfMode);
ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %ld\n", statstg.grfLocksSupported);
"Statstg grfMode should have been STGM_SHARE_EXCLUSIVE instead of 0x%x\n", statstg.grfMode);
ok(statstg.grfLocksSupported == 0, "Statstg grfLocksSupported should have been 0 instead of %d\n", statstg.grfLocksSupported);
ok(IsEqualCLSID(&statstg.clsid, &CLSID_NULL), "Statstg clsid is not CLSID_NULL\n");
ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %ld\n", statstg.grfStateBits);
ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %ld\n", statstg.reserved);
ok(statstg.grfStateBits == 0, "Statstg grfStateBits should have been 0 instead of %d\n", statstg.grfStateBits);
ok(statstg.reserved == 0, "Statstg reserved should have been 0 instead of %d\n", statstg.reserved);
CoTaskMemFree(statstg.pwcsName);
r = IStorage_CreateStorage( stg2, stgname2, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, 0, &stg3 );
ok(r == STG_E_ACCESSDENIED, "CreateStorage should have returned STG_E_ACCESSDENIED instead of 0x%08lx\n", r);
ok(r == STG_E_ACCESSDENIED, "CreateStorage should have returned STG_E_ACCESSDENIED instead of 0x%08x\n", r);
r = IStorage_CreateStream( stg2, stmname2, STGM_CREATE|STGM_SHARE_EXCLUSIVE, 0, 0, &stm );
ok(r == STG_E_ACCESSDENIED, "CreateStream should have returned STG_E_ACCESSDENIED instead of 0x%08lx\n", r);
ok(r == STG_E_ACCESSDENIED, "CreateStream should have returned STG_E_ACCESSDENIED instead of 0x%08x\n", r);
IStorage_Release(stg2);
......@@ -892,17 +892,17 @@ static void test_transact(void)
return;
r = IStorage_OpenStream(stg, stmname, NULL, STGM_SHARE_DENY_NONE|STGM_READ, 0, &stm );
ok(r==STG_E_INVALIDFLAG, "IStorage->OpenStream failed %08lx\n", r);
ok(r==STG_E_INVALIDFLAG, "IStorage->OpenStream failed %08x\n", r);
r = IStorage_OpenStream(stg, stmname, NULL, STGM_DELETEONRELEASE|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stm );
ok(r==STG_E_INVALIDFUNCTION, "IStorage->OpenStream failed %08lx\n", r);
ok(r==STG_E_INVALIDFUNCTION, "IStorage->OpenStream failed %08x\n", r);
r = IStorage_OpenStream(stg, stmname, NULL, STGM_TRANSACTED|STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stm );
ok(r==STG_E_INVALIDFUNCTION, "IStorage->OpenStream failed %08lx\n", r);
ok(r==STG_E_INVALIDFUNCTION, "IStorage->OpenStream failed %08x\n", r);
todo_wine {
r = IStorage_OpenStream(stg, stmname, NULL, STGM_SHARE_EXCLUSIVE|STGM_READWRITE, 0, &stm );
ok(r==STG_E_FILENOTFOUND, "IStorage->OpenStream should fail %08lx\n", r);
ok(r==STG_E_FILENOTFOUND, "IStorage->OpenStream should fail %08x\n", r);
}
if (stm)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment