| Index: sandbox/win/src/process_policy_test.cc
|
| diff --git a/sandbox/win/src/process_policy_test.cc b/sandbox/win/src/process_policy_test.cc
|
| index babe3214b0ca195de178b0bf188d909234039a6c..a03e0bee5e0dd98fa00b797eff9f74362bda85dd 100644
|
| --- a/sandbox/win/src/process_policy_test.cc
|
| +++ b/sandbox/win/src/process_policy_test.cc
|
| @@ -50,8 +50,12 @@ sandbox::SboxTestResult CreateProcessHelper(const string16& exe,
|
|
|
| // Create the process with the unicode version of the API.
|
| sandbox::SboxTestResult ret1 = sandbox::SBOX_TEST_FAILED;
|
| - if (!::CreateProcessW(exe_name, const_cast<wchar_t*>(cmd_line), NULL, NULL,
|
| - FALSE, 0, NULL, NULL, &si, pi.Receive())) {
|
| + PROCESS_INFORMATION temp_process_info = {};
|
| + if (::CreateProcessW(exe_name, const_cast<wchar_t*>(cmd_line), NULL, NULL,
|
| + FALSE, 0, NULL, NULL, &si, &temp_process_info)) {
|
| + pi.Set(temp_process_info);
|
| + ret1 = sandbox::SBOX_TEST_SUCCEEDED;
|
| + } else {
|
| DWORD last_error = GetLastError();
|
| if ((ERROR_NOT_ENOUGH_QUOTA == last_error) ||
|
| (ERROR_ACCESS_DENIED == last_error) ||
|
| @@ -60,8 +64,6 @@ sandbox::SboxTestResult CreateProcessHelper(const string16& exe,
|
| } else {
|
| ret1 = sandbox::SBOX_TEST_FAILED;
|
| }
|
| - } else {
|
| - ret1 = sandbox::SBOX_TEST_SUCCEEDED;
|
| }
|
|
|
| pi.Close();
|
| @@ -73,10 +75,13 @@ sandbox::SboxTestResult CreateProcessHelper(const string16& exe,
|
| std::string narrow_cmd_line;
|
| if (cmd_line)
|
| narrow_cmd_line = base::SysWideToMultiByte(cmd_line, CP_UTF8);
|
| - if (!::CreateProcessA(
|
| + if (::CreateProcessA(
|
| exe_name ? base::SysWideToMultiByte(exe_name, CP_UTF8).c_str() : NULL,
|
| cmd_line ? const_cast<char*>(narrow_cmd_line.c_str()) : NULL,
|
| - NULL, NULL, FALSE, 0, NULL, NULL, &sia, pi.Receive())) {
|
| + NULL, NULL, FALSE, 0, NULL, NULL, &sia, &temp_process_info)) {
|
| + pi.Set(temp_process_info);
|
| + ret2 = sandbox::SBOX_TEST_SUCCEEDED;
|
| + } else {
|
| DWORD last_error = GetLastError();
|
| if ((ERROR_NOT_ENOUGH_QUOTA == last_error) ||
|
| (ERROR_ACCESS_DENIED == last_error) ||
|
| @@ -85,8 +90,6 @@ sandbox::SboxTestResult CreateProcessHelper(const string16& exe,
|
| } else {
|
| ret2 = sandbox::SBOX_TEST_FAILED;
|
| }
|
| - } else {
|
| - ret2 = sandbox::SBOX_TEST_SUCCEEDED;
|
| }
|
|
|
| if (ret1 == ret2)
|
| @@ -215,13 +218,14 @@ SBOX_TESTS_COMMAND int Process_GetChildProcessToken(int argc, wchar_t **argv) {
|
|
|
| string16 path = MakeFullPathToSystem32(argv[0]);
|
|
|
| - base::win::ScopedProcessInformation pi;
|
| STARTUPINFOW si = {sizeof(si)};
|
|
|
| + PROCESS_INFORMATION temp_process_info = {};
|
| if (!::CreateProcessW(path.c_str(), NULL, NULL, NULL, FALSE, CREATE_SUSPENDED,
|
| - NULL, NULL, &si, pi.Receive())) {
|
| + NULL, NULL, &si, &temp_process_info)) {
|
| return SBOX_TEST_FAILED;
|
| }
|
| + base::win::ScopedProcessInformation pi(temp_process_info);
|
|
|
| HANDLE token = NULL;
|
| BOOL result =
|
|
|