Ë
    ©¨±ig­  ã                   óü  — d Z dZdZddlZddlZddlZej                  dk\  reZe	Z
ddlZej                  j                  dd«      aej                  j                  dd«      at        € ej                   «       dk(  rd	an"d
anej"                  j%                  t        «      at        € ej                   «       dk(  rdan"danej"                  j%                  t        «      at        ej                  d<   t        ej                  d<   ej"                  j'                  t        «       ddlmZ  G d„ de«      Zd„ ZdddœZd„ Zd„ Z G d„ de«      Z G d„ de«      Z G d„ de«      Z G d„ de«      Zda  G d„ de«      Z!y)z
VirtualBox Python API Glue.
aÇ  
Copyright (C) 2009-2023 Oracle and/or its affiliates.

This file is part of VirtualBox base platform packages, as
available from https://www.virtualbox.org.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, in version 3 of the
License.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, see <https://www.gnu.org/licenses>.

The contents of this file may alternatively be used under the terms
of the Common Development and Distribution License Version 1.0
(CDDL), a copy of it is provided in the "COPYING.CDDL" file included
in the VirtualBox distribution, in which case the provisions of the
CDDL are applicable instead of those of the GPL.

You may elect to license modified versions of this file under the
terms and conditions of either the GPL or the CDDL or both.

SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
z$Revision: 155244 $é    N)é   r   ÚVBOX_PROGRAM_PATHÚVBOX_SDK_PATHÚDarwinz+/Applications/VirtualBox.app/Contents/MacOSz/usr/lib/virtualboxz//Applications/VirtualBox.app/Contents/MacOS/sdkz/usr/lib/virtualbox/sdké   )ÚVirtualBoxReflectionInfoc                   ó.   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPerfCollectoraz   This class provides a wrapper over IPerformanceCollector in order to
    get more 'pythonic' interface.

    To begin collection of metrics use setup() method.

    To get collected data use query() method.

    It is possible to disable metric collection without changing collection
    parameters with disable() method. The enable() method resumes metric
    collection.
    c                 ó\   — || _         |j                  dk(  | _        |j                  | _        y)z$ Initializes the instance.

        ÚMSCOMN)ÚmgrÚtypeÚisMscomÚperformanceCollectorÚ	collector)Úselfr   Úvboxs      ú2/usr/lib/python3/dist-packages/vboxapi/__init__.pyÚ__init__zPerfCollector.__init__e   s(   € ð ˆŒØŸ™ GÑ+ˆŒØ×2Ñ2ˆ�ó    c                 ó@   — | j                   j                  ||||«       y)z³ Discards all previously collected values for the specified
        metrics, sets the period of collection and the number of retained
        samples, enables collection.
        N)r   ÚsetupMetrics)r   ÚnamesÚobjectsÚperiodÚnsampless        r   ÚsetupzPerfCollector.setupm   s   € ð
 	�‰×#Ñ# E¨7°F¸HÕEr   c                 ó<   — | j                   j                  ||«       y)z> Resumes metric collection for the specified metrics.
        N)r   ÚenableMetrics©r   r   r   s      r   ÚenablezPerfCollector.enablet   s   € ð 	�‰×$Ñ$ U¨GÕ4r   c                 ó<   — | j                   j                  ||«       y)z? Suspends metric collection for the specified metrics.
        N)r   ÚdisableMetricsr    s      r   ÚdisablezPerfCollector.disabley   s   € ð 	�‰×%Ñ% e¨WÕ5r   c                 ó  — | j                   r(| j                  j                  ||«      \
  }}}}}}}}}	}
n%| j                  j                  ||«      \  }}}}}}}	}
g }t        dt	        |«      «      D �]  }t        ||   «      }|dk7  rd}nd}|j                  t        ||   «      t        ||   «      t        ||   «      |t        t        |	|   «      t        |	|   «      t        |
|   «      z   «      D �cg c]  }t        ||   «      ‘Œ c}ddj                  t        t        |	|   «      t        |	|   «      t        |
|   «      z   «      D �cg c]  }|t        ||   «      |z  ||   fz  ‘Œ c}«      z   dz   dœ«       �Œ |S c c}w c c}w )	aÿ   Retrieves collected metric values as well as some auxiliary
        information. Returns an array of dictionaries, one dictionary per
        metric. Each dictionary contains the following entries:
        'name': metric name
        'object': managed object this metric associated with
        'unit': unit of measurement
        'scale': divide 'values' by this number to get float numbers
        'values': collected data
        'values_as_string': pre-processed values ready for 'print' statement
        r   r   z%.2f%sz%d %sú[z, ú])ÚnameÚobjectÚunitÚscaleÚvaluesÚvalues_as_string)	r   r   ÚqueryMetricsDataÚxrangeÚlenÚintÚappendÚstrÚjoin)r   r   r   r,   Ú	names_outÚobjects_outÚunitsÚscalesÚsequence_numbersÚindicesÚlengthsÚoutÚir+   ÚfmtÚjs                   r   ÚqueryzPerfCollector.query~   s«  € ð �<Š<à!%§¡×!@Ñ!@ÀÈÓ!PñˆV�U˜G Y°¸UÀFÐL\Ø‘gð "&§¡×!@Ñ!@ÀÈÓ!PñˆV�Y ¨U°FÐ<LØ�gØˆÜ˜œ3˜y›>Ó*ó 	ˆAÜ˜˜q™	“NˆEØ˜ŠzØ‘à�Ø�J‰JÜ˜I a™LÓ)Ü˜k¨!™nÓ-Ü˜E !™H›ØÜ39¼#¸gÀa¹j»/Ì3ÈwÐWXÉzË?Ô]`ÐahÐijÑakÓ]lÑKlÓ3mÖn¨aœ3˜v a™y�>ÒnØ$'¨$¯)©)Ü5;¼CÀÈÁ
»OÌSÐQXÐYZÑQ[Ë_Ô_bÐcjÐklÑcmÓ_nÑMnÓ5oö5qÐbc°S¼CÀÀqÁ	»NÈUÑ<RÐTYÐZ[ÑT\Ð;]Ó5]ò 5qó +rñ %rØtwñ%xñö ð	ð ˆ
ùò	 oùò5qs   Ã5FÅ F	N)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r!   r$   r@   © r   r   r
   r
   X   s!   „ ñ
ò3òFò5ò
6ó
#r   r
   c                 ó4   — | d   j                  «       | dd  z   S )Nr   r   )Ú
capitalize)r(   s    r   Ú
ComifyNamerH   §   s    € Ø�‰7×ÑÓ $ q r (Ñ*Ð*r   )ÚgetattrÚsetattrc                 óä  — | j                   j                  j                  |«      }|�|S |j                  «       }t	        | j                   j                  j                  «       «      D ]Q  }|j                  «       |k(  sŒt        | j                   || j                   j                  |   «       t        | |«      c S  	 t        d   | t        |«      «      S # t        $ r t        d   | |«      cY S w xY w)z0 Our getattr replacement for DispatchBaseClass. rI   )Ú	__class__Ú__dict__ÚgetÚlowerÚlistÚkeysrJ   rI   Ú_g_dCOMForwardrH   ÚAttributeError)r   ÚsAttrÚoRetÚ
sAttrLowerÚks        r   Ú_CustomGetAttrrX   ³   sÔ   € ð �>‰>×"Ñ"×&Ñ& uÓ-€DØÐØˆð —‘“€JÜ�$—.‘.×)Ñ)×.Ñ.Ó0Ó1ò $ˆØ�7‰7‹9˜
Ó"Ü�D—N‘N E¨4¯>©>×+BÑ+BÀ1Ñ+EÔFÜ˜4 Ó#Ò#ð$ð6Ü˜iÑ(¨¬z¸%Ó/@ÓAÐAøÜò 6Ü˜iÑ(¨¨uÓ5Ò5ð6ús   Â<C ÃC/Ã.C/c                 ót   — 	 t        d   | t        |«      |«      S # t        $ r t        d   | ||«      cY S w xY w)z0 Our setattr replacement for DispatchBaseClass. rJ   )rR   rH   rS   )r   rT   ÚoValues      r   Ú_CustomSetAttrr[   È   sC   € ð>Ü˜iÑ(¨¬z¸%Ó/@À&ÓIÐIøÜò >Ü˜iÑ(¨¨u°fÓ=Ò=ð>ús   ‚ ›7¶7c                   ó˜   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ «       Zy)ÚPlatformBasez4
    Base class for the platform specific code.
    c                 ó   — |}y ©NrE   )r   ÚaoParamsÚ_s      r   r   zPlatformBase.__init__Õ   s   € Ø‰r   c                  ó   — y)z3
        Gets a the IVirtualBox singleton.
        NrE   ©r   s    r   ÚgetVirtualBoxzPlatformBase.getVirtualBoxØ   ó   € ð r   c                  ó   — y)zä
        Get a session object that can be used for opening machine sessions.

        The oIVBox parameter is an getVirtualBox() return value, i.e. an
        IVirtualBox reference.

        See also openMachineSession.
        NrE   rc   s    r   ÚgetSessionObjectzPlatformBase.getSessionObjectÞ   s   € ð r   c                  ó   — y)z9 Returns the platform type (class name sans 'Platform'). NrE   rc   s    r   ÚgetTypezPlatformBase.getTypeé   ó   € àr   c                  ó   — y)zW
        Returns True if remote (web services) and False if local (COM/XPCOM).
        FrE   rc   s    r   ÚisRemotezPlatformBase.isRemoteí   ó   € ð r   c                 ó   — |}|}y)zÌ
        Retrives the value of the array attribute 'sAttrib' from
        interface 'oInterface'.

        This is for hiding platform specific differences in attributes
        returning arrays.
        NrE   )r   Ú
oInterfaceÚsAttribra   s       r   ÚgetArrayzPlatformBase.getArrayó   s   € ð ˆØˆØr   c                 ó   — |}|}|}y)zÎ
        Sets the value (aoArray) of the array attribute 'sAttrib' in
        interface 'oInterface'.

        This is for hiding platform specific differences in attributes
        setting arrays.
        NrE   )r   ro   rp   ÚaoArrayra   s        r   ÚsetArrayzPlatformBase.setArrayÿ   s   € ð ˆØˆØˆØr   c                  ó   — y)zN
        Does backend specific initialization for the calling thread.
        TrE   rc   s    r   ÚinitPerThreadzPlatformBase.initPerThread  re   r   c                  ó   — y)zP
        Does backend specific uninitialization for the calling thread.
        TrE   rc   s    r   ÚdeinitPerThreadzPlatformBase.deinitPerThread  re   r   c                 ó    — |}|}t        d«      ‚)ac  
        Instantiates and wraps an active event listener class so it can be
        passed to an event source for registration.

        oImplClass is a class (type, not instance) which implements
        IEventListener.

        dArgs is a dictionary with string indexed variables.  This may be
        modified by the method to pass platform specific parameters. Can
        be None.

        This currently only works on XPCOM.  COM support is not possible due to
        shortcuts taken in the COM bridge code, which is not under our control.
        Use passive listeners for COM and web services.
        z%No active listeners for this platform)Ú	Exception)r   Ú
oImplClassÚdArgsra   s       r   ÚcreateListenerzPlatformBase.createListener  s   € ð  ˆØˆÜÐ?Ó@Ð@r   c                 ó   — |}y)a>  
        Wait for events to arrive and process them.

        The timeout (cMsTimeout) is in milliseconds for how long to wait for
        events to arrive.  A negative value means waiting for ever, while 0
        does not wait at all.

        Returns 0 if events was processed.
        Returns 1 if timed out or interrupted in some way.
        Returns 2 on error (like not supported for web services).

        Raises an exception if the calling thread is not the main thread (the one
        that initialized VirtualBoxManager) or if the time isn't an integer.
        é   rE   )r   Ú
cMsTimeoutra   s      r   ÚwaitForEventszPlatformBase.waitForEvents,  s   € ð ˆØr   c                  ó   — y)z¶
        Interrupt a waitForEvents call.
        This is normally called from a worker thread to wake up the main thread.

        Returns True on success, False on failure.
        FrE   rc   s    r   ÚinterruptWaitEventsz PlatformBase.interruptWaitEvents>  s   € ð r   c                  ó   — y)z<
        Unitializes the platform specific backend.
        NrE   rc   s    r   ÚdeinitzPlatformBase.deinitG  re   r   c                  ó   — y)z—
        IUnknown::QueryInterface wrapper.

        oIUnknown is who to ask.
        sClassName is the name of the interface we're asking for.
        NrE   ©r   Ú	oIUnknownÚ
sClassNames      r   ÚqueryInterfacezPlatformBase.queryInterfaceM  s   € ð r   c                  ó   — y)zP
        Returns the COM status code from the VBox API given exception.
        NrE   ©r   ÚoXcpts     r   ÚxcptGetStatuszPlatformBase.xcptGetStatusZ  re   r   c                  ó   — y)zc
        Returns True if the exception indicates that the interface is dead, False if not.
        FrE   rŒ   s     r   ÚxcptIsDeadInterfacez PlatformBase.xcptIsDeadInterface`  rm   r   c                 óŠ   — 	 | j                  |«      }||k(  ryd|cxk  rdk  rn y|dk  r	|dz
  |k(  ryy# t        $ r Y yw xY w)a?  
        Checks if the exception oXcpt is equal to the COM/XPCOM status code
        hrStatus.

        The oXcpt parameter can be any kind of object, we'll just return True
        if it doesn't behave like a our exception class.

        Will not raise any exception as long as hrStatus and self are not bad.
        FTiÿÿÿì   ÿÿ r   l        )rŽ   rS   )r   r�   ÚhrStatusÚhrXcpts       r   ÚxcptIsEqualzPlatformBase.xcptIsEqualf  sh   € ð	Ø×'Ñ'¨Ó.ˆFð �XÒØð ˜Ô. JÔ.ð ð 4:¸A²:Ø˜;Ñ&¨6Ò1ØØøô ò 	Ùð	ús   ‚6 ¶	AÁAc                  ó   — y)zÊ
        Returns the best error message found in the COM-like exception.
        Returns None to fall back on xcptToString.
        Raises exception if oXcpt isn't our kind of exception object.
        NrE   rŒ   s     r   ÚxcptGetMessagezPlatformBase.xcptGetMessage}  s   € ð r   c                  ó   — y)z3
        Returns the base exception class.
        NrE   rc   s    r   ÚxcptGetBaseXcptzPlatformBase.xcptGetBaseXcpt…  re   r   c                 ó   — |S )z>
        Copy/whatever all error constants onto oDst.
        rE   )r   ÚoDsts     r   ÚxcptSetupConstantszPlatformBase.xcptSetupConstants‹  s	   € ð ˆr   c                 óÜ   — t        |«      D ]]  }|d   j                  «       sŒ|d   j                  «       s	|d   dk(  sŒ3t        ||«      }t        |«      t        u sŒQt        | ||«       Œ_ | S )zT
        Copy everything that looks like error constants from oDst to oSrc.
        r   r   ra   )ÚdirÚisupperrI   r   r1   rJ   )r›   ÚoSrcrT   ÚoAttrs       r   ÚxcptCopyErrorConstantsz#PlatformBase.xcptCopyErrorConstants‘  sk   € ô
 ˜“Yò 	0ˆEØ�Q‰x×ÑÕ! u¨Q¡x×'7Ñ'7Ô'9¸UÀ1¹XÈ»_Ü  eÓ,�Ü˜“;¤#Ò%Ü˜D %¨Õ/ð		0ð
 ˆr   N)rA   rB   rC   rD   r   rd   rg   ri   rl   rq   rt   rv   rx   r}   r�   rƒ   r…   rŠ   rŽ   r�   r•   r—   r™   rœ   Ústaticmethodr¢   rE   r   r   r]   r]   Ð   s€   „ ñòòò	òòò
òòòòAò(ò$òòòòòò.òòð ñ	ó ñ	r   r]   c                   ó’   — e Zd ZdZdZdZdZdZd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPlatformMSCOMz,
    Platform specific code for MS COM.
    z&{D7569351-1750-46F0-936E-BD127D5BC264}r   r   r   c           
      ó^  — t         j                  | |«       ddlm} ddlm}m} ddlm}m} dd l}dd l	}dd l
}	dd l}
ddlm} ddl
m}m}m}m} dd l}|
| _        	 |j'                  d d d |j(                  |j*                  d |j,                  d «        |«       | _         |«       } || |«       |dd|«      g| _        t>        d
   €N|j@                  d   t>        d<   |j@                  d   t>        d
<   tC        |dtD        «       tC        |dtF        «       | jI                  |jJ                  j
                  «       |jJ                  j
                  jM                  d«       |jJ                  j
                  jM                  d«       |jJ                  j
                  jM                  d«       d | _'        |jQ                  «       | _)        d| _*        |}y #  t/        j0                  «       \  }}}t3        ||j4                  «      r | j7                  |«      dk(  rt9        d«       nt9        d	|«       Y �Œ›xY w)Nr   )Ú	universal)ÚgencacheÚDispatchBaseClass)Ú	constantsÚ	getevents)ÚDUPLICATE_SAME_ACCESS)ÚGetCurrentThreadÚGetCurrentThreadIdÚDuplicateHandleÚGetCurrentProcessi€z0Warning: CoInitializeSecurity was already calledz&Warning: CoInitializeSecurity failed: rJ   Ú__getattr__rI   Ú__setattr__úVirtualBox.SessionzVirtualBox.VirtualBoxúVirtualBox.VirtualBoxClientF)+r]   r   Úwin32comr§   Úwin32com.clientr¨   r©   rª   r«   Ú	pythoncomÚwin32apiÚwinerrorÚwin32conr¬   r­   r®   r¯   r°   Ú	threadingÚCoInitializeSecurityÚRPC_C_AUTHN_LEVEL_DEFAULTÚRPC_C_IMP_LEVEL_IMPERSONATEÚ	EOAC_NONEÚsysÚexc_infoÚ
isinstanceÚ	com_errorrŽ   ÚprintÚtidÚ	aoHandlesrR   rM   rJ   rX   r[   ÚflushGenPyCacheÚclientÚEnsureDispatchÚoClientÚ	ConditionÚoIntCvÚfInterrupted)r   ÚdParamsr§   r¨   r©   rª   r«   rµ   r·   r¸   r¹   r¬   r­   r®   r¯   r°   r»   ra   r�   Úpids                       r   r   zPlatformMSCOM.__init__®  sÖ  € Ü×Ñ˜d GÔ,õ 	'ß?ß8ÛÛÛÛÝ2ßeÓeÛà ˆŒð	HØ×*Ñ*¨4Ø+/Ø+/Ø+4×+NÑ+NØ+4×+PÑ+PØ+/Ø+4×+>Ñ+>Ø+/ô1ñ  &Ó'ˆŒÙÓ!ˆÙ)¨#Ñ/?Ó/AÀ3ÈÈ1ÐNcÓdÐfˆŒô ˜)Ñ$Ð,Ø(9×(BÑ(BÀ=Ñ(QŒN˜9Ñ%Ø(9×(BÑ(BÀ=Ñ(QŒN˜9Ñ%ÜÐ% }´nÔEÜÐ% }´nÔEð 	×Ñ˜XŸ_™_×5Ñ5Ô6Ø�‰× Ñ ×/Ñ/Ð0DÔEØ�‰× Ñ ×/Ñ/Ð0GÔHØ�‰× Ñ ×/Ñ/Ð0MÔNàˆŒØ×)Ñ)Ó+ˆŒØ!ˆÔà‰øðK	HÜŸ,™,›.‰KˆAˆu�aÜ˜% ×!4Ñ!4Ô5¸$×:LÑ:LÈUÓ:SÐWbÒ:bÜÐHÕIäÐ>ÀÔFýs   Á6G ÇAH,c                 óö  — |j                  | j                  | j                  | j                  | j                  «      }|j                  «       }t        |«      dkD  rdt        |«      dkD  rVt        j                  j                  ||«      }t        j                  j                  |«      rddl}|j                  |d¬«       |j                  | j                  | j                  | j                  | j                  «      S )zË
        Flushes VBox related files in the win32com gen_py cache.

        This is necessary since we don't follow the typelib versioning rules
        that everyeone else seems to subscribe to.
        é$   é   r   NT)Úignore_errors)ÚGetGeneratedFileNameÚVBOX_TLB_GUIDÚVBOX_TLB_LCIDÚVBOX_TLB_MAJORÚVBOX_TLB_MINORÚGetGeneratePathr0   ÚosÚpathr4   ÚisdirÚshutilÚrmtreeÚEnsureModule)r   Ú	oGenCacheÚsNameÚsGenPathÚsTypelibPathrÝ   s         r   rÇ   zPlatformMSCOM.flushGenPyCacheó  sÃ   € ð ×.Ñ.¨t×/AÑ/AÀ4×CUÑCUØ/3×/BÑ/BÀD×DWÑDWóYˆà×,Ñ,Ó.ˆÜˆu‹:˜Š?œs 8›}¨qÒ0ÜŸ7™7Ÿ<™<¨°%Ó8ˆLÜ�w‰w�}‰}˜\Ô*ÛØ—‘˜l¸$�Ô?ð
 ×%Ñ% d×&8Ñ&8¸$×:LÑ:LÈd×NaÑNaÐcg×cvÑcvÓwÐwr   c                 óL   — dd l }ddlm} |j                  j                  d«      S )Nr   ©ÚDispatchr³   )rµ   r¶   ræ   rÈ   ©r   rµ   ræ   s      r   rg   zPlatformMSCOM.getSessionObject  s   € ÛÝ,Ø�‰×'Ñ'Ð(<Ó=Ð=r   c                 óš   — | j                   €*dd l}ddlm} |j                  j                  d«      | _         | j                   j
                  S )Nr   rå   r´   )rÊ   rµ   r¶   ræ   rÈ   Ú
virtualBoxrç   s      r   rd   zPlatformMSCOM.getVirtualBox  s;   € ð �<‰<ÐÛÝ0Ø#Ÿ?™?×3Ñ3Ð4QÓRˆDŒLØ�|‰|×&Ñ&Ð&r   c                  ó   — y)Nr   rE   rc   s    r   ri   zPlatformMSCOM.getType  ó   € Ør   c                 ó$   — |j                  |«      S r_   ©r±   ©r   ro   rp   s      r   rq   zPlatformMSCOM.getArray   ó   € Ø×%Ñ% gÓ.Ð.r   c                 ó2  — t        |d«      }t        |d«      }t        |d«      }||v r|n
t        |«      }	 ||   \  }}	||   }
dd l}|j                  |d   |d   |d   |j                  df|
d   f|«       y # t        $ r |j                  ||«      cY S w xY w)NÚ_oleobj_Ú_prop_map_get_Ú_prop_map_put_r   r   r   )rI   rH   ÚKeyErrorr²   r·   ÚInvokeTypesÚ
VT_HRESULT)r   ro   rp   rs   ÚoOleObjÚaPropMapGetÚaPropMapPutÚ
sComAttribÚaArgsÚaDefaultArgsÚaGetArgsr·   s               r   rt   zPlatformMSCOM.setArray#  sÀ   € ô ˜j¨*Ó5ˆÜ˜jÐ*:Ó;ˆÜ˜jÐ*:Ó;ˆØ!(¨KÑ!7‘g¼ZÈÓ=Pˆ
ð	<Ø"-¨jÑ"9ÑˆE�<Ø"-¨jÑ"9ˆHó 	Ø×Ñ˜E !™HØ! !™HØ! !™HØ&×1Ñ1°1Ð5Ø% a™[˜NØ#õ	&øô	 ò 	<Ø×)Ñ)¨'°7Ó;Ò;ð	<ús   ·A8 Á8BÂBc                 ó.   — dd l }|j                  d«       y ©Nr   )r·   ÚCoInitializeEx©r   r·   s     r   rv   zPlatformMSCOM.initPerThread?  s   € ÛØ× Ñ  Õ#r   c                 ó,   — dd l }|j                  «        y rÿ   )r·   ÚCoUninitializer  s     r   rx   zPlatformMSCOM.deinitPerThreadC  s   € ÛØ× Ñ Õ"r   c                 ó   — 	 t        d«      ‚)NzÔno active listeners on Windows as PyGatewayBase::QueryInterface() returns new gateway objects all the time, thus breaking EventQueue assumptions about the listener interface pointer being constants between calls )rz   r¥   rÕ   r×   rØ   Úexec)r   r{   r|   ÚdÚstr_s        r   r}   zPlatformMSCOM.createListenerG  s   € ØÜð nó oð or   c                 ó*  — ddl m} ddlm} ddlm}m}m}m} ddlm	} dd l
}	t        |t        «      st        d«      ‚| j                   |«       k7  rt        d«      ‚|dk  r|}
n|}
 || j                   d|
|«      }||cxk  r|t#        | j                   «      z   k  rn nd}n'||t#        | j                   «      z   k(  r
 |«        d}nd	}| j$                  j'                  «        | j(                  r	d
| _        d	}| j$                  j+                  «        |S )Nr   )r®   )ÚINFINITE)ÚMsgWaitForMultipleObjectsÚQS_ALLINPUTÚWAIT_TIMEOUTÚWAIT_OBJECT_0)ÚPumpWaitingMessagesz&The timeout argument is not an integerz0wait for events from the same thread you inited!r   r   F)r¸   r®   Ú
win32eventr	  r
  r  r  r  r·   r  ÚtypesrÂ   r1   Ú	TypeErrorrÅ   rz   rÆ   r0   rÌ   ÚacquirerÍ   Úrelease)r   Útimeoutr®   r	  r
  r  r  r  r  r  r€   Úrcs               r   r�   zPlatformMSCOM.waitForEventsf  sð   € Ý/Ý'ßbÓbÝ1Ûä˜'¤3Ô'ÜÐDÓEÐEØ�8‰8Ñ)Ó+Ò+ÜÐNÓOÐOà�QŠ;Ø!‰Jà ˆJÙ& t§~¡~°q¸*ÀkÓRˆØ˜BÔD ´°T·^±^Ó1DÑ!DÕDà‰BØ�=¤3 t§~¡~Ó#6Ñ6Ò6áÔ!Ø‰Bð ˆBð 	�‰×ÑÔØ×ÒØ %ˆDÔØˆBØ�‰×ÑÔàˆ	r   c                 óÌ   — ddl m} ddlm} | j                  j                  «        d| _        | j                  j                  «        	  || j                  |dd«       y#  Y yxY w)aJ  
        Basically a python implementation of NativeEventQueue::postEvent().

        The magic value must be in sync with the C++ implementation or this
        won't work.

        Note that because of this method we cannot easily make use of a
        non-visible Window to handle the message like we would like to do.
        r   )ÚPostThreadMessage)ÚWM_USERTNl   8ƒd F)	r¸   r  rº   r  rÌ   r  rÍ   r  rÅ   )r   r  r  s      r   rƒ   z!PlatformMSCOM.interruptWaitEvents‹  sX   € õ 	/Ý$à�‰×ÑÔØ ˆÔØ�‰×ÑÔð	Ù˜dŸh™h¨°°zÔBð øð	Ùús   Á	A ÁA#c                 ól   — | j                   D ]  }|€Œ|j                  «        Œ d | _        | `d | _        y r_   )rÆ   ÚCloseÚoHandlerÊ   )r   r  s     r   r…   zPlatformMSCOM.deinit¡  s9   € Ø—~‘~ò 	!ˆGØÑ"Ø—‘•ð	!ð ˆŒàˆLØˆ�r   c                 ó    — ddl m}  |||«      S )Nr   )ÚCastTo)r¶   r  )r   rˆ   r‰   r  s       r   rŠ   zPlatformMSCOM.queryInterface¯  s   € Ý*Ù�i Ó,Ð,r   c                 ó„   — |j                   }|| j                  j                  k(  r	 |j                  d   }|S |S #  Y |S xY w)NrÒ   )Úhresultr¹   ÚDISP_E_EXCEPTIONÚ	excepinfo)r   r�   r”   s      r   rŽ   zPlatformMSCOM.xcptGetStatus³  sL   € ð —‘ˆØ�T—]‘]×3Ñ3Ò3ðØŸ™¨Ñ+�ð ˆˆvˆøðØØˆús   §: º?c                 ó(   — | j                  |«      dv S )N)
l   º  iº€ì   ¾  é¾€l   ¿  i¿€l     i€l   µ  iµ€©rŽ   rŒ   s     r   r�   z!PlatformMSCOM.xcptIsDeadInterface¾  s   € Ø×!Ñ! %Ó(ð -
ð 
ð 	
r   c                 ó  — t        |d«      r;	 t        |j                  «      dk\  r"|j                  d   }t        |«      dkD  r|dd  S t        |d«      r	 |j                  }t        |«      dkD  r|S 	 y y #  Y Œ0xY w#  Y y xY w)Nr!  r   r   r   Ústrerror)Úhasattrr0   r!  r'  ©r   r�   ÚsRets      r   r—   zPlatformMSCOM.xcptGetMessageÇ  s�   € Ü�5˜+Ô&ðÜ�u—‘Ó'¨1Ò,Ø Ÿ?™?¨1Ñ-�DÜ˜4“y 1’}Ø# A B˜x˜ô �5˜*Ô%ðØ—~‘~�Ü�t“9˜q’=Ø�Kð !ñ øðÙûðØØús   Ž9A4 ÁA; Á4A8Á;A?c                 ó"   — dd l }|j                  S rÿ   )r·   rÃ   r  s     r   r™   zPlatformMSCOM.xcptGetBaseXcptÙ  s   € Ûà×"Ñ"Ð"r   c                 ód  — dd l }| j                  ||«      }|j                  |_        |j                  |_        |j                  |_        |j                  |_	        |j                  |_        |j                  |_        |j                  |_        |j                   |_        |j$                  |_        |S rÿ   )r¹   r¢   ÚS_OKÚNS_OKÚE_FAILÚNS_ERROR_FAILUREÚE_ABORTÚNS_ERROR_ABORTÚ	E_POINTERÚNS_ERROR_NULL_POINTERÚE_NOINTERFACEÚNS_ERROR_NO_INTERFACEÚE_INVALIDARGÚNS_ERROR_INVALID_ARGÚE_OUTOFMEMORYÚNS_ERROR_OUT_OF_MEMORYÚ	E_NOTIMPLÚNS_ERROR_NOT_IMPLEMENTEDÚE_UNEXPECTEDÚNS_ERROR_UNEXPECTED)r   r›   r¹   s      r   rœ   z PlatformMSCOM.xcptSetupConstantsÞ  s‘   € Ûà×*Ñ*¨4°Ó:ˆð —Y‘YˆŒ
Ø $§¡ˆÔØ"Ÿl™lˆÔØ%)§^¡^ˆÔ"Ø%)×%7Ñ%7ˆÔ"Ø$(×$5Ñ$5ˆÔ!Ø&*×&8Ñ&8ˆÔ#Ø(,¯©ˆÔ%Ø#'×#4Ñ#4ˆÔ Øˆr   N)rA   rB   rC   rD   rÕ   rÖ   r×   rØ   r   rÇ   rg   rd   ri   rq   rt   rv   rx   r}   r�   rƒ   r…   rŠ   rŽ   r�   r—   r™   rœ   rE   r   r   r¥   r¥   ž  s€   „ ñð =€MØ€MØ€NØ€NòCòJxò8>ò
'òò/ò&ò8$ò#òò>#òJò,ò-ò	ò
òò$#ó
r   r¥   c                   ó|   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPlatformXPCOMz+
    Platform specific code for XPCOM.
    c                 ó˜   — t         j                  | |«       t        j                  j	                  t
        dz   «       dd l}dd l}dd l}|}y )Nz/bindings/xpcom/python/r   )	r]   r   rÀ   rÛ   r2   Ú
VBoxSdkDirÚxpcom.vboxxpcomÚxpcomÚxpcom.components)r   rÎ   rD  ra   s       r   r   zPlatformXPCOM.__init__õ  s6   € Ü×Ñ˜d GÔ,Ü�‰�‰œ
Ð%>Ñ>Ô?ÛÛÛØ‰r   c                 óX   — dd l }|j                  j                  d   j                  «       S )Nr   z@virtualbox.org/Session;1)rE  Ú
componentsÚclassesÚcreateInstance©r   rD  s     r   rg   zPlatformXPCOM.getSessionObjectý  s&   € ÛØ×Ñ×'Ñ'Ð(CÑD×SÑSÓUÐUr   c                 óp   — dd l }|j                  j                  d   j                  «       }|j                  S )Nr   z"@virtualbox.org/VirtualBoxClient;1)rE  rG  rH  rI  ré   )r   rD  rÈ   s      r   rd   zPlatformXPCOM.getVirtualBox  s1   € ÛØ×!Ñ!×)Ñ)Ð*NÑO×^Ñ^Ó`ˆØ× Ñ Ð r   c                  ó   — y)NÚXPCOMrE   rc   s    r   ri   zPlatformXPCOM.getType  rë   r   c                 óF   —  |j                  dt        |«      z   «      «       S )NrN   ©r±   rH   rî   s      r   rq   zPlatformXPCOM.getArray	  s"   € ØBˆz×%Ñ% e¬j¸Ó.AÑ&AÓBÓDÐDr   c                 óH   —  |j                  dt        |«      z   «      |«      S )NÚsetrO  ©r   ro   rp   rs   s       r   rt   zPlatformXPCOM.setArray  s$   € ØBˆz×%Ñ% e¬j¸Ó.AÑ&AÓBÀ7ÓKÐKr   c                 ó@   — dd l }|j                  j                  «        y rÿ   )rD  Ú_xpcomÚAttachThreadrJ  s     r   rv   zPlatformXPCOM.initPerThread  ó   € ÛØ�‰×!Ñ!Õ#r   c                 ó@   — dd l }|j                  j                  «        y rÿ   )rD  rT  ÚDetachThreadrJ  s     r   rx   zPlatformXPCOM.deinitPerThread  rV  r   c                 ót   — i }||d<   ||d<   d}|dz  }|dz  }|dz  }|dz  }|dz  }t        |||«       |d	   S )
NÚ	BaseClassr|   Ú zimport xpcom.components
zclass ListenerImpl(BaseClass):
zA   _com_interfaces_ = xpcom.components.interfaces.IEventListener
z7   def __init__(self): BaseClass.__init__(self, dArgs)
zresult = ListenerImpl()
Úresult©r  )r   r{   r|   r  r3   s        r   r}   zPlatformXPCOM.createListener  sj   € ØˆØ#ˆˆ+‰Øˆˆ'‰
ØˆØÐ*Ñ*ˆØÐ1Ñ1ˆØÐSÑSˆØÐIÑIˆØÐ*Ñ*ˆÜˆS�!�QŒØ�‰{Ðr   c                 ó@   — dd l }|j                  j                  |«      S rÿ   )rD  rT  ÚWaitForEvents)r   r  rD  s      r   r�   zPlatformXPCOM.waitForEvents$  s   € ÛØ�|‰|×)Ñ)¨'Ó2Ð2r   c                 ó>   — dd l }|j                  j                  «       S rÿ   )rD  rT  ÚInterruptWaitrJ  s     r   rƒ   z!PlatformXPCOM.interruptWaitEvents(  s   € ÛØ�|‰|×)Ñ)Ó+Ð+r   c                 ó@   — dd l }|j                  j                  «        y rÿ   )rD  rT  Ú	DeinitCOMrJ  s     r   r…   zPlatformXPCOM.deinit,  s   € ÛØ�‰×ÑÕ r   c                 óh   — dd l }|j                  t        |j                  j                  |«      «      S rÿ   )rE  rŠ   rI   rG  Ú
interfaces)r   rˆ   r‰   rD  s       r   rŠ   zPlatformXPCOM.queryInterface0  s)   € ÛØ×'Ñ'¬°×0@Ñ0@×0KÑ0KÈZÓ(XÓYÐYr   c                 ó   — |j                   S r_   )ÚerrnorŒ   s     r   rŽ   zPlatformXPCOM.xcptGetStatus4  s   € Ø�{‰{Ðr   c                 ó(   — | j                  |«      dv S )N)l   @   i@ €r#  r$  r%  rŒ   s     r   r�   z!PlatformXPCOM.xcptIsDeadInterface7  s   € Ø×!Ñ! %Ó(ð -
ð 
ð 	
r   c                 óh   — t        |d«      r	 |j                  }t        |«      dkD  r|S 	 y y #  Y y xY w)NÚmsgr   )r(  rj  r0   r)  s      r   r—   zPlatformXPCOM.xcptGetMessage=  sA   € Ü�5˜%Ô ðØ—y‘y�Ü�t“9˜q’=Ø�Kð !ñ øðØØús   Ž- ­1c                 ó"   — dd l }|j                  S rÿ   )rD  rz   rJ  s     r   r™   zPlatformXPCOM.xcptGetBaseXcptG  s   € ÛØ�‰Ðr   c                 ó”  — dd l }| j                  ||j                  «      }d|_        |j                  |_        |j                  |_        |j                  |_	        |j                  |_        |j                  |_        |j                  |_        |j                   |_        |j$                  |_        |j(                  |_        d|_        |S )Nr   i €i	 €)rD  r¢   ÚnsErrorÚE_ACCESSDENIEDr.  r-  r0  r/  r2  r1  r4  r3  r6  r5  r8  r7  r:  r9  r<  r;  r>  r=  r   )r   r›   rD  s      r   rœ   z PlatformXPCOM.xcptSetupConstantsK  s©   € ÛØ×*Ñ*¨4°·±Ó?ˆð *ˆÔØ—J‘JˆŒ	Ø×+Ñ+ˆŒØ×*Ñ*ˆŒØ×3Ñ3ˆŒØ!×7Ñ7ˆÔØ ×5Ñ5ˆÔØ!×8Ñ8ˆÔØ×6Ñ6ˆŒØ ×4Ñ4ˆÔØ +ˆÔØˆr   N)rA   rB   rC   rD   r   rg   rd   ri   rq   rt   rv   rx   r}   r�   rƒ   r…   rŠ   rŽ   r�   r—   r™   rœ   rE   r   r   r@  r@  ð  se   „ ñòòVò!ò
òEòLò$ò$òò3ò,ò!òZòò
òòór   r@  c                   ó^   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zy)ÚPlatformWEBSERVICEz4
    VirtualBox Web Services API specific code.
    c                 óÊ  — t         j                  | |«       t        j                  j	                  t
        dddd«      }|t        j                  vrt        j                  j                  |«       dd l}ddlm	} |�F|j                  dd«      | _        |j                  d	d«      | _        |j                  d
d«      | _        nd| _        d| _        d | _        d | _        d | _        y )NÚbindingsÚ
webserviceÚpythonÚlibr   ©ÚIWebsessionManager2Úuserr[  ÚpasswordÚurl)r]   r   rÚ   rÛ   r4   rB  rÀ   r2   ÚVirtualBox_wrappersrw  rN   rx  ry  rz  r   Úwsmgr)r   rÎ   ÚsWebServLibr{  rw  s        r   r   zPlatformWEBSERVICE.__init__c  s°   € Ü×Ñ˜d GÔ,ä—g‘g—l‘l¤:¨z¸<ÈÐSXÓYˆØœcŸh™hÑ&Ü�H‰H�O‰O˜KÔ(Û"Ý;ð ÐØŸ™ F¨BÓ/ˆDŒIØ#ŸK™K¨
°BÓ7ˆDŒMØ—{‘{ 5¨"Ó-ˆD�HàˆDŒIØˆDŒMØˆDŒHØˆŒ	Øˆ�
r   c                 óL   — | j                   j                  | j                  «      S r_   )r|  rg   r   rc   s    r   rg   z#PlatformWEBSERVICE.getSessionObject|  s   € Ø�z‰z×*Ñ*¨4¯9©9Ó5Ð5r   c                 ód   — | j                  | j                  | j                  | j                  «      S r_   )Úconnectrz  rx  ry  rc   s    r   rd   z PlatformWEBSERVICE.getVirtualBox  s!   € Ø�|‰|˜DŸH™H d§i¡i°·±Ó?Ð?r   c                  ó   — y)NÚ
WEBSERVICErE   rc   s    r   ri   zPlatformWEBSERVICE.getType‚  s   € Ør   c                  ó   — y)z3 Returns True if remote VBox host, False if local. TrE   rc   s    r   rl   zPlatformWEBSERVICE.isRemote…  rj   r   c                 ó$   — |j                  |«      S r_   rí   rî   s      r   rq   zPlatformWEBSERVICE.getArray‰  rï   r   c                 ó&   — |j                  ||«      S r_   )r²   rR  s       r   rt   zPlatformWEBSERVICE.setArrayŒ  s   € Ø×%Ñ% g¨wÓ7Ð7r   c                  ó   — y)Nr   rE   ©r   r  s     r   r�   z PlatformWEBSERVICE.waitForEvents�  s   € àr   c                  ó   — y)NFrE   r‡  s     r   rƒ   z&PlatformWEBSERVICE.interruptWaitEvents“  s   € àr   c                 ó4   — 	 | j                  «        y #  Y y xY wr_   )Ú
disconnectrc   s    r   r…   zPlatformWEBSERVICE.deinit—  s   € ð	Ø�O‰OÕøð	Ùús   ‚ “c                 ód   — i }||d<   d}|d|z   dz   z  }|d|z   dz   z  }t        |||«       |d   S )Nrˆ   r[  z from VirtualBox_wrappers import ú
z	result = z"(oIUnknown.mgr, oIUnknown.handle)
r\  r]  )r   rˆ   r‰   r  r3   s        r   rŠ   z!PlatformWEBSERVICE.queryInterface�  sT   € ØˆØ"ˆˆ+‰ØˆØÐ1°JÑ>ÀÑEÑEˆØˆ{˜ZÑ'Ð*OÑOÑOˆäˆS�!�QŒØ�‰{Ðr   c                 óº  — | j                   �| j                  «        ddlm} |€d}|| _        |€d}|| _        |€d}|| _         || j                  «      | _        | j                  j                  | j
                  | j                  «      | _         | j                   j                  s+t        d| j                  z   dz   | j
                  z   dz   «      ‚| j                   S )Nr   rv  r[  zcannot connect to 'z' as 'ú')r   rŠ  r{  rw  rz  rx  ry  r|  ÚlogonÚhandlerz   )r   rz  rx  Úpasswdrw  s        r   r€  zPlatformWEBSERVICE.connect«  s¼   € Ø�9‰9Ð Ø�O‰OÔÝ;àˆ;ØˆCØˆŒØˆ<ØˆDØˆŒ	Øˆ>ØˆFØˆŒÙ(¨¯©Ó2ˆŒ
Ø—J‘J×$Ñ$ T§Y¡Y°·±Ó>ˆŒ	Ø�y‰y×ÒÜÐ1°D·H±HÑ<¸xÑGÈ$Ï)É)ÑSÐVYÑYÓZÐZØ�y‰yÐr   c                 óž   — | j                   �A| j                  �4| j                  j                  | j                   «       d | _         d | _        y y y r_   )r   r|  Úlogoffrc   s    r   rŠ  zPlatformWEBSERVICE.disconnect¿  sA   € Ø�9‰9Ð  T§Z¡ZÐ%;Ø�J‰J×Ñ˜dŸi™iÔ(ØˆDŒIØˆD�Jð &<Ð r   N)rA   rB   rC   rD   r   rg   rd   ri   rl   rq   rt   r�   rƒ   r…   rŠ   r€  rŠ  rE   r   r   rp  rp  ^  sI   „ ñòò26ò@òòò/ò8òòòòòó(r   rp  c                   óì   — e Zd ZdZ G d„ de«      Zd!d„Zd„ Zd„ Ze	d„ «       Z
d	„ Zd"d
„Zd„ Zd„ Zd"d„Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd#d„Zd„ Zd„ Zd„ Zd„ Zd$d„Zd"d„Zd"d„Zd"d„Zd„ Zd„ Z d"d„Z!d"d „Z"y)%ÚVirtualBoxManagera±  
    VirtualBox API manager class.

    The API users will have to instantiate this.  If no parameters are given,
    it will default to interface with the VirtualBox running on the local
    machine.  sStyle can be None (default), MSCOM, XPCOM or WEBSERVICES.  Most
    users will either be specifying None or WEBSERVICES.

    The dPlatformParams is an optional dictionary for passing parameters to the
    WEBSERVICE backend.
    c                   ó   — e Zd Zd„ Zy)úVirtualBoxManager.Statusesc                  ó   — y r_   rE   rc   s    r   r   z#VirtualBoxManager.Statuses.__init__Ý  s   € Ør   N)rA   rB   rC   r   rE   r   r   ÚStatusesr—  Ü  s   „ ó	r   r™  Nc                 ór  — |€t         j                  dk(  rd}nd}|dk(  rt        |«      | _        n:|dk(  rt        |«      | _        n$|dk(  rt	        |«      | _        nt        d|›�«      ‚|| _        | j                  j                  «       | _        | j                  j                  «       | _
        t        |dk(  «      | _        | j                  j                  t        j                  «       «      | _        d | _        i | _        | j                  j'                  «       | _        | j(                  a	 | j                  j-                  «       }y # t.        $ r! t1        d«       t3        j4                  «        ‚ t
        $ r; t        j6                  «       \  }}}t1        d|«       t3        j4                  «        Y y w xY w)NÚwin32r   rM  r‚  zUnknown sStyle=z:Installation problem: check that appropriate libs in placezinit exception: )rÀ   Úplatformr@  r¥   rp  rz   Ústyleri   r   rl   Úremoter   rª   rœ   r•  r™  ÚstatusesÚ_dErrorValToNameÚ_ddEnumValueToNamer™   Ú
