return found;
}
-static UINT SHELL_FindExecutableByOperation(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command)
+static UINT SHELL_FindExecutableByOperation(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation, LPWSTR key, LPWSTR filetype, LPWSTR command, LONG commandlen)
{
static const WCHAR wCommand[] = {'\\','c','o','m','m','a','n','d',0};
- LONG commandlen = 256*sizeof(WCHAR); /* This is the most DOS can handle :) */
-
/* Looking for ...buffer\shell\<verb>\command */
strcatW(filetype, wszShell);
strcatW(filetype, lpOperation);
{
filetypelen /= sizeof(WCHAR);
filetype[filetypelen] = '\0';
+ TRACE("File type: %s\n", debugstr_w(filetype));
}
}
{
/* pass the operation string to SHELL_FindExecutableByOperation() */
filetype[filetypelen] = '\0';
- retval = SHELL_FindExecutableByOperation(lpPath, lpFile, lpOperation, key, filetype, command);
+ retval = SHELL_FindExecutableByOperation(lpPath, lpFile, lpOperation, key, filetype, command, sizeof(command));
}
else
{
WCHAR operation[MAX_PATH];
HKEY hkey;
- /* Looking for ...buffer\shell\lpOperation\command */
+ /* Looking for ...buffer\shell\<operation>\command */
strcatW(filetype, wszShell);
/* enumerate the operation subkeys in the registry and search for one with an associated command */
break;
filetype[filetypelen] = '\0';
- retval = SHELL_FindExecutableByOperation(lpPath, lpFile, operation, key, filetype, command);
+ retval = SHELL_FindExecutableByOperation(lpPath, lpFile, operation, key, filetype, command, sizeof(command));
if (retval > 32)
break;
strncpyW(wszProtocol, lpFile, iSize);
wszProtocol[iSize] = '\0';
strcatW(wszProtocol, wszShell);
- strcatW(wszProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen); /*FIXME: enumerate registry subkeys - compare with the loop into SHELL_FindExecutable() */
+ strcatW(wszProtocol, sei_tmp.lpVerb? sei_tmp.lpVerb: wszOpen);
strcatW(wszProtocol, wCommand);
/* Remove File Protocol from lpFile */