
    VhZ                    $   d dl mZmZmZ eZd dlZd dlmZm	Z	 d dl
mZmZ d dlmZmZ d dlmZ d dlmZ 	 d dlmZ 	 d d	lmZmZ d
dlmZ  e       Zd Z G d de      Z  G d de      Z! G d d      Z"y# e$ r e	ZY Cw xY w# e$ r dxZZY Iw xY w)    )absolute_importdivisionprint_functionN)AnsibleActionFailAnsibleConnectionFailure)	to_nativeto_text)check_type_boolcheck_type_int)
ActionBase)Display)Timeout)DictOptional   )reboot_hostc                    i ddddddddd	d
dddddddddddddddddddddd d!d"i d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDi dEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfi dgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddddi ddddddddddddddddddddddddddddddddddi ddddddddddddddddddddddddddēddƓddȓddʓdd̓i ddΓddГddғddԓdd֓ddؓddړddܓddޓddddddddddddddddi dddddddddddddddddd ddddddddd	d
ddddddi dddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2i d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTi dUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvi dwdxdydzd{d|d}d~ddddddddddddddddddddddddddi ddddddddddddddddddddddddddddddddddi dddddddddÐdēdŐdƓdǐdȓdɐdʓdːd̓d͐dΓdϐdГdѐdғdӐdԓdՐd֓dאdؓdِdړdېdܓi dݐdޓdߐdddddddddddddddddddddddddddddddi dd ddddddddd	d
dddddddddddddddddddddd i d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBi dCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddi dedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~ddddddddi ddddddddddddddddddddddddddddddddddi dddddddddddddddddddddddddddÐdēdŐdƓdǐdȓdɐdʓi dːd̓d͐dΓdϐdГdѐdғdӐdԓdՐd֓dאdؓdِdړdېdܓdݐdޓdߐdddddddddddddi dddddddddddddddddddd ddddddddd	d
ddddi dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0i d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRi dSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdti dudvdwdxdydzd{d|d}d~ddddddddddddddddddddddddi dddddddddddddddddddddddddddddddddddddddddddddÐdĐdŜj                  | dƐd| z  f      \  }}d||| dz  fz  S (  a  Converts a WUA HRESULT to a human readable error message.

    Windows doesn't offer an automatic way to get an error message from a WUA HRESULT. This method is used to convert
    those results to a human readable error message based on the values extracted from wuerror.h from the Windows SDK.

    Args:
        hresult (int): The HRESULT to convert.

    Returns:
        (str): The error message for the HRESULT
    i $ )WU_S_SERVICE_STOPz-Windows Update Agent was stopped successfullyi $ )WU_S_SELFUPDATEz#Windows Update Agent updated itselfi $ )WU_S_UPDATE_ERRORzKOperation completed successfully but there were errors applying the updatesi $ )WU_S_MARKED_FOR_DISCONNECTzA callback was marked to be disconnected later because the request to disconnect the operation came while a callback was executingi $ )WU_S_REBOOT_REQUIREDzCThe system must be restarted to complete installation of the updatei $ )WU_S_ALREADY_INSTALLEDz=The update to be installed is already installed on the systemi $ )WU_S_ALREADY_UNINSTALLEDz7The update to be removed is not installed on the systemi $ )WU_S_ALREADY_DOWNLOADEDz7The update to be downloaded has already been downloadedi	 $ )$WU_S_SOME_UPDATES_SKIPPED_ON_BATTERYznThe operation completed successfully, but some updates were skipped because the system is running on batteriesi
 $ )WU_S_ALREADY_REVERTEDz6The update to be reverted is not present on the systemi $ )"WU_S_SEARCH_CRITERIA_NOT_SUPPORTEDzbThe operation is skipped because the update service does not support the requested search criteriai $ )WU_S_UH_INSTALLSTILLPENDINGz>The installation operation for the update is still in progressi $ ) WU_S_UH_DOWNLOAD_SIZE_CALCULATEDz;The actual download size has been calculated by the handleriP$ )WU_S_SIH_NOOPzINo operation was required by the server-initiated healing server responsei`$ )WU_S_DM_ALREADYDOWNLOADINGz7The update to be downloaded is already being downloadediq$ )(WU_S_METADATA_SKIPPED_BY_ENFORCEMENTMODEz5Metadata verification was skipped by enforcement modeiq$ ),WU_S_METADATA_IGNORED_SIGNATURE_VERIFICATIONzXA server configuration refresh resulted in metadata signature verification to be ignoredi$ )WU_S_SEARCH_LOAD_SHEDDINGzSSearch operation completed successfully but one or more services were shedding loadl    H  )WU_E_NO_SERVICEz6Windows Update Agent was unable to provide the servicel    H  )WU_E_MAX_CAPACITY_REACHEDz0The maximum capacity of the service was exceededl    H  )WU_E_UNKNOWN_IDzAn ID cannot be foundl    H  )WU_E_NOT_INITIALIZEDz#The object could not be initializedl    H  )WU_E_RANGEOVERLAPzRThe update handler requested a byte range overlapping a previously requested rangel    H  )WU_E_TOOMANYRANGESzIThe requested number of byte ranges exceeds the maximum number (2^31 - 1)l    H  )WU_E_INVALIDINDEXz%The index to a collection was invalidl    H  )WU_E_ITEMNOTFOUNDz/The key for the item queried could not be foundl   	 H  )WU_E_OPERATIONINPROGRESSz|Another conflicting operation was in progress. Some operations such as installation cannot be performed twice simultaneouslyl   
 H  )WU_E_COULDNOTCANCELz-Cancellation of the operation was not allowedl    H  )WU_E_CALL_CANCELLEDzOperation was cancelledl    H  )	WU_E_NOOPzNo operation was requiredl    H  )WU_E_XML_MISSINGDATAzQWindows Update Agent could not find required information in the update's XML datal    H  )WU_E_XML_INVALIDzGWindows Update Agent found invalid information in the update's XML datal    H  )WU_E_CYCLE_DETECTEDz;Circular update relationships were detected in the metadatal    H  )WU_E_TOO_DEEP_RELATIONz8Update relationships too deep to evaluate were evaluatedl    H  )WU_E_INVALID_RELATIONSHIPz+An invalid update relationship was detectedl    H  )WU_E_REG_VALUE_INVALIDz"An invalid registry value was readl    H  )WU_E_DUPLICATE_ITEMz1Operation tried to add a duplicate item to a listl    H  )WU_E_INVALID_INSTALL_REQUESTEDz;Updates requested for install are not installable by callerl    H  )WU_E_INSTALL_NOT_ALLOWEDzsOperation tried to install while another installation was in progress or the system was pending a mandatory restartl    H  )WU_E_NOT_APPLICABLEzCOperation was not performed because there are no applicable updatesl    H  )WU_E_NO_USERTOKENz9Operation failed because a required user token is missingl    H  )WU_E_EXCLUSIVE_INSTALL_CONFLICTzKAn exclusive update cannot be installed with other updates at the same timel    H  )WU_E_POLICY_NOT_SETzA policy value was not setl    H  )WU_E_SELFUPDATE_IN_PROGRESSzVThe operation could not be performed because the Windows Update Agent is self-updatingl    H  )WU_E_INVALID_UPDATEz#An update contains invalid metadatal    H  )WU_E_SERVICE_STOPzLOperation did not complete because the service or system was being shut downl    H  )WU_E_NO_CONNECTIONzIOperation did not complete because the network connection was unavailablel     H  )WU_E_NO_INTERACTIVE_USERzIOperation did not complete because there is no logged-on interactive userl   ! H  )WU_E_TIME_OUTz/Operation did not complete because it timed outl   " H  )WU_E_ALL_UPDATES_FAILEDz$Operation failed for all the updatesl   # H  )WU_E_EULAS_DECLINEDz/The license terms for all updates were declinedl   $ H  )WU_E_NO_UPDATEzThere are no updatesl   % H  )WU_E_USER_ACCESS_DISABLEDz8Group Policy settings prevented access to Windows Updatel   & H  )WU_E_INVALID_UPDATE_TYPEzThe type of update is invalidl   ' H  )WU_E_URL_TOO_LONGz#The URL exceeded the maximum lengthl   ( H  )WU_E_UNINSTALL_NOT_ALLOWEDz\The update could not be uninstalled because the request did not originate from a WSUS serverl   ) H  )WU_E_INVALID_PRODUCT_LICENSEz[Search may have missed some updates before there is an unlicensed application on the systeml   * H  )WU_E_MISSING_HANDLERz=A component required to detect applicable updates was missingl   + H  )WU_E_LEGACYSERVERzKAn operation did not complete because it requires a newer version of serverl   , H  )WU_E_BIN_SOURCE_ABSENTzOA delta-compressed update could not be installed because it required the sourcel   - H  )WU_E_SOURCE_ABSENTzHA full-file update could not be installed because it required the sourcel   . H  )WU_E_WU_DISABLEDz,Access to an unmanaged server is not allowedl   / H  )WU_E_CALL_CANCELLED_BY_POLICYzPOperation did not complete because the DisableWindowsUpdateAccess policy was setl   0 H  )WU_E_INVALID_PROXY_SERVERz(The format of the proxy list was invalidl   1 H  )WU_E_INVALID_FILEzThe file is in the wrong formatl   2 H  )WU_E_INVALID_CRITERIAz&The search criteria string was invalidl   3 H  )WU_E_EULA_UNAVAILABLEz%License terms could not be downloadedl   4 H  )WU_E_DOWNLOAD_FAILEDzUpdate failed to downloadl   5 H  )WU_E_UPDATE_NOT_PROCESSEDzThe update was not processedl   6 H  )WU_E_INVALID_OPERATIONz6The object's current state did not allow the operationl   7 H  )WU_E_NOT_SUPPORTEDz4The functionality for the operation is not supportedl   8 H  )WU_E_WINHTTP_INVALID_FILEz2The downloaded file has an unexpected content typel   9 H  )WU_E_TOO_MANY_RESYNCz1Agent is asked by server to resync too many timesl   @ H  )WU_E_NO_SERVER_CORE_SUPPORTz7WUA API method does not run on Server Core installationl   A H  )WU_E_SYSPREP_IN_PROGRESSz1Service is not available while sysprep is runningl   B H  )WU_E_UNKNOWN_SERVICEz2The update service is no longer registered with AUl   C H  )WU_E_NO_UI_SUPPORTzThere is no support for WUA UIl   D H  )%WU_E_PER_MACHINE_UPDATE_ACCESS_DENIEDzEOnly administrators can perform this operation on per-machine updatesl   E H  )WU_E_UNSUPPORTED_SEARCHSCOPEz[A search was attempted with a scope that is not currently supported for this type of searchl   F H  )WU_E_BAD_FILE_URLz The URL does not point to a filel   G H  )WU_E_REVERT_NOT_ALLOWEDz The update could not be revertedl   H H  )WU_E_INVALID_NOTIFICATION_INFOzGThe featured update notification info returned by the server is invalidl   I H  )WU_E_OUTOFRANGEzThe data is out of rangel   J H  )WU_E_SETUP_IN_PROGRESSzKWindows Update agent operations are not available while OS setup is runningl   K H  )WU_E_ORPHANED_DOWNLOAD_JOBz8An orphaned downloadjob was found with no active callersl   L H  )WU_E_LOW_BATTERYzRAn update could not be installed because the system battery power level is too lowl   M H  )&WU_E_INFRASTRUCTUREFILE_INVALID_FORMATz;The downloaded infrastructure file is incorrectly formattedl   N H  )$WU_E_INFRASTRUCTUREFILE_REQUIRES_SSLz;The infrastructure file must be downloaded using strong SSLl   O H  )#WU_E_IDLESHUTDOWN_OPCOUNT_DISCOVERYzQA discovery call contributed to a non-zero operation count at idle timer shutdownl   P H  ) WU_E_IDLESHUTDOWN_OPCOUNT_SEARCHzNA search call contributed to a non-zero operation count at idle timer shutdownl   Q H  )"WU_E_IDLESHUTDOWN_OPCOUNT_DOWNLOADzPA download call contributed to a non-zero operation count at idle timer shutdownl   R H  )!WU_E_IDLESHUTDOWN_OPCOUNT_INSTALLzPAn install call contributed to a non-zero operation count at idle timer shutdownl   S H  )WU_E_IDLESHUTDOWN_OPCOUNT_OTHERzTAn unspecified call contributed to a non-zero operation count at idle timer shutdownl   T H  )WU_E_INTERACTIVE_CALL_CANCELLEDz`An interactive user cancelled this operation, which was started from the Windows Update Agent UIl   U H  )WU_E_AU_CALL_CANCELLEDzxAutomatic Updates cancelled this operation because it applies to an update that is no longer applicable to this computerl   V H  )WU_E_SYSTEM_UNSUPPORTEDzXThis version or edition of the operating system doesn't support the needed functionalityl   W H  )WU_E_NO_SUCH_HANDLER_PLUGINzThe requested update download or install handler, or update applicability expression evaluator, is not provided by this Agent pluginl   X H  )"WU_E_INVALID_SERIALIZATION_VERSIONz4The requested serialization version is not supportedl   Y H  ) WU_E_NETWORK_COST_EXCEEDS_POLICYzTThe current network cost does not meet the conditions set by the network cost policyl   Z H  )WU_E_CALL_CANCELLED_BY_HIDEzlThe call is cancelled because it applies to an update that is hidden (no longer applicable to this computer)l   [ H  )WU_E_CALL_CANCELLED_BY_INVALIDzmThe call is cancelled because it applies to an update that is invalid (no longer applicable to this computer)l   \ H  )WU_E_INVALID_VOLUMEIDz"The specified volume id is invalidl   ] H  )WU_E_UNRECOGNIZED_VOLUMEIDz5The specified volume id is unrecognized by the systeml   ^ H  )WU_E_EXTENDEDERROR_NOTSETz5The installation extended error code is not specifiedl   _ H  )WU_E_EXTENDEDERROR_FAILEDz;The installation extended error code is set to general faill   ` H  )-WU_E_IDLESHUTDOWN_OPCOUNT_SERVICEREGISTRATIONz\A service registration call contributed to a non-zero operation count at idle timer shutdownl   a H  )$WU_E_FILETRUST_SHA2SIGNATURE_MISSINGzYSignature validation of the file fails to find valid SHA2+ signature on MS signed payloadl   b H  )WU_E_UPDATE_NOT_APPROVEDz0The update is not in the servicing approval listl   c H  ))WU_E_CALL_CANCELLED_BY_INTERACTIVE_SEARCHzTThe search call was cancelled by another interactive search against the same servicel   d H  )#WU_E_INSTALL_JOB_RESUME_NOT_ALLOWEDzIResume of install job not allowed due to another installation in progressl   e H  )WU_E_INSTALL_JOB_NOT_SUSPENDEDz>Resume of install job not allowed because job is not suspendedl   f H  )%WU_E_INSTALL_USERCONTEXT_ACCESSDENIEDzLUser context passed to installation from caller with insufficient privilegesl   H  )WU_E_UNEXPECTEDzDAn operation failed due to reasons not covered by another error codel   H  )WU_E_MSI_WRONG_VERSIONZSearch may have missed some updates because the Windows Installer is less than version 3.1l   H  )WU_E_MSI_NOT_CONFIGUREDzSSearch may have missed some updates because the Windows Installer is not configuredl   H  )WU_E_MSP_DISABLEDzZSearch may have missed some updates because policy has disabled Windows Installer patchingl   H  )WU_E_MSI_WRONG_APP_CONTEXTzLAn update could not be applied because the application is installed per-userl   H  )WU_E_MSI_NOT_PRESENTr   l   H  )WU_E_MSP_UNEXPECTEDzXSearch may have missed some updates because there was a failure of the Windows Installerl    @H  )WU_E_PT_SOAPCLIENT_BASEz[WU_E_PT_SOAPCLIENT_* error codes map to the SOAPCLIENT_ERROR enum of the ATL Server Libraryl   @H  )WU_E_PT_SOAPCLIENT_INITIALIZEzSame as SOAPCLIENT_INITIALIZE_ERROR - initialization of the SOAP client failed, possibly because of an MSXML installation failurel   @H  )WU_E_PT_SOAPCLIENT_OUTOFMEMORYzPSame as SOAPCLIENT_OUTOFMEMORY - SOAP client failed because it ran out of memoryl   @H  )WU_E_PT_SOAPCLIENT_GENERATEzNSame as SOAPCLIENT_GENERATE_ERROR - SOAP client failed to generate the requestl   @H  )WU_E_PT_SOAPCLIENT_CONNECTzNSame as SOAPCLIENT_CONNECT_ERROR - SOAP client failed to connect to the serverl   @H  )WU_E_PT_SOAPCLIENT_SENDznSame as SOAPCLIENT_SEND_ERROR - SOAP client failed to send a message for reasons of WU_E_WINHTTP_* error codesl   @H  )WU_E_PT_SOAPCLIENT_SERVERzUSame as SOAPCLIENT_SERVER_ERROR - SOAP client failed because there was a server errorl   @H  )WU_E_PT_SOAPCLIENT_SOAPFAULTzzSame as SOAPCLIENT_SOAPFAULT - SOAP client failed because there was a SOAP fault for reasons of WU_E_PT_SOAP_* error codesl   @H  )WU_E_PT_SOAPCLIENT_PARSEFAULTzNSame as SOAPCLIENT_PARSEFAULT_ERROR - SOAP client failed to parse a SOAP faultl   	@H  )WU_E_PT_SOAPCLIENT_READz]Same as SOAPCLIENT_READ_ERROR - SOAP client failed while reading the response from the serverl   
@H  )WU_E_PT_SOAPCLIENT_PARSEzYSame as SOAPCLIENT_PARSE_ERROR - SOAP client failed to parse the response from the serverl   @H  )WU_E_PT_SOAP_VERSIONzeSame as SOAP_E_VERSION_MISMATCH - SOAP client found an unrecognizable namespace for the SOAP envelopel   @H  )WU_E_PT_SOAP_MUST_UNDERSTANDzNSame as SOAP_E_MUST_UNDERSTAND - SOAP client was unable to understand a headerl   @H  )WU_E_PT_SOAP_CLIENTzYSame as SOAP_E_CLIENT - SOAP client found the message was malformed; fix before resendingl   @H  )WU_E_PT_SOAP_SERVERzcSame as SOAP_E_SERVER - The SOAP message could not be processed due to a server error; resend laterl   @H  )WU_E_PT_WMI_ERRORzGThere was an unspecified Windows Management Instrumentation (WMI) errorl   @H  )!WU_E_PT_EXCEEDED_MAX_SERVER_TRIPSzBThe number of round trips to the server exceeded the maximum limitl   @H  )WU_E_PT_SUS_SERVER_NOT_SETz0WUServer policy value is missing in the registryl   @H  )WU_E_PT_DOUBLE_INITIALIZATIONz@Initialization failed because the object was already initializedl   @H  )WU_E_PT_INVALID_COMPUTER_NAMEz)The computer name could not be determinedl   @H  )WU_E_PT_REFRESH_CACHE_REQUIREDzThe reply from the server indicates that the server was changed or the cookie was invalid; refresh the state of the internal cache and retryl   @H  )WU_E_PT_HTTP_STATUS_BAD_REQUESTzXSame as HTTP status 400 - the server could not process the request due to invalid syntaxl   @H  )WU_E_PT_HTTP_STATUS_DENIEDzMSame as HTTP status 401 - the requested resource requires user authenticationl   @H  )WU_E_PT_HTTP_STATUS_FORBIDDENzSSame as HTTP status 403 - server understood the request, but declined to fulfill itl   @H  )WU_E_PT_HTTP_STATUS_NOT_FOUNDz`Same as HTTP status 404 - the server cannot find the requested URI (Uniform Resource Identifier)l   @H  )WU_E_PT_HTTP_STATUS_BAD_METHODz8Same as HTTP status 405 - the HTTP method is not allowedl   @H  )"WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQz:Same as HTTP status 407 - proxy authentication is requiredl   @H  )#WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUTzFSame as HTTP status 408 - the server timed out waiting for the requestl   @H  )WU_E_PT_HTTP_STATUS_CONFLICTzpSame as HTTP status 409 - the request was not completed due to a conflict with the current state of the resourcel   @H  )WU_E_PT_HTTP_STATUS_GONEzQSame as HTTP status 410 - requested resource is no longer available at the serverl   @H  ) WU_E_PT_HTTP_STATUS_SERVER_ERRORzZSame as HTTP status 500 - an error internal to the server prevented fulfilling the requestl    @H  )!WU_E_PT_HTTP_STATUS_NOT_SUPPORTEDzcSame as HTTP status 500 - server does not support the functionality required to fulfill the requestl   !@H  )WU_E_PT_HTTP_STATUS_BAD_GATEWAYzSame as HTTP status 502 - the server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the requestl   "@H  )#WU_E_PT_HTTP_STATUS_SERVICE_UNAVAILz?Same as HTTP status 503 - the service is temporarily overloadedl   #@H  )#WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUTzISame as HTTP status 503 - the request was timed out waiting for a gatewayl   $@H  )#WU_E_PT_HTTP_STATUS_VERSION_NOT_SUPzdSame as HTTP status 505 - the server does not support the HTTP protocol version used for the requestl   %@H  )WU_E_PT_FILE_LOCATIONS_CHANGEDzROperation failed due to a changed file location; refresh internal state and resendl   &@H  )"WU_E_PT_REGISTRATION_NOT_SUPPORTEDzbOperation failed because Windows Update Agent does not support registration with a non-WSUS serverl   '@H  )!WU_E_PT_NO_AUTH_PLUGINS_REQUESTEDz<The server returned an empty authentication information listl   (@H  )WU_E_PT_NO_AUTH_COOKIES_CREATEDzJWindows Update Agent was unable to create any valid authentication cookiesl   )@H  )WU_E_PT_INVALID_CONFIG_PROPz(A configuration property value was wrongl   *@H  )WU_E_PT_CONFIG_PROP_MISSINGz*A configuration property value was missingl   +@H  )WU_E_PT_HTTP_STATUS_NOT_MAPPEDzrThe HTTP request could not be completed and the reason did not correspond to any of the WU_E_PT_HTTP_* error codesl   ,@H  )!WU_E_PT_WINHTTP_NAME_NOT_RESOLVEDzcSame as ERROR_WINHTTP_NAME_NOT_RESOLVED - the proxy server or target server name cannot be resolvedl   -@H  )WU_E_PT_LOAD_SHEDDINGzThe server is shedding loadl   -PH  )WU_E_PT_SAME_REDIR_IDzWindows Update Agent failed to download a redirector cabinet file with a new redirectorId value from the server during the recoveryl   .PH  )WU_E_PT_NO_MANAGED_RECOVERzKA redirector recovery action did not complete because the server is managedl   /@H  )!WU_E_PT_ECP_SUCCEEDED_WITH_ERRORSz7External cab file processing completed with some errorsl   0@H  )WU_E_PT_ECP_INIT_FAILEDz:The external cab processor initialization did not completel   1@H  )WU_E_PT_ECP_INVALID_FILE_FORMATz)The format of a metadata file was invalidl   2@H  )WU_E_PT_ECP_INVALID_METADATAz-External cab processor found invalid metadatal   3@H  )%WU_E_PT_ECP_FAILURE_TO_EXTRACT_DIGESTz@The file digest could not be extracted from an external cab filel   4@H  )*WU_E_PT_ECP_FAILURE_TO_DECOMPRESS_CAB_FILEz.An external cab file could not be decompressedl   5@H  )WU_E_PT_ECP_FILE_LOCATION_ERRORz7External cab processor was unable to get file locationsl   6H  )WU_E_PT_CATALOG_SYNC_REQUIREDzbThe server does not support category-specific search; Full catalog search has to be issued insteadl   7H  )%WU_E_PT_SECURITY_VERIFICATION_FAILUREz0There was a problem authorizing with the servicel   8H  )WU_E_PT_ENDPOINT_UNREACHABLEz9There is no route or network connectivity to the endpointl   9H  )WU_E_PT_INVALID_FORMATz>The data received does not meet the data contract expectationsl   :H  )WU_E_PT_INVALID_URLzThe url is invalidl   ;H  )WU_E_PT_NWS_NOT_LOADEDzUnable to load NWS runtimel   <H  )'WU_E_PT_PROXY_AUTH_SCHEME_NOT_SUPPORTEDz&The proxy auth scheme is not supportedl   =H  )WU_E_SERVICEPROP_NOTAVAILz/The requested service property is not availablel   >H  )!WU_E_PT_ENDPOINT_REFRESH_REQUIREDz4The endpoint provider plugin requires online refreshl   ?H  )WU_E_PT_ENDPOINTURL_NOTAVAILz9A URL for the requested service endpoint is not availablel   @H  )WU_E_PT_ENDPOINT_DISCONNECTEDz+The connection to the service endpoint diedl   AH  )WU_E_PT_INVALID_OPERATIONzMThe operation is invalid because protocol talker is in an inappropriate statel   BH  )WU_E_PT_OBJECT_FAULTEDz8The object is in a faulted state due to a previous errorl   CH  )WU_E_PT_NUMERIC_OVERFLOWz,The operation would lead to numeric overflowl   DH  )WU_E_PT_OPERATION_ABORTEDzThe operation was abortedl   EH  )WU_E_PT_OPERATION_ABANDONEDzThe operation was abandonedl   FH  )WU_E_PT_QUOTA_EXCEEDEDzA quota was exceededl   GH  ) WU_E_PT_NO_TRANSLATION_AVAILABLEz;The information was not available in the specified languagel   HH  )WU_E_PT_ADDRESS_IN_USEz!The address is already being usedl   IH  )WU_E_PT_ADDRESS_NOT_AVAILABLEz)The address is not valid for this contextl   JH  )WU_E_PT_OTHERzAUnrecognized error occurred in the Windows Web Services frameworkl   KH  )WU_E_PT_SECURITY_SYSTEM_FAILUREzAA security operation failed in the Windows Web Services frameworkl   OH  )WU_E_PT_UNEXPECTEDzAA communication error not covered by another WU_E_PT_* error codel   PH  )WU_E_REDIRECTOR_LOAD_XMLzBThe redirector XML document could not be loaded into the DOM classl   PH  )WU_E_REDIRECTOR_S_FALSEz@The redirector XML document is missing some required informationl   PH  )WU_E_REDIRECTOR_ID_SMALLERzPThe redirectorId in the downloaded redirector cab is less than in the cached cabl   PH  )WU_E_REDIRECTOR_UNKNOWN_SERVICEz:The service ID is not supported in the service environmentl   PH  )'WU_E_REDIRECTOR_UNSUPPORTED_CONTENTTYPEzGThe response from the redirector server had an unsupported content typel   PH  ) WU_E_REDIRECTOR_INVALID_RESPONSEzJThe response from the redirector server had an error status or was invalidl   PH  )3WU_E_REDIRECTOR_ATTRPROVIDER_EXCEEDED_MAX_NAMEVALUEzMThe maximum number of name value pairs was exceeded by the attribute providerl   	PH  ))WU_E_REDIRECTOR_ATTRPROVIDER_INVALID_NAMEz9The name received from the attribute provider was invalidl   
PH  )*WU_E_REDIRECTOR_ATTRPROVIDER_INVALID_VALUEz:The value received from the attribute provider was invalidl   PH  )!WU_E_REDIRECTOR_SLS_GENERIC_ERRORznThere was an error in connecting to or parsing the response from the Service Locator Service redirector serverl   PH  )WU_E_REDIRECTOR_CONNECT_POLICYzEConnections to the redirector server are disallowed by managed policyl   PH  )!WU_E_REDIRECTOR_ONLINE_DISALLOWEDzHThe redirector would go online but is disallowed by caller configurationl   PH  )WU_E_REDIRECTOR_UNEXPECTEDzUThe redirector failed for reasons not covered by another WU_E_REDIRECTOR_* error codel   QH  )WU_E_SIH_VERIFY_DOWNLOAD_ENGINEz3Verification of the servicing engine package failedl   QH  ) WU_E_SIH_VERIFY_DOWNLOAD_PAYLOADz*Verification of a servicing package failedl   QH  )WU_E_SIH_VERIFY_STAGE_ENGINEz(Verification of the staged engine failedl   QH  )WU_E_SIH_VERIFY_STAGE_PAYLOADz'Verification of a staged payload failedl   QH  )WU_E_SIH_ACTION_NOT_FOUNDzCAn internal error occurred where the servicing action was not foundl   QH  )WU_E_SIH_SLS_PARSEz;There was a parse error in the service environment responsel   QH  )WU_E_SIH_INVALIDHASHz+A downloaded file failed an integrity checkl   QH  )WU_E_SIH_NO_ENGINEzFNo engine was provided by the server-initiated healing server responsel   	QH  )#WU_E_SIH_POST_REBOOT_INSTALL_FAILEDzPost-reboot install failedl   
QH  )+WU_E_SIH_POST_REBOOT_NO_CACHED_SLS_RESPONSEzTThere were pending reboot actions, but cached SLS response was not found post-rebootl   QH  )WU_E_SIH_PARSEz%Parsing command line arguments failedl   QH  )WU_E_SIH_SECURITYzSecurity check failedl   QH  )WU_E_SIH_PPLzPPL check failedl   QH  )WU_E_SIH_POLICYz Execution was disabled by policyl   QH  )WU_E_SIH_STDEXCEPTIONzA standard exception was caughtl   QH  )WU_E_SIH_NONSTDEXCEPTIONz#A non-standard exception was caughtl   QH  )WU_E_SIH_ENGINE_EXCEPTIONziThe server-initiated healing engine encountered an exception not covered by another WU_E_SIH_* error codel   QH  )WU_E_SIH_BLOCKED_FOR_PLATFORMzBYou are running SIH Client with cmd not supported on your platforml   QH  )!WU_E_SIH_ANOTHER_INSTANCE_RUNNINGz%Another SIH Client is already runningl   QH  )WU_E_SIH_DNSRESILIENCY_OFFz8Disable DNS resiliency feature per service configurationl   QH  )WU_E_SIH_UNEXPECTEDzLThere was a failure for reasons not covered by another WU_E_SIH_* error codel   @I  )WU_E_DRV_PRUNEDzA driver was skippedl   @I  )WU_E_DRV_NOPROP_OR_LEGACYz]A property for the driver could not be found. It may not conform with required specificationsl   @I  )WU_E_DRV_REG_MISMATCHzFThe registry type read for the driver does not match the expected typel   @I  )WU_E_DRV_NO_METADATAz%The driver update is missing metadatal   @I  )WU_E_DRV_MISSING_ATTRIBUTEz1The driver update is missing a required attributel   @I  )WU_E_DRV_SYNC_FAILEDzDriver synchronization failedl   @I  )WU_E_DRV_NO_PRINTER_CONTENTzNInformation required for the synchronization of applicable printers is missingl   @I  )WU_E_DRV_DEVICE_PROBLEMzKAfter installing a driver update, the updated device has reported a probleml   OI  )WU_E_DRV_UNEXPECTEDz5A driver error not covered by another WU_E_DRV_* codel     I  )WU_E_DS_SHUTDOWNzAAn operation failed because Windows Update Agent is shutting downl    I  )WU_E_DS_INUSEz5An operation failed because the data store was in usel    I  )WU_E_DS_INVALIDz>The current and expected states of the data store do not matchl    I  )WU_E_DS_TABLEMISSINGz!The data store is missing a tablel    I  )WU_E_DS_TABLEINCORRECTz7The data store contains a table with unexpected columnsl    I  )WU_E_DS_INVALIDTABLENAMEzFA table could not be opened because the table is not in the data storel    I  )WU_E_DS_BADVERSIONz@The current and expected versions of the data store do not matchl    I  )WU_E_DS_NODATAz2The information requested is not in the data storel    I  )WU_E_DS_MISSINGDATAzmThe data store is missing required information or has a NULL in a table column that requires a non-null valuel   	 I  )WU_E_DS_MISSINGREFzThe data store is missing required information or has a reference to missing license terms, file, localized property or linked rowl   
 I  )WU_E_DS_UNKNOWNHANDLERzOThe update was not processed because its update handler could not be recognizedl    I  )WU_E_DS_CANTDELETEzQThe update was not deleted because it is still referenced by one or more servicesl    I  )WU_E_DS_LOCKTIMEOUTEXPIREDzCThe data store section could not be locked within the allotted timel    I  )WU_E_DS_NOCATEGORIESzjThe category was not added because it contains no parent categories and is not a top-level category itselfl    I  )WU_E_DS_ROWEXISTSzFThe row was not added because an existing row has the same primary keyl    I  )WU_E_DS_STOREFILELOCKEDzPThe data store could not be initialized because it was locked by another processl    I  )WU_E_DS_CANNOTREGISTERzNThe data store is not allowed to be registered with COM in the current processl    I  )WU_E_DS_UNABLETOSTARTz7Could not create a data store object in another processl    I  )WU_E_DS_DUPLICATEUPDATEIDzMThe server sent the same update to the client with two different revision IDsl    I  )WU_E_DS_UNKNOWNSERVICEzJAn operation did not complete because the service is not in the data storel    I  )WU_E_DS_SERVICEEXPIREDzQAn operation did not complete because the registration of the service has expiredl    I  )WU_E_DS_DECLINENOTALLOWEDztA request to hide an update was declined because it is a mandatory update or because it was deployed with a deadlinel    I  )WU_E_DS_TABLESESSIONMISMATCHDA table was not closed because it is not associated with the sessionl    I  )WU_E_DS_SESSIONLOCKMISMATCHr  l    I  )WU_E_DS_NEEDWINDOWSSERVICEzA request to remove the Windows Update service or to unregister it with Automatic Updates was declined because it is a built-in service and/or Automatic Updates cannot fall back to another servicel    I  )WU_E_DS_INVALIDOPERATIONz;A request was declined because the operation is not allowedl    I  )WU_E_DS_SCHEMAMISMATCHzdThe schema of the current data store and the schema of a table in a backup XML document do not matchl    I  )WU_E_DS_RESETREQUIREDzYThe data store requires a session reset; release the session and retry with a new sessionl    I  )WU_E_DS_IMPERSONATEDz^A data store operation did not complete because it was requested with an impersonated identityl    I  )WU_E_DS_DATANOTAVAILABLEzeAn operation against update metadata did not complete because the data was never received from serverl    I  )WU_E_DS_DATANOTLOADEDzrAn operation against update metadata did not complete because the data was available but not loaded from datastorel     I  )WU_E_DS_NODATA_NOSUCHREVISIONzPA data store operation did not complete because no such update revision is knownl   ! I  )WU_E_DS_NODATA_NOSUCHUPDATEzGA data store operation did not complete because no such update is knownl   " I  )WU_E_DS_NODATA_EULAzWA data store operation did not complete because an update's EULA information is missingl   # I  )WU_E_DS_NODATA_SERVICEzRA data store operation did not complete because a service's information is missingl   $ I  )WU_E_DS_NODATA_COOKIEzbA data store operation did not complete because a service's synchronization information is missingl   % I  )WU_E_DS_NODATA_TIMERzPA data store operation did not complete because a timer's information is missingl   & I  )WU_E_DS_NODATA_CCRzSA data store operation did not complete because a download's information is missingl   ' I  )WU_E_DS_NODATA_FILEzOA data store operation did not complete because a file's information is missingl   ( I  )WU_E_DS_NODATA_DOWNLOADJOBzWA data store operation did not complete because a download job's information is missingl   ) I  )WU_E_DS_NODATA_TMIz\A data store operation did not complete because a service's timestamp information is missingl   I  )WU_E_DS_UNEXPECTEDz8A data store error not covered by another WU_E_DS_* codel   I  )WU_E_INVENTORY_PARSEFAILEDzParsing of the rule file failedl   I  )(WU_E_INVENTORY_GET_INVENTORY_TYPE_FAILEDz:Failed to get the requested inventory type from the serverl   I  )#WU_E_INVENTORY_RESULT_UPLOAD_FAILEDz/Failed to upload inventory result to the serverl   I  )WU_E_INVENTORY_UNEXPECTEDz>There was an inventory error not covered by another error codel   I  )WU_E_INVENTORY_WMI_ERRORzJA WMI error occurred when enumerating the instances for a particular classl     I  )WU_E_AU_NOSERVICEz9Automatic Updates was unable to service incoming requestsl    I  )WU_E_AU_NONLEGACYSERVERzeThe old version of the Automatic Updates client has stopped because the WSUS server has been upgradedl    I  )WU_E_AU_LEGACYCLIENTDISABLEDz<The old version of the Automatic Updates client was disabledl    I  )WU_E_AU_PAUSEDzOAutomatic Updates was unable to process incoming requests because it was pausedl    I  )WU_E_AU_NO_REGISTERED_SERVICEz*No unmanaged service is registered with AUl    I  )WU_E_AU_DETECT_SVCID_MISMATCHz@The default service registered with AU changed during the searchl    I  )WU_E_REBOOT_IN_PROGRESSzA reboot is in progressl    I  )WU_E_AU_OOBE_IN_PROGRESSzRAutomatic Updates can't process incoming requests while Windows Welcome is runningl   /I  )WU_E_AU_UNEXPECTEDz@An Automatic Updates error not covered by another WU_E_AU * codel     H  )WU_E_UH_REMOTEUNAVAILABLEzcA request for a remote update handler could not be completed because no remote process is availablel    H  )WU_E_UH_LOCALONLYz^A request for a remote update handler could not be completed because the handler is local onlyl    H  )WU_E_UH_UNKNOWNHANDLERzbA request for an update handler could not be completed because the handler could not be recognizedl    H  )WU_E_UH_REMOTEALREADYACTIVEzGA remote update handler could not be created because one already existsl    H  )WU_E_UH_DOESNOTSUPPORTACTIONzA request for the handler to install (uninstall) an update could not be completed because the update does not support install (uninstall)l    H  )WU_E_UH_WRONGHANDLERzEAn operation did not complete because the wrong handler was specifiedl    H  )WU_E_UH_INVALIDMETADATAzWA handler operation could not be completed because the update contains invalid metadatal    H  )WU_E_UH_INSTALLERHUNGzQAn operation could not be completed because the installer exceeded the time limitl    H  )WU_E_UH_OPERATIONCANCELLEDz;An operation being done by the update handler was cancelledl   	 H  )WU_E_UH_BADHANDLERXMLzTAn operation could not be completed because the handler-specific metadata is invalidl   
 H  )WU_E_UH_CANREQUIREINPUTzkA request to the handler to install an update could not be completed because the update requires user inputl    H  )WU_E_UH_INSTALLERFAILUREz?The installer failed to install (uninstall) one or more updatesl    H  )WU_E_UH_FALLBACKTOSELFCONTAINEDzmThe update handler should download self-contained content rather than delta-compressed content for the updatel    H  )WU_E_UH_NEEDANOTHERDOWNLOADzUThe update handler did not install the update because it needs to be downloaded againl    H  )WU_E_UH_NOTIFYFAILUREzaThe update handler failed to send notification of the status of the install (uninstall) operationl    H  )WU_E_UH_INCONSISTENT_FILE_NAMESzZThe file names contained in the update metadata and in the update package are inconsistentl    H  )WU_E_UH_FALLBACKERRORzDThe update handler failed to fall back to the self-contained contentl    H  )WU_E_UH_TOOMANYDOWNLOADREQUESTSzGThe update handler has exceeded the maximum number of download requestsl    H  )WU_E_UH_UNEXPECTEDCBSRESPONSEz?The update handler has received an unexpected response from CBSl    H  )WU_E_UH_BADCBSPACKAGEIDz>The update metadata contains an invalid CBS package identifierl    H  )WU_E_UH_POSTREBOOTSTILLPENDINGz=The post-reboot operation for the update is still in progressl    H  )WU_E_UH_POSTREBOOTRESULTUNKNOWNzNThe result of the post-reboot operation for the update could not be determinedl    H  )!WU_E_UH_POSTREBOOTUNEXPECTEDSTATEzSThe state of the update after its post-reboot operation has completed is unexpectedl    H  )$WU_E_UH_NEW_SERVICING_STACK_REQUIREDzTThe OS servicing stack must be updated before this update is downloaded or installedl    H  )WU_E_UH_CALLED_BACK_FAILUREz.A callback installer called back with an errorl    H  ))WU_E_UH_CUSTOMINSTALLER_INVALID_SIGNATUREzQThe custom installer signature did not match the signature required by the updatel    H  )"WU_E_UH_UNSUPPORTED_INSTALLCONTEXTz=The installer does not support the installation configurationl    H  )WU_E_UH_INVALID_TARGETSESSIONz+The targeted session for install is invalidl    H  )WU_E_UH_DECRYPTFAILUREz.The handler failed to decrypt the update filesl    H  )#WU_E_UH_HANDLER_DISABLEDUNTILREBOOTz7The update handler is disabled until the system rebootsl    H  )WU_E_UH_APPX_NOT_PRESENTz4The AppX infrastructure is not present on the systeml    H  )WU_E_UH_NOTREADYTOCOMMITzUThe update cannot be committed because it has not been previously installed or stagedl     H  )#WU_E_UH_APPX_INVALID_PACKAGE_VOLUMEz7The specified volume is not a valid AppX package volumel   ! H  )/WU_E_UH_APPX_DEFAULT_PACKAGE_VOLUME_UNAVAILABLEz4The configured default storage volume is unavailablel   " H  )1WU_E_UH_APPX_INSTALLED_PACKAGE_VOLUME_UNAVAILABLEz?The volume on which the application is installed is unavailablel   # H  )%WU_E_UH_APPX_PACKAGE_FAMILY_NOT_FOUNDz9The specified package family is not present on the systeml   $ H  )$WU_E_UH_APPX_SYSTEM_VOLUME_NOT_FOUNDz0Unable to find a package volume marked as systeml   /H  )WU_E_UH_UNEXPECTEDz=An update handler error not covered by another WU_E_UH_* codel   `H  )WU_E_DM_URLNOTAVAILABLEzbA download manager operation could not be completed because the requested file does not have a URLl   `H  )WU_E_DM_INCORRECTFILEHASHz^A download manager operation could not be completed because the file digest was not recognizedl   `H  )WU_E_DM_UNKNOWNALGORITHMzvA download manager operation could not be completed because the file metadata requested an unrecognized hash algorithml   `H  )WU_E_DM_NEEDDOWNLOADREQUESTzdAn operation could not be completed because a download request is required from the download handlerl   `H  )WU_E_DM_NONETWORKzbA download manager operation could not be completed because the network connection was unavailablel   `H  )WU_E_DM_WRONGBITSVERSIONzA download manager operation could not be completed because the version of Background Intelligent Transfer Service (BITS) is incompatiblel   `H  )WU_E_DM_NOTDOWNLOADEDz"The update has not been downloadedl   `H  )WU_E_DM_FAILTOCONNECTTOBITSzA download manager operation failed because the download manager was unable to connect the Background Intelligent Transfer Service (BITS)l   	`H  )WU_E_DM_BITSTRANSFERERRORzA download manager operation failed because there was an unspecified Background Intelligent Transfer Service (BITS) transfer errorl   
`H  )WU_E_DM_DOWNLOADLOCATIONCHANGEDz[A download must be restarted because the location of the source of the download has changedl   `H  )WU_E_DM_CONTENTCHANGEDzQA download must be restarted because the update content changed in a new revisionl   `H  )#WU_E_DM_DOWNLOADLIMITEDBYUPDATESIZEzdA download failed because the current network limits downloads by update size for the update servicel   `H  )WU_E_DM_UNAUTHORIZEDzWThe download failed because the client was denied authorization to download the contentl   `H  )WU_E_DM_BG_ERROR_TOKEN_REQUIREDzXThe download failed because the user token associated with the BITS job no longer existsl   `H  )WU_E_DM_DOWNLOADSANDBOXNOTFOUNDz=The sandbox directory for the downloaded update was not foundl   `H  )WU_E_DM_DOWNLOADFILEPATHUNKNOWNz.The downloaded update has an unknown file pathl   `H  )WU_E_DM_DOWNLOADFILEMISSINGz=One or more of the files for the downloaded update is missingl   `H  )WU_E_DM_UPDATEREMOVEDzOAn attempt was made to access a downloaded update that has already been removedl   `H  )WU_E_DM_READRANGEFAILEDzKWindows Update couldn't find a needed portion of a downloaded update's filel   `H  )WU_E_DM_UNAUTHORIZED_NO_USERzpThe download failed because the client was denied authorization to download the content due to no user logged onl   `H  )WU_E_DM_UNAUTHORIZED_LOCAL_USERz[The download failed because the local user was denied authorization to download the contentl   `H  ) WU_E_DM_UNAUTHORIZED_DOMAIN_USERz\The download failed because the domain user was denied authorization to download the contentl   `H  )WU_E_DM_UNAUTHORIZED_MSA_USERzuThe download failed because the MSA account associated with the user was denied authorization to download the contentl   `H  )WU_E_DM_FALLINGBACKTOBITSzNThe download will be continued by falling back to BITS to download the contentl   `H  ) WU_E_DM_DOWNLOAD_VOLUME_CONFLICTz;Another caller has requested download to a different volumel   `H  )WU_E_DM_SANDBOX_HASH_MISMATCHzBThe hash of the update's sandbox does not match the expected valuel   `H  )WU_E_DM_HARDRESERVEID_CONFLICTzFThe hard reserve id specified conflicts with an id from another callerl   `H  )WU_E_DM_DOSVC_REQUIREDz&The update has to be downloaded via DOl   oH  )WU_E_DM_UNEXPECTEDzNThere was a download manager error not covered by another WU_E_DM_* error codel   PI  )WU_E_SETUP_INVALID_INFDATAzZWindows Update Agent could not be updated because an INF file contains invalid informationl   PI  )WU_E_SETUP_INVALID_IDENTDATAzcWindows Update Agent could not be updated because the wuident.cab file contains invalid informationl   PI  )WU_E_SETUP_ALREADY_INITIALIZEDz}Windows Update Agent could not be updated because of an internal error that caused setup initialization to be performed twicel   PI  )WU_E_SETUP_NOT_INITIALIZEDzcWindows Update Agent could not be updated because setup initialization never completed successfullyl   PI  )"WU_E_SETUP_SOURCE_VERSION_MISMATCHzWindows Update Agent could not be updated because the versions specified in the INF do not match the actual source file versionsl   PI  )!WU_E_SETUP_TARGET_VERSION_GREATERz}Windows Update Agent could not be updated because a WUA file on the target system is newer than the corresponding source filel   PI  )WU_E_SETUP_REGISTRATION_FAILEDzPWindows Update Agent could not be updated because regsvr32.exe returned an errorl   PI  )WU_E_SELFUPDATE_SKIP_ON_FAILUREzaAn update to the Windows Update Agent was skipped because previous attempts to update have failedl   	PI  )WU_E_SETUP_SKIP_UPDATEz\An update to the Windows Update Agent was skipped due to a directive in the wuident.cab filel   
PI  )$WU_E_SETUP_UNSUPPORTED_CONFIGURATIONzcWindows Update Agent could not be updated because the current system configuration is not supportedl   PI  ) WU_E_SETUP_BLOCKED_CONFIGURATIONz^Windows Update Agent could not be updated because the system is configured to block the updatel   PI  )WU_E_SETUP_REBOOT_TO_FIXzUWindows Update Agent could not be updated because a restart of the system is requiredl   PI  )WU_E_SETUP_ALREADYRUNNINGz-Windows Update Agent setup is already runningl   PI  )WU_E_SETUP_REBOOTREQUIREDzMWindows Update Agent setup package requires a reboot to complete installationl   PI  )WU_E_SETUP_HANDLER_EXEC_FAILUREz[Windows Update Agent could not be updated because the setup handler failed during executionl   PI  ) WU_E_SETUP_INVALID_REGISTRY_DATAz[Windows Update Agent could not be updated because the registry contains invalid informationl   PI  )WU_E_SELFUPDATE_REQUIREDz?Windows Update Agent must be updated before search can continuel   PI  )WU_E_SELFUPDATE_REQUIRED_ADMINzwWindows Update Agent must be updated before search can continue.  An administrator is required to perform the operationl   PI  )WU_E_SETUP_WRONG_SERVER_VERSIONzqWindows Update Agent could not be updated because the server does not contain update information for this versionl   PI  )$WU_E_SETUP_DEFERRABLE_REBOOT_PENDING\Windows Update Agent is successfully updated, but a reboot is required to complete the setupl   PI  )(WU_E_SETUP_NON_DEFERRABLE_REBOOT_PENDINGr  l   PI  )WU_E_SETUP_FAILzEWindows Update Agent could not be updated because of an unknown errorl   _I  )WU_E_SETUP_UNEXPECTEDzlWindows Update Agent could not be updated because of an error not covered by another WU_E_SETUP_* error codel   `I  )WU_E_EE_UNKNOWN_EXPRESSIONz_An expression evaluator operation could not be completed because an expression was unrecognizedl   `I  )WU_E_EE_INVALID_EXPRESSIONzZAn expression evaluator operation could not be completed because an expression was invalidl   `I  )WU_E_EE_MISSING_METADATAz}An expression evaluator operation could not be completed because an expression contains an incorrect number of metadata nodesl   `I  )WU_E_EE_INVALID_VERSIONzyAn expression evaluator operation could not be completed because the version of the serialized expression data is invalidl   `I  )WU_E_EE_NOT_INITIALIZEDz1The expression evaluator could not be initializedl   `I  )WU_E_EE_INVALID_ATTRIBUTEDATAz_An expression evaluator operation could not be completed because there was an invalid attributel   `I  )WU_E_EE_CLUSTER_ERRORzzAn expression evaluator operation could not be completed because the cluster state of the computer could not be determinedl   oI  )WU_E_EE_UNEXPECTEDzSThere was an expression evaluator error not covered by another WU_E_EE_* error codel   0H  ))WU_E_INSTALLATION_RESULTS_UNKNOWN_VERSIONzwThe results of download and installation could not be read from the registry due to an unrecognized data format versionl   0H  )&WU_E_INSTALLATION_RESULTS_INVALID_DATAzjThe results of download and installation could not be read from the registry due to an invalid data formatl   0H  )#WU_E_INSTALLATION_RESULTS_NOT_FOUNDzbThe results of download and installation are not available; the operation may have failed to startl   0H  )WU_E_TRAYICON_FAILUREzQA failure occurred when trying to create an icon in the taskbar notification areal   ?H  )WU_E_NON_UI_MODEzPUnable to show UI when in non-UI mode; WU client UI modules may not be installedl   ?H  ) WU_E_WUCLTUI_UNSUPPORTED_VERSIONz6Unsupported version of WU client UI exported functionsl   ?H  )WU_E_AUCLIENT_UNEXPECTEDzRThere was a user interface error not covered by another WU_E_AUCLIENT_* error codel   pI  )WU_E_REPORTER_EVENTCACHECORRUPTz"The event cache file was defectivel   pI  )'WU_E_REPORTER_EVENTNAMESPACEPARSEFAILED=The XML in the event namespace descriptor could not be parsedl   pI  )WU_E_INVALID_EVENTr  l   pI  )WU_E_SERVER_BUSYz<The server rejected an event because the server was too busyl   pI  )WU_E_CALLBACK_COOKIE_NOT_FOUNDz*The specified callback cookie is not foundl   I  )WU_E_REPORTER_UNEXPECTEDz<There was a reporter error not covered by another error codel   pH  )WU_E_OL_INVALID_SCANFILEzHAn operation could not be completed because the scan package was invalidl   pH  )WU_E_OL_NEWCLIENT_REQUIREDzsAn operation could not be completed because the scan package requires a greater version of the Windows Update Agentl   pH  )WU_E_INVALID_EVENT_PAYLOADz&An invalid event payload was specifiedl   pH  )WU_E_INVALID_EVENT_PAYLOADSIZEz2The size of the event payload submitted is invalidl   pH  )WU_E_SERVICE_NOT_REGISTEREDzThe service is not registeredl   H  )WU_E_OL_UNEXPECTEDz$Search using the scan package failedl    qH  )WU_E_METADATA_NOOPz9No operation was required by update metadata verificationl   qH  ),WU_E_METADATA_CONFIG_INVALID_BINARY_ENCODINGz7The binary encoding of metadata config data was invalidl   qH  )WU_E_METADATA_FETCH_CONFIGzJUnable to fetch required configuration for metadata signature verificationl   qH  )WU_E_METADATA_INVALID_PARAMETERzDA metadata verification operation failed due to an invalid parameterl   qH  )WU_E_METADATA_UNEXPECTEDzYA metadata verification operation failed due to reasons not covered by another error codel   qH  )"WU_E_METADATA_NO_VERIFICATION_DATAz]None of the update metadata had verification data, which may be disabled on the update serverl   qH  )(WU_E_METADATA_BAD_FRAGMENTSIGNING_CONFIGzXThe fragment signing configuration used for verifying update metadata signatures was badl   qH  )7WU_E_METADATA_FAILURE_PROCESSING_FRAGMENTSIGNING_CONFIGzXThere was an unexpected operational failure while parsing fragment signing configurationl    qH  )WU_E_METADATA_XML_MISSINGz0Required xml data was missing from configurationl   !qH  ))WU_E_METADATA_XML_FRAGMENTSIGNING_MISSINGz@Required fragmentsigning data was missing from xml configurationl   "qH  )WU_E_METADATA_XML_MODE_MISSINGz5Required mode data was missing from xml configurationl   #qH  )WU_E_METADATA_XML_MODE_INVALIDz1An invalid metadata enforcement mode was detectedl   $qH  )"WU_E_METADATA_XML_VALIDITY_INVALIDz?An invalid timestamp validity window configuration was detectedl   %qH  )"WU_E_METADATA_XML_LEAFCERT_MISSINGzARequired leaf certificate data was missing from xml configurationl   &qH  )*WU_E_METADATA_XML_INTERMEDIATECERT_MISSINGzIRequired intermediate certificate data was missing from xml configurationl   'qH  )%WU_E_METADATA_XML_LEAFCERT_ID_MISSINGzIRequired leaf certificate id attribute was missing from xml configurationl   (qH  )'WU_E_METADATA_XML_BASE64CERDATA_MISSINGzORequired certificate base64CerData attribute was missing from xml configurationl   @qH  )WU_E_METADATA_BAD_SIGNATUREzOThe metadata for an update was found to have a bad or invalid digital signaturel   AqH  )"WU_E_METADATA_UNSUPPORTED_HASH_ALGzEAn unsupported hash algorithm for metadata verification was specifiedl   BqH  )%WU_E_METADATA_SIGNATURE_VERIFY_FAILEDzDAn error occurred during an update's metadata signature verificationl   PqH  )0WU_E_METADATATRUST_CERTIFICATECHAIN_VERIFICATIONzQAn failure occurred while verifying trust for metadata signing certificate chainsl   QqH  )-WU_E_METADATATRUST_UNTRUSTED_CERTIFICATECHAINzAA metadata signing certificate had an untrusted certificate chainl   `qH  )%WU_E_METADATA_TIMESTAMP_TOKEN_MISSINGz0An expected metadata timestamp token was missingl   aqH  )1WU_E_METADATA_TIMESTAMP_TOKEN_VERIFICATION_FAILEDz.A metadata Timestamp token failed verificationl   bqH  )'WU_E_METADATA_TIMESTAMP_TOKEN_UNTRUSTEDzAA metadata timestamp token signer certificate chain was untrustedl   cqH  )-WU_E_METADATA_TIMESTAMP_TOKEN_VALIDITY_WINDOWzMA metadata signature timestamp token was no longer within the validity windowl   dqH  )'WU_E_METADATA_TIMESTAMP_TOKEN_SIGNATUREz6A metadata timestamp token failed signature validationl   eqH  )'WU_E_METADATA_TIMESTAMP_TOKEN_CERTCHAINzLA metadata timestamp token certificate failed certificate chain verificationl   fqH  )+WU_E_METADATA_TIMESTAMP_TOKEN_REFRESHONLINEzMA failure occurred when refreshing a missing timestamp token from the networkl   gqH  )%WU_E_METADATA_TIMESTAMP_TOKEN_ALL_BADz\All update metadata verification timestamp tokens from the timestamp token cache are invalidl   hqH  )$WU_E_METADATA_TIMESTAMP_TOKEN_NODATAzSNo update metadata verification timestamp tokens exist in the timestamp token cachel   iqH  ))WU_E_METADATA_TIMESTAMP_TOKEN_CACHELOOKUPzUAn error occurred during cache lookup of update metadata verification timestamp tokenl   ~qH  )7WU_E_METADATA_TIMESTAMP_TOKEN_VALIDITYWINDOW_UNEXPECTEDzpAn metadata timestamp token validity window failed unexpectedly due to reasons not covered by another error codel   qH  )(WU_E_METADATA_TIMESTAMP_TOKEN_UNEXPECTEDzjAn metadata timestamp token verification operation failed due to reasons not covered by another error codel   qH  )WU_E_METADATA_CERT_MISSINGz4An expected metadata signing certificate was missingl   qH  )-WU_E_METADATA_LEAFCERT_BAD_TRANSPORT_ENCODINGzKThe transport encoding of a metadata signing leaf certificate was malformedl   qH  ),WU_E_METADATA_INTCERT_BAD_TRANSPORT_ENCODINGzSThe transport encoding of a metadata signing intermediate certificate was malformedl   qH  )WU_E_METADATA_CERT_UNTRUSTEDz*A metadata certificate chain was untrustedl   0I  )WU_E_WUTASK_INPROGRESSz!The task is currently in progressl   0I  )WU_E_WUTASK_STATUS_DISABLEDzMThe operation cannot be completed since the task status is currently disabledl   0I  )WU_E_WUTASK_NOT_STARTEDzCThe operation cannot be completed since the task is not yet startedl   0I  )WU_E_WUTASK_RETRYz:The task was stopped and needs to be run again to completel   0I  )$WU_E_WUTASK_CANCELINSTALL_DISALLOWEDz%Cannot cancel a non-scheduled installl   1I  )WU_E_UNKNOWN_HARDWARECAPABILITYzIHardware capability meta data was not found after a sync with the servicel   1I  )WU_E_BAD_XML_HARDWARECAPABILITYzBHardware capability meta data was malformed and/or failed to parsel   1I  )WU_E_WMI_NOT_SUPPORTEDzWUnable to complete action due to WMI dependency, which isn't supported on this platforml   1I  )WU_E_UPDATE_MERGE_NOT_ALLOWEDz$Merging of the update is not allowedl   1I  ) WU_E_SKIPPED_UPDATE_INSTALLATIONzAInstalling merged updates only. So skipping non mergeable updatesl   2I  )WU_E_SLS_INVALID_REVISIONz-SLS response returned invalid revision numberl   3I  ) WU_E_FILETRUST_DUALSIGNATURE_RSAzUFile signature validation fails to find valid RSA signature on infrastructure payloadl   3I  ) WU_E_FILETRUST_DUALSIGNATURE_ECCzUFile signature validation fails to find valid ECC signature on infrastructure payloadl   3I  )WU_E_TRUST_SUBJECT_NOT_TRUSTEDz9The subject is not trusted by WU for the specified actionl   3I  )WU_E_TRUST_PROVIDER_UNKNOWNzUnknown trust provider for WUl   9I  )WU_E_RUXIM_EXCEPTIONz8An unexpected exception occurred during RUXIM processingl   9I  )WU_E_RUXIM_LOGGINGCVERRORzNAn error occurred while processing the correlation vector during RUXIM loggingl   9I  )(WU_E_RUXIM_UNEXPECTEDINTERACTIONRESPONSEzfThe RUXIM Interaction Handler returned an unexpected response while processing an interaction campaignl   9I  )&WU_E_RUXIM_INTERACTIONALREADYCOMPLETEDzUAn attempt was made to present a RUXIM interaction campaign that is already completedl   9I  )"WU_E_RUXIM_STOREDSTATENOTAVAILABLEzSRUXIM was unable to create or retrieve the stored state for an interaction campaignl   9I  )$WU_E_RUXIM_NOSUCHINTERACTIONCAMPAIGNz?RUXIM was unable to retrieve the requested interaction campaignl   9I  )WU_E_RUXIM_UNEXPECTEDz6An unexpected failure occurred during RUXIM processingl    9I  )WU_E_RUXIM_ICSPEC_INVALIDFORMATzRThe RUXIM interaction campaign specification does not have the expected XML formatl   !9I  )-WU_E_RUXIM_ICSPEC_MISSINGCONTROLCUSTOMIZATIONz~The RUXIM interaction campaign specification does not have a control customization for one or more controls in the interactionl   "9I  )(WU_E_RUXIM_ICSPEC_NOSUITABLELOCALIZATIONzxThe RUXIM interaction campaign specification does not have localized resources that match the user's preferred languagesl   #9I  )$WU_E_RUXIM_ICSPEC_COMMANDLINETOOLONGzThe RUXIM interaction campaign specification specifies an immediate action, and the command line set for that immediate action is too long)&WU_E_RUXIM_ICSPEC_DIRECTORYPATHTOOLONGzThe RUXIM interaction campaign specification specifies an immediate action, and the current directory set for that immediate action is too long)%WU_E_RUXIM_ICSPEC_PARAMETEROUTOFRANGEz`The RUXIM interaction campaign specification includes a parameter that is too large or too small)WU_E_RUXIM_ICSPEC_UNEXPECTEDzUAn unexpected problem occurred while processing an interaction campaign specification)#WU_E_RUXIM_ICO_NOREMAININGCAMPAIGNSz=There are no more interaction campaigns remaining to evaluate)WU_E_RUXIM_ICS_IHRESULTUNKNOWNzInteraction Campaign Scheduler launched Interaction Handler to process a campaign, but Interaction Handler did not report its result)&WU_E_EVALUATOR_UNKNOWNCHECKHANDLERNAMEz]The evaluation request includes a check handler name which the Evaluator DLL does not support)WU_E_EVALUATOR_UNKNOWNCHECKNAMEzUThe evaluation request includes a check name which the Evaluator DLL does not support) WU_E_EVALUATOR_UNKNOWNCOMPARISONzUThe evaluation request includes a comparison which the Evaluator DLL does not support)$WU_E_EVALUATOR_MISFORMATTEDCHECKNAMEzoThe evaluation request includes a check node whose check node is not in the format 'checkhandlername:checkname')%WU_E_EVALUATOR_INVALIDCHECKPARAMETERSzThe evaluation request includes a check which requires parameters, and one of those parameters is missing or in an unexpected format)WU_E_EVALUATOR_INVALIDNOTzbThe evaluation request includes a 'not' attribute on a check which does not return a Boolean value)WU_E_EVALUATOR_UNEXPECTEDzCAn unexpected error occurred while processing an evaluation request)l   $9I  l   %9I  l   ?9I  l   @9I  l   P9I  l   9I  l   9I  l   9I  l   9I  l   9I  l   9I  l   9I  UNKNOWNzUnknown WUA HRESULT %sz%s (%s 0x%08X)    )get)hresulterror_id	error_msgs      n/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/ansible/windows/plugins/action/win_updates.py_get_hresult_errorr  %   s    iZiNi 	xi 	 O	i 	si 	oi 	ki 	ji 	 Ui 	gi 	 Gi 	ui  	w!i" 	r#i$ 	m%i& 	y'i( 	 P)i, 	  I-i. 	a/i0 	e1i2 	@3i4 	S5i6 	7i8 	w9i: 	R;i< 	\=i> 	 I?iB 	\CiD 	FEiF 	>GiH 	  CIiJ 	tKiL 	jMiN 	jOiP 	`QiR 	TSiT 	`UiV 	uWiX 	 FYi\ 	r]i^ 	f_i` 	  Gaib 	Icid 	  Neif 	Rgih 	yiij 	wkil 	}min 	Xoip 	Wqir 	^sit 	>uiv 	mwix 	Qyiz 	P{i| 	  S}i~ 	  Ti@ 	mAiB 	xCiD 	  BEiF 	vGiH 	XIiJ 	  JKiL 	]MiN 	LOiP 	WQiR 	VSiT 	IUiV 	QWiX 	iYiZ 	b[i\ 	g]i^ 	a_i` 	naib 	ecid 	beif 	Lgih 	  Giij 	  Tkil 	Mmin 	Soip 	  Bqir 	Csit 	}uiv 	nwix 	~yiz 	}{i| 	{}i~ 	  Qi@ 	  KAiB 	  OCiD 	  NEiF 	  PGiH 	  \IiJ 	 @KiN 	  MOiP 	 UQiT 	rUiV 	  QWiX 	 AYi\ 	 D]i` 	Saib 	kcid 	jeif 	pgih 	 Riil 	  Zmin 	doip 	  Zqir 	  Isit 	xuiv 	  Nwix 	oyiz 	  M{i| 	  G}i~ 	  Hi@ 	  CAiB 	  KCiD 	  HEiF 	  OGiH 	 WIiL 	  KMiN 	  FOiP 	  EQiR 	 9SiV 	  KWiX 	 SYi\ 	  H]i^ 	  Q_i` 	  Naib 	  Vcid 	  Geif 	  Igih 	  Siij 	tkil 	min 	foip 	yqir 	bsit 	 duix 	  Tyiz 	  D{i| 	  M}i~ 	  Zi@ 	rAiB 	xCiD 	  FEiF 	 EGiJ 	  FKiL 	  WMiN 	 EOiR 	 NSiV 	~WiX 	  IYiZ 	 G[i^ 	  M_i` 	 Eaid 	yeif 	  Fgih 	_iij 	akil 	 Umip 	 Fqit 	Luiv 	 Lwiz 	  B{i| 	t}i~ 	mi@ 	dAiB 	eCiD 	  BEiF 	tGiH 	rIiJ 	  \KiL 	qMiN 	qOiP 	pQiR 	ASiT 	LUiV 	iWiX 	dYiZ 	q[i\ 	q]i^ 	d_i` 	  Caib 	jcid 	`eif 	Ngih 	Riij 	Fkil 	wmin 	Soip 	bqir 	jsit 	|uiv 	owix 	vyiz 	s{i| 	  G}i~ 	ui@ 	  KAiB 	  GCiD 	  ]EiF 	~GiH 	  AIiJ 	 OKiN 	OiP 	  FQiR 	  LSiT 	nUiV 	fWiX 	`YiZ 	`[i\ 	x]i^ 	i_i` 	[aib 	tcid 	Yeif 	  \gih 	Oiij 	Bkil 	8min 	Koip 	Pqir 	Wsit 	  _uiv 	{wix 	byiz 	n{i| 	{}i~ 	?i@ 	  SAiB 	wCiD 	UEiF 	gGiH 	MIiJ 	  FKiL 	~MiN 	dOiP 	mQiR 	^SiT 	iUiV 	QWiX 	iYiZ 	z[i\ 	n]i^ 	\_i` 	  ]aib 	 Ecif 	  Bgih 	iij 	ykil 	  [min 	soip 	  Dqir 	  Asit 	huiv 	  Cwix 	|yiz 	  D{i| 	 @}i@	 	|A	iB	 	{C	iD	 	 TE	iH	 	oI	iJ	 	  WK	iL	 	  KM	iN	 	  OO	iP	 	  ZQ	iR	 	 ;S	iV	 	  JW	iX	 	~Y	iZ	 	  H[	i\	 	  F]	i^	 	  U_	i`	 	  Ba	ib	 	  Cc	id	 	e	if	 	  Og	ih	 	  Li	ij	 	fk	il	 	Um	in	 	~o	ip	 	nq	ir	 	ss	it	 	~u	iv	 	fw	ix	 	  Yy	iz	 	t{	i|	 	y}	i~	 	c	i@
 	yA
