Skip to content

Commit ddcd5f7

Browse files
authored
[SHELL32] Don't assert on broken ShellExecuteEx error reporting (reactos#8065)
1 parent 5484038 commit ddcd5f7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dll/win32/shell32/shlexec.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,6 +1639,7 @@ static LONG ShellExecute_FromContextMenuHandlers( LPSHELLEXECUTEINFOW sei )
16391639
if (!hkey)
16401640
return ERROR_FUNCTION_FAILED;
16411641

1642+
// FIXME: Words cannot describe how broken this is, all of it needs to die
16421643
r = RegOpenKeyW(hkey, L"shellex\\ContextMenuHandlers", &hkeycm);
16431644
if (r == ERROR_SUCCESS)
16441645
{
@@ -2179,7 +2180,10 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
21792180
CHeapPtr<WCHAR, CLocalAllocator> buf;
21802181
DWORD size = MAX_PATH;
21812182
if (!buf.Allocate(size) || FAILED(PathCreateFromUrlW(sei_tmp.lpFile, buf, &size, 0)))
2182-
return SE_ERR_OOM;
2183+
{
2184+
SetLastError(ERROR_OUTOFMEMORY);
2185+
return FALSE;
2186+
}
21832187

21842188
wszApplicationName.Attach(buf.Detach());
21852189
sei_tmp.lpFile = wszApplicationName;
@@ -2374,7 +2378,10 @@ ShellExecute_Normal(_Inout_ LPSHELLEXECUTEINFOW sei)
23742378
if (SHELL_execute(sei, SHELL_ExecuteW))
23752379
return ERROR_SUCCESS;
23762380
DWORD err = GetLastError();
2377-
assert(err);
2381+
#if DBG
2382+
if (!err)
2383+
DbgPrint("FIXME: Failed with error 0 on '%ls'\n", sei->lpFile);
2384+
#endif
23782385
return err ? err : ERROR_FILE_NOT_FOUND;
23792386
}
23802387

0 commit comments

Comments
 (0)