HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/win_osinfo.cpython-310.pyc
o

�N�gO�	@s�dZddlZdZzddlmZmZmZmZddlZddl	Z	Wn
e
efy+dZYnwer5ejddd�Z
dd	�Zd
d�Zdd
�Zdd�ZdS)z&
Get Version information from Windows
�NT)�BYTE�DWORD�WCHAR�WORDF�kernel32)�use_last_errorcCstsdSdS)z4
    Only load if Win32 Libraries are installed
    )FzThis utility requires pywin32Z
win_osinfo)�	HAS_WIN32�r	r	�I/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/win_osinfo.py�__virtual__srcCs0tsdSGdd�dtj�}Gdd�d|�}|�S)z�
    Helper function to return the results of the GetVersionExW Windows API call.
    It is a ctypes Structure that contains Windows OS Version information.

    Returns:
        class: An instance of a class containing version info
    NcsHeZdZdefdefdefdefdefdedffZ�fdd	�Z�ZS)
z)os_version_info_ex.<locals>.OSVersionInfo�dwOSVersionInfoSize�dwMajorVersion�dwMinorVersion�
dwBuildNumber�dwPlatformIdZszCSDVersion�cs2t�j|i|��t�|�|_t�t�|��dS)N)�super�__init__�ctypes�sizeofrrZ
GetVersionExW�byref)�self�args�kwds��	__class__r	r
r:sz2os_version_info_ex.<locals>.OSVersionInfo.__init__)�__name__�
__module__�__qualname__rr�_fields_r�
__classcell__r	r	rr
�
OSVersionInfo0s
�	r!c@s.eZdZdefdefdefdefdeffZdS)z+os_version_info_ex.<locals>.OSVersionInfoEx�wServicePackMajor�wServicePackMinor�
wSuiteMask�wProductTypeZ	wReservedN)rrrrrrr	r	r	r
�OSVersionInfoEx?s�r&)rr�	Structure)r!r&r	r	r
�os_version_info_ex%s
	r(c	Cs0t�}|j|j|j|j|j|j|j|jd�}|S)N)ZMajorVersionZMinorVersionZBuildNumberZ
PlatformIDZServicePackMajorZServicePackMinorZ	SuiteMaskZProductType)	r(r
rrrr"r#r$r%)�info�retr	r	r
�get_os_version_infoKs�r+cCs:t��}tjdtjdtjdtjdi}|d||dd�S)z�
    Gets information about the domain/workgroup. This will tell you if the
    system is joined to a domain or a workgroup

    .. versionadded:: 2018.3.4

    Returns:
        dict: A dictionary containing the domain/workgroup and its status
    ZUnknownZUnjoinedZ	Workgroup�Domainr�)r,Z
DomainType)�win32netZNetGetJoinInformation�win32netconZNetSetupUnknownZNetSetupUnjoinedZNetSetupWorkgroupNameZNetSetupDomainName)r)�statusr	r	r
�
get_join_info[s
�r1)�__doc__rrZctypes.wintypesrrrrr.r/�ImportError�
ValueErrorZWinDLLrrr(r+r1r	r	r	r
�<module>s&��
&