mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 23:22:57 +00:00
[0.4.9][SHELL32] Squashed port of several RunDlg and ShellExecuteW() fixes
This is a big backport, that brings us closer to releases/0.4.14/0.4.14-release-10-g1b0b852 The main motivation is to fix the regression: CORE-6412 'FoxitReader4 starts directly instead of launching setup wizard' which regressed by SVN r56438 == gite5491506f1
By porting back the following commits: 0.4.15-dev-2883-g33c7c91b36
CORE-17351 CORE-16898 (#3797) Improve performance of Start-Run Dialog Box Options 0.4.14-dev-1016-g4e721f780e
CORE-12266 (#1854) [SHELL32] This fixes the ERROR_DDE_FAIL in the 'www.google.de' testcase 0.4.13-dev-790-g0f16d44b66
CORE-6412 + CORE-12927 but in return we have to fix all the callers of ShellExecuteW() that relied on this ancient hack-code, and we do this by picking 0.4.13-dev-930-gcb77f1701f
CORE-16299 [SHELL32][STOBJECT] ShellExecuteW() params part2 0.4.13-dev-860-g944aba1fcc
CORE-16299 [SHELL32] ShellExecuteW() params part1 (#1833) 0.4.12-dev-94-g932a812c66
CORE-15434 [SHELL32] shlexec.cpp UNICODE_NULL Add backslash if path was like C: (#1152) 0.4.12-dev-49-gfad9f6677a
CORE-15434 [SHELL32] dialogs.cpp (#1117) Addendum 0.4.12-dev-48-gc64d31e9b8
CORE-15434 [BROWSEUI] Add backslash for directory (#1121) C: C:\ 0.4.12-dev-36-g472787ffea
CORE-15431 (#1117) Crash on %SYSTEMROOT% 0.4.12-dev-19-g06d717e3bc
CORE-15431 (#1111) Enable Environment Variables 0.4.10-dev-446-gdb13b422b3
(#737) shlexec.cpp to avoid regression CORE-14886 "regsvr32 can no longer register dlls" 0.4.10-dev-419-gbfcbda227f
(#665) Multiple parameters dialogs.cpp, shlexec.cpp, sdk/include/reactis/undocshell.h 0.4.10-dev-335-ge018ccea4b
CORE-14469 (#681) [SHELL32] lpDirectory must have priority in ShellExecuteEx 0.4.10-dev-238-gc84f398306
CORE-14583 (#593) base/shell/explorer/traywnd.cpp 0.4.10-dev-106-g222534a5a2
IDS_FILE_NOT_FOUND from that unrelated commit was reused to display errors of the RunDlg
This commit is contained in:
parent
1711b13f21
commit
28f0841970
42 changed files with 361 additions and 54 deletions
|
@ -365,7 +365,13 @@ public:
|
||||||
|
|
||||||
m_RunFileDlgOwner = hwnd;
|
m_RunFileDlgOwner = hwnd;
|
||||||
|
|
||||||
RunFileDlg(hwnd, NULL, NULL, NULL, NULL, RFF_CALCDIRECTORY);
|
// build the default directory from two environment variables
|
||||||
|
CStringW strDefaultDir, strHomePath;
|
||||||
|
strDefaultDir.GetEnvironmentVariable(L"HOMEDRIVE");
|
||||||
|
strHomePath.GetEnvironmentVariable(L"HOMEPATH");
|
||||||
|
strDefaultDir += strHomePath;
|
||||||
|
|
||||||
|
RunFileDlg(hwnd, NULL, (LPCWSTR)strDefaultDir, NULL, NULL, RFF_CALCDIRECTORY);
|
||||||
|
|
||||||
m_RunFileDlgOwner = NULL;
|
m_RunFileDlgOwner = NULL;
|
||||||
::DestroyWindow(hwnd);
|
::DestroyWindow(hwnd);
|
||||||
|
|
|
@ -159,7 +159,12 @@ HRESULT STDMETHODCALLTYPE Hotplug_Shutdown(_In_ CSysTray * pSysTray)
|
||||||
|
|
||||||
static void _RunHotplug(CSysTray * pSysTray)
|
static void _RunHotplug(CSysTray * pSysTray)
|
||||||
{
|
{
|
||||||
ShellExecuteW(pSysTray->GetHWnd(), L"open", L"rundll32.exe shell32.dll,Control_RunDLL hotplug.dll", NULL, NULL, SW_SHOWNORMAL);
|
ShellExecuteW(pSysTray->GetHWnd(),
|
||||||
|
L"open",
|
||||||
|
L"rundll32.exe",
|
||||||
|
L"shell32.dll,Control_RunDLL hotplug.dll",
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _ShowContextMenu(CSysTray * pSysTray)
|
static void _ShowContextMenu(CSysTray * pSysTray)
|
||||||
|
|
|
@ -216,7 +216,12 @@ HRESULT Volume_OnDeviceChange(_In_ CSysTray * pSysTray, WPARAM wParam, LPARAM lP
|
||||||
|
|
||||||
static void _RunVolume(BOOL bTray)
|
static void _RunVolume(BOOL bTray)
|
||||||
{
|
{
|
||||||
ShellExecuteW(NULL, NULL, bTray ? L"sndvol32.exe /t" : L"sndvol32.exe", NULL, NULL, SW_SHOWNORMAL);
|
ShellExecuteW(NULL,
|
||||||
|
NULL,
|
||||||
|
L"sndvol32.exe",
|
||||||
|
bTray ? L"/t" : NULL,
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _RunMMCpl()
|
static void _RunMMCpl()
|
||||||
|
|
|
@ -382,6 +382,9 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo)
|
||||||
{
|
{
|
||||||
// Or just a plain old string.
|
// Or just a plain old string.
|
||||||
|
|
||||||
|
if (PathIsDirectoryW(strField))
|
||||||
|
PathAddBackslash(strField);
|
||||||
|
|
||||||
WCHAR szPath[MAX_PATH];
|
WCHAR szPath[MAX_PATH];
|
||||||
DWORD result = GetFullPathNameW(strField, _countof(szPath), szPath, NULL);
|
DWORD result = GetFullPathNameW(strField, _countof(szPath), szPath, NULL);
|
||||||
|
|
||||||
|
|
|
@ -408,7 +408,8 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
LRESULT lRet;
|
LRESULT lRet;
|
||||||
HWND htxt = GetDlgItem(hwnd, IDC_RUNDLG_EDITPATH);
|
HWND htxt = GetDlgItem(hwnd, IDC_RUNDLG_EDITPATH);
|
||||||
INT ic;
|
INT ic;
|
||||||
WCHAR *psz, *parent = NULL;
|
WCHAR *psz, *pszExpanded, *parent = NULL;
|
||||||
|
DWORD cchExpand;
|
||||||
SHELLEXECUTEINFOW sei;
|
SHELLEXECUTEINFOW sei;
|
||||||
NMRUNFILEDLGW nmrfd;
|
NMRUNFILEDLGW nmrfd;
|
||||||
|
|
||||||
|
@ -434,10 +435,28 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
}
|
}
|
||||||
|
|
||||||
GetWindowTextW(htxt, psz, ic + 1);
|
GetWindowTextW(htxt, psz, ic + 1);
|
||||||
|
|
||||||
sei.hwnd = hwnd;
|
sei.hwnd = hwnd;
|
||||||
sei.nShow = SW_SHOWNORMAL;
|
sei.nShow = SW_SHOWNORMAL;
|
||||||
sei.lpFile = psz;
|
sei.lpFile = psz;
|
||||||
|
StrTrimW(psz, L" \t");
|
||||||
|
|
||||||
|
if (wcschr(psz, L'%') != NULL)
|
||||||
|
{
|
||||||
|
cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0);
|
||||||
|
pszExpanded = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchExpand * sizeof(WCHAR));
|
||||||
|
if (!pszExpanded)
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(), 0, psz);
|
||||||
|
EndDialog(hwnd, IDCANCEL);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
ExpandEnvironmentStringsW(psz, pszExpanded, cchExpand);
|
||||||
|
StrTrimW(pszExpanded, L" \t");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pszExpanded = psz;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The precedence is the following: first the user-given
|
* The precedence is the following: first the user-given
|
||||||
|
@ -445,12 +464,22 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
* directory is computed if the RFF_CALCDIRECTORY is set,
|
* directory is computed if the RFF_CALCDIRECTORY is set,
|
||||||
* otherwise no current directory is defined.
|
* otherwise no current directory is defined.
|
||||||
*/
|
*/
|
||||||
|
LPCWSTR pszStartDir;
|
||||||
if (prfdp->lpstrDirectory)
|
if (prfdp->lpstrDirectory)
|
||||||
|
{
|
||||||
sei.lpDirectory = prfdp->lpstrDirectory;
|
sei.lpDirectory = prfdp->lpstrDirectory;
|
||||||
|
pszStartDir = prfdp->lpstrDirectory;
|
||||||
|
}
|
||||||
else if (prfdp->uFlags & RFF_CALCDIRECTORY)
|
else if (prfdp->uFlags & RFF_CALCDIRECTORY)
|
||||||
|
{
|
||||||
sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile);
|
sei.lpDirectory = parent = RunDlg_GetParentDir(sei.lpFile);
|
||||||
|
pszStartDir = parent = RunDlg_GetParentDir(pszExpanded);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
sei.lpDirectory = NULL;
|
sei.lpDirectory = NULL;
|
||||||
|
pszStartDir = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Hide the dialog for now on, we will show it up in case of retry */
|
/* Hide the dialog for now on, we will show it up in case of retry */
|
||||||
ShowWindow(hwnd, SW_HIDE);
|
ShowWindow(hwnd, SW_HIDE);
|
||||||
|
@ -467,9 +496,9 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
nmrfd.hdr.code = RFN_VALIDATE;
|
nmrfd.hdr.code = RFN_VALIDATE;
|
||||||
nmrfd.hdr.hwndFrom = hwnd;
|
nmrfd.hdr.hwndFrom = hwnd;
|
||||||
nmrfd.hdr.idFrom = 0;
|
nmrfd.hdr.idFrom = 0;
|
||||||
nmrfd.lpFile = sei.lpFile;
|
nmrfd.lpFile = pszExpanded;
|
||||||
nmrfd.lpDirectory = sei.lpDirectory;
|
nmrfd.lpDirectory = pszStartDir;
|
||||||
nmrfd.nShow = sei.nShow;
|
nmrfd.nShow = SW_SHOWNORMAL;
|
||||||
|
|
||||||
lRet = SendMessageW(prfdp->hwndOwner, WM_NOTIFY, 0, (LPARAM)&nmrfd.hdr);
|
lRet = SendMessageW(prfdp->hwndOwner, WM_NOTIFY, 0, (LPARAM)&nmrfd.hdr);
|
||||||
|
|
||||||
|
@ -480,9 +509,21 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case RF_OK:
|
case RF_OK:
|
||||||
if (ShellExecuteExW(&sei))
|
/* We use SECL_NO_UI because we don't want to see
|
||||||
|
* errors here, but we will try again below and
|
||||||
|
* there we will output our errors. */
|
||||||
|
if (SUCCEEDED(ShellExecCmdLine(hwnd, pszExpanded, pszStartDir, SW_SHOWNORMAL, NULL,
|
||||||
|
SECL_ALLOW_NONEXE | SECL_NO_UI)))
|
||||||
{
|
{
|
||||||
/* Call again GetWindowText in case the contents of the edit box has changed? */
|
/* Call GetWindowText again in case the contents of the edit box have changed. */
|
||||||
|
GetWindowTextW(htxt, psz, ic + 1);
|
||||||
|
FillList(htxt, psz, ic + 2 + 1, FALSE);
|
||||||
|
EndDialog(hwnd, IDOK);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (SUCCEEDED(ShellExecuteExW(&sei)))
|
||||||
|
{
|
||||||
|
/* Call GetWindowText again in case the contents of the edit box have changed. */
|
||||||
GetWindowTextW(htxt, psz, ic + 1);
|
GetWindowTextW(htxt, psz, ic + 1);
|
||||||
FillList(htxt, psz, ic + 2 + 1, FALSE);
|
FillList(htxt, psz, ic + 2 + 1, FALSE);
|
||||||
EndDialog(hwnd, IDOK);
|
EndDialog(hwnd, IDOK);
|
||||||
|
@ -500,6 +541,8 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
|
|
||||||
HeapFree(GetProcessHeap(), 0, parent);
|
HeapFree(GetProcessHeap(), 0, parent);
|
||||||
HeapFree(GetProcessHeap(), 0, psz);
|
HeapFree(GetProcessHeap(), 0, psz);
|
||||||
|
if (psz != pszExpanded)
|
||||||
|
HeapFree(GetProcessHeap(), 0, pszExpanded);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -515,8 +558,8 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
WCHAR filter[MAX_PATH], szCaption[MAX_PATH];
|
WCHAR filter[MAX_PATH], szCaption[MAX_PATH];
|
||||||
OPENFILENAMEW ofn;
|
OPENFILENAMEW ofn;
|
||||||
|
|
||||||
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER, filter, MAX_PATH);
|
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_FILTER, filter, _countof(filter));
|
||||||
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, MAX_PATH);
|
LoadStringW(shell32_hInstance, IDS_RUNDLG_BROWSE_CAPTION, szCaption, _countof(szCaption));
|
||||||
|
|
||||||
ZeroMemory(&ofn, sizeof(ofn));
|
ZeroMemory(&ofn, sizeof(ofn));
|
||||||
ofn.lStructSize = sizeof(ofn);
|
ofn.lStructSize = sizeof(ofn);
|
||||||
|
|
|
@ -845,8 +845,11 @@ HRESULT WINAPI CDesktopFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IData
|
||||||
{
|
{
|
||||||
if (uMsg == DFM_INVOKECOMMAND && wParam == 0)
|
if (uMsg == DFM_INVOKECOMMAND && wParam == 0)
|
||||||
{
|
{
|
||||||
if (32 >= (UINT)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL))
|
if (32 >= (UINT_PTR)ShellExecuteW(hwndOwner, L"open", L"rundll32.exe",
|
||||||
|
L"shell32.dll,Control_RunDLL desk.cpl", NULL, SW_SHOWNORMAL))
|
||||||
|
{
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
}
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
else if (uMsg == DFM_MERGECONTEXTMENU)
|
else if (uMsg == DFM_MERGECONTEXTMENU)
|
||||||
|
|
|
@ -41,22 +41,41 @@ HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder *psf,
|
||||||
|
|
||||||
if (_ILIsMyComputer(apidl[0]))
|
if (_ILIsMyComputer(apidl[0]))
|
||||||
{
|
{
|
||||||
if (32 >= (UINT)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL))
|
if (32 >= (UINT_PTR)ShellExecuteW(hwnd,
|
||||||
|
L"open",
|
||||||
|
L"rundll32.exe",
|
||||||
|
L"shell32.dll,Control_RunDLL sysdm.cpl",
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL))
|
||||||
|
{
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (_ILIsDesktop(apidl[0]))
|
else if (_ILIsDesktop(apidl[0]))
|
||||||
{
|
{
|
||||||
if (32 >= (UINT)ShellExecuteW(hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL))
|
if (32 >= (UINT_PTR)ShellExecuteW(hwnd,
|
||||||
|
L"open",
|
||||||
|
L"rundll32.exe",
|
||||||
|
L"shell32.dll,Control_RunDLL desk.cpl",
|
||||||
|
NULL,
|
||||||
|
SW_SHOWNORMAL))
|
||||||
|
{
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (_ILIsNetHood(apidl[0]))
|
else if (_ILIsNetHood(apidl[0]))
|
||||||
{
|
{
|
||||||
// FIXME path!
|
// FIXME path!
|
||||||
if (32 >= (UINT)ShellExecuteW(NULL, L"open", L"explorer.exe",
|
if (32 >= (UINT_PTR)ShellExecuteW(NULL,
|
||||||
|
L"open",
|
||||||
|
L"explorer.exe",
|
||||||
L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}",
|
L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}",
|
||||||
NULL, SW_SHOWDEFAULT))
|
NULL,
|
||||||
|
SW_SHOWDEFAULT))
|
||||||
|
{
|
||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (_ILIsBitBucket(apidl[0]))
|
else if (_ILIsBitBucket(apidl[0]))
|
||||||
{
|
{
|
||||||
/* FIXME: detect the drive path of bitbucket if appropiate */
|
/* FIXME: detect the drive path of bitbucket if appropiate */
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -886,4 +886,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -906,4 +906,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -901,4 +901,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Erweiterung wird bereits verwendet"
|
IDS_NEWEXT_EXT_IN_USE "Erweiterung wird bereits verwendet"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "Nach dem Entfernen einer registrierten Dateinamenerweiterung können Dateien mit dieser Erweiterung nicht mehr durch Doppelklicken auf das Dateisymbol geöffnet werden.\n\nSoll die Erweiterung trotzdem entfernt werden?"
|
IDS_REMOVE_EXT "Nach dem Entfernen einer registrierten Dateinamenerweiterung können Dateien mit dieser Erweiterung nicht mehr durch Doppelklicken auf das Dateisymbol geöffnet werden.\n\nSoll die Erweiterung trotzdem entfernt werden?"
|
||||||
|
IDS_FILE_NOT_FOUND "Die Datei '%s' wurde nicht gefunden."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -901,4 +901,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -902,4 +902,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "El archivo '%s' no pudo ser encontrado."
|
||||||
END
|
END
|
||||||
|
|
|
@ -908,4 +908,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -897,4 +897,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -905,4 +905,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Rozszerzenie jest w użyciu"
|
IDS_NEWEXT_EXT_IN_USE "Rozszerzenie jest w użyciu"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "Nie odnaleziono pliku '%s'."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -902,4 +902,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -902,4 +902,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "Файл '%s' не найден."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -904,4 +904,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -902,4 +902,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -900,4 +900,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -910,4 +910,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -908,4 +908,5 @@ BEGIN
|
||||||
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
IDS_NEWEXT_EXT_IN_USE "Extension is in use"
|
||||||
|
|
||||||
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
IDS_REMOVE_EXT "If you remove a registered file name extension, you will not be able to open files with this extension by double-clicking their icons.\n\nAre you sure you want to remove this extension?"
|
||||||
|
IDS_FILE_NOT_FOUND "The file '%s' was not found."
|
||||||
END
|
END
|
||||||
|
|
|
@ -20,11 +20,13 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
#include <undocshell.h>
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(exec);
|
WINE_DEFAULT_DEBUG_CHANNEL(exec);
|
||||||
|
|
||||||
static const WCHAR wszOpen[] = L"open";
|
static const WCHAR wszOpen[] = L"open";
|
||||||
static const WCHAR wszExe[] = L".exe";
|
static const WCHAR wszExe[] = L".exe";
|
||||||
|
static const WCHAR wszCom[] = L".com";
|
||||||
|
|
||||||
#define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY)
|
#define SEE_MASK_CLASSALL (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY)
|
||||||
|
|
||||||
|
@ -178,7 +180,7 @@ static void ParseTildeEffect(PWSTR &res, LPCWSTR &args, DWORD &len, DWORD &used,
|
||||||
* - use rules from here http://www.autohotkey.net/~deleyd/parameters/parameters.htm
|
* - use rules from here http://www.autohotkey.net/~deleyd/parameters/parameters.htm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* lpFile, LPITEMIDLIST pidl, LPCWSTR args, DWORD* out_len)
|
static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR* lpFile, LPITEMIDLIST pidl, LPCWSTR args, DWORD* out_len, const WCHAR* lpDir)
|
||||||
{
|
{
|
||||||
WCHAR xlpFile[1024];
|
WCHAR xlpFile[1024];
|
||||||
BOOL done = FALSE;
|
BOOL done = FALSE;
|
||||||
|
@ -265,7 +267,7 @@ static BOOL SHELL_ArgifyW(WCHAR* out, DWORD len, const WCHAR* fmt, const WCHAR*
|
||||||
if (!done || (*fmt == '1'))
|
if (!done || (*fmt == '1'))
|
||||||
{
|
{
|
||||||
/*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */
|
/*FIXME Is the call to SearchPathW() really needed? We already have separated out the parameter string in args. */
|
||||||
if (SearchPathW(NULL, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL))
|
if (SearchPathW(lpDir, lpFile, wszExe, sizeof(xlpFile) / sizeof(WCHAR), xlpFile, NULL))
|
||||||
cmd = xlpFile;
|
cmd = xlpFile;
|
||||||
else
|
else
|
||||||
cmd = lpFile;
|
cmd = lpFile;
|
||||||
|
@ -828,7 +830,7 @@ static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpVerb,
|
||||||
if (retval > 32)
|
if (retval > 32)
|
||||||
{
|
{
|
||||||
DWORD finishedLen;
|
DWORD finishedLen;
|
||||||
SHELL_ArgifyW(lpResult, resultLen, command, xlpFile, pidl, args, &finishedLen);
|
SHELL_ArgifyW(lpResult, resultLen, command, xlpFile, pidl, args, &finishedLen, lpPath);
|
||||||
if (finishedLen > resultLen)
|
if (finishedLen > resultLen)
|
||||||
ERR("Argify buffer not large enough.. truncated\n");
|
ERR("Argify buffer not large enough.. truncated\n");
|
||||||
/* Remove double quotation marks and command line arguments */
|
/* Remove double quotation marks and command line arguments */
|
||||||
|
@ -1039,6 +1041,22 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
|
||||||
TRACE("Couldn't launch\n");
|
TRACE("Couldn't launch\n");
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
/* if ddeexec is NULL, then we just need to exit here */
|
||||||
|
if (ddeexec == NULL)
|
||||||
|
{
|
||||||
|
TRACE("Exiting because ddeexec is NULL. ret=42.\n");
|
||||||
|
/* See https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew */
|
||||||
|
/* for reason why we use 42 here and also "Shell32_apitest ShellExecuteW" regression test */
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
|
/* if ddeexec is 'empty string', then we just need to exit here */
|
||||||
|
if (wcscmp(ddeexec, L"") == 0)
|
||||||
|
{
|
||||||
|
TRACE("Exiting because ddeexec is 'empty string'. ret=42.\n");
|
||||||
|
/* See https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutew */
|
||||||
|
/* for reason why we use 42 here and also "Shell32_apitest ShellExecuteW" regression test */
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
|
hConv = DdeConnect(ddeInst, hszApp, hszTopic, NULL);
|
||||||
if (!hConv)
|
if (!hConv)
|
||||||
{
|
{
|
||||||
|
@ -1061,11 +1079,11 @@ static unsigned dde_connect(const WCHAR* key, const WCHAR* start, WCHAR* ddeexec
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen);
|
SHELL_ArgifyW(static_res, sizeof(static_res)/sizeof(WCHAR), exec, lpFile, pidl, szCommandline, &resultLen, NULL);
|
||||||
if (resultLen > sizeof(static_res)/sizeof(WCHAR))
|
if (resultLen > sizeof(static_res)/sizeof(WCHAR))
|
||||||
{
|
{
|
||||||
res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR)));
|
res = dynamic_res = static_cast<WCHAR *>(HeapAlloc(GetProcessHeap(), 0, resultLen * sizeof(WCHAR)));
|
||||||
SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL);
|
SHELL_ArgifyW(dynamic_res, resultLen, exec, lpFile, pidl, szCommandline, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
res = static_res;
|
res = static_res;
|
||||||
|
@ -1131,7 +1149,8 @@ static UINT_PTR execute_from_key(LPCWSTR key, LPCWSTR lpFile, WCHAR *env,
|
||||||
if (cmdlen >= sizeof(cmd) / sizeof(WCHAR))
|
if (cmdlen >= sizeof(cmd) / sizeof(WCHAR))
|
||||||
cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1;
|
cmdlen = sizeof(cmd) / sizeof(WCHAR) - 1;
|
||||||
cmd[cmdlen] = '\0';
|
cmd[cmdlen] = '\0';
|
||||||
SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen);
|
SHELL_ArgifyW(param, sizeof(param) / sizeof(WCHAR), cmd, lpFile, (LPITEMIDLIST)psei->lpIDList, szCommandline, &resultLen,
|
||||||
|
(psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL);
|
||||||
if (resultLen > sizeof(param) / sizeof(WCHAR))
|
if (resultLen > sizeof(param) / sizeof(WCHAR))
|
||||||
ERR("Argify buffer not large enough, truncating\n");
|
ERR("Argify buffer not large enough, truncating\n");
|
||||||
}
|
}
|
||||||
|
@ -1511,7 +1530,8 @@ static UINT_PTR SHELL_execute_class(LPCWSTR wszApplicationName, LPSHELLEXECUTEIN
|
||||||
TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName));
|
TRACE("SEE_MASK_CLASSNAME->%s, doc->%s\n", debugstr_w(execCmd), debugstr_w(wszApplicationName));
|
||||||
|
|
||||||
wcmd[0] = '\0';
|
wcmd[0] = '\0';
|
||||||
done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen);
|
done = SHELL_ArgifyW(wcmd, sizeof(wcmd) / sizeof(WCHAR), execCmd, wszApplicationName, (LPITEMIDLIST)psei->lpIDList, NULL, &resultLen,
|
||||||
|
(psei->lpDirectory && *psei->lpDirectory) ? psei->lpDirectory : NULL);
|
||||||
if (!done && wszApplicationName[0])
|
if (!done && wszApplicationName[0])
|
||||||
{
|
{
|
||||||
strcatW(wcmd, L" ");
|
strcatW(wcmd, L" ");
|
||||||
|
@ -1577,7 +1597,8 @@ static BOOL SHELL_translate_idlist(LPSHELLEXECUTEINFOW sei, LPWSTR wszParameters
|
||||||
sei->lpVerb,
|
sei->lpVerb,
|
||||||
buffer, sizeof(buffer))) {
|
buffer, sizeof(buffer))) {
|
||||||
SHELL_ArgifyW(wszApplicationName, dwApplicationNameLen,
|
SHELL_ArgifyW(wszApplicationName, dwApplicationNameLen,
|
||||||
buffer, target, (LPITEMIDLIST)sei->lpIDList, NULL, &resultLen);
|
buffer, target, (LPITEMIDLIST)sei->lpIDList, NULL, &resultLen,
|
||||||
|
(sei->lpDirectory && *sei->lpDirectory) ? sei->lpDirectory : NULL);
|
||||||
if (resultLen > dwApplicationNameLen)
|
if (resultLen > dwApplicationNameLen)
|
||||||
ERR("Argify buffer not large enough... truncating\n");
|
ERR("Argify buffer not large enough... truncating\n");
|
||||||
appKnownSingular = FALSE;
|
appKnownSingular = FALSE;
|
||||||
|
@ -1987,34 +2008,6 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* If the executable name is not quoted, we have to use this search loop here,
|
|
||||||
that in CreateProcess() is not sufficient because it does not handle shell links. */
|
|
||||||
WCHAR buffer[MAX_PATH], xlpFile[MAX_PATH];
|
|
||||||
LPWSTR space, s;
|
|
||||||
|
|
||||||
LPWSTR beg = wszApplicationName/*sei_tmp.lpFile*/;
|
|
||||||
for(s = beg; (space = const_cast<LPWSTR>(strchrW(s, L' '))); s = space + 1)
|
|
||||||
{
|
|
||||||
int idx = space - sei_tmp.lpFile;
|
|
||||||
memcpy(buffer, sei_tmp.lpFile, idx * sizeof(WCHAR));
|
|
||||||
buffer[idx] = '\0';
|
|
||||||
|
|
||||||
/*FIXME This finds directory paths if the targeted file name contains spaces. */
|
|
||||||
if (SearchPathW(*sei_tmp.lpDirectory ? sei_tmp.lpDirectory : NULL, buffer, wszExe, sizeof(xlpFile) / sizeof(xlpFile[0]), xlpFile, NULL))
|
|
||||||
{
|
|
||||||
/* separate out command from parameter string */
|
|
||||||
LPCWSTR p = space + 1;
|
|
||||||
|
|
||||||
while(isspaceW(*p))
|
|
||||||
++p;
|
|
||||||
|
|
||||||
strcpyW(wszParameters, p);
|
|
||||||
*space = L'\0';
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lpFile = sei_tmp.lpFile;
|
lpFile = sei_tmp.lpFile;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2302,3 +2295,185 @@ EXTERN_C void WINAPI OpenAs_RunDLLW(HWND hwnd, HINSTANCE hinst, LPCWSTR cmdline,
|
||||||
{
|
{
|
||||||
FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_w(cmdline), cmdshow);
|
FIXME("%p, %p, %s, %d\n", hwnd, hinst, debugstr_w(cmdline), cmdshow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************************/
|
||||||
|
|
||||||
|
static LPCWSTR
|
||||||
|
SplitParams(LPCWSTR psz, LPWSTR pszArg0, size_t cchArg0)
|
||||||
|
{
|
||||||
|
LPCWSTR pch;
|
||||||
|
size_t ich = 0;
|
||||||
|
if (*psz == L'"')
|
||||||
|
{
|
||||||
|
// 1st argument is quoted. the string in quotes is quoted 1st argument.
|
||||||
|
// [pch] --> [pszArg0+ich]
|
||||||
|
for (pch = psz + 1; *pch && ich + 1 < cchArg0; ++ich, ++pch)
|
||||||
|
{
|
||||||
|
if (*pch == L'"' && pch[1] == L'"')
|
||||||
|
{
|
||||||
|
// doubled double quotations found!
|
||||||
|
pszArg0[ich] = L'"';
|
||||||
|
}
|
||||||
|
else if (*pch == L'"')
|
||||||
|
{
|
||||||
|
// single double quotation found!
|
||||||
|
++pch;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// otherwise
|
||||||
|
pszArg0[ich] = *pch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 1st argument is unquoted. non-space sequence is 1st argument.
|
||||||
|
// [pch] --> [pszArg0+ich]
|
||||||
|
for (pch = psz; *pch && !iswspace(*pch) && ich + 1 < cchArg0; ++ich, ++pch)
|
||||||
|
{
|
||||||
|
pszArg0[ich] = *pch;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pszArg0[ich] = 0;
|
||||||
|
|
||||||
|
// skip space
|
||||||
|
while (iswspace(*pch))
|
||||||
|
++pch;
|
||||||
|
|
||||||
|
return pch;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT WINAPI ShellExecCmdLine(
|
||||||
|
HWND hwnd,
|
||||||
|
LPCWSTR pwszCommand,
|
||||||
|
LPCWSTR pwszStartDir,
|
||||||
|
int nShow,
|
||||||
|
LPVOID pUnused,
|
||||||
|
DWORD dwSeclFlags)
|
||||||
|
{
|
||||||
|
SHELLEXECUTEINFOW info;
|
||||||
|
DWORD dwSize, dwError, dwType, dwFlags = SEE_MASK_DOENVSUBST | SEE_MASK_NOASYNC;
|
||||||
|
LPCWSTR pszVerb = NULL;
|
||||||
|
WCHAR szFile[MAX_PATH], szFile2[MAX_PATH];
|
||||||
|
HRESULT hr;
|
||||||
|
LPCWSTR pchParams;
|
||||||
|
LPWSTR lpCommand = NULL;
|
||||||
|
|
||||||
|
if (pwszCommand == NULL)
|
||||||
|
RaiseException(EXCEPTION_ACCESS_VIOLATION, EXCEPTION_NONCONTINUABLE,
|
||||||
|
1, (ULONG_PTR*)pwszCommand);
|
||||||
|
|
||||||
|
__SHCloneStrW(&lpCommand, pwszCommand);
|
||||||
|
StrTrimW(lpCommand, L" \t");
|
||||||
|
|
||||||
|
if (dwSeclFlags & SECL_NO_UI)
|
||||||
|
dwFlags |= SEE_MASK_FLAG_NO_UI;
|
||||||
|
if (dwSeclFlags & SECL_LOG_USAGE)
|
||||||
|
dwFlags |= SEE_MASK_FLAG_LOG_USAGE;
|
||||||
|
if (dwSeclFlags & SECL_USE_IDLIST)
|
||||||
|
dwFlags |= SEE_MASK_INVOKEIDLIST;
|
||||||
|
|
||||||
|
if (dwSeclFlags & SECL_RUNAS)
|
||||||
|
{
|
||||||
|
dwSize = 0;
|
||||||
|
hr = AssocQueryStringW(0, ASSOCSTR_COMMAND, lpCommand, L"RunAs", NULL, &dwSize);
|
||||||
|
if (SUCCEEDED(hr) && dwSize != 0)
|
||||||
|
{
|
||||||
|
pszVerb = L"runas";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PathIsURLW(lpCommand) || UrlIsW(lpCommand, URLIS_APPLIABLE))
|
||||||
|
{
|
||||||
|
StringCchCopyW(szFile, _countof(szFile), lpCommand);
|
||||||
|
pchParams = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pchParams = SplitParams(lpCommand, szFile, _countof(szFile));
|
||||||
|
if (szFile[0] != UNICODE_NULL && szFile[1] == L':' &&
|
||||||
|
szFile[2] == UNICODE_NULL)
|
||||||
|
{
|
||||||
|
PathAddBackslashW(szFile);
|
||||||
|
}
|
||||||
|
if (SearchPathW(NULL, szFile, NULL, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(NULL, szFile, wszExe, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(NULL, szFile, wszCom, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, szFile, NULL, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, szFile, wszExe, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, szFile, wszCom, _countof(szFile2), szFile2, NULL))
|
||||||
|
{
|
||||||
|
StringCchCopyW(szFile, _countof(szFile), szFile2);
|
||||||
|
}
|
||||||
|
else if (SearchPathW(NULL, lpCommand, NULL, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(NULL, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(NULL, lpCommand, wszCom, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, lpCommand, NULL, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, lpCommand, wszExe, _countof(szFile2), szFile2, NULL) ||
|
||||||
|
SearchPathW(pwszStartDir, lpCommand, wszCom, _countof(szFile2), szFile2, NULL))
|
||||||
|
{
|
||||||
|
StringCchCopyW(szFile, _countof(szFile), szFile2);
|
||||||
|
pchParams = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!(dwSeclFlags & SECL_ALLOW_NONEXE))
|
||||||
|
{
|
||||||
|
if (!GetBinaryTypeW(szFile, &dwType))
|
||||||
|
{
|
||||||
|
SHFree(lpCommand);
|
||||||
|
|
||||||
|
if (!(dwSeclFlags & SECL_NO_UI))
|
||||||
|
{
|
||||||
|
WCHAR szText[128 + MAX_PATH], szFormat[128];
|
||||||
|
LoadStringW(shell32_hInstance, IDS_FILE_NOT_FOUND, szFormat, _countof(szFormat));
|
||||||
|
StringCchPrintfW(szText, _countof(szText), szFormat, szFile);
|
||||||
|
MessageBoxW(hwnd, szText, NULL, MB_ICONERROR);
|
||||||
|
}
|
||||||
|
return CO_E_APPNOTFOUND;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (GetFileAttributesW(szFile) == INVALID_FILE_ATTRIBUTES)
|
||||||
|
{
|
||||||
|
SHFree(lpCommand);
|
||||||
|
|
||||||
|
if (!(dwSeclFlags & SECL_NO_UI))
|
||||||
|
{
|
||||||
|
WCHAR szText[128 + MAX_PATH], szFormat[128];
|
||||||
|
LoadStringW(shell32_hInstance, IDS_FILE_NOT_FOUND, szFormat, _countof(szFormat));
|
||||||
|
StringCchPrintfW(szText, _countof(szText), szFormat, szFile);
|
||||||
|
MessageBoxW(hwnd, szText, NULL, MB_ICONERROR);
|
||||||
|
}
|
||||||
|
return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ZeroMemory(&info, sizeof(info));
|
||||||
|
info.cbSize = sizeof(info);
|
||||||
|
info.fMask = dwFlags;
|
||||||
|
info.hwnd = hwnd;
|
||||||
|
info.lpVerb = pszVerb;
|
||||||
|
info.lpFile = szFile;
|
||||||
|
info.lpParameters = (pchParams && *pchParams) ? pchParams : NULL;
|
||||||
|
info.lpDirectory = pwszStartDir;
|
||||||
|
info.nShow = nShow;
|
||||||
|
if (ShellExecuteExW(&info))
|
||||||
|
{
|
||||||
|
if (info.lpIDList)
|
||||||
|
CoTaskMemFree(info.lpIDList);
|
||||||
|
|
||||||
|
SHFree(lpCommand);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
dwError = GetLastError();
|
||||||
|
|
||||||
|
SHFree(lpCommand);
|
||||||
|
|
||||||
|
return HRESULT_FROM_WIN32(dwError);
|
||||||
|
}
|
||||||
|
|
|
@ -267,6 +267,7 @@
|
||||||
#define IDS_NEWEXT_EXT_IN_USE 30521
|
#define IDS_NEWEXT_EXT_IN_USE 30521
|
||||||
|
|
||||||
#define IDS_REMOVE_EXT 30522
|
#define IDS_REMOVE_EXT 30522
|
||||||
|
#define IDS_FILE_NOT_FOUND 30530
|
||||||
|
|
||||||
/* Dialogs */
|
/* Dialogs */
|
||||||
|
|
||||||
|
|
|
@ -543,6 +543,21 @@ WORD WINAPI ArrangeWindows(
|
||||||
WORD cKids,
|
WORD cKids,
|
||||||
CONST HWND * lpKids);
|
CONST HWND * lpKids);
|
||||||
|
|
||||||
|
/* Flags for ShellExecCmdLine */
|
||||||
|
#define SECL_NO_UI 0x2
|
||||||
|
#define SECL_LOG_USAGE 0x8
|
||||||
|
#define SECL_USE_IDLIST 0x10
|
||||||
|
#define SECL_ALLOW_NONEXE 0x20
|
||||||
|
#define SECL_RUNAS 0x40
|
||||||
|
|
||||||
|
HRESULT WINAPI ShellExecCmdLine(
|
||||||
|
HWND hwnd,
|
||||||
|
LPCWSTR pwszCommand,
|
||||||
|
LPCWSTR pwszStartDir,
|
||||||
|
int nShow,
|
||||||
|
LPVOID pUnused,
|
||||||
|
DWORD dwSeclFlags);
|
||||||
|
|
||||||
/* RegisterShellHook types */
|
/* RegisterShellHook types */
|
||||||
#define RSH_DEREGISTER 0
|
#define RSH_DEREGISTER 0
|
||||||
#define RSH_REGISTER 1
|
#define RSH_REGISTER 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue