Changeset 2527 in vbox for trunk/src/VBox
- Timestamp:
- May 7, 2007 4:19:14 PM (18 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ConsoleImpl.cpp
r2463 r2527 302 302 303 303 #ifdef VRDP_MC 304 m_cAudioRefs = 0; 304 mcAudioRefs = 0; 305 mcVRDPClients = 0; 305 306 #endif /* VRDP_MC */ 306 307 … … 457 458 LogFlowFunc (("%d, %s, %s, %s\n", u32ClientId, pszUser, pszPassword, pszDomain)); 458 459 #else 460 uint32_t u32ClientId = 0; 459 461 LogFlowFunc (("%s, %s, %s\n", pszUser, pszPassword, pszDomain)); 460 462 #endif /* VRDP_MC */ … … 502 504 )); 503 505 506 /* Multiconnection check. */ 507 BOOL allowMultiConnection = FALSE; 508 hrc = console->mVRDPServer->COMGETTER(AllowMultiConnection) (&allowMultiConnection); 509 AssertComRCReturn (hrc, VERR_ACCESS_DENIED); 510 511 LogFlowFunc(("allowMultiConnection %d, console->mcVRDPClients = %d\n", allowMultiConnection, console->mcVRDPClients)); 512 513 if (allowMultiConnection == FALSE) 514 { 515 /* Note: the variable is incremented in ClientConnect callback, which is called when the client 516 * is successfully connected, that is after the ClientLogon callback. Therefore the mcVRDPClients 517 * value is 0 for first client. 518 */ 519 if (console->mcVRDPClients > 0) 520 { 521 /* Reject. */ 522 LogRel(("VRDPAUTH: Multiple connections are not enabled. Access denied.\n")); 523 return VERR_ACCESS_DENIED; 524 } 525 } 526 504 527 switch (authType) 505 528 { … … 513 536 { 514 537 /* Call the external library. */ 515 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain );538 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId); 516 539 517 540 if (result != VRDPAuthDelegateToGuest) … … 572 595 LogRel(("VRDPAUTH: Guest judgement %d.\n", guestJudgement)); 573 596 LogFlowFunc (("External auth called again with guest judgement = %d\n", guestJudgement)); 574 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain );597 result = console->mConsoleVRDPServer->Authenticate (uuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId); 575 598 } 576 599 else … … 624 647 #ifdef VBOX_VRDP 625 648 #ifdef VRDP_MC 649 ASMAtomicIncU32(&console->mcVRDPClients); 650 626 651 NOREF(u32ClientId); 627 652 console->mDisplay->VideoAccelVRDP (true); … … 655 680 #ifdef VBOX_VRDP 656 681 #ifdef VRDP_MC 682 ASMAtomicDecU32(&console->mcVRDPClients); 683 657 684 console->mDisplay->VideoAccelVRDP (false); 658 685 #else 686 u32ClientId = 0; 659 687 console->mDisplay->VideoAccelVRDP (false, 0); 660 688 #endif /* VRDP_MC */ … … 679 707 if (fu32Intercepted & VRDP_CLIENT_INTERCEPT_AUDIO) 680 708 { 681 console->m _cAudioRefs--;682 683 if (console->m _cAudioRefs <= 0)709 console->mcAudioRefs--; 710 711 if (console->mcAudioRefs <= 0) 684 712 { 685 713 if (console->mAudioSniffer) … … 705 733 #endif /* VBOX_VRDP */ 706 734 735 Guid uuid; 736 HRESULT hrc = console->mMachine->COMGETTER (Id) (uuid.asOutParam()); 737 AssertComRC (hrc); 738 739 VRDPAuthType_T authType = VRDPAuthType_VRDPAuthNull; 740 hrc = console->mVRDPServer->COMGETTER(AuthType) (&authType); 741 AssertComRC (hrc); 742 743 if (authType == VRDPAuthType_VRDPAuthExternal) 744 console->mConsoleVRDPServer->AuthDisconnect (uuid, u32ClientId); 745 707 746 LogFlowFuncLeave(); 708 747 return; … … 735 774 #ifdef VBOX_VRDP 736 775 #ifdef VRDP_MC 737 console->m _cAudioRefs++;738 739 if (console->m _cAudioRefs == 1)776 console->mcAudioRefs++; 777 778 if (console->mcAudioRefs == 1) 740 779 { 741 780 if (console->mAudioSniffer) -
trunk/src/VBox/Main/ConsoleVRDPServer.cpp
r2522 r2527 193 193 194 194 mpfnAuthEntry = NULL; 195 mpfnAuthEntry2 = NULL; 195 196 196 197 if (mAuthLibrary) … … 322 323 323 324 VRDPAuthResult ConsoleVRDPServer::Authenticate (const Guid &uuid, VRDPAuthGuestJudgement guestJudgement, 324 const char *pszUser, const char *pszPassword, const char *pszDomain) 325 const char *pszUser, const char *pszPassword, const char *pszDomain, 326 uint32_t u32ClientId) 325 327 { 326 328 VRDPAUTHUUID rawuuid; … … 328 330 memcpy (rawuuid, ((Guid &)uuid).ptr (), sizeof (rawuuid)); 329 331 330 LogFlow(("ConsoleVRDPServer::Authenticate: uuid = %Vuuid, guestJudgement = %d, pszUser = %s, pszPassword = %s, pszDomain = %s \n",331 rawuuid, guestJudgement, pszUser, pszPassword, pszDomain ));332 LogFlow(("ConsoleVRDPServer::Authenticate: uuid = %Vuuid, guestJudgement = %d, pszUser = %s, pszPassword = %s, pszDomain = %s, u32ClientId = %d\n", 333 rawuuid, guestJudgement, pszUser, pszPassword, pszDomain, u32ClientId)); 332 334 333 335 /* … … 362 364 { 363 365 /* Get the entry point. */ 364 rc = RTLdrGetSymbol(mAuthLibrary, "VRDPAuth", (void**)&mpfnAuthEntry); 365 if (VBOX_FAILURE (rc)) 366 LogRel(("VRDPAUTH: Failed to resolve import 'VRDPAuth'. Error code: %Vrc\n", rc)); 366 mpfnAuthEntry2 = NULL; 367 int rc2 = RTLdrGetSymbol(mAuthLibrary, "VRDPAuth2", (void**)&mpfnAuthEntry2); 368 if (VBOX_FAILURE (rc2)) 369 { 370 LogRel(("VRDPAUTH: Could not resolve import '%s'. Error code: %Vrc\n", "VRDPAuth2", rc2)); 371 rc = rc2; 372 } 373 374 /* Get the entry point. */ 375 mpfnAuthEntry = NULL; 376 rc2 = RTLdrGetSymbol(mAuthLibrary, "VRDPAuth", (void**)&mpfnAuthEntry); 377 if (VBOX_FAILURE (rc2)) 378 { 379 LogRel(("VRDPAUTH: Could not resolve import '%s'. Error code: %Vrc\n", "VRDPAuth", rc2)); 380 rc = rc2; 381 } 382 383 if (mpfnAuthEntry2 || mpfnAuthEntry) 384 { 385 LogRel(("VRDPAUTH: Using entry point '%s'.\n", mpfnAuthEntry2? "VRDPAuth2": "VRDPAuth")); 386 rc = VINF_SUCCESS; 387 } 367 388 } 368 389 … … 372 393 373 394 mpfnAuthEntry = NULL; 395 mpfnAuthEntry2 = NULL; 374 396 375 397 if (mAuthLibrary) … … 383 405 } 384 406 385 Assert (mAuthLibrary && mpfnAuthEntry); 386 387 VRDPAuthResult result = mpfnAuthEntry (&rawuuid, guestJudgement, pszUser, pszPassword, pszDomain); 407 Assert (mAuthLibrary && (mpfnAuthEntry || mpfnAuthEntry2)); 408 409 VRDPAuthResult result = mpfnAuthEntry? 410 mpfnAuthEntry (&rawuuid, guestJudgement, pszUser, pszPassword, pszDomain): 411 mpfnAuthEntry2 (&rawuuid, guestJudgement, pszUser, pszPassword, pszDomain, true, u32ClientId); 388 412 389 413 switch (result) … … 408 432 } 409 433 434 void ConsoleVRDPServer::AuthDisconnect (const Guid &uuid, uint32_t u32ClientId) 435 { 436 VRDPAUTHUUID rawuuid; 437 438 memcpy (rawuuid, ((Guid &)uuid).ptr (), sizeof (rawuuid)); 439 440 LogFlow(("ConsoleVRDPServer::AuthDisconnect: uuid = %Vuuid, u32ClientId = %d\n", 441 rawuuid, u32ClientId)); 442 443 Assert (mAuthLibrary && (mpfnAuthEntry || mpfnAuthEntry2)); 444 445 if (mpfnAuthEntry2) 446 mpfnAuthEntry2 (&rawuuid, VRDPAuthGuestNotAsked, NULL, NULL, NULL, false, u32ClientId); 447 } 410 448 411 449 #ifdef VRDP_MC -
trunk/src/VBox/Main/include/ConsoleImpl.h
r2463 r2527 405 405 406 406 #ifdef VRDP_MC 407 int m_cAudioRefs; 407 int mcAudioRefs; 408 volatile uint32_t mcVRDPClients; 408 409 409 410 static DECLCALLBACK(int) vrdp_ClientLogon (void *pvUser, uint32_t u32ClientId, const char *pszUser, const char *pszPassword, const char *pszDomain); -
trunk/src/VBox/Main/include/ConsoleVRDPServer.h
r2522 r2527 45 45 46 46 VRDPAuthResult Authenticate (const Guid &uuid, VRDPAuthGuestJudgement guestJudgement, 47 const char *pszUser, const char *pszPassword, const char *pszDomain); 47 const char *pszUser, const char *pszPassword, const char *pszDomain, 48 uint32_t u32ClientId); 49 50 void AuthDisconnect (const Guid &uuid, uint32_t u32ClientId); 48 51 49 52 #ifdef VRDP_MC … … 169 172 170 173 /* External authentication library handle. The library is loaded in the 171 * Authenticate 174 * Authenticate method and unloaded at the object destructor. 172 175 */ 173 176 RTLDRMOD mAuthLibrary; 174 177 PVRDPAUTHENTRY mpfnAuthEntry; 178 PVRDPAUTHENTRY2 mpfnAuthEntry2; 175 179 }; 176 180
Note:
See TracChangeset
for help on using the changeset viewer.