oXcptClassÚCurXcptClassrd   Ú	NameErrorrÄ   Ú	tracebackÚ	print_excrÁ   )r   ÚsStyleÚdPlatformParamsr   ra   Úes         r   r   zVirtualBoxManager.__init__à  sj  € Øˆ>Ü�|‰|˜wÒ&Ø ‘à �Ø�WÒÜ)¨/Ó:ˆD�MØ�wÒÜ)¨/Ó:ˆD�MØ�|Ò#Ü.¨Ó?ˆD�Må±6Ð;Ó<Ð<ØˆŒ
Ø—M‘M×)Ñ)Ó+ˆŒ	Ø—m‘m×,Ñ,Ó.ˆŒä1°&¸LÑ2HÓIˆŒð Ÿ™×8Ñ8Ô9J×9SÑ9SÓ9UÓVˆŒð !%ˆÔð #%ˆÔð Ÿ-™-×7Ñ7Ó9ˆŒà—‘ˆð		"Ø—=‘=×.Ñ.Ó0‰DøÜò 	ÜÐNÔOÜ×ÑÔ!ØÜò 	"Ü—l‘l“n‰GˆAˆq�!ÜÐ$ aÔ(Ü×ÑÖ!ð	"ús   Ä/E
 Å
A)F6Æ5F6c                 ó$   — | j                  «        y r_   )r…   rc   s    r   Ú__del__zVirtualBoxManager.__del__  s   € Ø�‰�r   c                  ó   — y)z~
        Returns a Python API revision number.
        This will be incremented when features are added to this file.
        r   rE   rc   s    r   ÚgetPythonApiRevisionz&VirtualBoxManager.getPythonApiRevision  s   € ð
 r   c                 ó   — | S )z£
        This used to be an attribute referring to a session manager class with
        only one method called getSessionObject. It moved into this class.
        rE   rc   s    r   r   zVirtualBoxManager.mgr  s	   € ð ˆr   c                 ó6   — | j                   j                  «       S )z$ See PlatformBase::getVirtualBox(). )rœ  rd   rc   s    r   rd   zVirtualBoxManager.getVirtualBox$  s   € à�}‰}×*Ñ*Ó,Ð,r   c                 ó:   — |}| j                   j                  «       S )z' See PlatformBase::getSessionObject(). )rœ  rg   )r   ÚoIVBoxra   s      r   rg   z"VirtualBoxManager.getSessionObject(  s   € ð ˆØ�}‰}×-Ñ-Ó/Ð/r   c                 ó:   — | j                   j                  ||«      S )z See PlatformBase::getArray(). )rœ  rq   rî   s      r   rq   zVirtualBoxManager.getArray.  s   € à�}‰}×%Ñ% j°'Ó:Ð:r   c                 ó<   — | j                   j                  |||«      S )z See PlatformBase::setArray(). )rœ  rt   rR  s       r   rt   zVirtualBoxManager.setArray2  s   € à�}‰}×%Ñ% j°'¸7ÓCÐCr   c                 ó:   — | j                   j                  ||«      S )z% See PlatformBase::createListener(). )rœ  r}   )r   r{   r|   s      r   r}   z VirtualBoxManager.createListener6  s   € à�}‰}×+Ñ+¨J¸Ó>Ð>r   c                 ó8   — | j                   j                  |«      S )z$ See PlatformBase::waitForEvents(). )rœ  r�   )r   r€   s     r   r�   zVirtualBoxManager.waitForEvents:  s   € à�}‰}×*Ñ*¨:Ó6Ð6r   c                 ó6   — | j                   j                  «       S )z* See PlatformBase::interruptWaitEvents(). )rœ  rƒ   rc   s    r   rƒ   z%VirtualBoxManager.interruptWaitEvents>  s   € à�}‰}×0Ñ0Ó2Ð2r   c                 ó:   — | j                   j                  ||«      S )z% See PlatformBase::queryInterface(). )rœ  rŠ   r‡   s      r   rŠ   z VirtualBoxManager.queryInterfaceB  s   € à�}‰}×+Ñ+¨I°zÓBÐBr   c                 ó8   — | j                   j                  «        y)ú& See PlatformBase::deinitPerThread(). N)rœ  rv   rc   s    r   rv   zVirtualBoxManager.initPerThreadI  s   € à�‰×#Ñ#Õ%r   c                 ó6   — | j                   j                  «       S )r¹  )rœ  rx   rc   s    r   rx   z!VirtualBoxManager.deinitPerThreadM  s   € à�}‰}×,Ñ,Ó.Ð.r   c                 óv   — t        | d«      r-| j                  �!| j                  j                  «        d| _        y)zc
        For unitializing the manager.
        Do not access it after calling this method.
        rœ  NT)r(  rœ  r…   rc   s    r   r…   zVirtualBoxManager.deinitQ  s1   € ô
 �4˜Ô$¨¯©Ð)BØ�M‰M× Ñ Ô"Ø ˆDŒMØr   c                 ó¨   — | j                  «       }|r| j                  j                  }n| j                  j                  }|j	                  ||«       |S )z’
        Attempts to open the a session to the machine.
        Returns a session object on success.
        Raises exception on failure.
        )rg   rª   ÚLockType_SharedÚLockType_WriteÚlockMachine)r   Ú	oIMachineÚfPermitSharingÚoSessionÚeTypes        r   ÚopenMachineSessionz$VirtualBoxManager.openMachineSession^  sH   € ð ×(Ñ(Ó*ˆÙØ—N‘N×2Ñ2‰Eà—N‘N×1Ñ1ˆEØ×Ñ˜h¨Ô.Øˆr   c                 ó(   — |�|j                  «        y)za
        Closes a session opened by openMachineSession.
        Ignores None parameters.
        T)ÚunlockMachine)r   rÂ  s     r   ÚcloseMachineSessionz%VirtualBoxManager.closeMachineSessionl  s   € ð
 ÐØ×"Ñ"Ô$Ør   c                 ó   — t        | |«      S )z�
        Returns a helper class (PerfCollector) for accessing performance
        collector goodies.  See PerfCollector for details.
        )r
   )r   r±  s     r   ÚgetPerfCollectorz"VirtualBoxManager.getPerfCollectoru  s   € ô
 ˜T 6Ó*Ð*r   c                 ó   — t         S )z:
        Returns the VirtualBox binary directory.
        )Ú
VBoxBinDirrc   s    r   Ú	getBinDirzVirtualBoxManager.getBinDir|  ó
   € ô
 Ðr   c                 ó   — t         S )z7
        Returns the VirtualBox SDK directory.
        )rB  rc   s    r   Ú	getSdkDirzVirtualBoxManager.getSdkDirƒ  rÍ  r   c                 ód  — | j                   j                  |«      }|�|j                  |«      }|rz|s|S |›d|›�S | j                  j                  |«      }t	        |«      dkD  rFt        «       }|D ]
  }||||   <   Œ || j                   |<   |j                  |«      }|r|s|S |›d|›�S |›d|›�S )zM
        Returns the name (string) for the corresponding enum value.
        ra   r   Ú	_Unknown_)r¡  rN   rª   Ú