iB
 	JC
iD
 	  HE
iF
 	nG
iH
 	  YI
iJ
 	  LK
iL
 	  UM
iN
 	~O
iP
 	 ]Q
iT
 	uU
iV
 	  KW
iX
 	  CY
iZ
 	q[
i\
 	  F]
i^
 	  __
i`
 	sa
ib
 	 Fc
if
 	  Mg
ih
 	  Si
ij
 	  Vk
il
 	um
in
 	  Co
ip
 	xq
ir
 	qs
it
 	wu
iv
 	  Jw
ix
 	  Qy
iz
 	  U{
i|
 	e}
i~
 	  W
i@ 	{AiB 	dCiD 	`EiF 	vGiH 	hIiJ 	  JKiL 	vMiN 	OiP 	  MQiR 	zSiT 	pUiV 	kWiX 	  VYiZ 	  T[i\ 	 C]i` 	  \aib 	  Pcid 	 Seih 	Siij 	 [kin 	 Soir 	  Wsit 	  Duiv 	 Nwiz 	  H{i| 	  T}i~ 	xi@ 	iAiB 	tCiD 	  AEiF 	  AGiH 	 BIiL 	  WMiN 	  YOiP 	 NQiT 	  DUiV 	wWiX 	|YiZ 	  A[i\ 	X]i^ 	|_i` 	  Qaib 	  \cid 	 _eih 	  Ziij 	 ^kin 	 [oir 	  Ksit 	  ]uiv 	  Owix 	 Jyi| 	  [}i~ 	  Ji@ 	bAiB 	  CCiD 	  WEiF 	  XGiH 	sIiJ 	 PKiN 	 LOiR 	  ]SiT 	 JUiX 	pYiZ 	  ^[i\ 	  V]i^ 	  Q_i` 	 Maid 	 Ceih 	diij 	  Ykil 	 ?mip 	  Bqir 	 fsiv 	 Vwiz 	 E{i~ 	  Ci@ 	|AiB 	rCiD 	  GEiF 	]GiH 	  AIiJ 	kKiL 	hMiN 	dOiP 	pQiR 	|SiT 	 CUiX 	\YiZ 	l[i\ 	T]i^ 	R_i` 	gaib 	cid 	  Aeif 	gih 	  Niij 	  \kil 	  ]min 	 aoir 	esit 	  Fuiv 	owix 	kyiz 	}{i| 	}i~ 	  Pi@ 	  KAiB 	  SCiD 	  GEiF 	  DGiH 	  GIiJ 	  ^KiL 	  KMiN 	qOiP 	{QiR 	  ESiT 	  WUiV 	yWiX 	  PYiZ 	  U[i\ 	  ^]i^ 	  T_i` 	  [aib 	 }cif 	 Wgij 	jkil 	  Umin 	  \oip 	bqir 	Ssit 	  Euiv 	vwix 	gyiz 	e{i| 	  E}i~ 	}i@ 	  KAiB 	]CiD 	}EiF 	bGiH 	  RIiJ 	  RKiL 	sMiN 	TOiP 	hQiR 	  DSiT 	 YUiX 	  XYiZ 	  R[i\ 	]i^ 	g_i` 	  Naib 	 ucif 	 dgij 	 okinvG N|\J Q R_r ZxQiR 
c'I7'ABCS HiV y(Gj4HIII    c                   "     e Zd ZdZ fdZ xZS )_ReturnResultExceptionz?Used to sneak results back to the return dict from an exceptionc                 :    t         t        |   |       || _        y N)superr
  __init__result)selfmsgr  	__class__s      r  r  z_ReturnResultException.__init__d  s    $d4S9r  )__name__
__module____qualname____doc__r  __classcell__r  s   @r  r
  r
  a  s    I r  r
  c                   X     e Zd Zg dZdZ fdZd	 fd	Zd Zd Z	 	 	 	 d
dZ	d Z
 xZS )ActionModule)	accept_listcategory_nameslog_pathrebootskip_optionalreboot_timeoutreject_listserver_selectionstatei  c                     t        t        | 
  |i | d | _        i | _        t               | _        i | _        i | _        i | _	        y r  )
r  r  r  _invocation_updatesset_selected_updates_filtered_updates_download_results_install_results)r  argskwargsr  s      r  r  zActionModule.__init__y  sJ    lD*D;F; "%!#!# "r  c                 @   d| _         d| _        t        t        |   ||       ~|xs i }	 t        | j                  j                  j                  dd            }	 t        | j                  j                  j                  d| j                              }| j                  j                  j                         }| j                  j                  dkD  r)|rt        d      d	di|d
<   | j!                  d||      }n	 | j#                  ||||      }d|d<   d|d<   d|d<   i |d<   i |d<   | j6                  D ]M  }| j9                  |      }	|	|d   |<   |dxx   dz  cc<   d|	v r|dxx   dz  cc<   ;|	d   sA|dxx   dz  cc<   O | j:                  j=                         D ]<  \  }}
| j9                  |      }	|
d   }|dk(  rd}n|dk(  rd}||	d<   |
|	d<   |	|d   |<   > | j>                  rd|vr| j>                  |d<   d|v r7d |d   v r0|d   d    jA                  d!d        |d   d    jA                  d
d        |S # t        $ r}t        dt        |      z        d }~ww xY w# t        $ r}t        dt        |      z        d }~ww xY w# t$        $ r}i }t'        |t(              r|j+                  |j,                         t'        |t.              rd|d<   nd|d<   t1        |      |d<   |j                  dd       st3        j4                         |d<   Y d }~d }~ww xY w)"NTr  Fz%Invalid value given for 'reboot': %s.r   z-Invalid value given for 'reboot_timeout': %s.r   z4async is not supported for this task when reboot=yeswait_operation_optionsansible.windows.win_updatesmodule_namemodule_args	task_varsunreachablefailedr  	exceptionfound_update_countfailed_update_countinstalled_update_countupdatesfiltered_updates   failure_hresult_code	installedr  	whitelistr!  	blacklistfiltered_reasonfiltered_reasons
invocationr4  
_operation)!_supports_check_mode_supports_asyncr  r  runr
   _taskr,  r  	TypeErrorr   r   r   DEFAULT_REBOOT_TIMEOUTcopy	async_val_execute_module	_run_sync	Exception
isinstancer
  updater  r   r	   	traceback
format_excr(  _get_update_infor)  itemsr%  pop)r  tmpr5  r  er   module_optionsr  	update_idupdate_inforeasons
dep_reasonr  s               r  rI  zActionModule.run  s~   $(!#lD%c95O		\$TZZ__%8%85%IJF	d+DJJOO,?,?@PRVRmRm,noN --/::!#'(^__ 5;D>N/0))9*# * FA	>6>Z  ,-F'(,-F()/0F+, "F9)+F%&!33 	:	"33I>/:y!),+,1,)[801Q61 -3494	: '+&<&<&B&B&D D"	7"33I> %QZ
.!,J=0!,J1;-.29./8C)*95D  F :#'#3#3F<  6!mvl7K&K< /33L$G< /334H$Oa  	\#$KiXYl$Z[[	\
  	d#$SV_`aVb$bcc	d(  Aa!78MM!((+a!9:,0F=)'+F8$ '
uzz+t4*3*>*>*@F;'AsH   /H: 9I" <J
 :	III"	J+JJ
	LA?LLc                    dddd}t               }d}d}	 |dz  }t        j                  d|z  |j                  dd      	       | j	                  ||      }	| j
                  j                  |	j                         | j                  j                  |	j                         | j                  j                  |	j                         | j                  j                  |	j                         | j                  j                  |	j                         t        |	j                        }
|
j!                  |      }|j                  |
       |
rL|sJ|
D ]&  }d
| j                  |   d<   d| j                  |   d<   ( d|d<   ddj#                  |
       |d<   	 |S |	j$                  x}|d<   |	j&                  rd|d<   |	j(                  r|	j*                  }|	j,                  r|dt/        |	j,                        z   z  }|rF|sD|j                  dd      dk7  r/t        j1                  d|z  |j                  dd      	       d}d}n d|d<   ||d<   |	j2                  |d<   	 |S |rd}|r|rt        j                  d|j                  dd      	       | j4                  j6                  rddi}n,t9        | j:                  j<                  | j>                  |      }d|d<   |d   r3d}d|v r|dtA        |d         z   z  }||d<   |j                  |       	 |S d|d<   d|d<   |rE| j4                  j6                  s/|j                  dd      dk7  s|stC        |	j                        dk(  r	 |S M) zYInstalls the updates in a synchronous fashion with multiple update invocations if needed.F)changedreboot_requiredrebootedr   Tr>  zRunning win_updates - round %sinventory_hostnameNhost   result_coder  r7  a  An update loop was detected, this could be caused by an update being rolled back during a reboot or the Windows Update API incorrectly reporting a failed update as being successful.Check the Windows Updates logs on the host to gather more information. Updates in the reboot loop are: z, r  rb  ra  z - r#   searchedzEFailure when running win_updates module (Will retry after reboot): %sr8  z'Rebooting host after installing updates)r   rc  zFailed to reboot hostz: r@  )"r'  displayvr  _run_updatesr&  rS  r<  r)  r=  r(  selected_updatesr*  download_resultsr+  install_results
differencejoinrb  ra  r7  r  r  r  vvr8  _play_context
check_moder   rJ  action_connectionstrlen)r  r5  r[  r  r   r  installed_updateshas_rebooted_on_failureroundupdate_resultcurrent_updatesnew_updatesr\  rb  r  
reboot_ress                   r  rP  zActionModule._run_sync  s    $

  E"'QJEII6>Y]]SgimEnIo --iHMMM  !6!67""))-*H*HI""))-*H*HI""))-*H*HI!!(()F)FG
 "-"?"?@O)445FGK$$_5{!0 EIFGD)))4]CBDD)))4Y?E $(x ! "&?!; <> u z w ;H:W:WWOf%67$$$(y!###'' ((5#5m6K6K#LLLC "9n>P>PQXZ\>]ak>kJJfill$-MM2F$M  O&*O.2+ (,F8$$'F5M*7*A*AF;'L I */'6		C)--XlnrJs	t%%00"*E!2J "-TZZ->->@P@Pao!pJ%)z"h'1C
*tc*U*;&<<<(+Ju%MM*-  %)y!,1() ""--""7K8KG$]-K-K)LPQ)Q y r  c           	      V   |j                  dd      }t        j                  d|       | j                  ||      }|j	                  di       }|j	                  di       }t        j                  d|       t               }d	}	 d
}	|	rE| j                  |d|d
      }
|
d   D ]%  }|d   }|j                  ||d   |       |dk(  s$d	}	' |	rE	 | j                  |d|       |S # t        $ r)}t        j                  dt        |      z         d
} d}~ww xY w# t        $ r0}|r"t        j                  dt        |      z         n Y d}~|S d}~ww xY w# 	 | j                  |d|       w # t        $ r/}|r"t        j                  dt        |      z         n Y d}~w d}~ww xY wxY w)zGRuns the win_updates module and returns the raw results from that task.rd  NzStarting update taskre  )r5  r[  cancel_optionspoll_optionsz#Starting polling for update resultsFTpoll)	operationoperation_optionsretry_on_failureoutputtaskr  exitzJUnknown failure when polling update result - attempting to cancel task: %scancel)r  r  z/Unknown failure when cancelling update task: %s)
r  rl  rt  _execute_win_updatesrX  UpdateResultprocess_resultrQ  warningr	   )r  r5  r[  rd  start_resultr  r  r~  has_erroredpollingpoll_resultprogressr  rZ  s                 r  rn  zActionModule._run_updatesJ  s    ']]+?F

)0B
C00) 1 
 &))*:B?#'';

8?Q
R$%	G"77$&2%)	 8  !,H 5 (H#F+D!00x7IK]^v~"'( 2
))&&4 *  -  	OOhkrstkuuvK		   OO$UX_`aXb$bc d 
))&&4 * 
  OO$UX_`aXb$bc dsm   AC% C% D %	D.$DDE 	E#%EEF(E-,F(-	F%6%F F( F%%F(c                    |xs i j                         }||d<   |xs i |d<   i }t        d      D ]  }	 | j                  d||      } n d|v r| j                  s
|d   | _        |j                  d	d
      rY|j                  dd|       }
i }d|v r|d   |d<   d|v r|d   |d<   d|v r|d   |d<   t        |
fd|j                  dd       i||j                  dg       D ]  }t
        j                  |        |S # t        t        f$ r4}	|r|dk(  r t
        j                  dt        |	      z         Y d }	~	d }	~	ww xY w)NrF  r0  r   r1  r2  r>  zGConnection failure when polling update result - attempting to retry: %srE  r7  Fr  z"Failure while running win_updates rcstdoutstderrr8  warnings)rM  rangerO  r   RequestTimeoutExceptionrl  r  r	   r%  r  r
  )r  r5  r[  r  r  r  final_optionsr  idxrZ  r  extra_resultws                r  r  z!ActionModule._execute_win_updates  s    (-2335&/l#.?.E2*+ 8 	xCx-- = -' . 
 	x 6!$*:*:%l3D::h&**U&H$TUCLv~%+D\T"6!)/)9X&6!)/)9X&(f

;PT8UfYeffJ+ 	AOOA	 3 -.EF x'3!8 ilstulv vww	xs   C>>E)D<<Ec                 Z   | j                   |   }|d   |d   D cg c]  }|j                  d      r|dd n| c}|d   |ddd}d	| j                  fd
| j                  ffD ]A  \  }}|j	                  |d      }|s|d   dk(  rd||<   )|d   |d<   t        |d         |d<   C |S c c}w )z-Gets the update results info value to return.titlekbKBr   N
categoriesF)r  r  r  id
downloadedr@  r  r@  rh  Tr  r?  failure_msg)r&  
startswithr*  r+  r  r  )r  r\  raw_inform  inforw  resultsaction_infos           r  rV  zActionModule._get_update_info  s    ==+g&AI$PAQ\\$/AabEQ6P"<0
 4112$//0 
 	UOFG "++i6K}-2#'DL 4?y3ID/0*<[=S*TD'	U ) Qs   B()NN)NstartNF)r  r  r  _VALID_ARGSrL  r  rI  rP  rn  r  rV  r  r  s   @r  r  r  i  sD    
K "
#ZxgR8z 3jr  r  c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)r  c                     i | _         i | _        t               | _        i | _        i | _        d| _        d| _        d| _        d | _	        d | _
        d | _        d| _        y )NF   )r<  r=  r'  ro  rp  rq  ra  rb  r7  r  r8  r  _update_display_fired)r  s    r  r  zUpdateResult.__init__  s^     " # "!$%'"r  c                     |dk(  r| j                  |       y|dv r| j                  |||       y|dv r| j                  |||       y|dk(  r| j                  ||       yy)zB Process the progress result and store it in a structured object. search_result)downloadinstall)download_resultinstall_resultr  N)_process_search_result"_process_download_install_progress _process_download_install_result_process_exit)r  r  r  rd  s       r  r  zUpdateResult.process_result  sm    ?"''/,,33D&BTU::11$@RSV^v'9: r  c                     t        d |d   D              | _        t        d |d   D              | _        |d   D ]1  }|d   }|| j                  vs| j                  j	                  |       3 y )Nc              3   *   K   | ]  }|d    |f  yw)r  N .0us     r  	<genexpr>z6UpdateResult._process_search_result.<locals>.<genexpr>  s     DQQtWaLDs   r<  c              3   0   K   | ]  }|d    |d   f  yw)r  r^  Nr  r  s     r  r  z6UpdateResult._process_search_result.<locals>.<genexpr>  s     $Yagq|%<$Ys   filteredr  )dictr<  r=  ro  add)r  r  rS  r\  s       r  r  z#UpdateResult._process_search_result  sp    D&2CDD $$YfZFX$Y YY' 	5FtI 5 55%%)))4		5r  c           
         |d   d   }| j                   |   }|d   d   }|dk(  rX|d   d   }dddd	j                  ||      }d
j                  |d   d   |d   d   ||d   |d   d   |d   d   |d   d   |      }	ndj                  ||d   |d   d         }	|| j                  k\  rKt        j                  |	|       | j                  |k  r%| xj                  dz  c_        | j                  |k  r%t        j                  |	|       y )Nr  CurrentUpdateIdPercentCompleter  CurrentUpdateDownloadPhaseInitializingDownloading	Verifying)r>  r      zODownload progress - Total: {0}/{1} {2}%, Update ({3}): {4}/{5} {6}%, Phase: {7}TotalBytesDownloadedTotalBytesToDownloadr  CurrentUpdateBytesDownloadedCurrentUpdateBytesToDownloadCurrentUpdatePercentCompletez2Install progress - Total: {0}%, Update ({1}): {2}%re  r  )r<  r  formatr  rl  rt  debug)
r  r  r  rd  r\  rS  total_percentagecurrent_phasedownload_phaser  s
             r  r  z/UpdateResult._process_download_install_progress  s`   :&'89	i(!*-.?@:":./KLM!  c-/	  djjz"#9:z"#9: wz"#ABz"#ABz"#AB	C GMM wz"#ABC t999JJs!3J4,,0@@**b0* ,,0@@ 	c 23r  c                     |d d }t         j                  d|z  |       d| _        |dk(  r| j                  n| j                  }|d   D ]!  }|d   dz  |d<   |||j                  d	      <   # y )
NizUpdate phase %s completedre  r  r  r  r  r  r  )rl  rt  r  rp  rq  rX  )r  r  r  rd  phasetotal_resultsresult_infos          r  r  z-UpdateResult._process_download_install_result&  s    Sb	

.6=O
P%'"16*1D--$J^J^!&> 	?K%0%;j%HK	"3>M+//$/0	?r  c                    t         j                  d|       |d   | _        |d   | _        |d   | _        |j                  dd       r@|d   d   | _        |d   j                  dd       | _        d|d   v r|d   d   d	z  | _        y y y )
Nz/Received final progress result from update taskre  ra  rb  r7  r8  messager  r  )	rl  rt  ra  rb  r7  r  r  r8  r  )r  r  rd  s      r  r  zUpdateResult._process_exit1  s    

DK]
^i(%&78X&::k4(k*95DH#K044[$GDNF;//%k29=
J 0 )r  N)	r  r  r  r  r  r  r  r  r  r  r  r  r  r    s"    (;5&4P	?Kr  r  )#
__future__r   r   r   type__metaclass__rT  ansible.errorsr   r   +ansible.module_utils.common.text.convertersr   r	   &ansible.module_utils.common.validationr
   r   ansible.plugins.actionr   ansible.utils.displayr   requests.exceptionsr   r  ImportErrortypingr   r   plugin_utils._rebootr   rl  r  rQ  r
  r  r  r  r  r  <module>r     s    C B  F J R - )7F / )yJxY i: iXgK gKE  767  D8s"   A6 B 6B ?B 	BB