| Index: sandbox/win/tests/validation_tests/commands.cc
|
| diff --git a/sandbox/win/tests/validation_tests/commands.cc b/sandbox/win/tests/validation_tests/commands.cc
|
| index e7620c37600eb0d92e5957d5b7a794577b4b72f6..00796b76118eb66d010bac57668896047898fc5a 100644
|
| --- a/sandbox/win/tests/validation_tests/commands.cc
|
| +++ b/sandbox/win/tests/validation_tests/commands.cc
|
| @@ -310,5 +310,25 @@ SBOX_TESTS_COMMAND int SleepCmd(int argc, wchar_t **argv) {
|
| return SBOX_TEST_SUCCEEDED;
|
| }
|
|
|
| +SBOX_TESTS_COMMAND int AllocateCmd(int argc, wchar_t **argv) {
|
| + if (argc > 2)
|
| + return SBOX_TEST_FAILED_TO_EXECUTE_COMMAND;
|
| +
|
| + size_t mem_size = static_cast<size_t>(_wtoll(argv[0]));
|
| + void* memory = ::VirtualAlloc(NULL, mem_size, MEM_COMMIT | MEM_RESERVE,
|
| + PAGE_READWRITE);
|
| + if (!memory) {
|
| + // If we're testing broker termination we need to wait for it.
|
| + if (argc == 2 && _wcsicmp(argv[1], L"wait") == 0)
|
| + ::Sleep(5000);
|
| + return SBOX_TEST_DENIED;
|
| + }
|
| +
|
| + if (!::VirtualFree(memory, 0, MEM_RELEASE))
|
| + return SBOX_TEST_FAILED;
|
| +
|
| + return SBOX_TEST_SUCCEEDED;
|
| +}
|
| +
|
|
|
| } // namespace sandbox
|
|
|