Module: wine Branch: refs/heads/master Commit: a8d1e6e068cc3b385214e7c1f1f37de064a76954 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a8d1e6e068cc3b385214e7c1...
Author: Ge van Geldorp gvg@reactos.org Date: Thu Jan 12 13:31:45 2006 +0100
shell32: Fix directory execution. Only use the Folder class handler if we're actually executing a folder.
---
dlls/shell32/shlexec.c | 19 ++++++++++++++++--- 1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c index 350ad7d..8290639 100644 --- a/dlls/shell32/shlexec.c +++ b/dlls/shell32/shlexec.c @@ -1315,9 +1315,22 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW strcpyW(wszApplicationName, wExplorer);
sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; - } else if (HCR_GetExecuteCommandW(0, wszFolder, sei_tmp.lpVerb?sei_tmp.lpVerb:wszOpen, buffer, sizeof(buffer))) { - SHELL_ArgifyW(wszApplicationName, sizeof(wszApplicationName)/sizeof(WCHAR), buffer, NULL, sei_tmp.lpIDList, NULL); - + } else { + WCHAR target[MAX_PATH]; + DWORD attribs; + /* Check if we're executing a directory and if so use the + handler for the Folder class */ + strcpyW(target, buffer); + attribs = GetFileAttributesW(buffer); + if (attribs != INVALID_FILE_ATTRIBUTES && + (attribs & FILE_ATTRIBUTE_DIRECTORY) && + HCR_GetExecuteCommandW(0, wszFolder, + sei_tmp.lpVerb?sei_tmp.lpVerb:wszOpen, + buffer, sizeof(buffer))) { + SHELL_ArgifyW(wszApplicationName, + sizeof(wszApplicationName)/sizeof(WCHAR), + buffer, target, sei_tmp.lpIDList, NULL); + } sei_tmp.fMask &= ~SEE_MASK_INVOKEIDLIST; } }