Commit 52b732dd authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Handle SEE_MASK_CLASSKEY case for ShellExecute.

parent 3e53d11e
......@@ -144,6 +144,31 @@ BOOL HCR_GetExecuteCommandA(LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD l
return FALSE;
}
BOOL HCR_GetExecuteCommandEx( HKEY hkeyClass, LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len )
{
BOOL ret = FALSE;
TRACE("%p %s %s\n", hkeyClass, szClass, szVerb );
if (szClass)
RegOpenKeyExA(hkeyClass,szClass,0,0x02000000,&hkeyClass);
if (hkeyClass)
{
char sTemp[MAX_PATH];
snprintf(sTemp, MAX_PATH, "shell\\%s\\command", szVerb);
ret = (ERROR_SUCCESS == SHGetValueA(hkeyClass, sTemp, NULL, NULL, szDest, &len));
if (szClass)
RegCloseKey(hkeyClass);
}
TRACE("-- %s\n", szDest );
return ret;
}
/***************************************************************************************
* HCR_GetDefaultIcon [internal]
*
......
......@@ -68,6 +68,7 @@ BOOL HCR_GetExecuteCommandA(LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD l
BOOL HCR_GetDefaultIconA(LPCSTR szClass, LPSTR szDest, DWORD len, LPDWORD dwNr);
BOOL HCR_GetClassNameA(REFIID riid, LPSTR szDest, DWORD len);
BOOL HCR_GetExecuteCommandEx ( HKEY hkeyClass, LPCSTR szClass, LPCSTR szVerb, LPSTR szDest, DWORD len );
BOOL HCR_GetFolderAttributes(REFIID riid, LPDWORD szDest);
INT_PTR CALLBACK AboutDlgProc(HWND,UINT,WPARAM,LPARAM);
......
......@@ -582,8 +582,7 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
if (sei->lpParameters)
strcpy(szCommandline, sei->lpParameters);
if (sei->fMask & ((SEE_MASK_CLASSKEY & ~SEE_MASK_CLASSNAME) |
SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
if (sei->fMask & (SEE_MASK_INVOKEIDLIST | SEE_MASK_ICON | SEE_MASK_HOTKEY |
SEE_MASK_CONNECTNETDRV | SEE_MASK_FLAG_DDEWAIT |
SEE_MASK_DOENVSUBST | SEE_MASK_FLAG_NO_UI | SEE_MASK_UNICODE |
SEE_MASK_NO_CONSOLE | SEE_MASK_ASYNCOK | SEE_MASK_HMONITOR ))
......@@ -618,12 +617,19 @@ BOOL WINAPI ShellExecuteExA32 (LPSHELLEXECUTEINFOA sei, SHELL_ExecuteA1632 execf
}
}
if (sei->fMask & SEE_MASK_CLASSNAME)
if (sei->fMask & (SEE_MASK_CLASSNAME | SEE_MASK_CLASSKEY))
{
/* launch a document by fileclass like 'WordPad.Document.1' */
/* the Commandline contains 'c:\Path\wordpad.exe "%1"' */
/* FIXME: szCommandline should not be of a fixed size. Plus MAX_PATH is way too short! */
HCR_GetExecuteCommandA(sei->lpClass, (sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
if (sei->fMask & SEE_MASK_CLASSKEY)
HCR_GetExecuteCommandEx(sei->hkeyClass,
(sei->fMask & SEE_MASK_CLASSNAME) ? sei->lpClass: NULL,
(sei->lpVerb) ? sei->lpVerb : "open", szCommandline, sizeof(szCommandline));
else if (sei->fMask & SEE_MASK_CLASSNAME)
HCR_GetExecuteCommandA(sei->lpClass, (sei->lpVerb) ? sei->lpVerb :
"open", szCommandline, sizeof(szCommandline));
/* FIXME: get the extension of lpFile, check if it fits to the lpClass */
TRACE("SEE_MASK_CLASSNAME->'%s', doc->'%s'\n", szCommandline, szApplicationName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment