%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python3/dist-packages/paramiko/__pycache__/
Upload File :
Create Path :
Current File : //usr/lib/python3/dist-packages/paramiko/__pycache__/_winapi.cpython-312.pyc

�

�ec^,����dZddlZddlZddlmZmZd�ZGd�dej�Zd�Z	dZ
ejjjZ
ejjej fe
_ejj$e
_ejjj(Zejj*fe_ejj,e_ejjj.Zejj*fe_ejj0e_ejjj2Zejj*fe_ej e_ejjj4Zejj$ej8ejj:ejj:ejj:ejj<ge_ejj$e_ejjj>Zejj$e_ejjj@Z ejj$fe _ejjjBZ!ej8ej8ej fe!_ejjDfejjjF_Gd	�d
e$�Z%dZ&dZ'e&Z(e&Z)e&Z*d
Z+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8e'e,ze-ze.ze/ze0ze1ze2ze3ze4ze5ze6ze7zZ9e(e-ze.zZ:e)e/ze0ze1ze2ze3ze4ze5ze6zZ;e*e,ze7zZ<Gd�d�Z=Gd�d�Z>Gd�dej~�Z@Gd �d!ej~�ZAGd"�d#ej~�ZBej�eA�ej8ejj0fejj�j�_d$�ZFd%�ZGd&�ZHd(d'�ZIy))z�
Windows API functions implemented as ctypes functions and classes as found
in jaraco.windows (3.4.1).

If you encounter issues with this module, please consider reporting the issues
in jaraco.windows and asking the author to port the fixes back here.
�N)�u�builtinsc	�l�d}d}||z}d}|}d}tjj�}d}d}	tjjj||||tj|�||	�}
t|
�|j}tjjj|�|S)zf
    Call FormatMessage with a system error number to retrieve
    the descriptive error message.
    ��Nr)
�ctypes�wintypes�LPWSTR�windll�kernel32�FormatMessageW�byref�handle_nonzero_success�value�	LocalFree)�errno�ALLOCATE_BUFFER�FROM_SYSTEM�flags�source�
message_id�language_id�
result_buffer�buffer_size�	arguments�bytes�messages            �2/usr/lib/python3/dist-packages/paramiko/_winapi.py�format_system_messagers����O��K�
�k�)�E�
�F��J��K��O�O�*�*�,�M��K��I��M�M�"�"�1�1�
�������]�#���
�E��5�!��!�!�G�
�M�M���$�$�]�3��N�c�P��eZdZdZd�fd�	Zed��Zed��Zd�Zd�Z	�xZ
S)�WindowsErrorzZmore info about errors at
    http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspxc����|�(tjjj�}t	|�}t
jdkDrd|d|f}n||f}tt|�&|�y)N)�r$r)
rrr�GetLastErrorr�sys�version_info�superr"�__init__)�selfr�strerror�args�	__class__s    �rr)zWindowsError.__init__;s^����=��M�M�*�*�7�7�9�E�(��/�����f�$��h��e�+�D��(�?�D�
�l�D�*�D�1r c��|jS�N)r+�r*s rrzWindowsError.messageE����}�}�r c��|jSr/)�winerrorr0s r�codezWindowsError.codeIr1r c��|jSr/)rr0s r�__str__zWindowsError.__str__Ms���|�|�r c�6�djdit���S)Nz*{self.__class__.__name__}({self.winerror})�)�format�varsr0s r�__repr__zWindowsError.__repr__Ps��B�;�B�B�L�T�V�L�Lr r/)�__name__�
__module__�__qualname__�__doc__r)�propertyrr4r6r;�
__classcell__�r-s@rr"r"7sA���D�2����������Mr r"c�"�|dk(r
t��y�Nr)r")�results rrrTs��
��{��n��r �c�6�eZdZdZd	d�Zd�Zd�Zd�Zd�Zd�Z	y)
�	MemoryMapzL
    A memory map object which can have security attributes overridden.
    Nc�<�||_||_||_d|_yrD)�name�length�security_attributes�pos)r*rJrKrLs    rr)zMemoryMap.__init__�s����	����#6�� ���r c
�n�|jrtj|j�nd}d}d}d}tjjj|||d|jt|j��}t|�||k(rtd��||_t||ddd�|_
|S)N����rFrzFailed to create file mapping)rLrrrr�CreateFileMappingWrKrrJr�	Exception�filemap�
MapViewOfFile�view)r*�p_SA�INVALID_HANDLE_VALUE�PAGE_READWRITE�FILE_MAP_WRITErSs      r�	__enter__zMemoryMap.__enter__�s����'�'�
�L�L��1�1�2��	
�
 "�������-�-�(�(�;�;� ���
