- Timestamp:
- Jul 19, 2007 4:08:54 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vrdpapi.h
r3633 r3720 906 906 */ 907 907 DECLCALLBACKMEMBER(void, VRDPCallbackInput)(void *pvCallback, 908 int type, 908 909 const void *pvInput, 909 910 unsigned cbInput); … … 946 947 HVRDPSERVER *phServer); 947 948 948 949 typedef VRDPDECL(int) FNVRDPCREATESERVER (const VRDPINTERFACEHDR *pCallbacks, 950 void *pvCallback, 951 VRDPINTERFACEHDR **ppEntryPoints, 952 HVRDPSERVER *phServer); 953 typedef FNVRDPCREATESERVER *PFNVRDPCREATESERVER; 949 954 #else 950 955 /** -
trunk/src/VBox/Main/ConsoleImpl.cpp
r3668 r3720 441 441 } 442 442 443 #ifdef VRDP_NO_COM 444 int Console::VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain) 445 #else 443 446 DECLCALLBACK(int) Console::vrdp_ClientLogon (void *pvUser, 444 447 uint32_t u32ClientId, … … 446 449 const char *pszPassword, 447 450 const char *pszDomain) 451 #endif /* VRDP_NO_COM */ 448 452 { 449 453 LogFlowFuncEnter(); 450 454 LogFlowFunc (("%d, %s, %s, %s\n", u32ClientId, pszUser, pszPassword, pszDomain)); 451 455 456 #ifdef VRDP_NO_COM 457 Console *console = this; 458 #else 452 459 Console *console = static_cast <Console *> (pvUser); 460 #endif /* VRDP_NO_COM */ 453 461 AssertReturn (console, VERR_INVALID_POINTER); 454 462 … … 617 625 } 618 626 627 #ifdef VRDP_NO_COM 628 void Console::VRDPClientConnect (uint32_t u32ClientId) 629 #else 619 630 DECLCALLBACK(void) Console::vrdp_ClientConnect (void *pvUser, 620 631 uint32_t u32ClientId) 632 #endif /* VRDP_NO_COM */ 621 633 { 622 634 LogFlowFuncEnter(); 623 635 636 #ifdef VRDP_NO_COM 637 Console *console = this; 638 #else 624 639 Console *console = static_cast <Console *> (pvUser); 640 #endif /* VRDP_NO_COM */ 625 641 AssertReturnVoid (console); 626 642 … … 639 655 } 640 656 657 #ifdef VRDP_NO_COM 658 void Console::VRDPClientDisconnect (uint32_t u32ClientId, 659 uint32_t fu32Intercepted) 660 #else 641 661 DECLCALLBACK(void) Console::vrdp_ClientDisconnect (void *pvUser, 642 662 uint32_t u32ClientId, 643 663 uint32_t fu32Intercepted) 664 #endif /* VRDP_NO_COM */ 644 665 { 645 666 LogFlowFuncEnter(); 646 667 668 #ifdef VRDP_NO_COM 669 Console *console = this; 670 #else 647 671 Console *console = static_cast <Console *> (pvUser); 672 #endif /* VRDP_NO_COM */ 648 673 AssertReturnVoid (console); 649 674 … … 703 728 } 704 729 730 #ifdef VRDP_NO_COM 731 void Console::VRDPInterceptAudio (uint32_t u32ClientId) 732 #else 705 733 DECLCALLBACK(void) Console::vrdp_InterceptAudio (void *pvUser, 706 734 uint32_t u32ClientId) 735 #endif /* VRDP_NO_COM */ 707 736 { 708 737 LogFlowFuncEnter(); 709 738 739 #ifdef VRDP_NO_COM 740 Console *console = this; 741 #else 710 742 Console *console = static_cast <Console *> (pvUser); 743 #endif /* VRDP_NO_COM */ 711 744 AssertReturnVoid (console); 712 745 … … 738 771 } 739 772 773 #ifdef VRDP_NO_COM 774 void Console::VRDPInterceptUSB (uint32_t u32ClientId) 775 #else 740 776 DECLCALLBACK(void) Console::vrdp_InterceptUSB (void *pvUser, 741 777 uint32_t u32ClientId, 742 778 PFNVRDPUSBCALLBACK *ppfn, 743 779 void **ppv) 780 #endif /* VRDP_NO_COM */ 744 781 { 745 782 LogFlowFuncEnter(); 746 783 784 #ifdef VRDP_NO_COM 785 Console *console = this; 786 #else 747 787 Console *console = static_cast <Console *> (pvUser); 788 #endif /* VRDP_NO_COM */ 748 789 AssertReturnVoid (console); 749 790 … … 753 794 AssertReturnVoid (console->mConsoleVRDPServer); 754 795 796 #ifdef VRDP_NO_COM 797 mConsoleVRDPServer->USBBackendCreate (u32ClientId); 798 #else 755 799 console->mConsoleVRDPServer->USBBackendCreate (u32ClientId, ppfn, ppv); 800 #endif /* VRDP_NO_COM */ 756 801 757 802 LogFlowFuncLeave(); … … 759 804 } 760 805 806 #ifdef VRDP_NO_COM 807 void Console::VRDPInterceptClipboard (uint32_t u32ClientId) 808 #else 761 809 DECLCALLBACK(void) Console::vrdp_InterceptClipboard (void *pvUser, 762 810 uint32_t u32ClientId, 763 811 PFNVRDPCLIPBOARDCALLBACK *ppfn, 764 812 void **ppv) 813 #endif /* VRDP_NO_COM */ 765 814 { 766 815 LogFlowFuncEnter(); 767 816 817 #ifdef VRDP_NO_COM 818 Console *console = this; 819 #else 768 820 Console *console = static_cast <Console *> (pvUser); 821 #endif /* VRDP_NO_COM */ 769 822 AssertReturnVoid (console); 770 823 … … 775 828 776 829 #ifdef VBOX_VRDP 830 #ifdef VRDP_NO_COM 831 mConsoleVRDPServer->ClipboardCreate (u32ClientId); 832 #else 777 833 console->mConsoleVRDPServer->ClipboardCreate (u32ClientId, ppfn, ppv); 834 #endif /* VRDP_NO_COM */ 778 835 #endif /* VBOX_VRDP */ 779 836 … … 783 840 784 841 842 #ifdef VRDP_NO_COM 843 #else 785 844 // static 786 845 VRDPSERVERCALLBACK Console::sVrdpServerCallback = … … 793 852 vrdp_InterceptClipboard 794 853 }; 854 #endif /* VRDP_NO_COM */ 795 855 796 856 //static … … 3134 3194 else 3135 3195 { 3196 #ifdef VRDP_NO_COM 3197 mConsoleVRDPServer->EnableConnections (); 3198 #else 3136 3199 mConsoleVRDPServer->SetCallback (); 3200 #endif /* VRDP_NO_COM */ 3137 3201 } 3138 3202 } … … 6711 6775 /* Enable client connections to the server. */ 6712 6776 ConsoleVRDPServer *server = console->consoleVRDPServer(); 6777 #ifdef VRDP_NO_COM 6778 server->EnableConnections (); 6779 #else 6713 6780 server->SetCallback (); 6781 #endif /* VRDP_NO_COM */ 6714 6782 } 6715 6783 #endif /* VBOX_VRDP */ -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r3692 r3720 23 23 #include "ConsoleImpl.h" 24 24 #include "DisplayImpl.h" 25 #ifdef VRDP_NO_COM 26 #include "KeyboardImpl.h" 27 #include "MouseImpl.h" 28 #include <VBox/VRDPOrders.h> 29 #endif /* VRDP_NO_COM */ 25 30 26 31 #include "Logging.h" … … 31 36 #include <VBox/err.h> 32 37 38 #ifdef VRDP_NO_COM 39 class VRDPConsoleCallback : public IConsoleCallback 40 { 41 public: 42 VRDPConsoleCallback (ConsoleVRDPServer *server) : 43 m_server(server) 44 { 45 #ifndef VBOX_WITH_XPCOM 46 refcnt = 0; 47 #endif /* !VBOX_WITH_XPCOM */ 48 } 49 50 virtual ~VRDPConsoleCallback() {} 51 52 NS_DECL_ISUPPORTS 53 54 #ifndef VBOX_WITH_XPCOM 55 STDMETHOD_(ULONG, AddRef)() { 56 return ::InterlockedIncrement (&refcnt); 57 } 58 STDMETHOD_(ULONG, Release)() 59 { 60 long cnt = ::InterlockedDecrement (&refcnt); 61 if (cnt == 0) 62 delete this; 63 return cnt; 64 } 65 STDMETHOD(QueryInterface) (REFIID riid , void **ppObj) 66 { 67 if (riid == IID_IUnknown) { 68 *ppObj = this; 69 AddRef(); 70 return S_OK; 71 } 72 if (riid == IID_IConsoleCallback) { 73 *ppObj = this; 74 AddRef(); 75 return S_OK; 76 } 77 *ppObj = NULL; 78 return E_NOINTERFACE; 79 } 80 #endif /* !VBOX_WITH_XPCOM */ 81 82 83 STDMETHOD(OnMousePointerShapeChange)(BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 84 ULONG width, ULONG height, BYTE *shape); 85 86 STDMETHOD(OnMouseCapabilityChange)(BOOL supportsAbsolute, BOOL needsHostCursor) 87 { 88 if (m_server) 89 { 90 m_server->NotifyAbsoluteMouse(!!supportsAbsolute); 91 } 92 return S_OK; 93 } 94 95 STDMETHOD(OnStateChange)(MachineState_T machineState) 96 { 97 return S_OK; 98 } 99 100 STDMETHOD(OnAdditionsStateChange)() 101 { 102 return S_OK; 103 } 104 105 STDMETHOD(OnKeyboardLedsChange)(BOOL fNumLock, BOOL fCapsLock, BOOL fScrollLock) 106 { 107 return S_OK; 108 } 109 110 STDMETHOD(OnUSBDeviceStateChange)(IUSBDevice *device, BOOL attached, 111 IVirtualBoxErrorInfo *message) 112 { 113 return S_OK; 114 } 115 116 STDMETHOD(OnRuntimeError)(BOOL fatal, INPTR BSTR id, INPTR BSTR message) 117 { 118 return S_OK; 119 } 120 121 STDMETHOD(OnCanShowWindow)(BOOL *canShow) 122 { 123 if (!canShow) 124 return E_POINTER; 125 /* we don't manage window activation here: always agree */ 126 *canShow = TRUE; 127 return S_OK; 128 } 129 130 STDMETHOD(OnShowWindow) (ULONG64 *winId) 131 { 132 if (!winId) 133 return E_POINTER; 134 /* we don't manage window activation here */ 135 *winId = 0; 136 return S_OK; 137 } 138 139 private: 140 ConsoleVRDPServer *m_server; 141 #ifndef VBOX_WITH_XPCOM 142 long refcnt; 143 #endif /* !VBOX_WITH_XPCOM */ 144 }; 145 146 #ifdef VBOX_WITH_XPCOM 147 #include <nsMemory.h> 148 NS_DECL_CLASSINFO(VRDPConsoleCallback) 149 NS_IMPL_ISUPPORTS1_CI(VRDPConsoleCallback, IConsoleCallback) 150 #endif /* VBOX_WITH_XPCOM */ 151 152 static void findTopLeftBorder (uint8_t *pu8Shape, uint32_t width, uint32_t height, uint32_t *pxSkip, uint32_t *pySkip) 153 { 154 /* 155 * Find the top border of the AND mask. First assign to special value. 156 */ 157 uint32_t ySkipAnd = ~0; 158 159 uint8_t *pu8And = pu8Shape; 160 const uint32_t cbAndRow = (width + 7) / 8; 161 const uint8_t maskLastByte = (uint8_t)( 0xFF << (cbAndRow * 8 - width) ); 162 163 Assert(cbAndRow > 0); 164 165 unsigned y; 166 unsigned x; 167 168 for (y = 0; y < height && ySkipAnd == ~(uint32_t)0; y++, pu8And += cbAndRow) 169 { 170 /* For each complete byte in the row. */ 171 for (x = 0; x < cbAndRow - 1; x++) 172 { 173 if (pu8And[x] != 0xFF) 174 { 175 ySkipAnd = y; 176 break; 177 } 178 } 179 180 if (ySkipAnd == ~(uint32_t)0) 181 { 182 /* Last byte. */ 183 if ((pu8And[cbAndRow - 1] & maskLastByte) != maskLastByte) 184 { 185 ySkipAnd = y; 186 } 187 } 188 } 189 190 if (ySkipAnd == ~(uint32_t)0) 191 { 192 ySkipAnd = 0; 193 } 194 195 /* 196 * Find the left border of the AND mask. 197 */ 198 uint32_t xSkipAnd = ~0; 199 200 /* For all bit columns. */ 201 for (x = 0; x < width && xSkipAnd == ~(uint32_t)0; x++) 202 { 203 pu8And = pu8Shape + x/8; /* Currently checking byte. */ 204 uint8_t mask = 1 << (7 - x%8); /* Currently checking bit in the byte. */ 205 206 for (y = ySkipAnd; y < height; y++, pu8And += cbAndRow) 207 { 208 if ((*pu8And & mask) == 0) 209 { 210 xSkipAnd = x; 211 break; 212 } 213 } 214 } 215 216 if (xSkipAnd == ~(uint32_t)0) 217 { 218 xSkipAnd = 0; 219 } 220 221 /* 222 * Find the XOR mask top border. 223 */ 224 uint32_t ySkipXor = ~0; 225 226 uint32_t *pu32XorStart = (uint32_t *)( pu8Shape + ((cbAndRow * height + 3) & ~3) ); 227 228 uint32_t *pu32Xor = pu32XorStart; 229 230 for (y = 0; y < height && ySkipXor == ~(uint32_t)0; y++, pu32Xor += width) 231 { 232 for (x = 0; x < width; x++) 233 { 234 if (pu32Xor[x] != 0) 235 { 236 ySkipXor = y; 237 break; 238 } 239 } 240 } 241 242 if (ySkipXor == ~(uint32_t)0) 243 { 244 ySkipXor = 0; 245 } 246 247 /* 248 * Find the left border of the XOR mask. 249 */ 250 uint32_t xSkipXor = ~(uint32_t)0; 251 252 /* For all columns. */ 253 for (x = 0; x < width && xSkipXor == ~(uint32_t)0; x++) 254 { 255 pu32Xor = pu32XorStart + x; /* Currently checking dword. */ 256 257 for (y = ySkipXor; y < height; y++, pu32Xor += width) 258 { 259 if (*pu32Xor != 0) 260 { 261 xSkipXor = x; 262 break; 263 } 264 } 265 } 266 267 if (xSkipXor == ~(uint32_t)0) 268 { 269 xSkipXor = 0; 270 } 271 272 *pxSkip = RT_MIN (xSkipAnd, xSkipXor); 273 *pySkip = RT_MIN (ySkipAnd, ySkipXor); 274 } 275 276 277 STDMETHODIMP VRDPConsoleCallback::OnMousePointerShapeChange (BOOL visible, BOOL alpha, ULONG xHot, ULONG yHot, 278 ULONG width, ULONG height, BYTE *shape) 279 { 280 Log(("VRDPConsoleCallback::OnMousePointerShapeChange: %d, %d, %dx%d, @%d,%d\n", visible, alpha, width, height, xHot, yHot)); 281 282 if (m_server) 283 { 284 if (!shape) 285 { 286 if (!visible) 287 { 288 m_server->MousePointerHide (); 289 } 290 } 291 else if (width != 0 && height != 0) 292 { 293 /* Pointer consists of 1 bpp AND and 24 BPP XOR masks. 294 * 'shape' AND mask followed by XOR mask. 295 * XOR mask contains 32 bit (lsb)BGR0(msb) values. 296 * 297 * We convert this to RDP color format which consist of 298 * one bpp AND mask and 24 BPP (BGR) color XOR image. 299 * 300 * RDP clients expect 8 aligned width and height of 301 * pointer (preferably 32x32). 302 * 303 * They even contain bugs which do not appear for 304 * 32x32 pointers but would appear for a 41x32 one. 305 * 306 * So set pointer size to 32x32. This can be done safely 307 * because most pointers are 32x32. 308 */ 309 310 /* Windows guest alpha pointers are wider than 32 pixels. 311 * Try to find out the top-left border of the pointer and 312 * then copy only meaningful bits. All complete top rows 313 * and all complete left columns where (AND == 1 && XOR == 0) 314 * are skipped. Hot spot is adjusted. 315 */ 316 uint32_t ySkip = 0; /* How many rows to skip at the top. */ 317 uint32_t xSkip = 0; /* How many columns to skip at the left. */ 318 319 findTopLeftBorder (shape, width, height, &xSkip, &ySkip); 320 321 /* Must not skip the hot spot. */ 322 xSkip = RT_MIN (xSkip, xHot); 323 ySkip = RT_MIN (ySkip, yHot); 324 325 /* 326 * Compute size and allocate memory for the pointer. 327 */ 328 const uint32_t dstwidth = 32; 329 const uint32_t dstheight = 32; 330 331 VRDPCOLORPOINTER *pointer = NULL; 332 333 uint32_t dstmaskwidth = (dstwidth + 7) / 8; 334 335 uint32_t rdpmaskwidth = dstmaskwidth; 336 uint32_t rdpmasklen = dstheight * rdpmaskwidth; 337 338 uint32_t rdpdatawidth = dstwidth * 3; 339 uint32_t rdpdatalen = dstheight * rdpdatawidth; 340 341 pointer = (VRDPCOLORPOINTER *)RTMemTmpAlloc (sizeof (VRDPCOLORPOINTER) + rdpmasklen + rdpdatalen); 342 343 if (pointer) 344 { 345 uint8_t *maskarray = (uint8_t *)pointer + sizeof (VRDPCOLORPOINTER); 346 uint8_t *dataarray = maskarray + rdpmasklen; 347 348 memset (maskarray, 0xFF, rdpmasklen); 349 memset (dataarray, 0x00, rdpdatalen); 350 351 uint32_t srcmaskwidth = (width + 7) / 8; 352 uint32_t srcdatawidth = width * 4; 353 354 /* Copy AND mask. */ 355 uint8_t *src = shape + ySkip * srcmaskwidth; 356 uint8_t *dst = maskarray + (dstheight - 1) * rdpmaskwidth; 357 358 uint32_t minheight = RT_MIN (height - ySkip, dstheight); 359 uint32_t minwidth = RT_MIN (width - xSkip, dstwidth); 360 361 unsigned x, y; 362 363 for (y = 0; y < minheight; y++) 364 { 365 for (x = 0; x < minwidth; x++) 366 { 367 uint32_t byteIndex = (x + xSkip) / 8; 368 uint32_t bitIndex = (x + xSkip) % 8; 369 370 bool bit = (src[byteIndex] & (1 << (7 - bitIndex))) != 0; 371 372 if (!bit) 373 { 374 byteIndex = x / 8; 375 bitIndex = x % 8; 376 377 dst[byteIndex] &= ~(1 << (7 - bitIndex)); 378 } 379 } 380 381 src += srcmaskwidth; 382 dst -= rdpmaskwidth; 383 } 384 385 /* Point src to XOR mask */ 386 src = shape + ((srcmaskwidth * height + 3) & ~3) + ySkip * srcdatawidth; 387 dst = dataarray + (dstheight - 1) * rdpdatawidth; 388 389 for (y = 0; y < minheight ; y++) 390 { 391 for (x = 0; x < minwidth; x++) 392 { 393 memcpy (dst + x * 3, &src[4 * (x + xSkip)], 3); 394 } 395 396 src += srcdatawidth; 397 dst -= rdpdatawidth; 398 } 399 400 pointer->u16HotX = (uint16_t)(xHot - xSkip); 401 pointer->u16HotY = (uint16_t)(yHot - ySkip); 402 403 pointer->u16Width = (uint16_t)dstwidth; 404 pointer->u16Height = (uint16_t)dstheight; 405 406 pointer->u16MaskLen = (uint16_t)rdpmasklen; 407 pointer->u16DataLen = (uint16_t)rdpdatalen; 408 409 m_server->MousePointerUpdate (pointer); 410 411 RTMemTmpFree (pointer); 412 } 413 } 414 } 415 416 return S_OK; 417 } 418 #endif /* VRDP_NO_COM */ 419 33 420 34 421 // ConsoleVRDPServer … … 37 424 #ifdef VBOX_VRDP 38 425 RTLDRMOD ConsoleVRDPServer::mVRDPLibrary; 426 427 #ifdef VRDP_NO_COM 428 PFNVRDPCREATESERVER ConsoleVRDPServer::mpfnVRDPCreateServer = NULL; 429 430 VRDPENTRYPOINTS_1 *ConsoleVRDPServer::mpEntryPoints = NULL; 431 432 VRDPCALLBACKS_1 ConsoleVRDPServer::mCallbacks = 433 { 434 { VRDP_INTERFACE_VERSION_1, sizeof (VRDPCALLBACKS_1) }, 435 ConsoleVRDPServer::VRDPCallbackQueryProperty, 436 ConsoleVRDPServer::VRDPCallbackClientLogon, 437 ConsoleVRDPServer::VRDPCallbackClientConnect, 438 ConsoleVRDPServer::VRDPCallbackClientDisconnect, 439 ConsoleVRDPServer::VRDPCallbackIntercept, 440 ConsoleVRDPServer::VRDPCallbackUSB, 441 ConsoleVRDPServer::VRDPCallbackClipboard, 442 ConsoleVRDPServer::VRDPCallbackFramebufferQuery, 443 ConsoleVRDPServer::VRDPCallbackFramebufferLock, 444 ConsoleVRDPServer::VRDPCallbackFramebufferUnlock, 445 ConsoleVRDPServer::VRDPCallbackInput, 446 ConsoleVRDPServer::VRDPCallbackVideoModeHint 447 }; 448 #else 39 449 int (VBOXCALL *ConsoleVRDPServer::mpfnVRDPStartServer) (IConsole *pConsole, IVRDPServer *pVRDPServer, HVRDPSERVER *phServer); 40 450 int (VBOXCALL *ConsoleVRDPServer::mpfnVRDPSetFramebuffer) (HVRDPSERVER hServer, IFramebuffer *pFramebuffer, uint32_t fFlags); … … 49 459 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPQueryInfo) (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut); 50 460 void (VBOXCALL *ConsoleVRDPServer::mpfnVRDPClipboard) (HVRDPSERVER hserver, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData, uint32_t *pcbActualRead); 461 #endif /* VRDP_NO_COM */ 51 462 #endif /* VBOX_VRDP */ 463 464 #ifdef VRDP_NO_COM 465 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackQueryProperty (void *pvCallback, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut) 466 { 467 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 468 469 int rc = VERR_NOT_SUPPORTED; 470 471 switch (index) 472 { 473 case VRDP_QP_NETWORK_PORT: 474 { 475 ULONG port = 0; 476 server->mConsole->getVRDPServer ()->COMGETTER(Port) (&port); 477 if (port == 0) 478 { 479 port = VRDP_DEFAULT_PORT; 480 } 481 482 if (cbBuffer >= sizeof (uint32_t)) 483 { 484 *(uint32_t *)pvBuffer = (uint32_t)port; 485 rc = VINF_SUCCESS; 486 } 487 else 488 { 489 rc = VINF_BUFFER_OVERFLOW; 490 } 491 492 *pcbOut = sizeof (uint32_t); 493 } break; 494 495 case VRDP_QP_NETWORK_ADDRESS: 496 { 497 com::Bstr address; 498 server->mConsole->getVRDPServer ()->COMGETTER(NetAddress) (address.asOutParam()); 499 500 if (cbBuffer >= address.length ()) 501 { 502 if (address.length () > 0) 503 { 504 memcpy (pvBuffer, address.raw(), address.length ()); 505 } 506 rc = VINF_SUCCESS; 507 } 508 509 *pcbOut = address.length (); 510 } break; 511 512 case VRDP_QP_NUMBER_MONITORS: 513 { 514 ULONG cMonitors = 1; 515 516 server->mConsole->machine ()->COMGETTER(MonitorCount)(&cMonitors); 517 518 if (cbBuffer >= sizeof (uint32_t)) 519 { 520 *(uint32_t *)pvBuffer = (uint32_t)cMonitors; 521 rc = VINF_SUCCESS; 522 } 523 else 524 { 525 rc = VINF_BUFFER_OVERFLOW; 526 } 527 528 *pcbOut = sizeof (uint32_t); 529 } break; 530 531 default: 532 break; 533 } 534 535 return rc; 536 } 537 538 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClientLogon (void *pvCallback, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain) 539 { 540 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 541 542 return server->mConsole->VRDPClientLogon (u32ClientId, pszUser, pszPassword, pszDomain); 543 } 544 545 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackClientConnect (void *pvCallback, uint32_t u32ClientId) 546 { 547 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 548 549 server->mConsole->VRDPClientConnect (u32ClientId); 550 } 551 552 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackClientDisconnect (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercepted) 553 { 554 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 555 556 server->mConsole->VRDPClientDisconnect (u32ClientId, fu32Intercepted); 557 } 558 559 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackIntercept (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercept, void **ppvIntercept) 560 { 561 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 562 563 int rc = VERR_NOT_SUPPORTED; 564 565 switch (fu32Intercept) 566 { 567 case VRDP_CLIENT_INTERCEPT_AUDIO: 568 { 569 server->mConsole->VRDPInterceptAudio (u32ClientId); 570 rc = VINF_SUCCESS; 571 } break; 572 573 case VRDP_CLIENT_INTERCEPT_USB: 574 { 575 server->mConsole->VRDPInterceptUSB (u32ClientId); 576 rc = VINF_SUCCESS; 577 } break; 578 579 case VRDP_CLIENT_INTERCEPT_CLIPBOARD: 580 { 581 server->mConsole->VRDPInterceptClipboard (u32ClientId); 582 rc = VINF_SUCCESS; 583 } break; 584 585 default: 586 break; 587 } 588 589 if (VBOX_SUCCESS (rc)) 590 { 591 if (ppvIntercept) 592 { 593 *ppvIntercept = server; 594 } 595 } 596 597 return rc; 598 } 599 600 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackUSB (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint8_t u8Code, const void *pvRet, uint32_t cbRet) 601 { 602 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 603 604 return USBClientResponseCallback (pvIntercept, u32ClientId, u8Code, pvRet, cbRet); 605 } 606 607 DECLCALLBACK(int) ConsoleVRDPServer::VRDPCallbackClipboard (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData) 608 { 609 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 610 611 return ClipboardCallback (pvIntercept, u32ClientId, u32Function, u32Format, pvData, cbData); 612 } 613 614 DECLCALLBACK(bool) ConsoleVRDPServer::VRDPCallbackFramebufferQuery (void *pvCallback, unsigned uScreenId, VRDPFRAMEBUFFERINFO *pInfo) 615 { 616 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 617 618 bool fAvailable = false; 619 620 IFramebuffer *pfb = NULL; 621 LONG xOrigin = 0; 622 LONG yOrigin = 0; 623 624 server->mConsole->getDisplay ()->GetFramebuffer (uScreenId, &pfb, &xOrigin, &yOrigin); 625 626 if (pfb) 627 { 628 pfb->Lock (); 629 630 /* Query framebuffer parameters. */ 631 ULONG lineSize = 0; 632 pfb->COMGETTER(LineSize) (&lineSize); 633 634 ULONG bitsPerPixel = 0; 635 pfb->COMGETTER(ColorDepth) (&bitsPerPixel); 636 637 BYTE *address = NULL; 638 pfb->COMGETTER(Address) (&address); 639 640 ULONG height = 0; 641 pfb->COMGETTER(Height) (&height); 642 643 ULONG width = 0; 644 pfb->COMGETTER(Width) (&width); 645 646 /* Now fill the information as requested by the caller. */ 647 pInfo->pu8Bits = address; 648 pInfo->xOrigin = xOrigin; 649 pInfo->yOrigin = yOrigin; 650 pInfo->cWidth = width; 651 pInfo->cHeight = height; 652 pInfo->cBitsPerPixel = bitsPerPixel; 653 pInfo->cbLine = lineSize; 654 655 pfb->Unlock (); 656 657 fAvailable = true; 658 } 659 660 if (server->maFramebuffers[uScreenId]) 661 { 662 server->maFramebuffers[uScreenId]->Release (); 663 } 664 server->maFramebuffers[uScreenId] = pfb; 665 666 return fAvailable; 667 } 668 669 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackFramebufferLock (void *pvCallback, unsigned uScreenId) 670 { 671 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 672 673 if (server->maFramebuffers[uScreenId]) 674 { 675 server->maFramebuffers[uScreenId]->Lock (); 676 } 677 } 678 679 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackFramebufferUnlock (void *pvCallback, unsigned uScreenId) 680 { 681 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 682 683 if (server->maFramebuffers[uScreenId]) 684 { 685 server->maFramebuffers[uScreenId]->Unlock (); 686 } 687 } 688 689 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackInput (void *pvCallback, int type, const void *pvInput, unsigned cbInput) 690 { 691 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 692 Console *pConsole = server->mConsole; 693 694 switch (type) 695 { 696 case VRDP_INPUT_SCANCODE: 697 { 698 if (cbInput == sizeof (VRDPINPUTSCANCODE)) 699 { 700 const VRDPINPUTSCANCODE *pInputScancode = (VRDPINPUTSCANCODE *)pvInput; 701 pConsole->getKeyboard ()->PutScancode((LONG)pInputScancode->uScancode); 702 } 703 } break; 704 705 case VRDP_INPUT_POINT: 706 { 707 if (cbInput == sizeof (VRDPINPUTPOINT)) 708 { 709 const VRDPINPUTPOINT *pInputPoint = (VRDPINPUTPOINT *)pvInput; 710 711 int mouseButtons = 0; 712 int iWheel = 0; 713 714 if (pInputPoint->uButtons & VRDP_INPUT_POINT_BUTTON1) 715 { 716 mouseButtons |= MouseButtonState_LeftButton; 717 } 718 if (pInputPoint->uButtons & VRDP_INPUT_POINT_BUTTON2) 719 { 720 mouseButtons |= MouseButtonState_RightButton; 721 } 722 if (pInputPoint->uButtons & VRDP_INPUT_POINT_BUTTON3) 723 { 724 mouseButtons |= MouseButtonState_MiddleButton; 725 } 726 if (pInputPoint->uButtons & VRDP_INPUT_POINT_WHEEL_UP) 727 { 728 mouseButtons |= MouseButtonState_WheelUp; 729 iWheel = -1; 730 } 731 if (pInputPoint->uButtons & VRDP_INPUT_POINT_WHEEL_DOWN) 732 { 733 mouseButtons |= MouseButtonState_WheelDown; 734 iWheel = 1; 735 } 736 737 if (server->m_fGuestWantsAbsolute) 738 { 739 pConsole->getMouse()->PutMouseEventAbsolute (pInputPoint->x + 1, pInputPoint->y + 1, iWheel, mouseButtons); 740 } else 741 { 742 pConsole->getMouse()->PutMouseEvent (pInputPoint->x - server->m_mousex, 743 pInputPoint->y - server->m_mousey, 744 iWheel, mouseButtons); 745 server->m_mousex = pInputPoint->x; 746 server->m_mousey = pInputPoint->y; 747 } 748 } 749 } break; 750 751 case VRDP_INPUT_CAD: 752 { 753 pConsole->getKeyboard ()->PutCAD(); 754 } break; 755 756 case VRDP_INPUT_RESET: 757 { 758 pConsole->Reset(); 759 } break; 760 761 default: 762 break; 763 } 764 } 765 766 DECLCALLBACK(void) ConsoleVRDPServer::VRDPCallbackVideoModeHint (void *pvCallback, unsigned cWidth, unsigned cHeight, unsigned cBitsPerPixel, unsigned uScreenId) 767 { 768 ConsoleVRDPServer *server = static_cast <ConsoleVRDPServer *> (pvCallback); 769 770 server->mConsole->getDisplay ()->SetVideoModeHint(cWidth, cHeight, cBitsPerPixel, uScreenId); 771 } 772 #endif /* VRDP_NO_COM */ 52 773 53 774 ConsoleVRDPServer::ConsoleVRDPServer (Console *console) … … 72 793 #ifdef VBOX_VRDP 73 794 mhServer = 0; 74 #endif 795 796 #ifdef VRDP_NO_COM 797 m_fGuestWantsAbsolute = false; 798 m_mousex = 0; 799 m_mousey = 0; 800 801 memset (maFramebuffers, 0, sizeof (maFramebuffers)); 802 803 mConsoleCallback = new VRDPConsoleCallback(this); 804 mConsoleCallback->AddRef(); 805 console->RegisterCallback(mConsoleCallback); 806 #endif /* VRDP_NO_COM */ 807 #endif /* VBOX_VRDP */ 75 808 76 809 mAuthLibrary = 0; … … 81 814 Stop (); 82 815 816 #ifdef VRDP_NO_COM 817 if (mConsoleCallback) 818 { 819 mConsole->UnregisterCallback(mConsoleCallback); 820 mConsoleCallback->Release(); 821 mConsoleCallback = NULL; 822 } 823 824 int i; 825 for (i = 0; i < ELEMENTS(maFramebuffers); i++) 826 { 827 if (maFramebuffers[i]) 828 { 829 maFramebuffers[i]->Release (); 830 maFramebuffers[i] = NULL; 831 } 832 } 833 #endif /* VRDP_NO_COM */ 83 834 if (RTCritSectIsInitialized (&mCritSect)) 84 835 { … … 104 855 && loadVRDPLibrary ()) 105 856 { 857 #ifdef VRDP_NO_COM 858 rc = mpfnVRDPCreateServer (&mCallbacks.header, this, (VRDPINTERFACEHDR **)&mpEntryPoints, &mhServer); 859 #else 106 860 rc = mpfnVRDPStartServer(mConsole, vrdpserver, &mhServer); 861 #endif /* VRDP_NO_COM */ 107 862 108 863 if (VBOX_SUCCESS(rc)) … … 117 872 #else 118 873 int rc = VERR_NOT_SUPPORTED; 119 #endif 874 #endif /* VBOX_VRDP */ 120 875 return rc; 121 876 } 122 877 878 #ifdef VRDP_NO_COM 879 void ConsoleVRDPServer::EnableConnections (void) 880 { 881 #ifdef VBOX_VRDP 882 if (mpEntryPoints) 883 { 884 mpEntryPoints->VRDPEnableConnections (mhServer, true); 885 } 886 #endif /* VBOX_VRDP */ 887 } 888 889 void ConsoleVRDPServer::MousePointerUpdate (const VRDPCOLORPOINTER *pPointer) 890 { 891 #ifdef VBOX_VRDP 892 if (mpEntryPoints) 893 { 894 mpEntryPoints->VRDPColorPointer (mhServer, pPointer); 895 } 896 #endif /* VBOX_VRDP */ 897 } 898 899 void ConsoleVRDPServer::MousePointerHide (void) 900 { 901 #ifdef VBOX_VRDP 902 if (mpEntryPoints) 903 { 904 mpEntryPoints->VRDPHidePointer (mhServer); 905 } 906 #endif /* VBOX_VRDP */ 907 } 908 #else 123 909 void ConsoleVRDPServer::SetCallback (void) 124 910 { … … 129 915 mpfnVRDPSetCallback (mhServer, mConsole->getVrdpServerCallback (), mConsole); 130 916 } 131 #endif 132 } 917 #endif /* VBOX_VRDP */ 918 } 919 #endif /* VRDP_NO_COM */ 133 920 134 921 void ConsoleVRDPServer::Stop (void) … … 144 931 mhServer = 0; 145 932 933 #ifdef VRDP_NO_COM 934 if (mpEntryPoints) 935 { 936 mpEntryPoints->VRDPDestroy (mhServer); 937 } 938 #else 146 939 mpfnVRDPShutdownServer (hServer); 147 } 148 #endif 940 #endif /* VRDP_NO_COM */ 941 } 942 #endif /* VBOX_VRDP */ 149 943 150 944 #ifdef VBOX_WITH_USB … … 487 1281 { 488 1282 /* The guest announces clipboard formats. This must be delivered to all clients. */ 1283 #ifdef VRDP_NO_COM 1284 if (mpEntryPoints) 1285 { 1286 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1287 VRDP_CLIPBOARD_FUNCTION_FORMAT_ANNOUNCE, 1288 pParms->u32Format, 1289 NULL, 1290 0, 1291 NULL); 1292 } 1293 #else 489 1294 if (mpfnVRDPClipboard) 490 1295 { … … 496 1301 NULL); 497 1302 } 1303 #endif /* VRDP_NO_COM */ 498 1304 } break; 499 1305 … … 504 1310 * announced the requested format most recently. 505 1311 */ 1312 #ifdef VRDP_NO_COM 1313 if (mpEntryPoints) 1314 { 1315 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1316 VRDP_CLIPBOARD_FUNCTION_DATA_READ, 1317 pParms->u32Format, 1318 pParms->pvData, 1319 pParms->cbData, 1320 &pParms->cbData); 1321 } 1322 #else 506 1323 if (mpfnVRDPClipboard) 507 1324 { … … 513 1330 &pParms->cbData); 514 1331 } 1332 #endif /* VRDP_NO_COM */ 515 1333 } break; 516 1334 517 1335 case VBOX_CLIPBOARD_EXT_FN_DATA_WRITE: 518 1336 { 1337 #ifdef VRDP_NO_COM 1338 if (mpEntryPoints) 1339 { 1340 mpEntryPoints->VRDPClipboard (pServer->mhServer, 1341 VRDP_CLIPBOARD_FUNCTION_DATA_WRITE, 1342 pParms->u32Format, 1343 pParms->pvData, 1344 pParms->cbData, 1345 NULL); 1346 } 1347 #else 519 1348 if (mpfnVRDPClipboard) 520 1349 { … … 526 1355 NULL); 527 1356 } 1357 #endif /* VRDP_NO_COM */ 528 1358 } break; 529 1359 … … 536 1366 } 537 1367 1368 #ifdef VRDP_NO_COM 1369 void ConsoleVRDPServer::ClipboardCreate (uint32_t u32ClientId) 1370 #else 538 1371 void ConsoleVRDPServer::ClipboardCreate (uint32_t u32ClientId, PFNVRDPCLIPBOARDCALLBACK *ppfn, void **ppv) 1372 #endif /* VRDP_NO_COM */ 539 1373 { 540 1374 int rc = lockConsoleVRDPServer (); … … 552 1386 } 553 1387 1388 #ifdef VRDP_NO_COM 1389 #else 554 1390 if (VBOX_SUCCESS (rc)) 555 1391 { … … 557 1393 *ppv = this; 558 1394 } 1395 #endif /* VRDP_NO_COM */ 559 1396 560 1397 unlockConsoleVRDPServer (); … … 582 1419 * The ConsoleVRDPServer keeps a list of created backend instances. 583 1420 */ 1421 #ifdef VRDP_NO_COM 1422 void ConsoleVRDPServer::USBBackendCreate (uint32_t u32ClientId) 1423 #else 584 1424 void ConsoleVRDPServer::USBBackendCreate (uint32_t u32ClientId, PFNVRDPUSBCALLBACK *ppfn, void **ppv) 1425 #endif /* VRDP_NO_COM */ 585 1426 { 586 1427 #ifdef VBOX_WITH_USB … … 613 1454 unlockConsoleVRDPServer (); 614 1455 1456 #ifdef VRDP_NO_COM 1457 #else 615 1458 pRemoteUSBBackend->QueryVRDPCallbackPointer (ppfn, ppv); 1459 #endif /* VRDP_NO_COM */ 616 1460 } 617 1461 … … 621 1465 } 622 1466 } 623 #endif 1467 #endif /* VBOX_WITH_USB */ 624 1468 } 625 1469 … … 835 1679 { 836 1680 #ifdef VBOX_VRDP 1681 #ifdef VRDP_NO_COM 1682 if (mpEntryPoints) 1683 { 1684 mpEntryPoints->VRDPUpdate (mhServer, uScreenId, pvUpdate, cbUpdate); 1685 } 1686 #else 837 1687 if (mpfnVRDPSendUpdate) 838 1688 mpfnVRDPSendUpdate (mhServer, uScreenId, pvUpdate, cbUpdate); 1689 #endif /* VRDP_NO_COM */ 839 1690 #endif 840 1691 } … … 843 1694 { 844 1695 #ifdef VBOX_VRDP 1696 #ifdef VRDP_NO_COM 1697 if (mpEntryPoints) 1698 { 1699 mpEntryPoints->VRDPResize (mhServer); 1700 } 1701 #else 845 1702 if (mpfnVRDPSendResize) 846 1703 mpfnVRDPSendResize (mhServer); 1704 #endif /* VRDP_NO_COM */ 847 1705 #endif 848 1706 } … … 851 1709 { 852 1710 #ifdef VBOX_VRDP 1711 #ifdef VRDP_NO_COM 1712 VRDPORDERHDR update; 1713 update.x = x; 1714 update.y = y; 1715 update.w = w; 1716 update.h = h; 1717 if (mpEntryPoints) 1718 { 1719 mpEntryPoints->VRDPUpdate (mhServer, uScreenId, &update, sizeof (update)); 1720 } 1721 #else 853 1722 if (mpfnVRDPSendUpdateBitmap) 854 1723 mpfnVRDPSendUpdateBitmap (mhServer, uScreenId, x, y, w, h); 1724 #endif /* VRDP_NO_COM */ 855 1725 #endif 856 1726 } 857 1727 1728 #ifdef VRDP_NO_COM 1729 #else 858 1730 void ConsoleVRDPServer::SetFramebuffer (IFramebuffer *framebuffer, uint32_t fFlags) const 859 1731 { … … 863 1735 #endif 864 1736 } 1737 #endif /* VRDP_NO_COM */ 865 1738 866 1739 void ConsoleVRDPServer::SendAudioSamples (void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format) const 867 1740 { 868 1741 #ifdef VBOX_VRDP 1742 #ifdef VRDP_NO_COM 1743 if (mpEntryPoints) 1744 { 1745 mpEntryPoints->VRDPAudioSamples (mhServer, pvSamples, cSamples, format); 1746 } 1747 #else 869 1748 if (mpfnVRDPSendAudioSamples) 870 1749 mpfnVRDPSendAudioSamples (mhServer, pvSamples, cSamples, format); 1750 #endif /* VRDP_NO_COM */ 871 1751 #endif 872 1752 } … … 875 1755 { 876 1756 #ifdef VBOX_VRDP 1757 #ifdef VRDP_NO_COM 1758 if (mpEntryPoints) 1759 { 1760 mpEntryPoints->VRDPAudioVolume (mhServer, left, right); 1761 } 1762 #else 877 1763 if (mpfnVRDPSendAudioVolume) 878 1764 mpfnVRDPSendAudioVolume (mhServer, left, right); 1765 #endif /* VRDP_NO_COM */ 879 1766 #endif 880 1767 } … … 883 1770 { 884 1771 #ifdef VBOX_VRDP 1772 #ifdef VRDP_NO_COM 1773 if (mpEntryPoints) 1774 { 1775 mpEntryPoints->VRDPUSBRequest (mhServer, u32ClientId, pvParms, cbParms); 1776 } 1777 #else 885 1778 if (mpfnVRDPSendUSBRequest) 886 1779 mpfnVRDPSendUSBRequest (mhServer, u32ClientId, pvParms, cbParms); 1780 #endif /* VRDP_NO_COM */ 887 1781 #endif 888 1782 } … … 891 1785 { 892 1786 #ifdef VBOX_VRDP 1787 #ifdef VRDP_NO_COM 1788 if (mpEntryPoints) 1789 { 1790 mpEntryPoints->VRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut); 1791 } 1792 #else 893 1793 if (mpfnVRDPQueryInfo) 894 1794 mpfnVRDPQueryInfo (mhServer, index, pvBuffer, cbBuffer, pcbOut); 1795 #endif /* VRDP_NO_COM */ 895 1796 #endif 896 1797 } … … 918 1819 #define DEFSYMENTRY(a) { #a, (void**)&mpfn##a } 919 1820 1821 #ifdef VRDP_NO_COM 1822 static const struct SymbolEntry symbols[] = 1823 { 1824 DEFSYMENTRY(VRDPCreateServer) 1825 }; 1826 #else 920 1827 static const struct SymbolEntry symbols[] = 921 1828 { … … 932 1839 DEFSYMENTRY(VRDPClipboard) 933 1840 }; 1841 #endif /* VRDP_NO_COM */ 934 1842 935 1843 #undef DEFSYMENTRY -
trunk/src/VBox/Main/Makefile.kmk
r3661 r3720 262 262 ifdef VBOX_WITH_VRDP 263 263 VBoxC_DEFS += VBOX_VRDP IN_VRDP_R3 264 ifdef VRDP_NO_COM 265 VBoxC_DEFS += VRDP_NO_COM 266 endif 264 267 endif 265 268 ifdef VBOX_WITH_HGCM -
trunk/src/VBox/Main/include/ConsoleImpl.h
r3652 r3720 182 182 AudioSniffer *getAudioSniffer () { return mAudioSniffer; } 183 183 184 #ifdef VRDP_NO_COM 185 int VRDPClientLogon (uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); 186 void VRDPClientConnect (uint32_t u32ClientId); 187 void VRDPClientDisconnect (uint32_t u32ClientId, uint32_t fu32Intercepted); 188 void VRDPInterceptAudio (uint32_t u32ClientId); 189 void VRDPInterceptUSB (uint32_t u32ClientId); 190 void VRDPInterceptClipboard (uint32_t u32ClientId); 191 #else 184 192 static VRDPSERVERCALLBACK *getVrdpServerCallback () { return &sVrdpServerCallback; }; 193 #endif /* VRDP_NO_COM */ 185 194 186 195 void processRemoteUSBDevices (uint32_t u32ClientId, VRDPUSBDEVICEDESC *pDevList, uint32_t cbDevList); … … 412 421 volatile uint32_t mcVRDPClients; 413 422 423 #ifdef VRDP_NO_COM 424 #else 414 425 static DECLCALLBACK(int) vrdp_ClientLogon (void *pvUser, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); 415 426 static DECLCALLBACK(void) vrdp_ClientConnect (void *pvUser, uint32_t u32ClientId); … … 420 431 421 432 static VRDPSERVERCALLBACK sVrdpServerCallback; 433 #endif /* VRDP_NO_COM */ 422 434 423 435 static const char *sSSMConsoleUnit; -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r3278 r3720 30 30 #include <VBox/HostServices/VBoxClipboardExt.h> 31 31 32 #ifdef VRDP_NO_COM 33 #include "SchemaDefs.h" 34 #endif /* VRDP_NO_COM */ 35 32 36 // ConsoleVRDPServer 33 37 /////////////////////////////////////////////////////////////////////////////// … … 41 45 42 46 int Launch (void); 47 #ifdef VRDP_NO_COM 48 void NotifyAbsoluteMouse (bool fGuestWantsAbsolute) 49 { 50 m_fGuestWantsAbsolute = fGuestWantsAbsolute; 51 } 52 53 void EnableConnections (void); 54 void MousePointerUpdate (const VRDPCOLORPOINTER *pPointer); 55 void MousePointerHide (void); 56 #else 43 57 void SetCallback (void); 58 #endif /* VRDP_NO_COM */ 44 59 void Stop (void); 45 60 … … 50 65 void AuthDisconnect (const Guid &uuid, uint32_t u32ClientId); 51 66 67 #ifdef VRDP_NO_COM 68 void USBBackendCreate (uint32_t u32ClientId); 69 #else 52 70 void USBBackendCreate (uint32_t u32ClientId, PFNVRDPUSBCALLBACK *ppfn, void **ppv); 71 #endif /* VRDP_NO_COM */ 53 72 void USBBackendDelete (uint32_t u32ClientId); 54 73 … … 66 85 void waitRemoteUSBThreadEvent (unsigned cMillies); 67 86 87 #ifdef VRDP_NO_COM 88 void ClipboardCreate (uint32_t u32ClientId); 89 #else 68 90 void ClipboardCreate (uint32_t u32ClientId, PFNVRDPCLIPBOARDCALLBACK *ppfn, void **ppv); 91 #endif /* VRDP_NO_COM */ 69 92 void ClipboardDelete (uint32_t u32ClientId); 70 93 … … 75 98 void SendResize (void) const; 76 99 void SendUpdateBitmap (unsigned uScreenId, uint32_t x, uint32_t y, uint32_t w, uint32_t h) const; 100 #ifdef VRDP_NO_COM 101 #else 77 102 void SetFramebuffer (IFramebuffer *framebuffer, uint32_t fFlags) const; 103 #endif /* VRDP_NO_COM */ 78 104 79 105 void SendAudioSamples (void *pvSamples, uint32_t cSamples, VRDPAUDIOFORMAT format) const; … … 97 123 static RTLDRMOD mVRDPLibrary; 98 124 125 #ifdef VRDP_NO_COM 126 static PFNVRDPCREATESERVER mpfnVRDPCreateServer; 127 128 static VRDPENTRYPOINTS_1 *mpEntryPoints; 129 static VRDPCALLBACKS_1 mCallbacks; 130 131 static DECLCALLBACK(int) VRDPCallbackQueryProperty (void *pvCallback, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut); 132 static DECLCALLBACK(int) VRDPCallbackClientLogon (void *pvCallback, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); 133 static DECLCALLBACK(void) VRDPCallbackClientConnect (void *pvCallback, uint32_t u32ClientId); 134 static DECLCALLBACK(void) VRDPCallbackClientDisconnect (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercepted); 135 static DECLCALLBACK(int) VRDPCallbackIntercept (void *pvCallback, uint32_t u32ClientId, uint32_t fu32Intercept, void **ppvIntercept); 136 static DECLCALLBACK(int) VRDPCallbackUSB (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint8_t u8Code, const void *pvRet, uint32_t cbRet); 137 static DECLCALLBACK(int) VRDPCallbackClipboard (void *pvCallback, void *pvIntercept, uint32_t u32ClientId, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData); 138 static DECLCALLBACK(bool) VRDPCallbackFramebufferQuery (void *pvCallback, unsigned uScreenId, VRDPFRAMEBUFFERINFO *pInfo); 139 static DECLCALLBACK(void) VRDPCallbackFramebufferLock (void *pvCallback, unsigned uScreenId); 140 static DECLCALLBACK(void) VRDPCallbackFramebufferUnlock (void *pvCallback, unsigned uScreenId); 141 static DECLCALLBACK(void) VRDPCallbackInput (void *pvCallback, int type, const void *pvInput, unsigned cbInput); 142 static DECLCALLBACK(void) VRDPCallbackVideoModeHint (void *pvCallback, unsigned cWidth, unsigned cHeight, unsigned cBitsPerPixel, unsigned uScreenId); 143 144 bool m_fGuestWantsAbsolute; 145 int m_mousex; 146 int m_mousey; 147 148 IFramebuffer *maFramebuffers[SchemaDefs::MaxGuestMonitors]; 149 150 IConsoleCallback *mConsoleCallback; 151 #else 99 152 // VRDP API function pointers 100 153 static int (VBOXCALL *mpfnVRDPStartServer) (IConsole *pConsole, IVRDPServer *pVRDPServer, HVRDPSERVER *phServer); … … 110 163 static void (VBOXCALL *mpfnVRDPQueryInfo) (HVRDPSERVER hserver, uint32_t index, void *pvBuffer, uint32_t cbBuffer, uint32_t *pcbOut); 111 164 static void (VBOXCALL *mpfnVRDPClipboard) (HVRDPSERVER hserver, uint32_t u32Function, uint32_t u32Format, const void *pvData, uint32_t cbData, uint32_t *pcbActualRead); 165 #endif /* VRDP_NO_COM */ 112 166 #endif /* VBOX_VRDP */ 113 167 -
trunk/src/VBox/Main/include/RemoteUSBBackend.h
r3278 r3720 28 28 #include <VBox/vrdpusb.h> 29 29 30 typedef enum31 {32 RDLIdle = 0,33 RDLReqSent,34 RDLObtained35 } RDLState;30 //typedef enum 31 //{ 32 // RDLIdle = 0, 33 // RDLReqSent, 34 // RDLObtained 35 //} RDLState; 36 36 37 37 class Console; 38 38 class ConsoleVRDPServer; 39 40 #ifdef VRDP_NO_COM 41 DECLCALLBACK(int) USBClientResponseCallback (void *pv, uint32_t u32ClientId, uint8_t code, const void *pvRet, uint32_t cbRet); 42 #endif /* VRDP_NO_COM */ 43 39 44 40 45 /* How many remote devices can be attached to a remote client. … … 64 69 void Release (void); 65 70 71 #ifdef VRDP_NO_COM 72 #else 66 73 void QueryVRDPCallbackPointer (PFNVRDPUSBCALLBACK *ppfn, void **ppv); 74 #endif /* VRDP_NO_COM */ 67 75 68 76 REMOTEUSBCALLBACK *GetBackendCallbackPointer (void) { return &mCallback; }
Note:
See TracChangeset
for help on using the changeset viewer.