- Timestamp:
- Sep 19, 2008 12:57:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r12596 r12599 1 /* $Id$ */ 1 2 /** @file 2 * 3 * VBox frontends: VBoxManage (command-line interface) 4 * 5 * VBoxManage is VirtualBox's command-line interface. This is its rather 6 * long source. 3 * VBoxManage - VirtualBox's command-line interface. 7 4 */ 8 5 … … 7810 7807 } 7811 7808 7812 /** *******************************************************************7813 * list *7814 *********************************************************************/7809 /** 7810 * list * 7811 */ 7815 7812 static int handleMetricsList(int argc, char *argv[], 7816 7813 ComPtr<IVirtualBox> aVirtualBox, … … 7861 7858 } 7862 7859 7863 /** *******************************************************************7864 * setup * 7865 *********************************************************************/7860 /** 7861 * Metics setup 7862 */ 7866 7863 static int handleMetricsSetup(int argc, char *argv[], 7867 7864 ComPtr<IVirtualBox> aVirtualBox, … … 7873 7870 com::SafeIfaceArray<IUnknown> objects; 7874 7871 ULONG period = 1, samples = 1; 7875 bool listMatches = false;7872 /*bool listMatches = false;*/ 7876 7873 int i; 7877 7874 … … 7922 7919 } 7923 7920 7924 /** *******************************************************************7925 * query * 7926 *********************************************************************/7921 /** 7922 * metrics query 7923 */ 7927 7924 static int handleMetricsQuery(int argc, char *argv[], 7928 7925 ComPtr<IVirtualBox> aVirtualBox, … … 8009 8006 } 8010 8007 8011 static bool fKeepGoing = true; 8008 /** Used by the handleMetricsCollect loop. */ 8009 static bool volatile g_fKeepGoing = true; 8012 8010 8013 8011 #ifdef RT_OS_WINDOWS 8014 static bool ctrlHandler(DWORD fdwCtrlType) 8015 { 8016 switch( fdwCtrlType ) 8017 { 8012 /** 8013 * Handler routine for catching Ctrl-C, Ctrl-Break and closing of 8014 * the console. 8015 * 8016 * @returns true if handled, false if not handled. 8017 * @param dwCtrlType The type of control signal. 8018 * 8019 * @remarks This is called on a new thread. 8020 */ 8021 static BOOL WINAPI ctrlHandler(DWORD dwCtrlType) 8022 { 8023 switch (dwCtrlType) 8024 { 8018 8025 /* Ctrl-C or Ctrl-Break or Close */ 8019 8026 case CTRL_C_EVENT: 8020 8027 case CTRL_BREAK_EVENT: 8021 case CTRL_CLOSE_EVENT: 8028 case CTRL_CLOSE_EVENT: 8022 8029 /* Let's shut down gracefully. */ 8023 fKeepGoing = false;8030 ASMAtomicWriteBool(&g_fKeepGoing, true); 8024 8031 return true; 8025 8032 } 8026 8033 /* Don't care about the rest -- let it die a horrible death. */ 8027 8034 return false; 8028 } 8035 } 8029 8036 #endif /* RT_OS_WINDOWS */ 8030 8037 8031 /** *******************************************************************8032 * collect * 8033 *********************************************************************/8038 /** 8039 * collect 8040 */ 8034 8041 static int handleMetricsCollect(int argc, char *argv[], 8035 8042 ComPtr<IVirtualBox> aVirtualBox, … … 8097 8104 8098 8105 #ifdef RT_OS_WINDOWS 8099 SetConsoleCtrlHandler( (PHANDLER_ROUTINE)ctrlHandler, true);8106 SetConsoleCtrlHandler(ctrlHandler, true); 8100 8107 #endif /* RT_OS_WINDOWS */ 8101 8108 8102 8109 RTPrintf("Time stamp Object Metric Value\n"); 8103 8110 8104 while ( fKeepGoing)8111 while (g_fKeepGoing) 8105 8112 { 8106 8113 RTPrintf("------------ ---------- -------------------- --------------------\n"); … … 8157 8164 8158 8165 #ifdef RT_OS_WINDOWS 8159 SetConsoleCtrlHandler( (PHANDLER_ROUTINE)ctrlHandler, false);8166 SetConsoleCtrlHandler(ctrlHandler, false); 8160 8167 #endif /* RT_OS_WINDOWS */ 8161 8168
Note:
See TracChangeset
for help on using the changeset viewer.