Changeset 66619 in vbox
- Timestamp:
- Apr 20, 2017 5:53:05 AM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 114662
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/vboxapi.py
r66617 r66619 439 439 self.winerror = winerror 440 440 441 # Setup client impersonation in COM calls 441 # Setup client impersonation in COM calls. 442 442 try: 443 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)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 451 except: 452 452 # handle RPC_E_TOO_LATE (repeat call of CoInitializeSecurity) 453 453 print("Warning: CoInitializeSecurity was already called") 454 pass455 456 454 457 455 pid = GetCurrentProcess() … … 482 480 win32com.client.gencache.EnsureDispatch('VirtualBox.VirtualBoxClient') 483 481 484 # instance of client used to support lifetime of VBoxSDS 485 self.client = None 486 482 self.oClient = None ##< instance of client used to support lifetime of VBoxSDS 487 483 self.oIntCv = threading.Condition() 488 484 self.fInterrupted = False … … 525 521 526 522 def getVirtualBox(self): 527 import win32com 528 from win32com.client import Dispatch 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 523 # Caching self.oClient is the trick for SDS. It allows to keep the 524 # VBoxSDS in the memory until the end of PlatformMSCOM lifetme. 525 if self.oClient is None: 526 import win32com 527 from win32com.client import Dispatch 528 self.oClient = win32com.client.Dispatch("VirtualBox.VirtualBoxClient") 529 return self.oClient.virtualBox 535 530 536 531 def getType(self):
Note:
See TracChangeset
for help on using the changeset viewer.