ieframe/tests: Enable compilation with long types.
Signed-off-by: Eric Pouech <eric.pouech@gmail.com> Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
722ecd5e65
commit
964a6e9953
|
@ -1,4 +1,3 @@
|
||||||
EXTRADEFS = -DWINE_NO_LONG_TYPES
|
|
||||||
TESTDLL = ieframe.dll
|
TESTDLL = ieframe.dll
|
||||||
IMPORTS = ole32 oleaut32 user32 gdi32 advapi32
|
IMPORTS = ole32 oleaut32 user32 gdi32 advapi32
|
||||||
|
|
||||||
|
|
|
@ -135,22 +135,22 @@ static void advise_cp(IUnknown *unk, BOOL init)
|
||||||
static DWORD cookie = 100;
|
static DWORD cookie = 100;
|
||||||
|
|
||||||
hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
|
hres = IUnknown_QueryInterface(unk, &IID_IConnectionPointContainer, (void**)&container);
|
||||||
ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08x\n", hres);
|
ok(hres == S_OK, "QueryInterface(IID_IConnectionPointContainer) failed: %08lx\n", hres);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hres = IConnectionPointContainer_FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point);
|
hres = IConnectionPointContainer_FindConnectionPoint(container, &DIID_DWebBrowserEvents2, &point);
|
||||||
IConnectionPointContainer_Release(container);
|
IConnectionPointContainer_Release(container);
|
||||||
ok(hres == S_OK, "FindConnectionPoint failed: %08x\n", hres);
|
ok(hres == S_OK, "FindConnectionPoint failed: %08lx\n", hres);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(init) {
|
if(init) {
|
||||||
hres = IConnectionPoint_Advise(point, (IUnknown*)&Dispatch, &cookie);
|
hres = IConnectionPoint_Advise(point, (IUnknown*)&Dispatch, &cookie);
|
||||||
ok(hres == S_OK, "Advise failed: %08x\n", hres);
|
ok(hres == S_OK, "Advise failed: %08lx\n", hres);
|
||||||
}else {
|
}else {
|
||||||
hres = IConnectionPoint_Unadvise(point, cookie);
|
hres = IConnectionPoint_Unadvise(point, cookie);
|
||||||
ok(hres == S_OK, "Unadvise failed: %08x\n", hres);
|
ok(hres == S_OK, "Unadvise failed: %08lx\n", hres);
|
||||||
}
|
}
|
||||||
|
|
||||||
IConnectionPoint_Release(point);
|
IConnectionPoint_Release(point);
|
||||||
|
@ -164,19 +164,19 @@ static void test_visible(IWebBrowser2 *wb)
|
||||||
|
|
||||||
b = 0x100;
|
b = 0x100;
|
||||||
hres = IWebBrowser2_get_Visible(wb, &b);
|
hres = IWebBrowser2_get_Visible(wb, &b);
|
||||||
ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
|
ok(hres == S_OK, "get_Visible failed: %08lx\n", hres);
|
||||||
ok(b == VARIANT_FALSE, "Visible = %x\n", b);
|
ok(b == VARIANT_FALSE, "Visible = %x\n", b);
|
||||||
|
|
||||||
hres = IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
|
hres = IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
|
||||||
ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
|
ok(hres == S_OK, "put_Visible failed: %08lx\n", hres);
|
||||||
|
|
||||||
b = 0x100;
|
b = 0x100;
|
||||||
hres = IWebBrowser2_get_Visible(wb, &b);
|
hres = IWebBrowser2_get_Visible(wb, &b);
|
||||||
ok(hres == S_OK, "get_Visible failed: %08x\n", hres);
|
ok(hres == S_OK, "get_Visible failed: %08lx\n", hres);
|
||||||
ok(b == VARIANT_TRUE, "Visible = %x\n", b);
|
ok(b == VARIANT_TRUE, "Visible = %x\n", b);
|
||||||
|
|
||||||
hres = IWebBrowser2_put_Visible(wb, VARIANT_FALSE);
|
hres = IWebBrowser2_put_Visible(wb, VARIANT_FALSE);
|
||||||
ok(hres == S_OK, "put_Visible failed: %08x\n", hres);
|
ok(hres == S_OK, "put_Visible failed: %08lx\n", hres);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_html_window(IWebBrowser2 *wb)
|
static void test_html_window(IWebBrowser2 *wb)
|
||||||
|
@ -186,11 +186,11 @@ static void test_html_window(IWebBrowser2 *wb)
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IWebBrowser2_QueryInterface(wb, &IID_IServiceProvider, (void**)&sp);
|
hres = IWebBrowser2_QueryInterface(wb, &IID_IServiceProvider, (void**)&sp);
|
||||||
ok(hres == S_OK, "Could not get IServiceProvider iface: %08x\n", hres);
|
ok(hres == S_OK, "Could not get IServiceProvider iface: %08lx\n", hres);
|
||||||
|
|
||||||
hres = IServiceProvider_QueryService(sp, &SID_SHTMLWindow, &IID_IHTMLWindow2, (void**)&html_window);
|
hres = IServiceProvider_QueryService(sp, &SID_SHTMLWindow, &IID_IHTMLWindow2, (void**)&html_window);
|
||||||
IServiceProvider_Release(sp);
|
IServiceProvider_Release(sp);
|
||||||
ok(hres == S_OK, "Could not get SHTMLWindow service: %08x\n", hres);
|
ok(hres == S_OK, "Could not get SHTMLWindow service: %08lx\n", hres);
|
||||||
|
|
||||||
IHTMLWindow2_Release(html_window);
|
IHTMLWindow2_Release(html_window);
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ static void test_window(IWebBrowser2 *wb)
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IWebBrowser2_get_HWND(wb, &handle);
|
hres = IWebBrowser2_get_HWND(wb, &handle);
|
||||||
ok(hres == S_OK, "get_HWND failed: %08x\n", hres);
|
ok(hres == S_OK, "get_HWND failed: %08lx\n", hres);
|
||||||
ok(handle, "handle == 0\n");
|
ok(handle, "handle == 0\n");
|
||||||
|
|
||||||
hwnd = (HWND)handle;
|
hwnd = (HWND)handle;
|
||||||
|
@ -223,7 +223,7 @@ static void test_navigate(IWebBrowser2 *wb, const WCHAR *url)
|
||||||
V_BSTR(&urlv) = SysAllocString(url);
|
V_BSTR(&urlv) = SysAllocString(url);
|
||||||
V_VT(&emptyv) = VT_EMPTY;
|
V_VT(&emptyv) = VT_EMPTY;
|
||||||
hres = IWebBrowser2_Navigate2(wb, &urlv, &emptyv, &emptyv, &emptyv, &emptyv);
|
hres = IWebBrowser2_Navigate2(wb, &urlv, &emptyv, &emptyv, &emptyv, &emptyv);
|
||||||
ok(hres == S_OK, "Navigate2 failed: %08x\n", hres);
|
ok(hres == S_OK, "Navigate2 failed: %08lx\n", hres);
|
||||||
SysFreeString(V_BSTR(&urlv));
|
SysFreeString(V_BSTR(&urlv));
|
||||||
|
|
||||||
while(!navigate_complete && GetMessageW(&msg, NULL, 0, 0)) {
|
while(!navigate_complete && GetMessageW(&msg, NULL, 0, 0)) {
|
||||||
|
@ -241,7 +241,7 @@ static void test_busy(IWebBrowser2 *wb)
|
||||||
|
|
||||||
b = 0xdead;
|
b = 0xdead;
|
||||||
hres = IWebBrowser2_get_Busy(wb, &b);
|
hres = IWebBrowser2_get_Busy(wb, &b);
|
||||||
ok(hres == S_OK, "get_Busy failed: %08x\n", hres);
|
ok(hres == S_OK, "get_Busy failed: %08lx\n", hres);
|
||||||
ok(b == VARIANT_FALSE, "Busy = %x\n", b);
|
ok(b == VARIANT_FALSE, "Busy = %x\n", b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,13 +254,13 @@ static void test_InternetExplorer(void)
|
||||||
|
|
||||||
hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
|
hres = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_SERVER,
|
||||||
&IID_IUnknown, (void**)&unk);
|
&IID_IUnknown, (void**)&unk);
|
||||||
ok(hres == S_OK, "Could not create InternetExplorer instance: %08x\n", hres);
|
ok(hres == S_OK, "Could not create InternetExplorer instance: %08lx\n", hres);
|
||||||
|
|
||||||
if(hres != S_OK)
|
if(hres != S_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
|
hres = IUnknown_QueryInterface(unk, &IID_IWebBrowser2, (void**)&wb);
|
||||||
ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08x\n", hres);
|
ok(hres == S_OK, "Could not get IWebBrowser2 interface: %08lx\n", hres);
|
||||||
if (hres != S_OK) {
|
if (hres != S_OK) {
|
||||||
IUnknown_Release(unk);
|
IUnknown_Release(unk);
|
||||||
return;
|
return;
|
||||||
|
@ -278,7 +278,7 @@ static void test_InternetExplorer(void)
|
||||||
|
|
||||||
IWebBrowser2_Release(wb);
|
IWebBrowser2_Release(wb);
|
||||||
ref = IUnknown_Release(unk);
|
ref = IUnknown_Release(unk);
|
||||||
ok(!ref, "object not destroyed, ref=%u\n", ref);
|
ok(!ref, "object not destroyed, ref=%lu\n", ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_InternetExplorerManager(void)
|
static void test_InternetExplorerManager(void)
|
||||||
|
@ -289,7 +289,7 @@ static void test_InternetExplorerManager(void)
|
||||||
|
|
||||||
hres = CoCreateInstance(&CLSID_InternetExplorerManager, NULL, CLSCTX_LOCAL_SERVER,
|
hres = CoCreateInstance(&CLSID_InternetExplorerManager, NULL, CLSCTX_LOCAL_SERVER,
|
||||||
&IID_IInternetExplorerManager, (void**)&unk);
|
&IID_IInternetExplorerManager, (void**)&unk);
|
||||||
ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), "Could not create InternetExplorerManager instance: %08x\n", hres);
|
ok(hres == S_OK || broken(hres == REGDB_E_CLASSNOTREG), "Could not create InternetExplorerManager instance: %08lx\n", hres);
|
||||||
|
|
||||||
if(hres != S_OK)
|
if(hres != S_OK)
|
||||||
{
|
{
|
||||||
|
@ -298,7 +298,7 @@ static void test_InternetExplorerManager(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
ref = IUnknown_Release(unk);
|
ref = IUnknown_Release(unk);
|
||||||
ok(!ref, "object not destroyed, ref=%u\n", ref);
|
ok(!ref, "object not destroyed, ref=%lu\n", ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
START_TEST(ie)
|
START_TEST(ie)
|
||||||
|
|
|
@ -75,17 +75,17 @@ static void test_Aggregability(void)
|
||||||
IUnknown *pUnknown = NULL;
|
IUnknown *pUnknown = NULL;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
||||||
ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUnknown, hr = 0x%x\n", hr);
|
ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUnknown, hr = 0x%lx\n", hr);
|
||||||
if (pUnknown)
|
if (pUnknown)
|
||||||
IUnknown_Release(pUnknown);
|
IUnknown_Release(pUnknown);
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&pUnknown);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&pUnknown);
|
||||||
ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUniformResourceLocatorA, hr = 0x%x\n", hr);
|
ok(hr == S_OK, "could not create instance of CLSID_InternetShortcut with IID_IUniformResourceLocatorA, hr = 0x%lx\n", hr);
|
||||||
if (pUnknown)
|
if (pUnknown)
|
||||||
IUnknown_Release(pUnknown);
|
IUnknown_Release(pUnknown);
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, &unknown, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, &unknown, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
||||||
ok(hr == CLASS_E_NOAGGREGATION, "aggregation didn't fail like it should, hr = 0x%x\n", hr);
|
ok(hr == CLASS_E_NOAGGREGATION, "aggregation didn't fail like it should, hr = 0x%lx\n", hr);
|
||||||
if (pUnknown)
|
if (pUnknown)
|
||||||
IUnknown_Release(pUnknown);
|
IUnknown_Release(pUnknown);
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,7 @@ static void test_QueryInterface(void)
|
||||||
IUnknown *pUnknown;
|
IUnknown *pUnknown;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUnknown, (void**)&pUnknown);
|
||||||
ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
|
ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
|
||||||
|
|
||||||
can_query_interface(pUnknown, &IID_IUniformResourceLocatorA);
|
can_query_interface(pUnknown, &IID_IUniformResourceLocatorA);
|
||||||
can_query_interface(pUnknown, &IID_IUniformResourceLocatorW);
|
can_query_interface(pUnknown, &IID_IUniformResourceLocatorW);
|
||||||
|
@ -122,10 +122,10 @@ static void _test_shortcut_url(unsigned line, IUnknown *unk, const char *exurl)
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = IUnknown_QueryInterface(unk, &IID_IUniformResourceLocatorA, (void**)&locator_a);
|
hres = IUnknown_QueryInterface(unk, &IID_IUniformResourceLocatorA, (void**)&locator_a);
|
||||||
ok_(__FILE__,line)(hres == S_OK, "Could not get IUniformResourceLocatorA iface: %08x\n", hres);
|
ok_(__FILE__,line)(hres == S_OK, "Could not get IUniformResourceLocatorA iface: %08lx\n", hres);
|
||||||
|
|
||||||
hres = locator_a->lpVtbl->GetURL(locator_a, &url_a);
|
hres = locator_a->lpVtbl->GetURL(locator_a, &url_a);
|
||||||
ok_(__FILE__,line)(hres == S_OK, "GetURL failed: %08x\n", hres);
|
ok_(__FILE__,line)(hres == S_OK, "GetURL failed: %08lx\n", hres);
|
||||||
ok_(__FILE__,line)(!strcmp(url_a, exurl), "unexpected URL, got %s, expected %s\n", url_a, exurl);
|
ok_(__FILE__,line)(!strcmp(url_a, exurl), "unexpected URL, got %s, expected %s\n", url_a, exurl);
|
||||||
CoTaskMemFree(url_a);
|
CoTaskMemFree(url_a);
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ static void _check_string_transform(unsigned line, IUniformResourceLocatorA *url
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
|
|
||||||
hr = urlA->lpVtbl->SetURL(urlA, input, flags);
|
hr = urlA->lpVtbl->SetURL(urlA, input, flags);
|
||||||
ok_(__FILE__,line)(hr == S_OK, "SetUrl failed, hr=0x%x\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "SetUrl failed, hr=0x%lx\n", hr);
|
||||||
if (FAILED(hr))
|
if (FAILED(hr))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -148,14 +148,14 @@ static void _check_string_transform(unsigned line, IUniformResourceLocatorA *url
|
||||||
hr = urlA->lpVtbl->GetURL(urlA, &output);
|
hr = urlA->lpVtbl->GetURL(urlA, &output);
|
||||||
if(expectedOutput) {
|
if(expectedOutput) {
|
||||||
todo_wine_if(is_todo) {
|
todo_wine_if(is_todo) {
|
||||||
ok_(__FILE__,line)(hr == S_OK, "GetUrl failed, hr=0x%x\n", hr);
|
ok_(__FILE__,line)(hr == S_OK, "GetUrl failed, hr=0x%lx\n", hr);
|
||||||
}
|
}
|
||||||
todo_wine
|
todo_wine
|
||||||
ok_(__FILE__,line)(!lstrcmpA(output, expectedOutput), "unexpected URL change %s -> %s (expected %s)\n",
|
ok_(__FILE__,line)(!lstrcmpA(output, expectedOutput), "unexpected URL change %s -> %s (expected %s)\n",
|
||||||
input, output, expectedOutput);
|
input, output, expectedOutput);
|
||||||
}else {
|
}else {
|
||||||
todo_wine
|
todo_wine
|
||||||
ok_(__FILE__,line)(hr == S_FALSE, "GetUrl failed, hr=0x%x\n", hr);
|
ok_(__FILE__,line)(hr == S_FALSE, "GetUrl failed, hr=0x%lx\n", hr);
|
||||||
todo_wine
|
todo_wine
|
||||||
ok_(__FILE__,line)(!output, "GetUrl returned %s\n", output);
|
ok_(__FILE__,line)(!output, "GetUrl returned %s\n", output);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +184,7 @@ static void test_ReadAndWriteProperties(void)
|
||||||
lstrcatW(fileNameW, L"testshortcut.url");
|
lstrcatW(fileNameW, L"testshortcut.url");
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
||||||
ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hr);
|
ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hr);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
IPersistFile *pf;
|
IPersistFile *pf;
|
||||||
|
@ -194,14 +194,14 @@ static void test_ReadAndWriteProperties(void)
|
||||||
|
|
||||||
/* We need to set a URL -- IPersistFile refuses to save without one. */
|
/* We need to set a URL -- IPersistFile refuses to save without one. */
|
||||||
hr = urlA->lpVtbl->SetURL(urlA, testurl, 0);
|
hr = urlA->lpVtbl->SetURL(urlA, testurl, 0);
|
||||||
ok(hr == S_OK, "Failed to set a URL. hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to set a URL. hr=0x%lx\n", hr);
|
||||||
|
|
||||||
/* Write this shortcut out to a file so that we can test reading it in again. */
|
/* Write this shortcut out to a file so that we can test reading it in again. */
|
||||||
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPersistFile, (void **) &pf);
|
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPersistFile, (void **) &pf);
|
||||||
ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to get the IPersistFile for writing. hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPersistFile_Save(pf, fileNameW, TRUE);
|
hr = IPersistFile_Save(pf, fileNameW, TRUE);
|
||||||
ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to save via IPersistFile. hr=0x%lx\n", hr);
|
||||||
|
|
||||||
IPersistFile_Release(pf);
|
IPersistFile_Release(pf);
|
||||||
|
|
||||||
|
@ -210,16 +210,16 @@ static void test_ReadAndWriteProperties(void)
|
||||||
pv[1].vt = VT_I4;
|
pv[1].vt = VT_I4;
|
||||||
U(pv[1]).lVal = iconIndex;
|
U(pv[1]).lVal = iconIndex;
|
||||||
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPropertySetStorage, (void **) &pPropSetStg);
|
hr = urlA->lpVtbl->QueryInterface(urlA, &IID_IPropertySetStorage, (void **) &pPropSetStg);
|
||||||
ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &pPropStgWrite);
|
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READWRITE | STGM_SHARE_EXCLUSIVE, &pPropStgWrite);
|
||||||
ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to get an IPropertyStorage for writing, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPropertyStorage_WriteMultiple(pPropStgWrite, 2, ps, pv, 0);
|
hr = IPropertyStorage_WriteMultiple(pPropStgWrite, 2, ps, pv, 0);
|
||||||
ok(hr == S_OK, "Unable to set properties, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to set properties, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPropertyStorage_Commit(pPropStgWrite, STGC_DEFAULT);
|
hr = IPropertyStorage_Commit(pPropStgWrite, STGC_DEFAULT);
|
||||||
ok(hr == S_OK, "Failed to commit properties, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to commit properties, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
pPropStgWrite->lpVtbl->Release(pPropStgWrite);
|
pPropStgWrite->lpVtbl->Release(pPropStgWrite);
|
||||||
urlA->lpVtbl->Release(urlA);
|
urlA->lpVtbl->Release(urlA);
|
||||||
|
@ -227,7 +227,7 @@ static void test_ReadAndWriteProperties(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlAFromFile);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlAFromFile);
|
||||||
ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hr);
|
ok(hr == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hr);
|
||||||
if (hr == S_OK)
|
if (hr == S_OK)
|
||||||
{
|
{
|
||||||
IPropertySetStorage *pPropSetStg;
|
IPropertySetStorage *pPropSetStg;
|
||||||
|
@ -238,29 +238,29 @@ static void test_ReadAndWriteProperties(void)
|
||||||
|
|
||||||
/* Now read that .url file back in. */
|
/* Now read that .url file back in. */
|
||||||
hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPersistFile, (void **) &pf);
|
hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPersistFile, (void **) &pf);
|
||||||
ok(hr == S_OK, "Failed to get the IPersistFile for reading. hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to get the IPersistFile for reading. hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPersistFile_Load(pf, fileNameW, 0);
|
hr = IPersistFile_Load(pf, fileNameW, 0);
|
||||||
ok(hr == S_OK, "Failed to load via IPersistFile. hr=0x%x\n", hr);
|
ok(hr == S_OK, "Failed to load via IPersistFile. hr=0x%lx\n", hr);
|
||||||
IPersistFile_Release(pf);
|
IPersistFile_Release(pf);
|
||||||
|
|
||||||
|
|
||||||
hr = urlAFromFile->lpVtbl->GetURL(urlAFromFile, &url);
|
hr = urlAFromFile->lpVtbl->GetURL(urlAFromFile, &url);
|
||||||
ok(hr == S_OK, "Unable to get url from file, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to get url from file, hr=0x%lx\n", hr);
|
||||||
ok(lstrcmpA(url, testurl) == 0, "Wrong url read from file: %s\n",url);
|
ok(lstrcmpA(url, testurl) == 0, "Wrong url read from file: %s\n",url);
|
||||||
CoTaskMemFree(url);
|
CoTaskMemFree(url);
|
||||||
|
|
||||||
hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPropertySetStorage, (void **) &pPropSetStg);
|
hr = urlAFromFile->lpVtbl->QueryInterface(urlAFromFile, &IID_IPropertySetStorage, (void **) &pPropSetStg);
|
||||||
ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStgRead);
|
hr = IPropertySetStorage_Open(pPropSetStg, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &pPropStgRead);
|
||||||
ok(hr == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%x\n", hr);
|
ok(hr == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
memset(pvread, 0, sizeof(pvread));
|
memset(pvread, 0, sizeof(pvread));
|
||||||
hr = IPropertyStorage_ReadMultiple(pPropStgRead, 2, ps, pvread);
|
hr = IPropertyStorage_ReadMultiple(pPropStgRead, 2, ps, pvread);
|
||||||
todo_wine /* Wine doesn't yet support setting properties after save */
|
todo_wine /* Wine doesn't yet support setting properties after save */
|
||||||
{
|
{
|
||||||
ok(hr == S_OK, "Unable to read properties, hr=0x%x\n", hr);
|
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(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(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(pvread[0].vt == VT_LPWSTR, "got %d\n", pvread[0].vt);
|
||||||
|
@ -282,17 +282,17 @@ static void test_NullURLs(void)
|
||||||
IUniformResourceLocatorA *urlA;
|
IUniformResourceLocatorA *urlA;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
||||||
ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
|
ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
|
||||||
|
|
||||||
hr = urlA->lpVtbl->GetURL(urlA, &url);
|
hr = urlA->lpVtbl->GetURL(urlA, &url);
|
||||||
ok(hr == S_FALSE, "getting uninitialized URL unexpectedly failed, hr=0x%x\n", hr);
|
ok(hr == S_FALSE, "getting uninitialized URL unexpectedly failed, hr=0x%lx\n", hr);
|
||||||
ok(url == NULL, "uninitialized URL is not NULL but %s\n", url);
|
ok(url == NULL, "uninitialized URL is not NULL but %s\n", url);
|
||||||
|
|
||||||
hr = urlA->lpVtbl->SetURL(urlA, NULL, 0);
|
hr = urlA->lpVtbl->SetURL(urlA, NULL, 0);
|
||||||
ok(hr == S_OK, "setting NULL URL unexpectedly failed, hr=0x%x\n", hr);
|
ok(hr == S_OK, "setting NULL URL unexpectedly failed, hr=0x%lx\n", hr);
|
||||||
|
|
||||||
hr = urlA->lpVtbl->GetURL(urlA, &url);
|
hr = urlA->lpVtbl->GetURL(urlA, &url);
|
||||||
ok(hr == S_FALSE, "getting NULL URL unexpectedly failed, hr=0x%x\n", hr);
|
ok(hr == S_FALSE, "getting NULL URL unexpectedly failed, hr=0x%lx\n", hr);
|
||||||
ok(url == NULL, "URL unexpectedly not NULL but %s\n", url);
|
ok(url == NULL, "URL unexpectedly not NULL but %s\n", url);
|
||||||
|
|
||||||
urlA->lpVtbl->Release(urlA);
|
urlA->lpVtbl->Release(urlA);
|
||||||
|
@ -342,31 +342,31 @@ static void test_Load(void)
|
||||||
CloseHandle(file);
|
CloseHandle(file);
|
||||||
|
|
||||||
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IPersistFile, (void**)&persist_file);
|
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IPersistFile, (void**)&persist_file);
|
||||||
ok(hres == S_OK, "Could not create InternetShortcut instance: %08x\n", hres);
|
ok(hres == S_OK, "Could not create InternetShortcut instance: %08lx\n", hres);
|
||||||
|
|
||||||
hres = IPersistFile_Load(persist_file, file_path, 0);
|
hres = IPersistFile_Load(persist_file, file_path, 0);
|
||||||
ok(hres == S_OK, "Load failed: %08x\n", hres);
|
ok(hres == S_OK, "Load failed: %08lx\n", hres);
|
||||||
|
|
||||||
test_shortcut_url((IUnknown*)persist_file, test->url);
|
test_shortcut_url((IUnknown*)persist_file, test->url);
|
||||||
|
|
||||||
hres = IPersistFile_QueryInterface(persist_file, &IID_IPropertySetStorage, (void **)&propsetstorage);
|
hres = IPersistFile_QueryInterface(persist_file, &IID_IPropertySetStorage, (void **)&propsetstorage);
|
||||||
ok(hres == S_OK, "Unable to get an IPropertySetStorage, hr=0x%x\n", hres);
|
ok(hres == S_OK, "Unable to get an IPropertySetStorage, hr=0x%lx\n", hres);
|
||||||
|
|
||||||
hres = IPropertySetStorage_Open(propsetstorage, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &propstorage);
|
hres = IPropertySetStorage_Open(propsetstorage, &FMTID_Intshcut, STGM_READ | STGM_SHARE_EXCLUSIVE, &propstorage);
|
||||||
ok(hres == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%x\n", hres);
|
ok(hres == S_OK, "Unable to get an IPropertyStorage for reading, hr=0x%lx\n", hres);
|
||||||
|
|
||||||
ps.ulKind = PRSPEC_PROPID;
|
ps.ulKind = PRSPEC_PROPID;
|
||||||
U(ps).propid = PID_IS_ICONFILE;
|
U(ps).propid = PID_IS_ICONFILE;
|
||||||
v.vt = VT_NULL;
|
v.vt = VT_NULL;
|
||||||
hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v);
|
hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v);
|
||||||
ok(hres == S_FALSE, "got 0x%08x\n", hres);
|
ok(hres == S_FALSE, "got 0x%08lx\n", hres);
|
||||||
ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
|
ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
|
||||||
|
|
||||||
ps.ulKind = PRSPEC_PROPID;
|
ps.ulKind = PRSPEC_PROPID;
|
||||||
U(ps).propid = PID_IS_ICONINDEX;
|
U(ps).propid = PID_IS_ICONINDEX;
|
||||||
v.vt = VT_EMPTY;
|
v.vt = VT_EMPTY;
|
||||||
hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v);
|
hres = IPropertyStorage_ReadMultiple(propstorage, 1, &ps, &v);
|
||||||
ok(hres == S_FALSE, "got 0x%08x\n", hres);
|
ok(hres == S_FALSE, "got 0x%08lx\n", hres);
|
||||||
ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
|
ok(v.vt == VT_EMPTY, "got %d\n", v.vt);
|
||||||
|
|
||||||
IPropertyStorage_Release(propstorage);
|
IPropertyStorage_Release(propstorage);
|
||||||
|
@ -383,7 +383,7 @@ static void test_SetURLFlags(void)
|
||||||
IUniformResourceLocatorA *urlA;
|
IUniformResourceLocatorA *urlA;
|
||||||
|
|
||||||
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&urlA);
|
||||||
ok(hr == S_OK, "Could not create InternetShortcut object: %08x\n", hr);
|
ok(hr == S_OK, "Could not create InternetShortcut object: %08lx\n", hr);
|
||||||
|
|
||||||
check_string_transform(urlA, "somerandomstring", 0, NULL, TRUE);
|
check_string_transform(urlA, "somerandomstring", 0, NULL, TRUE);
|
||||||
check_string_transform(urlA, "www.winehq.org", 0, NULL, TRUE);
|
check_string_transform(urlA, "www.winehq.org", 0, NULL, TRUE);
|
||||||
|
@ -400,7 +400,7 @@ static void test_InternetShortcut(void)
|
||||||
HRESULT hres;
|
HRESULT hres;
|
||||||
|
|
||||||
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&url);
|
hres = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL, &IID_IUniformResourceLocatorA, (void**)&url);
|
||||||
ok(hres == S_OK, "Could not create CLSID_InternetShortcut instance: %08x\n", hres);
|
ok(hres == S_OK, "Could not create CLSID_InternetShortcut instance: %08lx\n", hres);
|
||||||
if(FAILED(hres))
|
if(FAILED(hres))
|
||||||
return;
|
return;
|
||||||
url->lpVtbl->Release(url);
|
url->lpVtbl->Release(url);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue