Author: hbelusca
Date: Sun Dec 23 23:17:10 2012
New Revision: 57986
URL:
http://svn.reactos.org/svn/reactos?rev=57986&view=rev
Log:
[WRITE/SETUP/RUNONCE/SERVICES/MMSYS/MSGINA/SYSSETUP]
- Use in some places ZeroMemory instead of memset(..., 0, ...).
- Fix way of initializing the STARTUPINFO structure before call to CreateProcess: in
particular, when using the wShowWindow field, also use the STARTF_USESHOWWINDOW flag.
[USERINIT]
- Fix way of initializing the STARTUPINFO structure before call to CreateProcess: in
particular, when using the wShowWindow field, also use the STARTF_USESHOWWINDOW flag.
- This fixes CORE-5735.
CORE-5735 #resolve #comment Command-line launching fixed in revision r57986.
Modified:
trunk/reactos/base/applications/rapps/loaddlg.c
trunk/reactos/base/applications/rapps/misc.c
trunk/reactos/base/applications/write/write.c
trunk/reactos/base/setup/welcome/welcome.c
trunk/reactos/base/system/runonce/runonce.c
trunk/reactos/base/system/services/database.c
trunk/reactos/base/system/userinit/userinit.c
trunk/reactos/dll/cpl/mmsys/audio.c
trunk/reactos/dll/win32/msgina/msgina.c
trunk/reactos/dll/win32/syssetup/install.c
trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/base/applications/rapps/loaddlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/lo…
==============================================================================
--- trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/loaddlg.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -260,7 +260,7 @@
ShowWindow(Dlg, SW_HIDE);
/* run it */
- memset(&si, 0, sizeof(si));
+ ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
r = CreateProcessW(path, NULL, NULL, NULL, 0, 0, NULL, NULL, &si, &pi);
if (0 == r) goto end;
Modified: trunk/reactos/base/applications/rapps/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/rapps/mi…
==============================================================================
--- trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/rapps/misc.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -168,6 +168,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
if (!CreateProcessW(NULL, lpPath, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&pi))
Modified: trunk/reactos/base/applications/write/write.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/write/wr…
==============================================================================
--- trunk/reactos/base/applications/write/write.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/write/write.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -35,16 +35,20 @@
PROCESS_INFORMATION info;
if (!GetSystemDirectoryW(path, MAX_PATH - 1 - lstrlenW(SZ_WORDPAD)))
- goto failed;
+ goto failed;
+
if (path[lstrlenW(path) - 1] != '\\')
- lstrcatW(path, SZ_BACKSLASH);
+ lstrcatW(path, SZ_BACKSLASH);
+
lstrcatW(path, SZ_WORDPAD);
- stinf.cb = sizeof(STARTUPINFOW);
+ ZeroMemory(&stinf, sizeof(stinf));
+ stinf.cb = sizeof(stinf);
GetStartupInfoW(&stinf);
if (!CreateProcessW(path, GetCommandLineW(), NULL, NULL, FALSE, 0, NULL, NULL,
&stinf, &info))
- goto failed;
+ goto failed;
+
CloseHandle(info.hProcess);
CloseHandle(info.hThread);
return 0;
Modified: trunk/reactos/base/setup/welcome/welcome.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/welcome/welcome…
==============================================================================
--- trunk/reactos/base/setup/welcome/welcome.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/welcome/welcome.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -261,8 +261,8 @@
_tcscat(AppName, CurrentDir);
}
- memset(&StartupInfo, 0, sizeof(STARTUPINFO));
- StartupInfo.cb = sizeof(STARTUPINFO);
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
+ StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.lpTitle = TEXT("Test");
StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_SHOWNORMAL;
Modified: trunk/reactos/base/system/runonce/runonce.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/runonce/runonc…
==============================================================================
--- trunk/reactos/base/system/runonce/runonce.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/runonce/runonce.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -25,6 +25,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
if (!CreateProcess(NULL, szData, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&pi))
@@ -156,6 +157,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
if (!CreateProcess(NULL, szData, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi))
Modified: trunk/reactos/base/system/services/database.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/datab…
==============================================================================
--- trunk/reactos/base/system/services/database.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/database.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -1512,13 +1512,9 @@
return ScmSendStartCommand(Service, argc, argv);
}
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(StartupInfo);
- StartupInfo.lpReserved = NULL;
- StartupInfo.lpDesktop = NULL;
- StartupInfo.lpTitle = NULL;
- StartupInfo.dwFlags = 0;
- StartupInfo.cbReserved2 = 0;
- StartupInfo.lpReserved2 = 0;
+ ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
Result = CreateProcessW(NULL,
Service->lpImage->szImagePath,
Modified: trunk/reactos/base/system/userinit/userinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/userinit/useri…
==============================================================================
--- trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/userinit/userinit.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -241,9 +241,11 @@
TRACE("(%s)\n", debugstr_w(Shell));
- ZeroMemory(&si, sizeof(STARTUPINFO));
- si.cb = sizeof(STARTUPINFO);
- ZeroMemory(&pi, sizeof(PROCESS_INFORMATION));
+ ZeroMemory(&si, sizeof(si));
+ si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_SHOWNORMAL;
+ ZeroMemory(&pi, sizeof(pi));
ExpandEnvironmentStrings(Shell, ExpandedShell, MAX_PATH);
Modified: trunk/reactos/dll/cpl/mmsys/audio.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/mmsys/audio.c?rev=…
==============================================================================
--- trunk/reactos/dll/cpl/mmsys/audio.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/mmsys/audio.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -204,6 +204,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi);
@@ -223,6 +224,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi);
@@ -242,6 +244,7 @@
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
CreateProcess(NULL, szPath, NULL, NULL, FALSE, 0, NULL, NULL,
&si, &pi);
Modified: trunk/reactos/dll/win32/msgina/msgina.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/msgina/msgina.c?…
==============================================================================
--- trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/msgina/msgina.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -218,12 +218,11 @@
return FALSE;
}
- ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
- ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
- StartupInfo.cb = sizeof(STARTUPINFOW);
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
+ ZeroMemory(&ProcessInformation, sizeof(ProcessInformation));
+ StartupInfo.cb = sizeof(StartupInfo);
StartupInfo.lpTitle = pszCmdLine;
- StartupInfo.dwX = StartupInfo.dwY = StartupInfo.dwXSize = StartupInfo.dwYSize = 0L;
- StartupInfo.dwFlags = 0;
+ StartupInfo.dwFlags = STARTF_USESHOWWINDOW;
StartupInfo.wShowWindow = SW_SHOW;
StartupInfo.lpDesktop = pszDesktopName;
Modified: trunk/reactos/dll/win32/syssetup/install.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/install…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/install.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -678,13 +678,8 @@
SetupCloseInfFile(hSysSetupInf);
/* Run the shell */
- StartupInfo.cb = sizeof(STARTUPINFOW);
- StartupInfo.lpReserved = NULL;
- StartupInfo.lpDesktop = NULL;
- StartupInfo.lpTitle = NULL;
- StartupInfo.dwFlags = 0;
- StartupInfo.cbReserved2 = 0;
- StartupInfo.lpReserved2 = 0;
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
+ StartupInfo.cb = sizeof(StartupInfo);
bRes = CreateProcessW(
L"userinit.exe",
NULL,
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sun Dec 23 23:17:10 2012
@@ -794,7 +794,7 @@
PROCESS_INFORMATION ProcessInformation;
WCHAR CmdLine[MAX_PATH] = L"rundll32.exe shell32.dll,Control_RunDLL ";
- ZeroMemory(&StartupInfo, sizeof(STARTUPINFOW));
+ ZeroMemory(&StartupInfo, sizeof(StartupInfo));
StartupInfo.cb = sizeof(STARTUPINFOW);
ASSERT(_countof(CmdLine) > wcslen(CmdLine) + wcslen(pwszCPLParameters));