mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 12:03:29 +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
|
#endif
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
ExecuteAutoRunFile (VOID)
|
ExecuteAutoRunFile(HKEY hkeyRoot)
|
||||||
{
|
{
|
||||||
TCHAR autorun[MAX_PATH];
|
TCHAR autorun[2048];
|
||||||
DWORD len = MAX_PATH;
|
DWORD len = sizeof autorun;
|
||||||
HKEY hkey;
|
HKEY hkey;
|
||||||
|
|
||||||
if( RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(hkeyRoot,
|
||||||
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
_T("SOFTWARE\\Microsoft\\Command Processor"),
|
||||||
0,
|
0,
|
||||||
KEY_READ,
|
KEY_READ,
|
||||||
|
@ -1547,10 +1547,9 @@ ExecuteAutoRunFile (VOID)
|
||||||
if (*autorun)
|
if (*autorun)
|
||||||
ParseCommandLine(autorun);
|
ParseCommandLine(autorun);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Get the command that comes after a /C or /K switch */
|
/* Get the command that comes after a /C or /K switch */
|
||||||
static VOID
|
static VOID
|
||||||
|
@ -1756,7 +1755,10 @@ Initialize()
|
||||||
AddBreakHandler ();
|
AddBreakHandler ();
|
||||||
|
|
||||||
if (AutoRun)
|
if (AutoRun)
|
||||||
ExecuteAutoRunFile();
|
{
|
||||||
|
ExecuteAutoRunFile(HKEY_LOCAL_MACHINE);
|
||||||
|
ExecuteAutoRunFile(HKEY_CURRENT_USER);
|
||||||
|
}
|
||||||
|
|
||||||
if (*ptr)
|
if (*ptr)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue