diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 0b794b02081..1e795ac9280 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1165,13 +1165,12 @@ static HKEY ShellExecute_GetClassKey( const SHELLEXECUTEINFOW *sei ) return hkey; } -static IDataObject *shellex_get_dataobj( LPSHELLEXECUTEINFOW sei ) +static HRESULT shellex_get_dataobj( LPSHELLEXECUTEINFOW sei, IDataObject **dataobj ) { LPCITEMIDLIST pidllast = NULL; - IDataObject *dataobj = NULL; IShellFolder *shf = NULL; LPITEMIDLIST pidl = NULL; - HRESULT r; + HRESULT r = SE_ERR_DLLNOTFOUND; if (sei->fMask & SEE_MASK_CLASSALL) pidl = sei->lpIDList; @@ -1192,15 +1191,15 @@ static IDataObject *shellex_get_dataobj( LPSHELLEXECUTEINFOW sei ) if ( FAILED( r ) ) goto end; - IShellFolder_GetUIObjectOf( shf, NULL, 1, &pidllast, - &IID_IDataObject, NULL, (LPVOID*) &dataobj ); + r = IShellFolder_GetUIObjectOf( shf, NULL, 1, &pidllast, + &IID_IDataObject, NULL, (void**)dataobj ); end: if ( pidl != sei->lpIDList ) ILFree( pidl ); if ( shf ) IShellFolder_Release( shf ); - return dataobj; + return r; } static HRESULT shellex_run_context_menu_default( IShellExtInit *obj, @@ -1295,8 +1294,8 @@ static HRESULT shellex_load_object_and_run( HKEY hkey, LPCGUID guid, LPSHELLEXEC goto end; } - dataobj = shellex_get_dataobj( sei ); - if ( !dataobj ) + r = shellex_get_dataobj( sei, &dataobj ); + if ( FAILED( r ) ) { ERR("failed to get data object\n"); goto end; diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c index bb2b842f2f0..9dff9f81e6b 100644 --- a/dlls/shell32/tests/shlexec.c +++ b/dlls/shell32/tests/shlexec.c @@ -1780,7 +1780,7 @@ static fileurl_tests_t fileurl_tests[]= {"file:///", "%%TMPDIR%%\\test file.shlexec", 0, 0}, /* Test shortcuts vs. URLs */ - {"file://///", "%s\\test_shortcut_shlexec.lnk", 0, 0x1d}, + {"file://///", "%s\\test_shortcut_shlexec.lnk", 0, 0x1c}, /* Confuse things by mixing protocols */ {"file://", "shlproto://foo/bar", USE_COLON, 0}, @@ -1926,11 +1926,11 @@ static void test_urls(void) } /* A .lnk ending does not turn a URL into a shortcut */ - todo_wait rc = shell_execute(NULL, "shlproto://foo/bar.lnk", NULL, NULL); + rc = shell_execute(NULL, "shlproto://foo/bar.lnk", NULL, NULL); ok(rc > 32, "%s failed: rc=%lu\n", shell_call, rc); okChildInt("argcA", 5); - todo_wine okChildString("argvA3", "URL"); - todo_wine okChildString("argvA4", "shlproto://foo/bar.lnk"); + okChildString("argvA3", "URL"); + okChildString("argvA4", "shlproto://foo/bar.lnk"); /* Neither does a .exe extension */ rc = shell_execute(NULL, "shlproto://foo/bar.exe", NULL, NULL);