vbox的更動 60447 路徑 trunk/src/VBox/Main
- 時間撮記:
- 2016-4-12 上午10:03:09 (9 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/src-server/win/HostDnsServiceWin.cpp
r55224 r60447 65 65 66 66 HostDnsServiceWin::HostDnsServiceWin() 67 : HostDnsMonitor(true), 68 m(NULL) 69 { 70 std::auto_ptr<Data> data(new Data()); 71 LONG lrc; 72 73 lrc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, 74 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 75 0, 76 KEY_READ|KEY_NOTIFY, 77 &data->hKeyTcpipParameters); 78 if (lrc != ERROR_SUCCESS) 79 { 80 LogRel(("HostDnsServiceWin: failed to open key Tcpip\\Parameters (error %d)\n", lrc)); 81 return; 82 } 83 84 for (size_t i = 0; i < DATA_MAX_EVENT; ++i) 85 { 86 HANDLE h; 87 88 if (i == DATA_TIMER) 89 h = CreateWaitableTimer(NULL, FALSE, NULL); 90 else 91 h = CreateEvent(NULL, TRUE, FALSE, NULL); 92 93 if (h == NULL) 94 { 95 LogRel(("HostDnsServiceWin: failed to create event (error %d)\n", GetLastError())); 96 return; 97 } 98 99 data->haDataEvent[i] = h; 100 } 101 102 m = data.release(); 103 } 104 67 : HostDnsMonitor(true) 68 { 69 m = new Data(); 70 } 105 71 106 72 HostDnsServiceWin::~HostDnsServiceWin() … … 115 81 if (m == NULL) 116 82 return E_FAIL; 83 84 { 85 bool res = true; 86 LONG lrc = RegOpenKeyExW(HKEY_LOCAL_MACHINE, 87 L"SYSTEM\\CurrentControlSet\\Services\\Tcpip\\Parameters", 88 0, 89 KEY_READ|KEY_NOTIFY, 90 &m->hKeyTcpipParameters); 91 if (lrc != ERROR_SUCCESS) 92 { 93 LogRel(("HostDnsServiceWin: failed to open key Tcpip\\Parameters (error %d)\n", lrc)); 94 res = false; 95 } 96 else 97 { 98 for (size_t i = 0; i < DATA_MAX_EVENT; ++i) 99 { 100 HANDLE h; 101 102 if (i == DATA_TIMER) 103 h = CreateWaitableTimer(NULL, FALSE, NULL); 104 else 105 h = CreateEvent(NULL, TRUE, FALSE, NULL); 106 107 if (h == NULL) 108 { 109 LogRel(("HostDnsServiceWin: failed to create event (error %d)\n", GetLastError())); 110 res = false; 111 break; 112 } 113 114 m->haDataEvent[i] = h; 115 } 116 } 117 if(!res) 118 return E_FAIL; 119 } 117 120 118 121 HRESULT hrc = HostDnsMonitor::init(virtualbox);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器