From: Akihiro Sagawa sagawa.aki@gmail.com
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com --- dlls/ieframe/tests/intshcut.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c index 4e86000d610..9778d77cd11 100644 --- a/dlls/ieframe/tests/intshcut.c +++ b/dlls/ieframe/tests/intshcut.c @@ -173,12 +173,18 @@ static void test_ReadAndWriteProperties(void) WCHAR fileNameW[MAX_PATH]; static WCHAR iconPath[] = L"file:///C:/arbitrary/icon/path"; char testurl[] = "http://some/bogus/url.html"; + PROPVARIANT pv[2], pvread[2];
ps[0].ulKind = PRSPEC_PROPID; U(ps[0]).propid = PID_IS_ICONFILE; ps[1].ulKind = PRSPEC_PROPID; U(ps[1]).propid = PID_IS_ICONINDEX;
+ pv[0].vt = VT_LPWSTR; + U(pv[0]).pwszVal = iconPath; + pv[1].vt = VT_I4; + U(pv[1]).lVal = iconIndex; + /* Make sure we have a valid temporary directory */ GetTempPathW(MAX_PATH, fileNameW); lstrcatW(fileNameW, L"testshortcut.url"); @@ -190,7 +196,6 @@ static void test_ReadAndWriteProperties(void) IPersistFile *pf; IPropertyStorage *pPropStgWrite; IPropertySetStorage *pPropSetStg; - PROPVARIANT pv[2];
/* We need to set a URL -- IPersistFile refuses to save without one. */ hr = urlA->lpVtbl->SetURL(urlA, testurl, 0); @@ -205,10 +210,6 @@ static void test_ReadAndWriteProperties(void)
IPersistFile_Release(pf);
- pv[0].vt = VT_LPWSTR; - U(pv[0]).pwszVal = iconPath; - pv[1].vt = VT_I4; - U(pv[1]).lVal = iconIndex; hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPropertySetStorage, (void **) &pPropSetStg); ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hr);
@@ -218,6 +219,16 @@ static void test_ReadAndWriteProperties(void) hr = IPropertyStorage_WriteMultiple(pPropStgWrite, 2, ps, pv, 0); ok(hr == S_OK, "Unable to set properties, hr=0x%lx\n", hr);
+ memset(pvread, 0, sizeof(pvread)); + hr = IPropertyStorage_ReadMultiple(pPropStgWrite, 2, ps, pvread); + ok(hr == S_OK, "Unable to read properties, hr=0x%lx\n", hr); + ok(pvread[1].vt == VT_I4, "got %d\n", pvread[1].vt); + ok(U(pvread[1]).lVal == iconIndex, "Read wrong icon index: %d\n", U(pvread[1]).iVal); + ok(pvread[0].vt == VT_LPWSTR, "got %d\n", pvread[0].vt); + ok(lstrcmpW(U(pvread[0]).pwszVal, iconPath) == 0, "Wrong icon path read: %s\n", wine_dbgstr_w(U(pvread[0]).pwszVal)); + PropVariantClear(&pvread[0]); + PropVariantClear(&pvread[1]); + hr = IPropertyStorage_Commit(pPropStgWrite, STGC_DEFAULT); ok(hr == S_OK, "Failed to commit properties, hr=0x%lx\n", hr);
@@ -268,6 +279,10 @@ static void test_ReadAndWriteProperties(void) } PropVariantClear(&pvread[0]); PropVariantClear(&pvread[1]); + + hr = IPropertyStorage_WriteMultiple(pPropStgRead, 2, ps, pv, 0); + ok(hr == STG_E_ACCESSDENIED, "setting properties should return STG_E_ACCESSDENIED instead of 0x%lx\n", hr); + IPropertyStorage_Release(pPropStgRead); IPropertySetStorage_Release(pPropSetStg); urlAFromFile->lpVtbl->Release(urlAFromFile);
From: Akihiro Sagawa sagawa.aki@gmail.com
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com --- dlls/ieframe/tests/intshcut.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c index 9778d77cd11..5d9baa7cd9f 100644 --- a/dlls/ieframe/tests/intshcut.c +++ b/dlls/ieframe/tests/intshcut.c @@ -233,6 +233,25 @@ static void test_ReadAndWriteProperties(void) ok(hr == S_OK, "Failed to commit properties, hr=0x%lx\n", hr);
pPropStgWrite->lpVtbl->Release(pPropStgWrite); + + /* Test with STGM_WRITE */ + hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_WRITE, &pPropStgWrite); + todo_wine ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%lx\n", hr); + + if (hr == S_OK) + { + memset(pvread, 0, sizeof(pvread)); + hr = IPropertyStorage_ReadMultiple(pPropStgWrite, 2, ps, pvread); + ok(hr == S_OK, "Unable to read properties, hr=0x%lx\n", hr); + ok(pvread[1].vt == VT_I4, "got %d\n", pvread[1].vt); + ok(U(pvread[1]).lVal == iconIndex, "Read wrong icon index: %d\n", U(pvread[1]).iVal); + ok(pvread[0].vt == VT_LPWSTR, "got %d\n", pvread[0].vt); + ok(lstrcmpW(U(pvread[0]).pwszVal, iconPath) == 0, "Wrong icon path read: %s\n", wine_dbgstr_w(U(pvread[0]).pwszVal)); + PropVariantClear(&pvread[0]); + PropVariantClear(&pvread[1]); + + IPropertyStorage_Release(pPropStgWrite); + } urlA->lpVtbl->Release(urlA); IPropertySetStorage_Release(pPropSetStg); }
From: Akihiro Sagawa sagawa.aki@gmail.com
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com --- dlls/ieframe/intshcut.c | 5 +++++ dlls/ieframe/tests/intshcut.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/dlls/ieframe/intshcut.c b/dlls/ieframe/intshcut.c index 8938a2d9c71..e1dda3f6c1c 100644 --- a/dlls/ieframe/intshcut.c +++ b/dlls/ieframe/intshcut.c @@ -718,9 +718,14 @@ static HRESULT WINAPI PropertySetStorage_Open( DWORD grfMode, IPropertyStorage **ppprstg) { + const DWORD STGM_ACCESS_MASK = 0x0000000f; InternetShortcut *This = impl_from_IPropertySetStorage(iface); TRACE("(%s, 0x%lx, %p)\n", debugstr_guid(rfmtid), grfMode, ppprstg);
+ /* ole32 doesn't like STGM_WRITE */ + if ((grfMode & STGM_ACCESS_MASK) == STGM_WRITE) + grfMode = (grfMode & ~STGM_ACCESS_MASK) | STGM_READWRITE; + /* Note: The |STGM_SHARE_EXCLUSIVE is to cope with a bug in the implementation. Should be fixed in ole32. */ return IPropertySetStorage_Open(This->property_set_storage, rfmtid, diff --git a/dlls/ieframe/tests/intshcut.c b/dlls/ieframe/tests/intshcut.c index 5d9baa7cd9f..b5487491414 100644 --- a/dlls/ieframe/tests/intshcut.c +++ b/dlls/ieframe/tests/intshcut.c @@ -236,7 +236,7 @@ static void test_ReadAndWriteProperties(void)
/* Test with STGM_WRITE */ hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_WRITE, &pPropStgWrite); - todo_wine ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%lx\n", hr); + ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%lx\n", hr);
if (hr == S_OK) {
This merge request was approved by Jacek Caban.