vbox的更動 60784 路徑 trunk/src/VBox/HostServices
- 時間撮記:
- 2016-5-2 上午11:41:08 (9 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/HostServices/SharedClipboard/VBoxClipboard-win.cpp
r60772 r60784 148 148 { 149 149 /* "OpenClipboard fails if another window has the clipboard open." 150 * So try a few times and wait up to 1 second. 151 */ 152 int rc; 153 154 uint32_t u32SleepMS = 1; 155 int i; 156 for (i = 0; i <= 9; ++i) /* u32SleepMS = [1..512] */ 150 * So try a few times and wait up to 1 second. 151 */ 152 BOOL fOpened = FALSE; 153 154 int i = 0; 155 for (;;) 157 156 { 158 157 if (OpenClipboard(hwnd)) 159 158 { 160 rc = 0;159 fOpened = TRUE; 161 160 break; 162 161 } 163 rc = RTErrConvertFromWin32(GetLastError()); 164 165 RTThreadSleep(u32SleepMS); 166 u32SleepMS <<= 1; 167 } 162 163 if (i >= 10) /* sleep interval = [1..512] ms */ 164 break; 165 166 RTThreadSleep(1 << i); 167 ++i; 168 } 169 168 170 #ifdef LOG_ENABLED 169 171 if (i > 0) 170 LogFlow (("vboxOpenClipboard: %d times tried to open clipboard. \n", ++i));172 LogFlowFunc(("%d times tried to open clipboard.\n", i + 1)); 171 173 #endif 174 175 int rc; 176 if (fOpened) 177 rc = VINF_SUCCESS; 178 else 179 { 180 const DWORD err = GetLastError(); 181 LogFlowFunc(("error %d\n", err)); 182 rc = RTErrConvertFromWin32(err); 183 } 184 172 185 return rc; 173 186 } … … 527 540 * windows is to be destroyed and therefore the guest side becomes inactive. 528 541 */ 529 int res= vboxOpenClipboard(hwnd);530 if (RT_SUCCESS( res))542 int vboxrc = vboxOpenClipboard(hwnd); 543 if (RT_SUCCESS(vboxrc)) 531 544 { 532 545 EmptyClipboard(); … … 536 549 else 537 550 { 538 LogFlow(("vboxClipboardWndProc: WM_RENDERALLFORMATS: error in open clipboard. hwnd: %x, rc: %Rrc\n", hwnd, res));551 LogFlow(("vboxClipboardWndProc: WM_RENDERALLFORMATS: error in open clipboard. hwnd: %x, rc: %Rrc\n", hwnd, vboxrc)); 539 552 } 540 553 } break; … … 556 569 Log(("WM_USER u32Formats = %02X\n", u32Formats)); 557 570 558 int res= vboxOpenClipboard(hwnd);559 if (RT_SUCCESS( res))571 int vboxrc = vboxOpenClipboard(hwnd); 572 if (RT_SUCCESS(vboxrc)) 560 573 { 561 574 EmptyClipboard(); … … 595 608 else 596 609 { 597 dprintf(("window proc WM_USER: failed to open clipboard. rc: %Rrc \n", res));610 dprintf(("window proc WM_USER: failed to open clipboard. rc: %Rrc\n", vboxrc)); 598 611 } 599 612 } break; … … 874 887 else 875 888 { 876 dprintf(("vboxClipboardReadData: failed to open clipboard, rc: %Rrc 889 dprintf(("vboxClipboardReadData: failed to open clipboard, rc: %Rrc\n", rc)); 877 890 } 878 891
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器