mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 09:25:10 +00:00
- Check for cmd's AutoRun registry value in HKEY_CURRENT_USER as well as HKEY_LOCAL_MACHINE.
- Allow AutoRun commands to be longer than MAX_PATH. svn path=/trunk/; revision=40361
This commit is contained in:
parent
edb9b66280
commit
c0fd81e39e
1 changed files with 9 additions and 7 deletions
|
@ -1525,13 +1525,13 @@ ShowCommands (VOID)
|
|||
#endif
|
||||
|
||||
static VOID
|
||||
ExecuteAutoRunFile (VOID)
|
||||
ExecuteAutoRunFile(HKEY hkeyRoot)
|
||||
{
|
||||
TCHAR autorun[MAX_PATH];
|
||||
DWORD len = MAX_PATH;
|
||||
TCHAR autorun[2048];
|
||||
DWORD len = sizeof autorun;
|
||||
HKEY hkey;
|
||||
|
||||
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
if (RegOpenKeyEx(hkeyRoot,
|
||||
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
||||
0,
|
||||
KEY_READ,
|
||||
|
@ -1547,9 +1547,8 @@ ExecuteAutoRunFile (VOID)
|
|||
if (*autorun)
|
||||
ParseCommandLine(autorun);
|
||||
}
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
RegCloseKey(hkey);
|
||||
}
|
||||
|
||||
/* Get the command that comes after a /C or /K switch */
|
||||
|
@ -1756,7 +1755,10 @@ Initialize()
|
|||
AddBreakHandler ();
|
||||
|
||||
if (AutoRun)
|
||||
ExecuteAutoRunFile();
|
||||
{
|
||||
ExecuteAutoRunFile(HKEY_LOCAL_MACHINE);
|
||||
ExecuteAutoRunFile(HKEY_CURRENT_USER);
|
||||
}
|
||||
|
||||
if (*ptr)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue