OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ | 5 #ifndef SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ |
6 #define SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ | 6 #define SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 | 11 |
11 namespace sandbox { | 12 namespace sandbox { |
12 class BrokerServices; | 13 class BrokerServices; |
13 class SandboxFactory; | |
14 class TargetProcess; | |
15 enum ResultCode; | 14 enum ResultCode; |
16 } | 15 } |
17 | 16 |
18 // Header file for the MainUIWindow, a simple window with a menu bar that | 17 // Header file for the MainUIWindow, a simple window with a menu bar that |
19 // can pop up a dialog (accessible through the menu bar), to specify a path and | 18 // can pop up a dialog (accessible through the menu bar), to specify a path and |
20 // filename of any DLL to load and choose an entry point of his/her choice | 19 // filename of any DLL to load and choose an entry point of his/her choice |
21 // (note: only entry points with no parameters are expected to work). | 20 // (note: only entry points with no parameters are expected to work). |
22 // | 21 // |
23 // The purpose of this is to be able to spawn an EXE inside a SandBox, have it | 22 // The purpose of this is to be able to spawn an EXE inside a SandBox, have it |
24 // load a DLL and call the entry point on it to test how it behaves inside the | 23 // load a DLL and call the entry point on it to test how it behaves inside the |
(...skipping 25 matching lines...) Expand all Loading... |
50 // Creates the main window, displays it and starts the message pump. This | 49 // Creates the main window, displays it and starts the message pump. This |
51 // call will not return until user closes the main UI window that appears | 50 // call will not return until user closes the main UI window that appears |
52 // as a result. Arguments 'instance', 'command_line' and 'show_cmd' can be | 51 // as a result. Arguments 'instance', 'command_line' and 'show_cmd' can be |
53 // passed in directly from winmain. The 'broker' argument is a pointer to a | 52 // passed in directly from winmain. The 'broker' argument is a pointer to a |
54 // BrokerService that will launch a new EXE inside the sandbox and load the | 53 // BrokerService that will launch a new EXE inside the sandbox and load the |
55 // DLL of the user's choice. | 54 // DLL of the user's choice. |
56 unsigned int CreateMainWindowAndLoop(HINSTANCE instance, | 55 unsigned int CreateMainWindowAndLoop(HINSTANCE instance, |
57 wchar_t* command_line, | 56 wchar_t* command_line, |
58 int show_command, | 57 int show_command, |
59 sandbox::BrokerServices* broker); | 58 sandbox::BrokerServices* broker); |
| 59 |
60 private: | 60 private: |
61 // The default value DLL name to add to the edit box. | 61 // The default value DLL name to add to the edit box. |
62 static const wchar_t kDefaultDll_[]; | 62 static const wchar_t kDefaultDll_[]; |
63 | 63 |
64 // The default value to show in the entry point. | 64 // The default value to show in the entry point. |
65 static const wchar_t kDefaultEntryPoint_[]; | 65 static const wchar_t kDefaultEntryPoint_[]; |
66 | 66 |
67 // The default value to show in the log file. | 67 // The default value to show in the log file. |
68 static const wchar_t kDefaultLogFile_[]; | 68 static const wchar_t kDefaultLogFile_[]; |
69 | 69 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // user. | 184 // user. |
185 static HWND list_view_; | 185 static HWND list_view_; |
186 | 186 |
187 // Pipe used to communicate the logs between the target and the broker. | 187 // Pipe used to communicate the logs between the target and the broker. |
188 HANDLE pipe_handle_; | 188 HANDLE pipe_handle_; |
189 | 189 |
190 DISALLOW_COPY_AND_ASSIGN(MainUIWindow); | 190 DISALLOW_COPY_AND_ASSIGN(MainUIWindow); |
191 }; | 191 }; |
192 | 192 |
193 #endif // SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ | 193 #endif // SANDBOX_SANDBOX_POC_MAIN_UI_WINDOW_H__ |
OLD | NEW |