all_valuesr0   Údict)r   ÚsEnumTypeNmÚ
oEnumValueÚfTypePrefixÚdValueNamesÚ
sValueNameÚdNamedValuesrá   s           r   ÚgetEnumValueNamez"VirtualBoxManager.getEnumValueNameŠ  sÏ   € ð
 ×-Ñ-×1Ñ1°+Ó>ˆØÐ"Ø$Ÿ™¨Ó4ˆJÙÙ)4�zÐ]Â[ÑR\Ð:]Ð]ð  Ÿ>™>×4Ñ4°[ÓAˆLÜ�<Ó  1Ò$ä"›f�Ø)ò >�EØ7<�K ¨UÑ 3Ò4ð>à7B�×'Ñ'¨Ñ4ð )Ÿ_™_¨ZÓ8�
ÙÙ-8˜:ÐaÊÑV`Ð>aÐaò #.©zÐ:Ð:r   c                 ój   — |€t        j                  «       d   }| j                  j                  |«      S )z‘
        Gets the status code from an exception.  If the exception parameter
        isn't specified, the current exception is examined.
        r   )rÀ   rÁ   rœ  rŽ   rŒ   s     r   rŽ   zVirtualBoxManager.xcptGetStatusª  s.   € ð
 ˆ=Ü—L‘L“N 1Ñ%ˆEØ�}‰}×*Ñ*¨5Ó1Ð1r   c                 ój   — |€t        j                  «       d   }| j                  j                  |«      S )zÃ
        Returns True if the exception indicates that the interface is dead,
        False if not.  If the exception parameter isn't specified, the current
        exception is examined.
        r   )rÀ   rÁ   rœ  r�   rŒ   s     r   r�   z%VirtualBoxManager.xcptIsDeadInterface³  s.   € ð ˆ=Ü—L‘L“N 1Ñ%ˆEØ�}‰}×0Ñ0°Ó7Ð7r   c                 óz   — | j                   €y|€t        j                  «       d   }t        || j                   «      S )z²
        Checks if the exception is one that could come from the VBox API. If
        the exception parameter isn't specified, the current exception is
        examined.
        Fr   )r¢  rÀ   rÁ   rÂ   rŒ   s     r   ÚxcptIsOurXcptKindz#VirtualBoxManager.xcptIsOurXcptKind½  s7   € ð �?‰?Ð"ØØˆ=Ü—L‘L“N 1Ñ%ˆEÜ˜% §¡Ó1Ð1r   c                 ól   — |€t        j                  «       d   }| j                  j                  ||«      S )aŠ  
        Checks if the exception oXcpt is equal to the COM/XPCOM status code
        hrStatus.

        The oXcpt parameter can be any kind of object, we'll just return True
        if it doesn't behave like a our exception class.  If it's None, we'll
        query the current exception and examine that.

        Will not raise any exception as long as hrStatus and self are not bad.
        r   )rÀ   rÁ   rœ  r•   ©r   r�   r“   s      r   r•   zVirtualBoxManager.xcptIsEqualÉ  s0   € ð ˆ=Ü—L‘L“N 1Ñ%ˆEØ�}‰}×(Ñ(¨°Ó9Ð9r   c                 ó(   — | j                  ||«       S )z&
        Negated xcptIsEqual.
        )r•   rà  s      r   ÚxcptIsNotEqualz VirtualBoxManager.xcptIsNotEqualØ  s   € ð ×#Ñ# E¨8Ó4Ð4Ð4r   c                 ó(  — |�| j                  |«      r| j                  |«      }n|}| j                  € t        «       }t	        | j
                  «      D ]Q  }|d   j                  «       sŒt        | j
                  |«      }t        |t        t        f«      sŒD||t        |«      <   ŒS dD ]!  }t        | j
                  |d«      }|€Œ|||<   Œ# || _        	 | j                  t        |«         }|S # t        $ r t        |«      }d|dz  |fz  }Y |S w xY w)zà
        Converts the specified COM status code, or the status code of the
        specified exception, to a C constant string.  If the parameter isn't
        specified (is None), the current exception is examined.
        Nr   )	r-  r/  r1  r3  r5  r7  r9  r;  r=  z%#x (%d)r’   )rÞ  rŽ   r   rÓ  rž   rŸ  rŸ   rI   rÂ   r1   Úlongrô   )r   ÚhrStatusOrXcptr“   ÚdErrorValToNameÚsKeyrZ   ÚsStrÚhrLongs           r   ÚxcptToStringzVirtualBoxManager.xcptToStringÞ  s$  € ð Ð! T×%;Ñ%;¸NÔ%KØ×)Ñ)¨.Ó9‰Hà%ˆHð × Ñ Ð(Ü"›fˆOÜ˜DŸM™MÓ*ò <�Ø˜‘7—?‘?Õ$Ü$ T§]¡]°DÓ9�FÜ! &¬3´¨+Õ6Ø7;˜¬¨F«Ò4ð	<ðHò 3�ä  §¡°°dÓ;�ØÑ%Ø.2�O FÒ+ð	3ð
 %4ˆDÔ!ð	>Ø×(Ñ(¬¨X«Ñ7ˆDð ˆøô ò 	>Ü˜(“^ˆFØ ¨*Ñ!4°fÐ =Ñ=‰DØˆð	>ús   ÃC/ Ã/DÄDc                 ó”   — |€t        j                  «       d   }| j                  j                  |«      }|€| j	                  |«      }|S )z¨
        Returns the best error message found in the COM-like exception. If the
        exception parameter isn't specified, the current exception is examined.
        r   )rÀ   rÁ   rœ  r—   rê  r)  s      r   r—   z VirtualBoxManager.xcptGetMessage  sG   € ð
 ˆ=Ü—L‘L“N 1Ñ%ˆEØ�}‰}×+Ñ+¨EÓ2ˆØˆ<Ø×$Ñ$ UÓ+ˆDØˆr   )NNr_   )T)F)#rA   rB   rC   rD   r)   r™  r   r«  r­  Úpropertyr   rd   rg   rq   rt   r}   r�   rƒ   rŠ   rv   rx   r…   rÄ  rÇ  rÉ  rÌ  rÏ  rÚ  rŽ   r�   rÞ  r•   râ  rê  r—   rE   r   r   r•  r•  Ï  s³   „ ñ
ô�6ô ó-"ò^òð ñó ðò-ó0ò;òDó?ò7ò3òCò&ò/òóòò+òòó<ó@2ó8ó
2ò:ò5ó#ôJ
r   r•  )"rD   Ú__copyright__Ú__version__rÚ   rÀ   r¥  Úversion_infoÚranger/   r1   rä  rœ  ÚenvironrN   rË  rB  ÚsystemrÛ   Úabspathr2   ÚVirtualBox_constantsr   r)   r
   rH   rR   rX   r[   r]   r¥   r@  rp  r£  r•  rE   r   r   ú<module>rõ     s„  ðñð
ð ð> $€ó 
Û 
Û ð ×Ñ�vÒØ€FØ€Dó
 Ø�Z‰Z�^‰^Ð/°Ó6€
Ø�Z‰Z�^‰^˜O¨TÓ2€
äÐØ€x‡�Ó˜HÒ$ØB‰
à*‰
à—‘—‘¤Ó,€JäÐØ€x‡�Ó˜HÒ$ØF‰
à.‰
à—‘—‘¤Ó,€Jä",€‡
�
ÐÑ Ü(€‡
�
ˆ?Ñ Ø ‡�‡�”
Ô õ ;ôI�Fô Iò^+ð Øñ€ò6ò*>ôK�6ô Kô\O�Lô Oôd
k�Lô kô\e˜ô eð\ €ô~˜õ ~r   