Changeset 66617 in vbox for trunk/src/VBox/Main/glue
- Timestamp:
- Apr 20, 2017 1:00:29 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/vboxapi.py
r62900 r66617 439 439 self.winerror = winerror 440 440 441 # Setup client impersonation in COM calls 442 try: 443 pythoncom.CoInitializeSecurity(None, 444 None, 445 None, 446 pythoncom.RPC_C_AUTHN_LEVEL_DEFAULT, 447 pythoncom.RPC_C_IMP_LEVEL_IMPERSONATE, 448 None, 449 pythoncom.EOAC_NONE, 450 None) 451 except: 452 # handle RPC_E_TOO_LATE (repeat call of CoInitializeSecurity) 453 print("Warning: CoInitializeSecurity was already called") 454 pass 455 456 441 457 pid = GetCurrentProcess() 442 458 self.tid = GetCurrentThreadId() … … 465 481 win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBox') 466 482 win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBoxClient') 483 484 # instance of client used to support lifetime of VBoxSDS 485 self.client = None 467 486 468 487 self.oIntCv = threading.Condition() … … 508 527 import win32com 509 528 from win32com.client import Dispatch 510 client = win32com.client.Dispatch("VirtualBox.VirtualBoxClient") 511 return client.virtualBox 529 # Caching self.client is the trick for SDS 530 # It's allows to keep the VBoxSDS in the memory 531 # until the end of PlatformMSCOM lifetme 532 if self.client is None: 533 self.client = win32com.client.Dispatch("VirtualBox.VirtualBoxClient") 534 return self.client.virtualBox 512 535 513 536 def getType(self):
Note:
See TracChangeset
for help on using the changeset viewer.