��K�K�
�d�i�i�L�

��	�w�'��*�*��;�<�<����!�'�>�1�a��C��	��r c��||_yr/)rM)r*rMs  r�seekzMemoryMap.seek�s	����r c�n�t|t�sJ�t|�}|j|z|jk\rtd|z��|j|jz}tj|�}tjjj|||�|xj|z
c_y)NzRefusing to write %d bytes)�
isinstancer�lenrMrK�
ValueErrorrUr�c_size_trr�
RtlMoveMemory)r*�msg�n�destrKs     r�writezMemoryMap.write�s����#�u�%�%�%���H���8�8�a�<�4�;�;�&��9�A�=�>�>��y�y�4�8�8�#������#���
�
���,�,�T�3��?����A�
�r c� �tj|�}|j|jz}tj|�}tj
jj|||�|xj|z
c_|jS)z0
        Read n bytes from mapped view.
        )	r�create_string_bufferrUrMrarrrb�raw)r*rd�outrrKs     r�readzMemoryMap.read�sf���)�)�!�,�����T�X�X�%������#���
�
���,�,�S�&�&�A����A�
���w�w�r c���tjjj|j�tjjj|j�yr/)rrr�UnmapViewOfFilerU�CloseHandlerS)r*�exc_type�exc_val�tbs    r�__exit__zMemoryMap.__exit__�s:���
�
���.�.�t�y�y�9��
�
���*�*�4�<�<�8r r/)
r<r=r>r?r)rZr\rfrkrrr8r rrHrH�s%�����0��	�9r rHiii�rP��� �@�riiirc��eZdZdZy)�TokenAccessrtN)r<r=r>�TOKEN_QUERYr8r rrzrzs���Kr rzc��eZdZdZy)�TokenInformationClassrsN)r<r=r>�	TokenUserr8r rr}r}s���Ir r}c�\�eZdZdZdej
fdejjfgZy)�
TOKEN_USERrs�SID�
ATTRIBUTESN)	r<r=r>�numr�c_void_pr	�DWORD�_fields_r8r rr�r�s,��
�C�	���� �	�v���,�,�-��Hr r�c���eZdZdZej
jZdZdejfdejfdefdejfdejfdejfd	ejfgZy
)�SECURITY_DESCRIPTORz�
    typedef struct _SECURITY_DESCRIPTOR
        {
        UCHAR Revision;
        UCHAR Sbz1;
        SECURITY_DESCRIPTOR_CONTROL Control;
        PSID Owner;
        PSID Group;
        PACL Sacl;
        PACL Dacl;
        }   SECURITY_DESCRIPTOR;
    rs�Revision�Sbz1�Control�Owner�Group�Sacl�DaclN)r<r=r>r?rr	�USHORT�SECURITY_DESCRIPTOR_CONTROL�REVISION�c_ubyter�r�r8r rr�r�sx���#)�/�/�"8�"8���H�
�V�^�^�$�	���� �	�/�0�	�&�/�/�"�	�&�/�/�"�	����!�	����!��Hr r�c����eZdZdZdej
jfdejfdej
jfgZ	�fd�Z
ed��Zejd��Z�xZS)�SECURITY_ATTRIBUTESz�
    typedef struct _SECURITY_ATTRIBUTES {
        DWORD  nLength;
        LPVOID lpSecurityDescriptor;
        BOOL   bInheritHandle;
    } SECURITY_ATTRIBUTES;
    �nLength�lpSecurityDescriptor�bInheritHandlec�h��tt|�
|i|��tjt�|_yr/)r(r�r)r�sizeofr�)r*r,�kwargsr-s   �rr)zSECURITY_ATTRIBUTES.__init__Gs)���
�!�4�1�4�B�6�B��}�}�%8�9��r c��|jSr/)�_descriptorr0s r�
descriptorzSECURITY_ATTRIBUTES.descriptorKs�����r c�F�||_tj|�|_yr/)r�r�	addressofr�)r*rs  rr�zSECURITY_ATTRIBUTES.descriptorOs�� ���$*�$4�$4�U�$;��!r )r<r=r>r?rr	r�r��BOOLr�r)r@r��setterrArBs@rr�r�8st����
�F�O�O�)�)�*�	����1�	�6�?�?�/�/�0��H�:�� �� ����<��<r r�c�p�tjj�}tjjj||jddtj|��tj|j�}ttjjj||jtj|�tj|�tj|���tj|tjt��jS)z:
    Given a token, get the token information for it.
    r)rr	r�r�advapi32�GetTokenInformationr�rrhrrr��cast�POINTERr��contents)�token�information_class�	data_size�datas    rr�r�_s������%�%�'�I�
�M�M���.�.�
� �$�$�a��F�L�L��,C���&�&�y���7�D���
�
���2�2���!�!��L�L����M�M�$���L�L��#�	
���;�;�t�V�^�^�J�7�8�A�A�Ar c	��tjj�}tjj|�}ttjj
j
||tj|���|Sr/)rr	�HANDLErrr��OpenProcessTokenr)�proc_handle�accessrEs   rr�r�ts_��
�_�_�
#�
#�
%�F��/�/�(�(��5�K���
�
���/�/������f�!5�	
��
�Mr c��ttjjj	�t
j�}t|t�S)z<
    Return a TOKEN_USER for the owner of this process.
    )	r�rrr�GetCurrentProcessrzr{r�r�)�processs r�get_current_userr�s;����
�
���0�0�2�K�4K�4K��G��w�
�3�3r c��|�
t�}t|t�sJd��t�}t	�}||_d|_tjjjtj|�tj�tjjjtj|�|jd�|S)z�
    Return a SECURITY_ATTRIBUTES structure with the SID set to the
    specified user (uses current user if none is specified).
    z user must be TOKEN_USER instancersr)r�r^r�r�r�r�r�rrr��InitializeSecurityDescriptorrr��SetSecurityDescriptorOwnerr�)�user�SD�SAs   r� get_security_attributes_for_userr��s���
�|��!���d�J�'�K�)K�K�'�	�	�B�	�	�B��B�M��B��
�M�M���7�7����R��-�6�6���M�M���5�5����R��$�(�(�A���Ir r/)Jr?r&�ctypes.wintypesr�paramiko.py3compatrrrr"r�
GMEM_MOVEABLErr�GlobalAllocr	�UINTra�argtypesr��restype�
GlobalLock�HGLOBAL�LPVOID�GlobalUnlockr��
GlobalSizerQ�CreateFileMappingr�r�r
rTrmrb�HLOCALr�objectrH�READ_CONTROL�STANDARD_RIGHTS_REQUIRED�STANDARD_RIGHTS_READ�STANDARD_RIGHTS_WRITE�STANDARD_RIGHTS_EXECUTE�STANDARD_RIGHTS_ALL�POLICY_VIEW_LOCAL_INFORMATION�POLICY_VIEW_AUDIT_INFORMATION�POLICY_GET_PRIVATE_INFORMATION�POLICY_TRUST_ADMIN�POLICY_CREATE_ACCOUNT�POLICY_CREATE_SECRET�POLICY_CREATE_PRIVILEGE�POLICY_SET_DEFAULT_QUOTA_LIMITS�POLICY_SET_AUDIT_REQUIREMENTS�POLICY_AUDIT_LOG_ADMIN�POLICY_SERVER_ADMIN�POLICY_LOOKUP_NAMES�POLICY_NOTIFICATION�POLICY_ALL_ACCESS�POLICY_READ�POLICY_WRITE�POLICY_EXECUTErzr}�	Structurer�r�r�r�r�r�r�r�r�r�r8r r�<module>r�sw�����*�!�HM�8�(�(�M�:��
��m�m�$�$�0�0�����+�+�V�_�_�<����o�o�,�,���
�]�]�
#�
#�
.�
.�
����.�.�0�
���_�_�+�+�
���}�}�%�%�2�2�����0�0�2������+�+���
�]�]�
#�
#�
.�
.�
����.�.�0�
���_�_�
���M�M�*�*�=�=��
�O�O���
�O�O�
�O�O���
�O�O���
�O�O���
�O�O���
���#�O�O�2�2����
�
�&�&�4�4�
����.�.�
���-�-�(�(�8�8��"�O�O�2�2�4����
�
�&�&�4�4�
� �/�/�6�?�?�F�O�O�L�
��-3�_�_�-C�-C�,E��
�
��� � �)�=9��=9�H��%��#��$��&�� ��!+�� *��!+����"��!��$��",�� *��#�� �� �� ���#�$�#�$�%�%��	�
���
���&�&�$�	$��
������$�#�$�$�%����������	�
&�&�$�
$�����
��#�$����������!�!���&�*�*��8<�&�*�*�<�<�F�N�N�&�'�
�O�O�
�O�O���>��
�
���1�1�:�B�*�4�r 

Zerion Mini Shell 1.0