diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..174f733
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,10 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = tab
+tab_width = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
\ No newline at end of file
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..9b5ef6a
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,3 @@
+* text=auto eol=lf
+*.sln eol=crlf
+*.vcxproj eol=crlf
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5b40a76
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,122 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+*.userprefs
+
+# Build results
+Debug/
+Debug-VC08/
+Debug-VC17/
+Release/
+*.exe
+*.dll
+!setup/modern_aerowizard.exe
+!setup/x86-unicode/*.dll
+setup/x86-unicode/LegacyUpdateNSIS.dll
+obj/
+*_layout.inf
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_i.h
+*idl.h
+*.i
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.tlog
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# Windows Installer files from build outputs
+*.cab
+*.msi
+*.msix
+*.msm
+*.msp
diff --git a/.idea/.idea.LegacyUpdate/.idea/.gitignore b/.idea/.idea.LegacyUpdate/.idea/.gitignore
new file mode 100644
index 0000000..15cc650
--- /dev/null
+++ b/.idea/.idea.LegacyUpdate/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/.idea.LegacyUpdate.iml
+/modules.xml
+/contentModel.xml
+/projectSettingsUpdater.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.LegacyUpdate/.idea/discord.xml b/.idea/.idea.LegacyUpdate/.idea/discord.xml
new file mode 100644
index 0000000..8cf359d
--- /dev/null
+++ b/.idea/.idea.LegacyUpdate/.idea/discord.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.LegacyUpdate/.idea/icon.svg b/.idea/.idea.LegacyUpdate/.idea/icon.svg
new file mode 100644
index 0000000..bdea646
--- /dev/null
+++ b/.idea/.idea.LegacyUpdate/.idea/icon.svg
@@ -0,0 +1 @@
+
diff --git a/.idea/.idea.LegacyUpdate/.idea/indexLayout.xml b/.idea/.idea.LegacyUpdate/.idea/indexLayout.xml
new file mode 100644
index 0000000..323a9b7
--- /dev/null
+++ b/.idea/.idea.LegacyUpdate/.idea/indexLayout.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ .
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.LegacyUpdate/.idea/vcs.xml b/.idea/.idea.LegacyUpdate/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/.idea.LegacyUpdate/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
new file mode 100644
index 0000000..21c0cef
--- /dev/null
+++ b/.vscode/c_cpp_properties.json
@@ -0,0 +1,37 @@
+{
+ "configurations": [
+ {
+ "name": "MinGW",
+ "includePath": [
+ "${workspaceFolder}/include",
+ "${workspaceFolder}/shared"
+ ],
+ "compilerPath": "/usr/bin/i686-w64-mingw32-g++",
+ "cStandard": "c17",
+ "cppStandard": "c++11",
+ "intelliSenseMode": "windows-gcc-x86",
+ "compilerArgs": [
+ "-std=c++11",
+ "-mwindows",
+ "-municode",
+ "-s",
+ "-fPIE",
+ "-ffunction-sections",
+ "-fdata-sections",
+ "-fno-unwind-tables",
+ "-fno-asynchronous-unwind-tables",
+ "-fno-exceptions",
+ "-fno-rtti",
+ "-flto",
+ "-Wno-write-strings",
+ "-include stdafx.h"
+ ],
+ "defines": [
+ "UNICODE",
+ "_UNICODE",
+ "_USRDLL"
+ ]
+ }
+ ],
+ "version": 4
+}
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..a3c3d84
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "files.associations": {
+ "*.rc": "cpp",
+ "*.idl": "cpp"
+ }
+}
diff --git a/.vsconfig b/.vsconfig
new file mode 100644
index 0000000..31366d6
--- /dev/null
+++ b/.vsconfig
@@ -0,0 +1,8 @@
+{
+ "version": "1.0",
+ "components": [
+ "Microsoft.VisualStudio.Component.VC.v141.x86.x64",
+ "Microsoft.VisualStudio.Component.WinXP",
+ "Microsoft.VisualStudio.Component.VC.v141.ATL"
+ ]
+}
diff --git a/LegacyUpdate/IUpdateInstaller4.h b/LegacyUpdate/IUpdateInstaller4.h
new file mode 100644
index 0000000..53e6998
--- /dev/null
+++ b/LegacyUpdate/IUpdateInstaller4.h
@@ -0,0 +1,650 @@
+#pragma once
+#include
+
+// Copied from wuapi.h in Windows SDK 10.0.19041.0
+
+#ifndef __IUpdateInstaller3_FWD_DEFINED__
+#define __IUpdateInstaller3_FWD_DEFINED__
+typedef interface IUpdateInstaller3 IUpdateInstaller3;
+
+#endif /* __IUpdateInstaller3_FWD_DEFINED__ */
+
+#ifndef __IUpdateInstaller4_FWD_DEFINED__
+#define __IUpdateInstaller4_FWD_DEFINED__
+typedef interface IUpdateInstaller4 IUpdateInstaller4;
+
+#endif /* __IUpdateInstaller4_FWD_DEFINED__ */
+
+// {16d11c35-099a-48d0-8338-5fae64047f8e}
+DEFINE_GUID(IID_IUpdateInstaller3,0x16d11c35,0x099a,0x48d0,0x83,0x38,0x5f,0xae,0x64,0x04,0x7f,0x8e);
+
+// {EF8208EA-2304-492D-9109-23813B0958E1}
+DEFINE_GUID(IID_IUpdateInstaller4, 0xef8208ea, 0x2304, 0x492d, 0x91, 0x9, 0x23, 0x81, 0x3b, 0x9, 0x58, 0xe1);
+
+#ifndef __IUpdateInstaller3_INTERFACE_DEFINED__
+#define __IUpdateInstaller3_INTERFACE_DEFINED__
+
+/* interface IUpdateInstaller3 */
+/* [hidden][unique][uuid][nonextensible][dual][oleautomation][object][helpstring] */
+
+
+EXTERN_C const IID IID_IUpdateInstaller3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("16d11c35-099a-48d0-8338-5fae64047f8e")
+ IUpdateInstaller3 : public IUpdateInstaller2
+ {
+ public:
+ virtual /* [helpstring][propget][id] */ HRESULT STDMETHODCALLTYPE get_AttemptCloseAppsIfNecessary(
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval) = 0;
+
+ virtual /* [helpstring][propput][id] */ HRESULT STDMETHODCALLTYPE put_AttemptCloseAppsIfNecessary(
+ /* [in] */ VARIANT_BOOL value) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IUpdateInstaller3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ __RPC__in IUpdateInstaller3 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ __RPC__in IUpdateInstaller3 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [out] */ __RPC__out UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in REFIID riid,
+ /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames,
+ /* [range][in] */ __RPC__in_range(0,16384) UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IUpdateInstaller3 * This,
+ /* [annotation][in] */
+ _In_ DISPID dispIdMember,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][in] */
+ _In_ LCID lcid,
+ /* [annotation][in] */
+ _In_ WORD wFlags,
+ /* [annotation][out][in] */
+ _In_ DISPPARAMS *pDispParams,
+ /* [annotation][out] */
+ _Out_opt_ VARIANT *pVarResult,
+ /* [annotation][out] */
+ _Out_opt_ EXCEPINFO *pExcepInfo,
+ /* [annotation][out] */
+ _Out_opt_ UINT *puArgErr);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ClientApplicationID )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt BSTR *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClientApplicationID )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in BSTR value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsForced )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IsForced )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][restricted][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentHwnd )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt HWND *retval);
+
+ /* [helpstring][restricted][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentHwnd )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [unique][in] */ __RPC__in_opt HWND value);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentWindow )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [unique][in] */ __RPC__in_opt IUnknown *value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentWindow )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Updates )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IUpdateCollection **retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Updates )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in_opt IUpdateCollection *value);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginInstall )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
+ /* [in] */ __RPC__in_opt IUnknown *onCompleted,
+ /* [in] */ VARIANT state,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginUninstall )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
+ /* [in] */ __RPC__in_opt IUnknown *onCompleted,
+ /* [in] */ VARIANT state,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndInstall )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in_opt IInstallationJob *value,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndUninstall )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ __RPC__in_opt IInstallationJob *value,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Install )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RunWizard )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [defaultvalue][unique][in] */ __RPC__in_opt BSTR dialogTitle,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsBusy )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Uninstall )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AllowSourcePrompts )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AllowSourcePrompts )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RebootRequiredBeforeInstallation )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ForceQuiet )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ForceQuiet )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AttemptCloseAppsIfNecessary )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AttemptCloseAppsIfNecessary )(
+ __RPC__in IUpdateInstaller3 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ END_INTERFACE
+ } IUpdateInstaller3Vtbl;
+
+ interface IUpdateInstaller3
+ {
+ CONST_VTBL struct IUpdateInstaller3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IUpdateInstaller3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IUpdateInstaller3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IUpdateInstaller3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IUpdateInstaller3_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IUpdateInstaller3_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IUpdateInstaller3_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IUpdateInstaller3_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IUpdateInstaller3_get_ClientApplicationID(This,retval) \
+ ( (This)->lpVtbl -> get_ClientApplicationID(This,retval) )
+
+#define IUpdateInstaller3_put_ClientApplicationID(This,value) \
+ ( (This)->lpVtbl -> put_ClientApplicationID(This,value) )
+
+#define IUpdateInstaller3_get_IsForced(This,retval) \
+ ( (This)->lpVtbl -> get_IsForced(This,retval) )
+
+#define IUpdateInstaller3_put_IsForced(This,value) \
+ ( (This)->lpVtbl -> put_IsForced(This,value) )
+
+#define IUpdateInstaller3_get_ParentHwnd(This,retval) \
+ ( (This)->lpVtbl -> get_ParentHwnd(This,retval) )
+
+#define IUpdateInstaller3_put_ParentHwnd(This,value) \
+ ( (This)->lpVtbl -> put_ParentHwnd(This,value) )
+
+#define IUpdateInstaller3_put_ParentWindow(This,value) \
+ ( (This)->lpVtbl -> put_ParentWindow(This,value) )
+
+#define IUpdateInstaller3_get_ParentWindow(This,retval) \
+ ( (This)->lpVtbl -> get_ParentWindow(This,retval) )
+
+#define IUpdateInstaller3_get_Updates(This,retval) \
+ ( (This)->lpVtbl -> get_Updates(This,retval) )
+
+#define IUpdateInstaller3_put_Updates(This,value) \
+ ( (This)->lpVtbl -> put_Updates(This,value) )
+
+#define IUpdateInstaller3_BeginInstall(This,onProgressChanged,onCompleted,state,retval) \
+ ( (This)->lpVtbl -> BeginInstall(This,onProgressChanged,onCompleted,state,retval) )
+
+#define IUpdateInstaller3_BeginUninstall(This,onProgressChanged,onCompleted,state,retval) \
+ ( (This)->lpVtbl -> BeginUninstall(This,onProgressChanged,onCompleted,state,retval) )
+
+#define IUpdateInstaller3_EndInstall(This,value,retval) \
+ ( (This)->lpVtbl -> EndInstall(This,value,retval) )
+
+#define IUpdateInstaller3_EndUninstall(This,value,retval) \
+ ( (This)->lpVtbl -> EndUninstall(This,value,retval) )
+
+#define IUpdateInstaller3_Install(This,retval) \
+ ( (This)->lpVtbl -> Install(This,retval) )
+
+#define IUpdateInstaller3_RunWizard(This,dialogTitle,retval) \
+ ( (This)->lpVtbl -> RunWizard(This,dialogTitle,retval) )
+
+#define IUpdateInstaller3_get_IsBusy(This,retval) \
+ ( (This)->lpVtbl -> get_IsBusy(This,retval) )
+
+#define IUpdateInstaller3_Uninstall(This,retval) \
+ ( (This)->lpVtbl -> Uninstall(This,retval) )
+
+#define IUpdateInstaller3_get_AllowSourcePrompts(This,retval) \
+ ( (This)->lpVtbl -> get_AllowSourcePrompts(This,retval) )
+
+#define IUpdateInstaller3_put_AllowSourcePrompts(This,value) \
+ ( (This)->lpVtbl -> put_AllowSourcePrompts(This,value) )
+
+#define IUpdateInstaller3_get_RebootRequiredBeforeInstallation(This,retval) \
+ ( (This)->lpVtbl -> get_RebootRequiredBeforeInstallation(This,retval) )
+
+
+#define IUpdateInstaller3_get_ForceQuiet(This,retval) \
+ ( (This)->lpVtbl -> get_ForceQuiet(This,retval) )
+
+#define IUpdateInstaller3_put_ForceQuiet(This,value) \
+ ( (This)->lpVtbl -> put_ForceQuiet(This,value) )
+
+
+#define IUpdateInstaller3_get_AttemptCloseAppsIfNecessary(This,retval) \
+ ( (This)->lpVtbl -> get_AttemptCloseAppsIfNecessary(This,retval) )
+
+#define IUpdateInstaller3_put_AttemptCloseAppsIfNecessary(This,value) \
+ ( (This)->lpVtbl -> put_AttemptCloseAppsIfNecessary(This,value) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IUpdateInstaller3_INTERFACE_DEFINED__ */
+
+
+#ifndef __IUpdateInstaller4_INTERFACE_DEFINED__
+#define __IUpdateInstaller4_INTERFACE_DEFINED__
+
+/* interface IUpdateInstaller4 */
+/* [hidden][unique][uuid][nonextensible][dual][oleautomation][object][helpstring] */
+
+
+EXTERN_C const IID IID_IUpdateInstaller4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("EF8208EA-2304-492D-9109-23813B0958E1")
+ IUpdateInstaller4 : public IUpdateInstaller3
+ {
+ public:
+ virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE Commit(
+ /* [in] */ DWORD dwFlags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct IUpdateInstaller4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ __RPC__in IUpdateInstaller4 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ __RPC__in IUpdateInstaller4 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [out] */ __RPC__out UINT *pctinfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ UINT iTInfo,
+ /* [in] */ LCID lcid,
+ /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo);
+
+ HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in REFIID riid,
+ /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames,
+ /* [range][in] */ __RPC__in_range(0,16384) UINT cNames,
+ /* [in] */ LCID lcid,
+ /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId);
+
+ /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )(
+ IUpdateInstaller4 * This,
+ /* [annotation][in] */
+ _In_ DISPID dispIdMember,
+ /* [annotation][in] */
+ _In_ REFIID riid,
+ /* [annotation][in] */
+ _In_ LCID lcid,
+ /* [annotation][in] */
+ _In_ WORD wFlags,
+ /* [annotation][out][in] */
+ _In_ DISPPARAMS *pDispParams,
+ /* [annotation][out] */
+ _Out_opt_ VARIANT *pVarResult,
+ /* [annotation][out] */
+ _Out_opt_ EXCEPINFO *pExcepInfo,
+ /* [annotation][out] */
+ _Out_opt_ UINT *puArgErr);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ClientApplicationID )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt BSTR *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ClientApplicationID )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in BSTR value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsForced )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_IsForced )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][restricted][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentHwnd )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt HWND *retval);
+
+ /* [helpstring][restricted][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentHwnd )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [unique][in] */ __RPC__in_opt HWND value);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ParentWindow )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [unique][in] */ __RPC__in_opt IUnknown *value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ParentWindow )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IUnknown **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_Updates )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IUpdateCollection **retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_Updates )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in_opt IUpdateCollection *value);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginInstall )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
+ /* [in] */ __RPC__in_opt IUnknown *onCompleted,
+ /* [in] */ VARIANT state,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *BeginUninstall )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in_opt IUnknown *onProgressChanged,
+ /* [in] */ __RPC__in_opt IUnknown *onCompleted,
+ /* [in] */ VARIANT state,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationJob **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndInstall )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in_opt IInstallationJob *value,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *EndUninstall )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ __RPC__in_opt IInstallationJob *value,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Install )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *RunWizard )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [defaultvalue][unique][in] */ __RPC__in_opt BSTR dialogTitle,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_IsBusy )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Uninstall )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__deref_out_opt IInstallationResult **retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AllowSourcePrompts )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AllowSourcePrompts )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_RebootRequiredBeforeInstallation )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_ForceQuiet )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_ForceQuiet )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][propget][id] */ HRESULT ( STDMETHODCALLTYPE *get_AttemptCloseAppsIfNecessary )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [retval][out] */ __RPC__out VARIANT_BOOL *retval);
+
+ /* [helpstring][propput][id] */ HRESULT ( STDMETHODCALLTYPE *put_AttemptCloseAppsIfNecessary )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ VARIANT_BOOL value);
+
+ /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *Commit )(
+ __RPC__in IUpdateInstaller4 * This,
+ /* [in] */ DWORD dwFlags);
+
+ END_INTERFACE
+ } IUpdateInstaller4Vtbl;
+
+ interface IUpdateInstaller4
+ {
+ CONST_VTBL struct IUpdateInstaller4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define IUpdateInstaller4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define IUpdateInstaller4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define IUpdateInstaller4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define IUpdateInstaller4_GetTypeInfoCount(This,pctinfo) \
+ ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) )
+
+#define IUpdateInstaller4_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \
+ ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) )
+
+#define IUpdateInstaller4_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \
+ ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) )
+
+#define IUpdateInstaller4_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \
+ ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) )
+
+
+#define IUpdateInstaller4_get_ClientApplicationID(This,retval) \
+ ( (This)->lpVtbl -> get_ClientApplicationID(This,retval) )
+
+#define IUpdateInstaller4_put_ClientApplicationID(This,value) \
+ ( (This)->lpVtbl -> put_ClientApplicationID(This,value) )
+
+#define IUpdateInstaller4_get_IsForced(This,retval) \
+ ( (This)->lpVtbl -> get_IsForced(This,retval) )
+
+#define IUpdateInstaller4_put_IsForced(This,value) \
+ ( (This)->lpVtbl -> put_IsForced(This,value) )
+
+#define IUpdateInstaller4_get_ParentHwnd(This,retval) \
+ ( (This)->lpVtbl -> get_ParentHwnd(This,retval) )
+
+#define IUpdateInstaller4_put_ParentHwnd(This,value) \
+ ( (This)->lpVtbl -> put_ParentHwnd(This,value) )
+
+#define IUpdateInstaller4_put_ParentWindow(This,value) \
+ ( (This)->lpVtbl -> put_ParentWindow(This,value) )
+
+#define IUpdateInstaller4_get_ParentWindow(This,retval) \
+ ( (This)->lpVtbl -> get_ParentWindow(This,retval) )
+
+#define IUpdateInstaller4_get_Updates(This,retval) \
+ ( (This)->lpVtbl -> get_Updates(This,retval) )
+
+#define IUpdateInstaller4_put_Updates(This,value) \
+ ( (This)->lpVtbl -> put_Updates(This,value) )
+
+#define IUpdateInstaller4_BeginInstall(This,onProgressChanged,onCompleted,state,retval) \
+ ( (This)->lpVtbl -> BeginInstall(This,onProgressChanged,onCompleted,state,retval) )
+
+#define IUpdateInstaller4_BeginUninstall(This,onProgressChanged,onCompleted,state,retval) \
+ ( (This)->lpVtbl -> BeginUninstall(This,onProgressChanged,onCompleted,state,retval) )
+
+#define IUpdateInstaller4_EndInstall(This,value,retval) \
+ ( (This)->lpVtbl -> EndInstall(This,value,retval) )
+
+#define IUpdateInstaller4_EndUninstall(This,value,retval) \
+ ( (This)->lpVtbl -> EndUninstall(This,value,retval) )
+
+#define IUpdateInstaller4_Install(This,retval) \
+ ( (This)->lpVtbl -> Install(This,retval) )
+
+#define IUpdateInstaller4_RunWizard(This,dialogTitle,retval) \
+ ( (This)->lpVtbl -> RunWizard(This,dialogTitle,retval) )
+
+#define IUpdateInstaller4_get_IsBusy(This,retval) \
+ ( (This)->lpVtbl -> get_IsBusy(This,retval) )
+
+#define IUpdateInstaller4_Uninstall(This,retval) \
+ ( (This)->lpVtbl -> Uninstall(This,retval) )
+
+#define IUpdateInstaller4_get_AllowSourcePrompts(This,retval) \
+ ( (This)->lpVtbl -> get_AllowSourcePrompts(This,retval) )
+
+#define IUpdateInstaller4_put_AllowSourcePrompts(This,value) \
+ ( (This)->lpVtbl -> put_AllowSourcePrompts(This,value) )
+
+#define IUpdateInstaller4_get_RebootRequiredBeforeInstallation(This,retval) \
+ ( (This)->lpVtbl -> get_RebootRequiredBeforeInstallation(This,retval) )
+
+
+#define IUpdateInstaller4_get_ForceQuiet(This,retval) \
+ ( (This)->lpVtbl -> get_ForceQuiet(This,retval) )
+
+#define IUpdateInstaller4_put_ForceQuiet(This,value) \
+ ( (This)->lpVtbl -> put_ForceQuiet(This,value) )
+
+
+#define IUpdateInstaller4_get_AttemptCloseAppsIfNecessary(This,retval) \
+ ( (This)->lpVtbl -> get_AttemptCloseAppsIfNecessary(This,retval) )
+
+#define IUpdateInstaller4_put_AttemptCloseAppsIfNecessary(This,value) \
+ ( (This)->lpVtbl -> put_AttemptCloseAppsIfNecessary(This,value) )
+
+
+#define IUpdateInstaller4_Commit(This,dwFlags) \
+ ( (This)->lpVtbl -> Commit(This,dwFlags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __IUpdateInstaller4_INTERFACE_DEFINED__ */
diff --git a/LegacyUpdate/wuapi.idl b/LegacyUpdate/wuapi.idl
new file mode 100644
index 0000000..0b8f894
--- /dev/null
+++ b/LegacyUpdate/wuapi.idl
@@ -0,0 +1,39 @@
+import "oaidl.idl";
+
+// Just types we need from wuapi.idl
+
+[
+ helpstring("IUpdateInstaller Interface"),
+ object,
+ oleautomation,
+ dual,
+ nonextensible,
+ uuid(7b929c68-ccdc-4226-96b1-8724600b54c2),
+ pointer_default(unique),
+]
+interface IUpdateInstaller : IDispatch {
+ [id(0x60020003), propget, restricted]
+ HRESULT ParentHwnd([out, retval] HWND *retval);
+
+ [id(0x60020003), propput, restricted]
+ HRESULT ParentHwnd([in, unique] HWND value);
+};
+
+[
+ uuid(B596CC9F-56E5-419E-A622-E01BB457431E),
+ version(2.0),
+ helpstring("WUAPI 2.0 Type Library")
+]
+library WUApiLib
+{
+ importlib("stdole2.tlb");
+
+ [
+ helpstring("UpdateInstaller Class"),
+ uuid(D2E0FE7F-D23E-48E1-93C0-6FA8CC346474)
+ ]
+ coclass UpdateInstaller
+ {
+ [default] interface IUpdateInstaller2;
+ };
+};
diff --git a/LegacyUpdate/wuerror.mc b/LegacyUpdate/wuerror.mc
new file mode 100644
index 0000000..347916b
--- /dev/null
+++ b/LegacyUpdate/wuerror.mc
@@ -0,0 +1,3943 @@
+;// Reverse engineered from wuerror.h from Windows SDK 10.0.26100.0
+
+;/***************************************************************************
+;* *
+;* wuerror.mc -- error code definitions for Windows Update. *
+;* *
+;* Copyright (c) Microsoft Corporation. All rights reserved. *
+;* *
+;***************************************************************************/
+;#ifndef _WUERROR_
+;#define _WUERROR_
+
+MessageIdTypedef = DWORD
+OutputBase = 16
+
+FacilityNames = (
+ WindowsUpdate = 0x024
+)
+
+SeverityNames = (
+ Success = 0x0
+ Error = 0x2
+)
+
+LanguageNames = (
+ English = 0x0409:MSG0409
+)
+
+;///////////////////////////////////////////////////////////////////////////////
+;// Windows Update Success Codes
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x0001
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SERVICE_STOP
+Language = English
+Windows Update Agent was stopped successfully.
+.
+
+MessageId = 0x0002
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SELFUPDATE
+Language = English
+Windows Update Agent updated itself.
+.
+
+MessageId = 0x0003
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_UPDATE_ERROR
+Language = English
+Operation completed successfully but there were errors applying the updates.
+.
+
+MessageId = 0x0004
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_MARKED_FOR_DISCONNECT
+Language = English
+A callback was marked to be disconnected later because the request to disconnect the operation came while a callback was executing.
+.
+
+MessageId = 0x0005
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_REBOOT_REQUIRED
+Language = English
+The system must be restarted to complete installation of the update.
+.
+
+MessageId = 0x0006
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_ALREADY_INSTALLED
+Language = English
+The update to be installed is already installed on the system.
+.
+
+MessageId = 0x0007
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_ALREADY_UNINSTALLED
+Language = English
+The update to be removed is not installed on the system.
+.
+
+MessageId = 0x0008
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_ALREADY_DOWNLOADED
+Language = English
+The update to be downloaded has already been downloaded.
+.
+
+MessageId = 0x0009
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SOME_UPDATES_SKIPPED_ON_BATTERY
+Language = English
+The operation completed successfully, but some updates were skipped because the system is running on batteries.
+.
+
+MessageId = 0x000A
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_ALREADY_REVERTED
+Language = English
+The update to be reverted is not present on the system.
+.
+
+MessageId = 0x0010
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SEARCH_CRITERIA_NOT_SUPPORTED
+Language = English
+The operation is skipped because the update service does not support the requested search criteria.
+.
+
+MessageId = 0x2015
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_UH_INSTALLSTILLPENDING
+Language = English
+The installation operation for the update is still in progress.
+.
+
+MessageId = 0x2016
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_UH_DOWNLOAD_SIZE_CALCULATED
+Language = English
+The actual download size has been calculated by the handler.
+.
+
+MessageId = 0x5001
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SIH_NOOP
+Language = English
+No operation was required by the server-initiated healing server response.
+.
+
+MessageId = 0x6001
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_DM_ALREADYDOWNLOADING
+Language = English
+The update to be downloaded is already being downloaded.
+.
+
+MessageId = 0x7101
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_METADATA_SKIPPED_BY_ENFORCEMENTMODE
+Language = English
+Metadata verification was skipped by enforcement mode.
+.
+
+MessageId = 0x7102
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_METADATA_IGNORED_SIGNATURE_VERIFICATION
+Language = English
+A server configuration refresh resulted in metadata signature verification to be ignored.
+.
+
+MessageId = 0x8001
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_SEARCH_LOAD_SHEDDING
+Language = English
+Search operation completed successfully but one or more services were shedding load.
+.
+
+MessageId = 0x8002
+Facility = WindowsUpdate
+Severity = Success
+SymbolicName = WU_S_AAD_DEVICE_TICKET_NOT_NEEDED
+Language = English
+There was no need to retrieve an AAD device ticket.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// Windows Update Error Codes
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x0001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_SERVICE
+Language = English
+Windows Update Agent was unable to provide the service.
+.
+
+MessageId = 0x0002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MAX_CAPACITY_REACHED
+Language = English
+The maximum capacity of the service was exceeded.
+.
+
+MessageId = 0x0003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNKNOWN_ID
+Language = English
+An ID cannot be found.
+.
+
+MessageId = 0x0004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NOT_INITIALIZED
+Language = English
+The object could not be initialized.
+.
+
+MessageId = 0x0005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_RANGEOVERLAP
+Language = English
+The update handler requested a byte range overlapping a previously requested range.
+.
+
+MessageId = 0x0006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TOOMANYRANGES
+Language = English
+The requested number of byte ranges exceeds the maximum number (2^31 - 1).
+.
+
+MessageId = 0x0007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALIDINDEX
+Language = English
+The index to a collection was invalid.
+.
+
+MessageId = 0x0008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_ITEMNOTFOUND
+Language = English
+The key for the item queried could not be found.
+.
+
+MessageId = 0x0009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_OPERATIONINPROGRESS
+Language = English
+Another conflicting operation was in progress. Some operations such as installation cannot be performed twice simultaneously.
+.
+
+MessageId = 0x000A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_COULDNOTCANCEL
+Language = English
+Cancellation of the operation was not allowed.
+.
+
+MessageId = 0x000B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALL_CANCELLED
+Language = English
+Operation was cancelled.
+.
+
+MessageId = 0x000C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NOOP
+Language = English
+No operation was required.
+.
+
+MessageId = 0x000D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_XML_MISSINGDATA
+Language = English
+Windows Update Agent could not find required information in the update's XML data.
+.
+
+MessageId = 0x000E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_XML_INVALID
+Language = English
+Windows Update Agent found invalid information in the update's XML data.
+.
+
+MessageId = 0x000F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CYCLE_DETECTED
+Language = English
+Circular update relationships were detected in the metadata.
+.
+
+MessageId = 0x0010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TOO_DEEP_RELATION
+Language = English
+Update relationships too deep to evaluate were evaluated.
+.
+
+MessageId = 0x0011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_RELATIONSHIP
+Language = English
+An invalid update relationship was detected.
+.
+
+MessageId = 0x0012
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REG_VALUE_INVALID
+Language = English
+An invalid registry value was read.
+.
+
+MessageId = 0x0013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DUPLICATE_ITEM
+Language = English
+Operation tried to add a duplicate item to a list.
+.
+
+MessageId = 0x0014
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_INSTALL_REQUESTED
+Language = English
+Updates requested for install are not installable by caller.
+.
+
+MessageId = 0x0016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALL_NOT_ALLOWED
+Language = English
+Operation tried to install while another installation was in progress or the system was pending a mandatory restart.
+.
+
+MessageId = 0x0017
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NOT_APPLICABLE
+Language = English
+Operation was not performed because there are no applicable updates.
+.
+
+MessageId = 0x0018
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_USERTOKEN
+Language = English
+Operation failed because a required user token is missing.
+.
+
+MessageId = 0x0019
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EXCLUSIVE_INSTALL_CONFLICT
+Language = English
+An exclusive update cannot be installed with other updates at the same time.
+.
+
+MessageId = 0x001A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_POLICY_NOT_SET
+Language = English
+A policy value was not set.
+.
+
+MessageId = 0x001B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SELFUPDATE_IN_PROGRESS
+Language = English
+The operation could not be performed because the Windows Update Agent is self-updating.
+.
+
+MessageId = 0x001D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_UPDATE
+Language = English
+An update contains invalid metadata.
+.
+
+MessageId = 0x001E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SERVICE_STOP
+Language = English
+Operation did not complete because the service or system was being shut down.
+.
+
+MessageId = 0x001F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_CONNECTION
+Language = English
+Operation did not complete because the network connection was unavailable.
+.
+
+MessageId = 0x0020
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_INTERACTIVE_USER
+Language = English
+Operation did not complete because there is no logged-on interactive user.
+.
+
+MessageId = 0x0021
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TIME_OUT
+Language = English
+Operation did not complete because it timed out.
+.
+
+MessageId = 0x0022
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_ALL_UPDATES_FAILED
+Language = English
+Operation failed for all the updates.
+.
+
+MessageId = 0x0023
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EULAS_DECLINED
+Language = English
+The license terms for all updates were declined.
+.
+
+MessageId = 0x0024
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_UPDATE
+Language = English
+There are no updates.
+.
+
+MessageId = 0x0025
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_USER_ACCESS_DISABLED
+Language = English
+Group Policy settings prevented access to Windows Update.
+.
+
+MessageId = 0x0026
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_UPDATE_TYPE
+Language = English
+The type of update is invalid.
+.
+
+MessageId = 0x0027
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_URL_TOO_LONG
+Language = English
+The URL exceeded the maximum length.
+.
+
+MessageId = 0x0028
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNINSTALL_NOT_ALLOWED
+Language = English
+The update could not be uninstalled because the request did not originate from a WSUS server.
+.
+
+MessageId = 0x0029
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_PRODUCT_LICENSE
+Language = English
+Search may have missed some updates before there is an unlicensed application on the system.
+.
+
+MessageId = 0x002A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MISSING_HANDLER
+Language = English
+A component required to detect applicable updates was missing.
+.
+
+MessageId = 0x002B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_LEGACYSERVER
+Language = English
+An operation did not complete because it requires a newer version of server.
+.
+
+MessageId = 0x002C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_BIN_SOURCE_ABSENT
+Language = English
+A delta-compressed update could not be installed because it required the source.
+.
+
+MessageId = 0x002D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SOURCE_ABSENT
+Language = English
+A full-file update could not be installed because it required the source.
+.
+
+MessageId = 0x002E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WU_DISABLED
+Language = English
+Access to an unmanaged server is not allowed.
+.
+
+MessageId = 0x002F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALL_CANCELLED_BY_POLICY
+Language = English
+Operation did not complete because the DisableWindowsUpdateAccess policy was set.
+.
+
+MessageId = 0x0030
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_PROXY_SERVER
+Language = English
+The format of the proxy list was invalid.
+.
+
+MessageId = 0x0031
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_FILE
+Language = English
+The file is in the wrong format.
+.
+
+MessageId = 0x0032
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_CRITERIA
+Language = English
+The search criteria string was invalid.
+.
+
+MessageId = 0x0033
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EULA_UNAVAILABLE
+Language = English
+License terms could not be downloaded.
+.
+
+MessageId = 0x0034
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DOWNLOAD_FAILED
+Language = English
+Update failed to download.
+.
+
+MessageId = 0x0035
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UPDATE_NOT_PROCESSED
+Language = English
+The update was not processed.
+.
+
+MessageId = 0x0036
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_OPERATION
+Language = English
+The object's current state did not allow the operation.
+.
+
+MessageId = 0x0037
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NOT_SUPPORTED
+Language = English
+The functionality for the operation is not supported.
+.
+
+MessageId = 0x0038
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WINHTTP_INVALID_FILE
+Language = English
+The downloaded file has an unexpected content type.
+.
+
+MessageId = 0x0039
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TOO_MANY_RESYNC
+Language = English
+Agent is asked by server to resync too many times.
+.
+
+MessageId = 0x0040
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_SERVER_CORE_SUPPORT
+Language = English
+WUA API method does not run on Server Core installation.
+.
+
+MessageId = 0x0041
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SYSPREP_IN_PROGRESS
+Language = English
+Service is not available while sysprep is running.
+.
+
+MessageId = 0x0042
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNKNOWN_SERVICE
+Language = English
+The update service is no longer registered with AU.
+.
+
+MessageId = 0x0043
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_UI_SUPPORT
+Language = English
+There is no support for WUA UI.
+.
+
+MessageId = 0x0044
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PER_MACHINE_UPDATE_ACCESS_DENIED
+Language = English
+Only administrators can perform this operation on per-machine updates.
+.
+
+MessageId = 0x0045
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNSUPPORTED_SEARCHSCOPE
+Language = English
+A search was attempted with a scope that is not currently supported for this type of search.
+.
+
+MessageId = 0x0046
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_BAD_FILE_URL
+Language = English
+The URL does not point to a file.
+.
+
+MessageId = 0x0047
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REVERT_NOT_ALLOWED
+Language = English
+The update could not be reverted.
+.
+
+MessageId = 0x0048
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_NOTIFICATION_INFO
+Language = English
+The featured update notification info returned by the server is invalid.
+.
+
+MessageId = 0x0049
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_OUTOFRANGE
+Language = English
+The data is out of range.
+.
+
+MessageId = 0x004A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_IN_PROGRESS
+Language = English
+Windows Update agent operations are not available while OS setup is running.
+.
+
+MessageId = 0x004B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_ORPHANED_DOWNLOAD_JOB
+Language = English
+An orphaned downloadjob was found with no active callers.
+.
+
+MessageId = 0x004C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_LOW_BATTERY
+Language = English
+An update could not be installed because the system battery power level is too low.
+.
+
+MessageId = 0x004D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INFRASTRUCTUREFILE_INVALID_FORMAT
+Language = English
+The downloaded infrastructure file is incorrectly formatted.
+.
+
+MessageId = 0x004E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INFRASTRUCTUREFILE_REQUIRES_SSL
+Language = English
+The infrastructure file must be downloaded using strong SSL.
+.
+
+MessageId = 0x004F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_DISCOVERY
+Language = English
+A discovery call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0050
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_SEARCH
+Language = English
+A search call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0051
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_DOWNLOAD
+Language = English
+A download call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0052
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_INSTALL
+Language = English
+An install call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0053
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_OTHER
+Language = English
+An unspecified call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0054
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INTERACTIVE_CALL_CANCELLED
+Language = English
+An interactive user cancelled this operation, which was started from the Windows Update Agent UI.
+.
+
+MessageId = 0x0055
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_CALL_CANCELLED
+Language = English
+Automatic Updates cancelled this operation because it applies to an update that is no longer applicable to this computer.
+.
+
+MessageId = 0x0056
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SYSTEM_UNSUPPORTED
+Language = English
+This version or edition of the operating system doesn't support the needed functionality.
+.
+
+MessageId = 0x0057
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NO_SUCH_HANDLER_PLUGIN
+Language = English
+The requested update download or install handler, or update applicability expression evaluator, is not provided by this Agent plugin.
+.
+
+MessageId = 0x0058
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_SERIALIZATION_VERSION
+Language = English
+The requested serialization version is not supported.
+.
+
+MessageId = 0x0059
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NETWORK_COST_EXCEEDS_POLICY
+Language = English
+The current network cost does not meet the conditions set by the network cost policy.
+.
+
+MessageId = 0x005A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALL_CANCELLED_BY_HIDE
+Language = English
+The call is cancelled because it applies to an update that is hidden (no longer applicable to this computer).
+.
+
+MessageId = 0x005B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALL_CANCELLED_BY_INVALID
+Language = English
+The call is cancelled because it applies to an update that is invalid (no longer applicable to this computer).
+.
+
+MessageId = 0x005C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_VOLUMEID
+Language = English
+The specified volume id is invalid.
+.
+
+MessageId = 0x005D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNRECOGNIZED_VOLUMEID
+Language = English
+The specified volume id is unrecognized by the system.
+.
+
+MessageId = 0x005E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EXTENDEDERROR_NOTSET
+Language = English
+The installation extended error code is not specified.
+.
+
+MessageId = 0x005F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EXTENDEDERROR_FAILED
+Language = English
+The installation extended error code is set to general fail.
+.
+
+MessageId = 0x0060
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_IDLESHUTDOWN_OPCOUNT_SERVICEREGISTRATION
+Language = English
+A service registration call contributed to a non-zero operation count at idle timer shutdown.
+.
+
+MessageId = 0x0061
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_FILETRUST_SHA2SIGNATURE_MISSING
+Language = English
+Signature validation of the file fails to find valid SHA2+ signature on MS signed payload.
+.
+
+MessageId = 0x0062
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UPDATE_NOT_APPROVED
+Language = English
+The update is not in the servicing approval list.
+.
+
+MessageId = 0x0063
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALL_CANCELLED_BY_INTERACTIVE_SEARCH
+Language = English
+The search call was cancelled by another interactive search against the same service.
+.
+
+MessageId = 0x0064
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALL_JOB_RESUME_NOT_ALLOWED
+Language = English
+Resume of install job not allowed due to another installation in progress.
+.
+
+MessageId = 0x0065
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALL_JOB_NOT_SUSPENDED
+Language = English
+Resume of install job not allowed because job is not suspended.
+.
+
+MessageId = 0x0066
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALL_USERCONTEXT_ACCESSDENIED
+Language = English
+User context passed to installation from caller with insufficient privileges.
+.
+
+MessageId = 0x0067
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_STANDBY_ACTIVITY_NOT_ALLOWED
+Language = English
+Operation is not allowed because the device is in DC (Direct Current) and DS (Disconnected Standby).
+.
+
+MessageId = 0x0068
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_COULD_NOT_EVALUATE_PROPERTY
+Language = English
+The property could not be evaluated.
+.
+
+MessageId = 0x0FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNEXPECTED
+Language = English
+An operation failed due to reasons not covered by another error code.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// Windows Installer minor errors
+;//
+;// The following errors are used to indicate that part of a search failed for
+;// MSI problems. Another part of the search may successfully return updates.
+;// All MSI minor codes should share the same error code range so that the caller
+;// tell that they are related to Windows Installer.
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x1001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSI_WRONG_VERSION
+Language = English
+Search may have missed some updates because the Windows Installer is less than version 3.1.
+.
+
+MessageId = 0x1002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSI_NOT_CONFIGURED
+Language = English
+Search may have missed some updates because the Windows Installer is not configured.
+.
+
+MessageId = 0x1003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSP_DISABLED
+Language = English
+Search may have missed some updates because policy has disabled Windows Installer patching.
+.
+
+MessageId = 0x1004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSI_WRONG_APP_CONTEXT
+Language = English
+An update could not be applied because the application is installed per-user.
+.
+
+MessageId = 0x1005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSI_NOT_PRESENT
+Language = English
+Search may have missed some updates because the Windows Installer is less than version 3.1.
+.
+
+MessageId = 0x1FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_MSP_UNEXPECTED
+Language = English
+Search may have missed some updates because there was a failure of the Windows Installer.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// Protocol Talker errors
+;//
+;// The following map to SOAPCLIENT_ERRORs from atlsoap.h. These errors
+;// are obtained from calling GetClientError() on the CClientWebService
+;// object.
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x4000
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_BASE
+Language = English
+WU_E_PT_SOAPCLIENT_* error codes map to the SOAPCLIENT_ERROR enum of the ATL Server Library.
+.
+
+MessageId = 0x4001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_INITIALIZE
+Language = English
+SOAPCLIENT_INITIALIZE_ERROR - initialization of the SOAP client failed, possibly because of an MSXML installation failure.
+.
+
+MessageId = 0x4002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_OUTOFMEMORY
+Language = English
+SOAPCLIENT_OUTOFMEMORY - SOAP client failed because it ran out of memory.
+.
+
+MessageId = 0x4003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_GENERATE
+Language = English
+SOAPCLIENT_GENERATE_ERROR - SOAP client failed to generate the request.
+.
+
+MessageId = 0x4004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_CONNECT
+Language = English
+SOAPCLIENT_CONNECT_ERROR - SOAP client failed to connect to the server.
+.
+
+MessageId = 0x4005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_SEND
+Language = English
+SOAPCLIENT_SEND_ERROR - SOAP client failed to send a message for reasons of WU_E_WINHTTP_* error codes.
+.
+
+MessageId = 0x4006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_SERVER
+Language = English
+SOAPCLIENT_SERVER_ERROR - SOAP client failed because there was a server error.
+.
+
+MessageId = 0x4007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_SOAPFAULT
+Language = English
+SOAPCLIENT_SOAPFAULT - SOAP client failed because there was a SOAP fault for reasons of WU_E_PT_SOAP_* error codes.
+.
+
+MessageId = 0x4008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_PARSEFAULT
+Language = English
+SOAPCLIENT_PARSEFAULT_ERROR - SOAP client failed to parse a SOAP fault.
+.
+
+MessageId = 0x4009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_READ
+Language = English
+SOAPCLIENT_READ_ERROR - SOAP client failed while reading the response from the server.
+.
+
+MessageId = 0x400A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAPCLIENT_PARSE
+Language = English
+SOAPCLIENT_PARSE_ERROR - SOAP client failed to parse the response from the server.
+.
+
+;// The following map to SOAP_ERROR_CODEs from atlsoap.h. These errors
+;// are obtained from the m_fault.m_soapErrCode member on the
+;// CClientWebService object when GetClientError() returned
+;// SOAPCLIENT_SOAPFAULT.
+MessageId = 0x400B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAP_VERSION
+Language = English
+SOAP_E_VERSION_MISMATCH - SOAP client found an unrecognizable namespace for the SOAP envelope.
+.
+
+MessageId = 0x400C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAP_MUST_UNDERSTAND
+Language = English
+SOAP_E_MUST_UNDERSTAND - SOAP client was unable to understand a header.
+.
+
+MessageId = 0x400D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAP_CLIENT
+Language = English
+SOAP_E_CLIENT - SOAP client found the message was malformed; fix before resending.
+.
+
+MessageId = 0x400E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SOAP_SERVER
+Language = English
+SOAP_E_SERVER - The SOAP message could not be processed due to a server error; resend later.
+.
+
+MessageId = 0x400F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_WMI_ERROR
+Language = English
+There was an unspecified Windows Management Instrumentation (WMI) error.
+.
+
+MessageId = 0x4010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_EXCEEDED_MAX_SERVER_TRIPS
+Language = English
+The number of round trips to the server exceeded the maximum limit.
+.
+
+MessageId = 0x4011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SUS_SERVER_NOT_SET
+Language = English
+WUServer policy value is missing in the registry.
+.
+
+MessageId = 0x4012
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_DOUBLE_INITIALIZATION
+Language = English
+Initialization failed because the object was already initialized.
+.
+
+MessageId = 0x4013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_INVALID_COMPUTER_NAME
+Language = English
+The computer name could not be determined.
+.
+
+MessageId = 0x4015
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_REFRESH_CACHE_REQUIRED
+Language = English
+The reply from the server indicates that the server was changed or the cookie was invalid; refresh the state of the internal cache and retry.
+.
+
+MessageId = 0x4016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_BAD_REQUEST
+Language = English
+HTTP status 400 - the server could not process the request due to invalid syntax.
+.
+
+MessageId = 0x4017
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_DENIED
+Language = English
+HTTP status 401 - the requested resource requires user authentication.
+.
+
+MessageId = 0x4018
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_FORBIDDEN
+Language = English
+HTTP status 403 - server understood the request, but declined to fulfill it.
+.
+
+MessageId = 0x4019
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_NOT_FOUND
+Language = English
+HTTP status 404 - the server cannot find the requested URI (Uniform Resource Identifier).
+.
+
+MessageId = 0x401A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_BAD_METHOD
+Language = English
+HTTP status 405 - the HTTP method is not allowed.
+.
+
+MessageId = 0x401B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_PROXY_AUTH_REQ
+Language = English
+HTTP status 407 - proxy authentication is required.
+.
+
+MessageId = 0x401C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_REQUEST_TIMEOUT
+Language = English
+HTTP status 408 - the server timed out waiting for the request.
+.
+
+MessageId = 0x401D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_CONFLICT
+Language = English
+HTTP status 409 - the request was not completed due to a conflict with the current state of the resource.
+.
+
+MessageId = 0x401E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_GONE
+Language = English
+HTTP status 410 - requested resource is no longer available at the server.
+.
+
+MessageId = 0x401F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_SERVER_ERROR
+Language = English
+HTTP status 500 - an error internal to the server prevented fulfilling the request.
+.
+
+MessageId = 0x4020
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_NOT_SUPPORTED
+Language = English
+HTTP status 501 - server does not support the functionality required to fulfill the request.
+.
+
+MessageId = 0x4021
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_BAD_GATEWAY
+Language = English
+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 request.
+.
+
+MessageId = 0x4022
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_SERVICE_UNAVAIL
+Language = English
+HTTP status 503 - the service is temporarily overloaded.
+.
+
+MessageId = 0x4023
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_GATEWAY_TIMEOUT
+Language = English
+HTTP status 504 - the request was timed out waiting for a gateway.
+.
+
+MessageId = 0x4024
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_VERSION_NOT_SUP
+Language = English
+HTTP status 505 - the server does not support the HTTP protocol version used for the request.
+.
+
+MessageId = 0x4025
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_FILE_LOCATIONS_CHANGED
+Language = English
+Operation failed due to a changed file location; refresh internal state and resend.
+.
+
+MessageId = 0x4026
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_REGISTRATION_NOT_SUPPORTED
+Language = English
+Operation failed because Windows Update Agent does not support registration with a non-WSUS server.
+.
+
+MessageId = 0x4027
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NO_AUTH_PLUGINS_REQUESTED
+Language = English
+The server returned an empty authentication information list.
+.
+
+MessageId = 0x4028
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NO_AUTH_COOKIES_CREATED
+Language = English
+Windows Update Agent was unable to create any valid authentication cookies.
+.
+
+MessageId = 0x4029
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_INVALID_CONFIG_PROP
+Language = English
+A configuration property value was wrong.
+.
+
+MessageId = 0x402A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_CONFIG_PROP_MISSING
+Language = English
+A configuration property value was missing.
+.
+
+MessageId = 0x402B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_HTTP_STATUS_NOT_MAPPED
+Language = English
+The HTTP request could not be completed and the reason did not correspond to any of the WU_E_PT_HTTP_* error codes.
+.
+
+MessageId = 0x402C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_WINHTTP_NAME_NOT_RESOLVED
+Language = English
+ERROR_WINHTTP_NAME_NOT_RESOLVED - the proxy server or target server name cannot be resolved.
+.
+
+MessageId = 0x402D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_LOAD_SHEDDING
+Language = English
+The server is shedding load.
+.
+
+MessageId = 0x402E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_CLIENT_ENFORCED_LOAD_SHEDDING
+Language = English
+Windows Update Agent is enforcing honoring the service load shedding interval.
+.
+
+MessageId = 0x502D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SAME_REDIR_ID
+Language = English
+Windows Update Agent failed to download a redirector cabinet file with a new redirectorId value from the server during the recovery.
+.
+
+MessageId = 0x502E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NO_MANAGED_RECOVER
+Language = English
+A redirector recovery action did not complete because the server is managed.
+.
+
+MessageId = 0x402F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_SUCCEEDED_WITH_ERRORS
+Language = English
+External cab file processing completed with some errors.
+.
+
+MessageId = 0x4030
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_INIT_FAILED
+Language = English
+The external cab processor initialization did not complete.
+.
+
+MessageId = 0x4031
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_INVALID_FILE_FORMAT
+Language = English
+The format of a metadata file was invalid.
+.
+
+MessageId = 0x4032
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_INVALID_METADATA
+Language = English
+External cab processor found invalid metadata.
+.
+
+MessageId = 0x4033
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_FAILURE_TO_EXTRACT_DIGEST
+Language = English
+The file digest could not be extracted from an external cab file.
+.
+
+MessageId = 0x4034
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_FAILURE_TO_DECOMPRESS_CAB_FILE
+Language = English
+An external cab file could not be decompressed.
+.
+
+MessageId = 0x4035
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ECP_FILE_LOCATION_ERROR
+Language = English
+External cab processor was unable to get file locations.
+.
+
+MessageId = 0x0436
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_CATALOG_SYNC_REQUIRED
+Language = English
+The server does not support category-specific search; Full catalog search has to be issued instead.
+.
+
+MessageId = 0x0437
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SECURITY_VERIFICATION_FAILURE
+Language = English
+There was a problem authorizing with the service.
+.
+
+MessageId = 0x0438
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ENDPOINT_UNREACHABLE
+Language = English
+There is no route or network connectivity to the endpoint.
+.
+
+MessageId = 0x0439
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_INVALID_FORMAT
+Language = English
+The data received does not meet the data contract expectations.
+.
+
+MessageId = 0x043A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_INVALID_URL
+Language = English
+The url is invalid.
+.
+
+MessageId = 0x043B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NWS_NOT_LOADED
+Language = English
+Unable to load NWS runtime.
+.
+
+MessageId = 0x043C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_PROXY_AUTH_SCHEME_NOT_SUPPORTED
+Language = English
+The proxy auth scheme is not supported.
+.
+
+MessageId = 0x043D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SERVICEPROP_NOTAVAIL
+Language = English
+The requested service property is not available.
+.
+
+MessageId = 0x043E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ENDPOINT_REFRESH_REQUIRED
+Language = English
+The endpoint provider plugin requires online refresh.
+.
+
+MessageId = 0x043F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ENDPOINTURL_NOTAVAIL
+Language = English
+A URL for the requested service endpoint is not available.
+.
+
+MessageId = 0x0440
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ENDPOINT_DISCONNECTED
+Language = English
+The connection to the service endpoint died.
+.
+
+MessageId = 0x0441
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_INVALID_OPERATION
+Language = English
+The operation is invalid because protocol talker is in an inappropriate state.
+.
+
+;// Same as WS_E_OBJECT_FAULTED
+MessageId = 0x0442
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_OBJECT_FAULTED
+Language = English
+The object is in a faulted state due to a previous error.
+.
+
+;// Same as WS_E_NUMERIC_OVERFLOW
+MessageId = 0x0443
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NUMERIC_OVERFLOW
+Language = English
+The operation would lead to numeric overflow.
+.
+
+;// Same as WS_E_OPERATION_ABORTED
+MessageId = 0x0444
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_OPERATION_ABORTED
+Language = English
+The operation was aborted.
+.
+
+;// Same as WS_E_OPERATION_ABANDONED
+MessageId = 0x0445
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_OPERATION_ABANDONED
+Language = English
+The operation was abandoned.
+.
+
+;// Same as WS_E_QUOTA_EXCEEDED
+MessageId = 0x0446
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_QUOTA_EXCEEDED
+Language = English
+A quota was exceeded.
+.
+
+;// Same as WS_E_NO_TRANSLATION_AVAILABLE
+MessageId = 0x0447
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_NO_TRANSLATION_AVAILABLE
+Language = English
+The information was not available in the specified language.
+.
+
+;// Same as WS_E_ADDRESS_IN_USE
+MessageId = 0x0448
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ADDRESS_IN_USE
+Language = English
+The address is already being used.
+.
+
+;// Same as WS_E_ADDRESS_NOT_AVAILABLE
+MessageId = 0x0449
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_ADDRESS_NOT_AVAILABLE
+Language = English
+The address is not valid for this context.
+.
+
+;// Same as WS_E_OTHER
+MessageId = 0x044A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_OTHER
+Language = English
+Unrecognized error occurred in the Windows Web Services framework.
+.
+
+;// Same as WS_E_SECURITY_SYSTEM_FAILURE
+MessageId = 0x044B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_SECURITY_SYSTEM_FAILURE
+Language = English
+A security operation failed in the Windows Web Services framework.
+.
+
+MessageId = 0x4100
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_DATA_BOUNDARY_RESTRICTED
+Language = English
+The client is data boundary restricted and needs to talk to a restricted endpoint.
+.
+
+MessageId = 0x4101
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_GENERAL_AAD_CLIENT_ERROR
+Language = English
+The client hit an error in retrieving AAD device ticket.
+.
+
+MessageId = 0x4FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_PT_UNEXPECTED
+Language = English
+A communication error not covered by another WU_E_PT_* error code.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// Redirector errors
+;//
+;// The following errors are generated by the components that download and
+;// parse the wuredir.cab
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x5001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_LOAD_XML
+Language = English
+The redirector XML document could not be loaded into the DOM class.
+.
+
+MessageId = 0x5002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_S_FALSE
+Language = English
+The redirector XML document is missing some required information.
+.
+
+MessageId = 0x5003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_ID_SMALLER
+Language = English
+The redirectorId in the downloaded redirector cab is less than in the cached cab.
+.
+
+MessageId = 0x5004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_UNKNOWN_SERVICE
+Language = English
+The service ID is not supported in the service environment.
+.
+
+MessageId = 0x5005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_UNSUPPORTED_CONTENTTYPE
+Language = English
+The response from the redirector server had an unsupported content type.
+.
+
+MessageId = 0x5006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_INVALID_RESPONSE
+Language = English
+The response from the redirector server had an error status or was invalid.
+.
+
+MessageId = 0x5008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_ATTRPROVIDER_EXCEEDED_MAX_NAMEVALUE
+Language = English
+The maximum number of name value pairs was exceeded by the attribute provider.
+.
+
+MessageId = 0x5009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_ATTRPROVIDER_INVALID_NAME
+Language = English
+The name received from the attribute provider was invalid.
+.
+
+MessageId = 0x500A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_ATTRPROVIDER_INVALID_VALUE
+Language = English
+The value received from the attribute provider was invalid.
+.
+
+MessageId = 0x500B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_SLS_GENERIC_ERROR
+Language = English
+There was an error in connecting to or parsing the response from the Service Locator Service redirector server.
+.
+
+MessageId = 0x500C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_CONNECT_POLICY
+Language = English
+Connections to the redirector server are disallowed by managed policy.
+.
+
+MessageId = 0x500D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_ONLINE_DISALLOWED
+Language = English
+The redirector would go online but is disallowed by caller configuration.
+.
+
+MessageId = 0x50FF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REDIRECTOR_UNEXPECTED
+Language = English
+The redirector failed for reasons not covered by another WU_E_REDIRECTOR_* error code.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// SIH errors
+;//
+;// The following errors are generated by the components that are involved with
+;// service-initiated healing.
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x5101
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_VERIFY_DOWNLOAD_ENGINE
+Language = English
+Verification of the servicing engine package failed.
+.
+
+MessageId = 0x5102
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_VERIFY_DOWNLOAD_PAYLOAD
+Language = English
+Verification of a servicing package failed.
+.
+
+MessageId = 0x5103
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_VERIFY_STAGE_ENGINE
+Language = English
+Verification of the staged engine failed.
+.
+
+MessageId = 0x5104
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_VERIFY_STAGE_PAYLOAD
+Language = English
+Verification of a staged payload failed.
+.
+
+MessageId = 0x5105
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_ACTION_NOT_FOUND
+Language = English
+An internal error occurred where the servicing action was not found.
+.
+
+MessageId = 0x5106
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_SLS_PARSE
+Language = English
+There was a parse error in the service environment response.
+.
+
+MessageId = 0x5107
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_INVALIDHASH
+Language = English
+A downloaded file failed an integrity check.
+.
+
+MessageId = 0x5108
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_NO_ENGINE
+Language = English
+No engine was provided by the server-initiated healing server response.
+.
+
+MessageId = 0x5109
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_POST_REBOOT_INSTALL_FAILED
+Language = English
+Post-reboot install failed.
+.
+
+MessageId = 0x510A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_POST_REBOOT_NO_CACHED_SLS_RESPONSE
+Language = English
+There were pending reboot actions, but cached SLS response was not found post-reboot.
+.
+
+MessageId = 0x510B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_PARSE
+Language = English
+Parsing command line arguments failed.
+.
+
+MessageId = 0x510C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_SECURITY
+Language = English
+Security check failed.
+.
+
+MessageId = 0x510D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_PPL
+Language = English
+PPL check failed.
+.
+
+MessageId = 0x510E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_POLICY
+Language = English
+Execution was disabled by policy.
+.
+
+MessageId = 0x510F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_STDEXCEPTION
+Language = English
+A standard exception was caught.
+.
+
+MessageId = 0x5110
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_NONSTDEXCEPTION
+Language = English
+A non-standard exception was caught.
+.
+
+MessageId = 0x5111
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_ENGINE_EXCEPTION
+Language = English
+The server-initiated healing engine encountered an exception not covered by another WU_E_SIH_* error code.
+.
+
+MessageId = 0x5112
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_BLOCKED_FOR_PLATFORM
+Language = English
+You are running SIH Client with cmd not supported on your platform.
+.
+
+MessageId = 0x5113
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_ANOTHER_INSTANCE_RUNNING
+Language = English
+Another SIH Client is already running.
+.
+
+MessageId = 0x5114
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_DNSRESILIENCY_OFF
+Language = English
+Disable DNS resiliency feature per service configuration.
+.
+
+MessageId = 0x51FF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SIH_UNEXPECTED
+Language = English
+There was a failure for reasons not covered by another WU_E_SIH_* error code.
+.
+
+;///////////////////////////////////////////////////////////////////////////////
+;// driver util errors
+;//
+;// The device PnP enumerated device was pruned from the SystemSpec because
+;// one of the hardware or compatible IDs matched an installed printer driver.
+;// This is not considered a fatal error and the device is simply skipped.
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0xC001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_PRUNED
+Language = English
+A driver was skipped.
+.
+
+MessageId = 0xC002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_NOPROP_OR_LEGACY
+Language = English
+A property for the driver could not be found. It may not conform with required specifications.
+.
+
+MessageId = 0xC003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_REG_MISMATCH
+Language = English
+The registry type read for the driver does not match the expected type.
+.
+
+MessageId = 0xC004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_NO_METADATA
+Language = English
+The driver update is missing metadata.
+.
+
+MessageId = 0xC005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_MISSING_ATTRIBUTE
+Language = English
+The driver update is missing a required attribute.
+.
+
+MessageId = 0xC006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_SYNC_FAILED
+Language = English
+Driver synchronization failed.
+.
+
+MessageId = 0xC007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_NO_PRINTER_CONTENT
+Language = English
+Information required for the synchronization of applicable printers is missing.
+.
+
+MessageId = 0xC008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_DEVICE_PROBLEM
+Language = English
+After installing a driver update, the updated device has reported a problem.
+.
+
+;// MessageId 0xCE00 through 0xCEFF are reserved for post-install driver problem codes
+;// (see uhdriver.cpp)
+MessageId = 0xCFFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DRV_UNEXPECTED
+Language = English
+A driver error not covered by another WU_E_DRV_* code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// data store errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x8000
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_SHUTDOWN
+Language = English
+An operation failed because Windows Update Agent is shutting down.
+.
+
+MessageId = 0x8001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_INUSE
+Language = English
+An operation failed because the data store was in use.
+.
+
+MessageId = 0x8002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_INVALID
+Language = English
+The current and expected states of the data store do not match.
+.
+
+MessageId = 0x8003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_TABLEMISSING
+Language = English
+The data store is missing a table.
+.
+
+MessageId = 0x8004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_TABLEINCORRECT
+Language = English
+The data store contains a table with unexpected columns.
+.
+
+MessageId = 0x8005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_INVALIDTABLENAME
+Language = English
+A table could not be opened because the table is not in the data store.
+.
+
+MessageId = 0x8006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_BADVERSION
+Language = English
+The current and expected versions of the data store do not match.
+.
+
+MessageId = 0x8007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA
+Language = English
+The information requested is not in the data store.
+.
+
+MessageId = 0x8008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_MISSINGDATA
+Language = English
+The data store is missing required information or has a NULL in a table column that requires a non-null value.
+.
+
+MessageId = 0x8009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_MISSINGREF
+Language = English
+The data store is missing required information or has a reference to missing license terms, file, localized property or linked row.
+.
+
+MessageId = 0x800A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_UNKNOWNHANDLER
+Language = English
+The update was not processed because its update handler could not be recognized.
+.
+
+MessageId = 0x800B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_CANTDELETE
+Language = English
+The update was not deleted because it is still referenced by one or more services.
+.
+
+MessageId = 0x800C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_LOCKTIMEOUTEXPIRED
+Language = English
+The data store section could not be locked within the allotted time.
+.
+
+MessageId = 0x800D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NOCATEGORIES
+Language = English
+The category was not added because it contains no parent categories and is not a top-level category itself.
+.
+
+MessageId = 0x800E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_ROWEXISTS
+Language = English
+The row was not added because an existing row has the same primary key.
+.
+
+MessageId = 0x800F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_STOREFILELOCKED
+Language = English
+The data store could not be initialized because it was locked by another process.
+.
+
+MessageId = 0x8010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_CANNOTREGISTER
+Language = English
+The data store is not allowed to be registered with COM in the current process.
+.
+
+MessageId = 0x8011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_UNABLETOSTART
+Language = English
+Could not create a data store object in another process.
+.
+
+MessageId = 0x8013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_DUPLICATEUPDATEID
+Language = English
+The server sent the same update to the client with two different revision IDs.
+.
+
+MessageId = 0x8014
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_UNKNOWNSERVICE
+Language = English
+An operation did not complete because the service is not in the data store.
+.
+
+MessageId = 0x8015
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_SERVICEEXPIRED
+Language = English
+An operation did not complete because the registration of the service has expired.
+.
+
+MessageId = 0x8016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_DECLINENOTALLOWED
+Language = English
+A request to hide an update was declined because it is a mandatory update or because it was deployed with a deadline.
+.
+
+MessageId = 0x8017
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_TABLESESSIONMISMATCH
+Language = English
+A table was not closed because it is not associated with the session.
+.
+
+MessageId = 0x8018
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_SESSIONLOCKMISMATCH
+Language = English
+A table was not closed because it is not associated with the session.
+.
+
+MessageId = 0x8019
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NEEDWINDOWSSERVICE
+Language = English
+A 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 service.
+.
+
+MessageId = 0x801A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_INVALIDOPERATION
+Language = English
+A request was declined because the operation is not allowed.
+.
+
+MessageId = 0x801B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_SCHEMAMISMATCH
+Language = English
+The schema of the current data store and the schema of a table in a backup XML document do not match.
+.
+
+MessageId = 0x801C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_RESETREQUIRED
+Language = English
+The data store requires a session reset; release the session and retry with a new session.
+.
+
+MessageId = 0x801D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_IMPERSONATED
+Language = English
+A data store operation did not complete because it was requested with an impersonated identity.
+.
+
+MessageId = 0x801E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_DATANOTAVAILABLE
+Language = English
+An operation against update metadata did not complete because the data was never received from server.
+.
+
+MessageId = 0x801F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_DATANOTLOADED
+Language = English
+An operation against update metadata did not complete because the data was available but not loaded from datastore.
+.
+
+MessageId = 0x8020
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_NOSUCHREVISION
+Language = English
+A data store operation did not complete because no such update revision is known.
+.
+
+MessageId = 0x8021
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_NOSUCHUPDATE
+Language = English
+A data store operation did not complete because no such update is known.
+.
+
+MessageId = 0x8022
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_EULA
+Language = English
+A data store operation did not complete because an update's EULA information is missing.
+.
+
+MessageId = 0x8023
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_SERVICE
+Language = English
+A data store operation did not complete because a service's information is missing.
+.
+
+MessageId = 0x8024
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_COOKIE
+Language = English
+A data store operation did not complete because a service's synchronization information is missing.
+.
+
+MessageId = 0x8025
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_TIMER
+Language = English
+A data store operation did not complete because a timer's information is missing.
+.
+
+MessageId = 0x8026
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_CCR
+Language = English
+A data store operation did not complete because a download's information is missing.
+.
+
+MessageId = 0x8027
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_FILE
+Language = English
+A data store operation did not complete because a file's information is missing.
+.
+
+MessageId = 0x8028
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_DOWNLOADJOB
+Language = English
+A data store operation did not complete because a download job's information is missing.
+.
+
+MessageId = 0x8029
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_NODATA_TMI
+Language = English
+A data store operation did not complete because a service's timestamp information is missing.
+.
+
+MessageId = 0x8FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DS_UNEXPECTED
+Language = English
+A data store error not covered by another WU_E_DS_* code.
+.
+
+;/////////////////////////////////////////////////////////////////////////////
+;//Inventory Errors
+;/////////////////////////////////////////////////////////////////////////////
+MessageId = 0x9001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVENTORY_PARSEFAILED
+Language = English
+Parsing of the rule file failed.
+.
+
+MessageId = 0x9002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVENTORY_GET_INVENTORY_TYPE_FAILED
+Language = English
+Failed to get the requested inventory type from the server.
+.
+
+MessageId = 0x9003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVENTORY_RESULT_UPLOAD_FAILED
+Language = English
+Failed to upload inventory result to the server.
+.
+
+MessageId = 0x9004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVENTORY_UNEXPECTED
+Language = English
+There was an inventory error not covered by another error code.
+.
+
+MessageId = 0x9005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVENTORY_WMI_ERROR
+Language = English
+A WMI error occurred when enumerating the instances for a particular class.
+.
+
+;/////////////////////////////////////////////////////////////////////////////
+;//AU Errors
+;/////////////////////////////////////////////////////////////////////////////
+MessageId = 0xA000
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_NOSERVICE
+Language = English
+Automatic Updates was unable to service incoming requests.
+.
+
+MessageId = 0xA002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_NONLEGACYSERVER
+Language = English
+The old version of the Automatic Updates client has stopped because the WSUS server has been upgraded.
+.
+
+MessageId = 0xA003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_LEGACYCLIENTDISABLED
+Language = English
+The old version of the Automatic Updates client was disabled.
+.
+
+MessageId = 0xA004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_PAUSED
+Language = English
+Automatic Updates was unable to process incoming requests because it was paused.
+.
+
+MessageId = 0xA005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_NO_REGISTERED_SERVICE
+Language = English
+No unmanaged service is registered with AU.
+.
+
+MessageId = 0xA006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_DETECT_SVCID_MISMATCH
+Language = English
+The default service registered with AU changed during the search.
+.
+
+MessageId = 0xA007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REBOOT_IN_PROGRESS
+Language = English
+A reboot is in progress.
+.
+
+MessageId = 0xA008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_OOBE_IN_PROGRESS
+Language = English
+Automatic Updates can't process incoming requests while Windows Welcome is running.
+.
+
+MessageId = 0xAFFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AU_UNEXPECTED
+Language = English
+An Automatic Updates error not covered by another WU_E_AU * code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// update handler errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x2000
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_REMOTEUNAVAILABLE
+Language = English
+A request for a remote update handler could not be completed because no remote process is available.
+.
+
+MessageId = 0x2001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_LOCALONLY
+Language = English
+A request for a remote update handler could not be completed because the handler is local only.
+.
+
+MessageId = 0x2002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_UNKNOWNHANDLER
+Language = English
+A request for an update handler could not be completed because the handler could not be recognized.
+.
+
+MessageId = 0x2003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_REMOTEALREADYACTIVE
+Language = English
+A remote update handler could not be created because one already exists.
+.
+
+MessageId = 0x2004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_DOESNOTSUPPORTACTION
+Language = English
+A request for the handler to install (uninstall) an update could not be completed because the update does not support install (uninstall).
+.
+
+MessageId = 0x2005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_WRONGHANDLER
+Language = English
+An operation did not complete because the wrong handler was specified.
+.
+
+MessageId = 0x2006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_INVALIDMETADATA
+Language = English
+A handler operation could not be completed because the update contains invalid metadata.
+.
+
+MessageId = 0x2007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_INSTALLERHUNG
+Language = English
+An operation could not be completed because the installer exceeded the time limit.
+.
+
+MessageId = 0x2008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_OPERATIONCANCELLED
+Language = English
+An operation being done by the update handler was cancelled.
+.
+
+MessageId = 0x2009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_BADHANDLERXML
+Language = English
+An operation could not be completed because the handler-specific metadata is invalid.
+.
+
+MessageId = 0x200A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_CANREQUIREINPUT
+Language = English
+A request to the handler to install an update could not be completed because the update requires user input.
+.
+
+MessageId = 0x200B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_INSTALLERFAILURE
+Language = English
+The installer failed to install (uninstall) one or more updates.
+.
+
+MessageId = 0x200C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_FALLBACKTOSELFCONTAINED
+Language = English
+The update handler should download self-contained content rather than delta-compressed content for the update.
+.
+
+MessageId = 0x200D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_NEEDANOTHERDOWNLOAD
+Language = English
+The update handler did not install the update because it needs to be downloaded again.
+.
+
+MessageId = 0x200E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_NOTIFYFAILURE
+Language = English
+The update handler failed to send notification of the status of the install (uninstall) operation.
+.
+
+MessageId = 0x200F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_INCONSISTENT_FILE_NAMES
+Language = English
+The file names contained in the update metadata and in the update package are inconsistent.
+.
+
+MessageId = 0x2010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_FALLBACKERROR
+Language = English
+The update handler failed to fall back to the self-contained content.
+.
+
+MessageId = 0x2011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_TOOMANYDOWNLOADREQUESTS
+Language = English
+The update handler has exceeded the maximum number of download requests.
+.
+
+MessageId = 0x2012
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_UNEXPECTEDCBSRESPONSE
+Language = English
+The update handler has received an unexpected response from CBS.
+.
+
+MessageId = 0x2013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_BADCBSPACKAGEID
+Language = English
+The update metadata contains an invalid CBS package identifier.
+.
+
+MessageId = 0x2014
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_POSTREBOOTSTILLPENDING
+Language = English
+The post-reboot operation for the update is still in progress.
+.
+
+MessageId = 0x2015
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_POSTREBOOTRESULTUNKNOWN
+Language = English
+The result of the post-reboot operation for the update could not be determined.
+.
+
+MessageId = 0x2016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_POSTREBOOTUNEXPECTEDSTATE
+Language = English
+The state of the update after its post-reboot operation has completed is unexpected.
+.
+
+MessageId = 0x2017
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_NEW_SERVICING_STACK_REQUIRED
+Language = English
+The OS servicing stack must be updated before this update is downloaded or installed.
+.
+
+MessageId = 0x2018
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_CALLED_BACK_FAILURE
+Language = English
+A callback installer called back with an error.
+.
+
+MessageId = 0x2019
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_CUSTOMINSTALLER_INVALID_SIGNATURE
+Language = English
+The custom installer signature did not match the signature required by the update.
+.
+
+MessageId = 0x201A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_UNSUPPORTED_INSTALLCONTEXT
+Language = English
+The installer does not support the installation configuration.
+.
+
+MessageId = 0x201B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_INVALID_TARGETSESSION
+Language = English
+The targeted session for install is invalid.
+.
+
+MessageId = 0x201C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_DECRYPTFAILURE
+Language = English
+The handler failed to decrypt the update files.
+.
+
+MessageId = 0x201D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_HANDLER_DISABLEDUNTILREBOOT
+Language = English
+The update handler is disabled until the system reboots.
+.
+
+MessageId = 0x201E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_NOT_PRESENT
+Language = English
+The AppX infrastructure is not present on the system.
+.
+
+MessageId = 0x201F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_NOTREADYTOCOMMIT
+Language = English
+The update cannot be committed because it has not been previously installed or staged.
+.
+
+MessageId = 0x2020
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_INVALID_PACKAGE_VOLUME
+Language = English
+The specified volume is not a valid AppX package volume.
+.
+
+MessageId = 0x2021
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_DEFAULT_PACKAGE_VOLUME_UNAVAILABLE
+Language = English
+The configured default storage volume is unavailable.
+.
+
+MessageId = 0x2022
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_INSTALLED_PACKAGE_VOLUME_UNAVAILABLE
+Language = English
+The volume on which the application is installed is unavailable.
+.
+
+MessageId = 0x2023
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_PACKAGE_FAMILY_NOT_FOUND
+Language = English
+The specified package family is not present on the system.
+.
+
+MessageId = 0x2024
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_APPX_SYSTEM_VOLUME_NOT_FOUND
+Language = English
+Unable to find a package volume marked as system.
+.
+
+MessageId = 0x2025
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_UA_SESSION_INFO_VERSION_NOT_SUPPORTED
+Language = English
+UA does not support the version of OptionalSessionInfo.
+.
+
+MessageId = 0x2026
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_RESERVICING_REQUIRED_BASELINE
+Language = English
+This operation cannot be completed. You must install the baseline update(s) before you can install this update.
+.
+
+MessageId = 0x2FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UH_UNEXPECTED
+Language = English
+An update handler error not covered by another WU_E_UH_* code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// download manager errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x6001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_URLNOTAVAILABLE
+Language = English
+A download manager operation could not be completed because the requested file does not have a URL.
+.
+
+MessageId = 0x6002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_INCORRECTFILEHASH
+Language = English
+A download manager operation could not be completed because the file digest was not recognized.
+.
+
+MessageId = 0x6003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNKNOWNALGORITHM
+Language = English
+A download manager operation could not be completed because the file metadata requested an unrecognized hash algorithm.
+.
+
+MessageId = 0x6004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_NEEDDOWNLOADREQUEST
+Language = English
+An operation could not be completed because a download request is required from the download handler.
+.
+
+MessageId = 0x6005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_NONETWORK
+Language = English
+A download manager operation could not be completed because the network connection was unavailable.
+.
+
+MessageId = 0x6006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_WRONGBITSVERSION
+Language = English
+A download manager operation could not be completed because the version of Background Intelligent Transfer Service (BITS) is incompatible.
+.
+
+MessageId = 0x6007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_NOTDOWNLOADED
+Language = English
+The update has not been downloaded.
+.
+
+MessageId = 0x6008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_FAILTOCONNECTTOBITS
+Language = English
+A download manager operation failed because the download manager was unable to connect the Background Intelligent Transfer Service (BITS).
+.
+
+MessageId = 0x6009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_BITSTRANSFERERROR
+Language = English
+A download manager operation failed because there was an unspecified Background Intelligent Transfer Service (BITS) transfer error.
+.
+
+MessageId = 0x600A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADLOCATIONCHANGED
+Language = English
+A download must be restarted because the location of the source of the download has changed.
+.
+
+MessageId = 0x600B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_CONTENTCHANGED
+Language = English
+A download must be restarted because the update content changed in a new revision.
+.
+
+MessageId = 0x600C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADLIMITEDBYUPDATESIZE
+Language = English
+A download failed because the current network limits downloads by update size for the update service.
+.
+
+MessageId = 0x600E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNAUTHORIZED
+Language = English
+The download failed because the client was denied authorization to download the content.
+.
+
+MessageId = 0x600F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_BG_ERROR_TOKEN_REQUIRED
+Language = English
+The download failed because the user token associated with the BITS job no longer exists.
+.
+
+MessageId = 0x6010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADSANDBOXNOTFOUND
+Language = English
+The sandbox directory for the downloaded update was not found.
+.
+
+MessageId = 0x6011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADFILEPATHUNKNOWN
+Language = English
+The downloaded update has an unknown file path.
+.
+
+MessageId = 0x6012
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADFILEMISSING
+Language = English
+One or more of the files for the downloaded update is missing.
+.
+
+MessageId = 0x6013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UPDATEREMOVED
+Language = English
+An attempt was made to access a downloaded update that has already been removed.
+.
+
+MessageId = 0x6014
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_READRANGEFAILED
+Language = English
+Windows Update couldn't find a needed portion of a downloaded update's file.
+.
+
+MessageId = 0x6016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNAUTHORIZED_NO_USER
+Language = English
+The download failed because the client was denied authorization to download the content due to no user logged on.
+.
+
+MessageId = 0x6017
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNAUTHORIZED_LOCAL_USER
+Language = English
+The download failed because the local user was denied authorization to download the content.
+.
+
+MessageId = 0x6018
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNAUTHORIZED_DOMAIN_USER
+Language = English
+The download failed because the domain user was denied authorization to download the content.
+.
+
+MessageId = 0x6019
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNAUTHORIZED_MSA_USER
+Language = English
+The download failed because the MSA account associated with the user was denied authorization to download the content.
+.
+
+MessageId = 0x601A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_FALLINGBACKTOBITS
+Language = English
+The download will be continued by falling back to BITS to download the content.
+.
+
+MessageId = 0x601B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOAD_VOLUME_CONFLICT
+Language = English
+Another caller has requested download to a different volume.
+.
+
+MessageId = 0x601C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_SANDBOX_HASH_MISMATCH
+Language = English
+The hash of the update's sandbox does not match the expected value.
+.
+
+MessageId = 0x601D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_HARDRESERVEID_CONFLICT
+Language = English
+The hard reserve id specified conflicts with an id from another caller.
+.
+
+MessageId = 0x601E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOSVC_REQUIRED
+Language = English
+The update has to be downloaded via DO.
+.
+
+MessageId = 0x601F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_DOWNLOADTYPE_CONFLICT
+Language = English
+Windows Update only supports one download type per update at one time. The download failure is by design here since the same update with different download type is operating. Please try again later.
+.
+
+MessageId = 0x6FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_DM_UNEXPECTED
+Language = English
+There was a download manager error not covered by another WU_E_DM_* error code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// Setup/SelfUpdate errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0xD001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_INVALID_INFDATA
+Language = English
+Windows Update Agent could not be updated because an INF file contains invalid information.
+.
+
+MessageId = 0xD002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_INVALID_IDENTDATA
+Language = English
+Windows Update Agent could not be updated because the wuident.cab file contains invalid information.
+.
+
+MessageId = 0xD003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_ALREADY_INITIALIZED
+Language = English
+Windows Update Agent could not be updated because of an internal error that caused setup initialization to be performed twice.
+.
+
+MessageId = 0xD004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_NOT_INITIALIZED
+Language = English
+Windows Update Agent could not be updated because setup initialization never completed successfully.
+.
+
+MessageId = 0xD005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_SOURCE_VERSION_MISMATCH
+Language = English
+Windows Update Agent could not be updated because the versions specified in the INF do not match the actual source file versions.
+.
+
+MessageId = 0xD006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_TARGET_VERSION_GREATER
+Language = English
+Windows Update Agent could not be updated because a WUA file on the target system is newer than the corresponding source file.
+.
+
+MessageId = 0xD007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_REGISTRATION_FAILED
+Language = English
+Windows Update Agent could not be updated because regsvr32.exe returned an error.
+.
+
+MessageId = 0xD008
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SELFUPDATE_SKIP_ON_FAILURE
+Language = English
+An update to the Windows Update Agent was skipped because previous attempts to update have failed.
+.
+
+MessageId = 0xD009
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_SKIP_UPDATE
+Language = English
+An update to the Windows Update Agent was skipped due to a directive in the wuident.cab file.
+.
+
+MessageId = 0xD00A
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_UNSUPPORTED_CONFIGURATION
+Language = English
+Windows Update Agent could not be updated because the current system configuration is not supported.
+.
+
+MessageId = 0xD00B
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_BLOCKED_CONFIGURATION
+Language = English
+Windows Update Agent could not be updated because the system is configured to block the update.
+.
+
+MessageId = 0xD00C
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_REBOOT_TO_FIX
+Language = English
+Windows Update Agent could not be updated because a restart of the system is required.
+.
+
+MessageId = 0xD00D
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_ALREADYRUNNING
+Language = English
+Windows Update Agent setup is already running.
+.
+
+MessageId = 0xD00E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_REBOOTREQUIRED
+Language = English
+Windows Update Agent setup package requires a reboot to complete installation.
+.
+
+MessageId = 0xD00F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_HANDLER_EXEC_FAILURE
+Language = English
+Windows Update Agent could not be updated because the setup handler failed during execution.
+.
+
+MessageId = 0xD010
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_INVALID_REGISTRY_DATA
+Language = English
+Windows Update Agent could not be updated because the registry contains invalid information.
+.
+
+MessageId = 0xD011
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SELFUPDATE_REQUIRED
+Language = English
+Windows Update Agent must be updated before search can continue.
+.
+
+MessageId = 0xD012
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SELFUPDATE_REQUIRED_ADMIN
+Language = English
+Windows Update Agent must be updated before search can continue. An administrator is required to perform the operation.
+.
+
+MessageId = 0xD013
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_WRONG_SERVER_VERSION
+Language = English
+Windows Update Agent could not be updated because the server does not contain update information for this version.
+.
+
+MessageId = 0xD014
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_DEFERRABLE_REBOOT_PENDING
+Language = English
+Windows Update Agent is successfully updated, but a reboot is required to complete the setup.
+.
+
+MessageId = 0xD015
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_NON_DEFERRABLE_REBOOT_PENDING
+Language = English
+Windows Update Agent is successfully updated, but a reboot is required to complete the setup.
+.
+
+MessageId = 0xD016
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_FAIL
+Language = English
+Windows Update Agent could not be updated because of an unknown error.
+.
+
+MessageId = 0xDFFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SETUP_UNEXPECTED
+Language = English
+Windows Update Agent could not be updated because of an error not covered by another WU_E_SETUP_* error code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// expression evaluator errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0xE001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_UNKNOWN_EXPRESSION
+Language = English
+An expression evaluator operation could not be completed because an expression was unrecognized.
+.
+
+MessageId = 0xE002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_INVALID_EXPRESSION
+Language = English
+An expression evaluator operation could not be completed because an expression was invalid.
+.
+
+MessageId = 0xE003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_MISSING_METADATA
+Language = English
+An expression evaluator operation could not be completed because an expression contains an incorrect number of metadata nodes.
+.
+
+MessageId = 0xE004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_INVALID_VERSION
+Language = English
+An expression evaluator operation could not be completed because the version of the serialized expression data is invalid.
+.
+
+MessageId = 0xE005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_NOT_INITIALIZED
+Language = English
+The expression evaluator could not be initialized.
+.
+
+MessageId = 0xE006
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_INVALID_ATTRIBUTEDATA
+Language = English
+An expression evaluator operation could not be completed because there was an invalid attribute.
+.
+
+MessageId = 0xE007
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_CLUSTER_ERROR
+Language = English
+An expression evaluator operation could not be completed because the cluster state of the computer could not be determined.
+.
+
+MessageId = 0xEFFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_EE_UNEXPECTED
+Language = English
+There was an expression evaluator error not covered by another WU_E_EE_* error code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// UI errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0x3001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALLATION_RESULTS_UNKNOWN_VERSION
+Language = English
+The results of download and installation could not be read from the registry due to an unrecognized data format version.
+.
+
+MessageId = 0x3002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALLATION_RESULTS_INVALID_DATA
+Language = English
+The results of download and installation could not be read from the registry due to an invalid data format.
+.
+
+MessageId = 0x3003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INSTALLATION_RESULTS_NOT_FOUND
+Language = English
+The results of download and installation are not available; the operation may have failed to start.
+.
+
+MessageId = 0x3004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TRAYICON_FAILURE
+Language = English
+A failure occurred when trying to create an icon in the taskbar notification area.
+.
+
+MessageId = 0x3FFD
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_NON_UI_MODE
+Language = English
+Unable to show UI when in non-UI mode; WU client UI modules may not be installed.
+.
+
+MessageId = 0x3FFE
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUCLTUI_UNSUPPORTED_VERSION
+Language = English
+Unsupported version of WU client UI exported functions.
+.
+
+MessageId = 0x3FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_AUCLIENT_UNEXPECTED
+Language = English
+There was a user interface error not covered by another WU_E_AUCLIENT_* error code.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// reporter errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0xF001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REPORTER_EVENTCACHECORRUPT
+Language = English
+The event cache file was defective.
+.
+
+MessageId = 0xF002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REPORTER_EVENTNAMESPACEPARSEFAILED
+Language = English
+The XML in the event namespace descriptor could not be parsed.
+.
+
+MessageId = 0xF003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_EVENT
+Language = English
+The XML in the event namespace descriptor could not be parsed.
+.
+
+MessageId = 0xF004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SERVER_BUSY
+Language = English
+The server rejected an event because the server was too busy.
+.
+
+MessageId = 0xF005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_CALLBACK_COOKIE_NOT_FOUND
+Language = English
+The specified callback cookie is not found.
+.
+
+MessageId = 0xFFFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_REPORTER_UNEXPECTED
+Language = English
+There was a reporter error not covered by another error code.
+.
+
+MessageId = 0x7001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_OL_INVALID_SCANFILE
+Language = English
+An operation could not be completed because the scan package was invalid.
+.
+
+MessageId = 0x7002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_OL_NEWCLIENT_REQUIRED
+Language = English
+An operation could not be completed because the scan package requires a greater version of the Windows Update Agent.
+.
+
+MessageId = 0x7003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_EVENT_PAYLOAD
+Language = English
+An invalid event payload was specified.
+.
+
+MessageId = 0x7004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_INVALID_EVENT_PAYLOADSIZE
+Language = English
+The size of the event payload submitted is invalid.
+.
+
+MessageId = 0x7005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SERVICE_NOT_REGISTERED
+Language = English
+The service is not registered.
+.
+
+MessageId = 0x7FFF
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_OL_UNEXPECTED
+Language = English
+Search using the scan package failed.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// WU Metadata Integrity related errors - 0x71FE
+;///////////////////////////////////////////////////////////////////////////////
+;///////
+;// Metadata General errors 0x7100 - 0x711F
+;///////
+MessageId = 0x7100
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_NOOP
+Language = English
+No operation was required by update metadata verification.
+.
+
+MessageId = 0x7101
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_CONFIG_INVALID_BINARY_ENCODING
+Language = English
+The binary encoding of metadata config data was invalid.
+.
+
+MessageId = 0x7102
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_FETCH_CONFIG
+Language = English
+Unable to fetch required configuration for metadata signature verification.
+.
+
+MessageId = 0x7104
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_INVALID_PARAMETER
+Language = English
+A metadata verification operation failed due to an invalid parameter.
+.
+
+MessageId = 0x7105
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_UNEXPECTED
+Language = English
+A metadata verification operation failed due to reasons not covered by another error code.
+.
+
+MessageId = 0x7106
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_NO_VERIFICATION_DATA
+Language = English
+None of the update metadata had verification data, which may be disabled on the update server.
+.
+
+MessageId = 0x7107
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_BAD_FRAGMENTSIGNING_CONFIG
+Language = English
+The fragment signing configuration used for verifying update metadata signatures was bad.
+.
+
+MessageId = 0x7108
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_FAILURE_PROCESSING_FRAGMENTSIGNING_CONFIG
+Language = English
+There was an unexpected operational failure while parsing fragment signing configuration.
+.
+
+;///////
+;// Metadata XML errors 0x7120 - 0x713F
+;///////
+MessageId = 0x7120
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_MISSING
+Language = English
+Required xml data was missing from configuration.
+.
+
+MessageId = 0x7121
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_FRAGMENTSIGNING_MISSING
+Language = English
+Required fragmentsigning data was missing from xml configuration.
+.
+
+MessageId = 0x7122
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_MODE_MISSING
+Language = English
+Required mode data was missing from xml configuration.
+.
+
+MessageId = 0x7123
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_MODE_INVALID
+Language = English
+An invalid metadata enforcement mode was detected.
+.
+
+MessageId = 0x7124
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_VALIDITY_INVALID
+Language = English
+An invalid timestamp validity window configuration was detected.
+.
+
+MessageId = 0x7125
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_LEAFCERT_MISSING
+Language = English
+Required leaf certificate data was missing from xml configuration.
+.
+
+MessageId = 0x7126
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_INTERMEDIATECERT_MISSING
+Language = English
+Required intermediate certificate data was missing from xml configuration.
+.
+
+MessageId = 0x7127
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_LEAFCERT_ID_MISSING
+Language = English
+Required leaf certificate id attribute was missing from xml configuration.
+.
+
+MessageId = 0x7128
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_XML_BASE64CERDATA_MISSING
+Language = English
+Required certificate base64CerData attribute was missing from xml configuration.
+.
+
+;///////
+;// Metadata Signature/Hash-related errors 0x7140 - 0x714F
+;///////
+MessageId = 0x7140
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_BAD_SIGNATURE
+Language = English
+The metadata for an update was found to have a bad or invalid digital signature.
+.
+
+MessageId = 0x7141
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_UNSUPPORTED_HASH_ALG
+Language = English
+An unsupported hash algorithm for metadata verification was specified.
+.
+
+MessageId = 0x7142
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_SIGNATURE_VERIFY_FAILED
+Language = English
+An error occurred during an update's metadata signature verification.
+.
+
+;///////
+;// Metadata Certificate Chain trust related errors 0x7150 - 0x715F
+;///////
+MessageId = 0x7150
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATATRUST_CERTIFICATECHAIN_VERIFICATION
+Language = English
+An failure occurred while verifying trust for metadata signing certificate chains.
+.
+
+MessageId = 0x7151
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATATRUST_UNTRUSTED_CERTIFICATECHAIN
+Language = English
+A metadata signing certificate had an untrusted certificate chain.
+.
+
+;///////
+;// Metadata Timestamp Token/Signature errors 0x7160 - 0x717F
+;///////
+MessageId = 0x7160
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_MISSING
+Language = English
+An expected metadata timestamp token was missing.
+.
+
+MessageId = 0x7161
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_VERIFICATION_FAILED
+Language = English
+A metadata Timestamp token failed verification.
+.
+
+MessageId = 0x7162
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_UNTRUSTED
+Language = English
+A metadata timestamp token signer certificate chain was untrusted.
+.
+
+MessageId = 0x7163
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_VALIDITY_WINDOW
+Language = English
+A metadata signature timestamp token was no longer within the validity window.
+.
+
+MessageId = 0x7164
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_SIGNATURE
+Language = English
+A metadata timestamp token failed signature validation
+.
+
+MessageId = 0x7165
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_CERTCHAIN
+Language = English
+A metadata timestamp token certificate failed certificate chain verification.
+.
+
+MessageId = 0x7166
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_REFRESHONLINE
+Language = English
+A failure occurred when refreshing a missing timestamp token from the network.
+.
+
+MessageId = 0x7167
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_ALL_BAD
+Language = English
+All update metadata verification timestamp tokens from the timestamp token cache are invalid.
+.
+
+MessageId = 0x7168
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_NODATA
+Language = English
+No update metadata verification timestamp tokens exist in the timestamp token cache.
+.
+
+MessageId = 0x7169
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_CACHELOOKUP
+Language = English
+An error occurred during cache lookup of update metadata verification timestamp token.
+.
+
+MessageId = 0x717E
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_VALIDITYWINDOW_UNEXPECTED
+Language = English
+An metadata timestamp token validity window failed unexpectedly due to reasons not covered by another error code.
+.
+
+MessageId = 0x717F
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_TIMESTAMP_TOKEN_UNEXPECTED
+Language = English
+An metadata timestamp token verification operation failed due to reasons not covered by another error code.
+.
+
+;///////
+;// Metadata Certificate-Related errors 0x7180 - 0x719F
+;///////
+MessageId = 0x7180
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_CERT_MISSING
+Language = English
+An expected metadata signing certificate was missing.
+.
+
+MessageId = 0x7181
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_LEAFCERT_BAD_TRANSPORT_ENCODING
+Language = English
+The transport encoding of a metadata signing leaf certificate was malformed.
+.
+
+MessageId = 0x7182
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_INTCERT_BAD_TRANSPORT_ENCODING
+Language = English
+The transport encoding of a metadata signing intermediate certificate was malformed.
+.
+
+MessageId = 0x7183
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_METADATA_CERT_UNTRUSTED
+Language = English
+A metadata certificate chain was untrusted.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// WU Task related errors
+;///////////////////////////////////////////////////////////////////////////////
+MessageId = 0xB001
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUTASK_INPROGRESS
+Language = English
+The task is currently in progress.
+.
+
+MessageId = 0xB002
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUTASK_STATUS_DISABLED
+Language = English
+The operation cannot be completed since the task status is currently disabled.
+.
+
+MessageId = 0xB003
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUTASK_NOT_STARTED
+Language = English
+The operation cannot be completed since the task is not yet started.
+.
+
+MessageId = 0xB004
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUTASK_RETRY
+Language = English
+The task was stopped and needs to be run again to complete.
+.
+
+MessageId = 0xB005
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WUTASK_CANCELINSTALL_DISALLOWED
+Language = English
+Cannot cancel a non-scheduled install.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// Hardware Capability related errors
+;////
+MessageId = 0xB101
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UNKNOWN_HARDWARECAPABILITY
+Language = English
+Hardware capability meta data was not found after a sync with the service.
+.
+
+MessageId = 0xB102
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_BAD_XML_HARDWARECAPABILITY
+Language = English
+Hardware capability meta data was malformed and/or failed to parse.
+.
+
+MessageId = 0xB103
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_WMI_NOT_SUPPORTED
+Language = English
+Unable to complete action due to WMI dependency, which isn't supported on this platform.
+.
+
+MessageId = 0xB104
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_UPDATE_MERGE_NOT_ALLOWED
+Language = English
+Merging of the update is not allowed
+.
+
+MessageId = 0xB105
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SKIPPED_UPDATE_INSTALLATION
+Language = English
+Installing merged updates only. So skipping non mergeable updates.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// SLS related errors - 0xB201
+;////
+;///////
+;// SLS General errors 0xB201 - 0xB2FF
+;///////
+MessageId = 0xB201
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_SLS_INVALID_REVISION
+Language = English
+SLS response returned invalid revision number.
+.
+
+;//////////////////////////////////////////////////////////////////////////////
+;// trust related errors - 0xB301
+;////
+;///////
+;// trust General errors 0xB301 - 0xB3FF
+;///////
+MessageId = 0xB301
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_FILETRUST_DUALSIGNATURE_RSA
+Language = English
+File signature validation fails to find valid RSA signature on infrastructure payload.
+.
+
+MessageId = 0xB302
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_FILETRUST_DUALSIGNATURE_ECC
+Language = English
+File signature validation fails to find valid ECC signature on infrastructure payload.
+.
+
+MessageId = 0xB303
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TRUST_SUBJECT_NOT_TRUSTED
+Language = English
+The subject is not trusted by WU for the specified action.
+.
+
+MessageId = 0xB304
+Facility = WindowsUpdate
+Severity = Error
+SymbolicName = WU_E_TRUST_PROVIDER_UNKNOWN
+Language = English
+Unknown trust provider for WU.
+.
+
+;#endif //_WUERROR_
diff --git a/build/fix-nsis.sh b/build/fix-nsis.sh
new file mode 100644
index 0000000..6d81be7
--- /dev/null
+++ b/build/fix-nsis.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+# Fixes NSIS binaries so they run on Pentium/486. Debian's build of NSIS is compiled with MinGW,
+# but they lack any -mcpu flag, so the binaries receive a default of i686. To fix this, we'll
+# download the official Windows build of NSIS and extract its binaries. We only handle stubs though,
+# because we provide our own plugin builds in this repo.
+
+set -e
+
+if [[ $UID != 0 ]]; then
+ echo "This script needs to be run as root (sorry)" >&2
+ exit 1
+fi
+
+if [[ ! -d /usr/share/nsis/Stubs ]]; then
+ echo "NSIS not installed, or Stubs directory is broken" >&2
+ exit 1
+fi
+
+if [[ -d /usr/share/nsis/Stubs_old ]]; then
+ echo "NSIS stubs are already fixed" >&2
+ exit 0
+fi
+
+apt-get install -qy curl p7zip-full
+
+mkdir /tmp/nsis
+cd /tmp/nsis
+
+curl -fSL https://prdownloads.sourceforge.net/nsis/NSIS%203/3.10/nsis-3.10-setup.exe -o nsis.exe
+7z x nsis.exe
+
+mv /usr/share/nsis/Stubs{,_old}
+cp -ra Stubs /usr/share/nsis/Stubs
+
+rm -rf /tmp/nsis
diff --git a/build/fix-vc08-aslr.reg b/build/fix-vc08-aslr.reg
new file mode 100644
index 0000000..a5fa7e1
Binary files /dev/null and b/build/fix-vc08-aslr.reg differ
diff --git a/include/licdll.h b/include/licdll.h
new file mode 100644
index 0000000..5676ef9
--- /dev/null
+++ b/include/licdll.h
@@ -0,0 +1,1360 @@
+/*** Autogenerated by WIDL 8.5 from licdll.idl - Do not edit ***/
+
+#ifdef _WIN32
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
+#endif
+#include
+#include
+#endif
+
+#ifndef COM_NO_WINDOWS_H
+#include
+#include
+#endif
+
+#ifndef __licdll_h__
+#define __licdll_h__
+
+#ifndef __WIDL_INLINE
+#if defined(__cplusplus) || defined(_MSC_VER)
+#define __WIDL_INLINE inline
+#elif defined(__GNUC__)
+#define __WIDL_INLINE __inline__
+#endif
+#endif
+
+/* Forward declarations */
+
+#ifndef __COMLicenseAgent_FWD_DEFINED__
+#define __COMLicenseAgent_FWD_DEFINED__
+#ifdef __cplusplus
+typedef class COMLicenseAgent COMLicenseAgent;
+#else
+typedef struct COMLicenseAgent COMLicenseAgent;
+#endif /* defined __cplusplus */
+#endif /* defined __COMLicenseAgent_FWD_DEFINED__ */
+
+#ifndef __ICOMLicenseAgent_FWD_DEFINED__
+#define __ICOMLicenseAgent_FWD_DEFINED__
+typedef interface ICOMLicenseAgent ICOMLicenseAgent;
+#ifdef __cplusplus
+interface ICOMLicenseAgent;
+#endif /* __cplusplus */
+#endif
+
+#ifndef __ICOMLicenseAgent2_FWD_DEFINED__
+#define __ICOMLicenseAgent2_FWD_DEFINED__
+typedef interface ICOMLicenseAgent2 ICOMLicenseAgent2;
+#ifdef __cplusplus
+interface ICOMLicenseAgent2;
+#endif /* __cplusplus */
+#endif
+
+/* Headers for imported files */
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef __LICDLLLib_LIBRARY_DEFINED__
+#define __LICDLLLib_LIBRARY_DEFINED__
+
+DEFINE_GUID(LIBID_LICDLLLib, 0xc7879482, 0xf798, 0x4a74, 0xaf,0x43, 0xe8,0x87,0xfb,0xdc,0xed,0x40);
+
+#ifndef __ICOMLicenseAgent_FWD_DEFINED__
+#define __ICOMLicenseAgent_FWD_DEFINED__
+typedef interface ICOMLicenseAgent ICOMLicenseAgent;
+#ifdef __cplusplus
+interface ICOMLicenseAgent;
+#endif /* __cplusplus */
+#endif
+
+#ifndef __ICOMLicenseAgent2_FWD_DEFINED__
+#define __ICOMLicenseAgent2_FWD_DEFINED__
+typedef interface ICOMLicenseAgent2 ICOMLicenseAgent2;
+#ifdef __cplusplus
+interface ICOMLicenseAgent2;
+#endif /* __cplusplus */
+#endif
+
+/*****************************************************************************
+ * COMLicenseAgent coclass
+ */
+
+DEFINE_GUID(CLSID_COMLicenseAgent, 0xacadf079, 0xcbcd, 0x4032, 0x83,0xf2, 0xfa,0x47,0xc4,0xdb,0x09,0x6f);
+
+#ifdef __cplusplus
+class DECLSPEC_UUID("acadf079-cbcd-4032-83f2-fa47c4db096f") COMLicenseAgent;
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(COMLicenseAgent, 0xacadf079, 0xcbcd, 0x4032, 0x83,0xf2, 0xfa,0x47,0xc4,0xdb,0x09,0x6f)
+#endif
+#endif
+
+/*****************************************************************************
+ * ICOMLicenseAgent interface
+ */
+#ifndef __ICOMLicenseAgent_INTERFACE_DEFINED__
+#define __ICOMLicenseAgent_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ICOMLicenseAgent, 0xb8cbad79, 0x3f1f, 0x481a, 0xbb,0x0c, 0xe7,0xbb,0xd7,0x7b,0xdd,0xd1);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+MIDL_INTERFACE("b8cbad79-3f1f-481a-bb0c-e7bbd77bddd1")
+ICOMLicenseAgent : public IDispatch
+{
+ virtual HRESULT STDMETHODCALLTYPE Initialize(
+ ULONG dwBPC,
+ ULONG dwMode,
+ BSTR bstrLicSource,
+ ULONG *pdwRetCode) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFirstName(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFirstName(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetLastName(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetLastName(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOrgName(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetOrgName(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetEmail(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetEmail(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPhone(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetPhone(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAddress1(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAddress1(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCity(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetCity(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetState(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetState(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCountryCode(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetCountryCode(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCountryDesc(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetCountryDesc(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetZip(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetZip(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetIsoLanguage(
+ ULONG *pdwVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetIsoLanguage(
+ ULONG dwNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMSUpdate(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetMSUpdate(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMSOffer(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetMSOffer(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetOtherOffer(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetOtherOffer(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAddress2(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetAddress2(
+ BSTR bstrNewVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessHandshakeRequest(
+ LONG bReviseCustInfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessNewLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessReissueLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessReviseCustInfoRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetAsyncProcessReturnCode(
+ ULONG *pdwRetCode) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessDroppedLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GenerateInstallationId(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE DepositConfirmationId(
+ BSTR bstrVal,
+ ULONG *pdwRetCode) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetExpirationInfo(
+ ULONG *pdwWPALeft,
+ ULONG *pdwEvalLeft) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AsyncProcessRegistrationRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ProcessHandshakeRequest(
+ LONG bReviseCustInfo) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ProcessNewLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ProcessDroppedLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ProcessReissueLicenseRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ProcessReviseCustInfoRequest(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnsureInternetConnection(
+ ) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetProductKey(
+ LPWSTR pszNewProductKey) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetProductID(
+ BSTR *pbstrVal) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE VerifyCheckDigits(
+ BSTR bstrCIDIID,
+ LONG *pbValue) = 0;
+
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ICOMLicenseAgent, 0xb8cbad79, 0x3f1f, 0x481a, 0xbb,0x0c, 0xe7,0xbb,0xd7,0x7b,0xdd,0xd1)
+#endif
+#else
+typedef struct ICOMLicenseAgentVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ICOMLicenseAgent *This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ICOMLicenseAgent *This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ICOMLicenseAgent *This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ICOMLicenseAgent *This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ICOMLicenseAgent *This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ICOMLicenseAgent *This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ICOMLicenseAgent *This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ICOMLicenseAgent methods ***/
+ HRESULT (STDMETHODCALLTYPE *Initialize)(
+ ICOMLicenseAgent *This,
+ ULONG dwBPC,
+ ULONG dwMode,
+ BSTR bstrLicSource,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *GetFirstName)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetFirstName)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetLastName)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetLastName)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetOrgName)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetOrgName)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetEmail)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetEmail)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetPhone)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetPhone)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetAddress1)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetAddress1)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCity)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCity)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetState)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetState)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCountryCode)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCountryCode)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCountryDesc)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCountryDesc)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetZip)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetZip)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetIsoLanguage)(
+ ICOMLicenseAgent *This,
+ ULONG *pdwVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetIsoLanguage)(
+ ICOMLicenseAgent *This,
+ ULONG dwNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetMSUpdate)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetMSUpdate)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetMSOffer)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetMSOffer)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetOtherOffer)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetOtherOffer)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetAddress2)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetAddress2)(
+ ICOMLicenseAgent *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessHandshakeRequest)(
+ ICOMLicenseAgent *This,
+ LONG bReviseCustInfo);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessNewLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessReissueLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessReviseCustInfoRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *GetAsyncProcessReturnCode)(
+ ICOMLicenseAgent *This,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessDroppedLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *GenerateInstallationId)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *DepositConfirmationId)(
+ ICOMLicenseAgent *This,
+ BSTR bstrVal,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *GetExpirationInfo)(
+ ICOMLicenseAgent *This,
+ ULONG *pdwWPALeft,
+ ULONG *pdwEvalLeft);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessRegistrationRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessHandshakeRequest)(
+ ICOMLicenseAgent *This,
+ LONG bReviseCustInfo);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessNewLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessDroppedLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessReissueLicenseRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessReviseCustInfoRequest)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *EnsureInternetConnection)(
+ ICOMLicenseAgent *This);
+
+ HRESULT (STDMETHODCALLTYPE *SetProductKey)(
+ ICOMLicenseAgent *This,
+ LPWSTR pszNewProductKey);
+
+ HRESULT (STDMETHODCALLTYPE *GetProductID)(
+ ICOMLicenseAgent *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *VerifyCheckDigits)(
+ ICOMLicenseAgent *This,
+ BSTR bstrCIDIID,
+ LONG *pbValue);
+
+ END_INTERFACE
+} ICOMLicenseAgentVtbl;
+
+interface ICOMLicenseAgent {
+ CONST_VTBL ICOMLicenseAgentVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+#ifndef WIDL_C_INLINE_WRAPPERS
+/*** IUnknown methods ***/
+#define ICOMLicenseAgent_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ICOMLicenseAgent_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ICOMLicenseAgent_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ICOMLicenseAgent_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ICOMLicenseAgent_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ICOMLicenseAgent_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ICOMLicenseAgent_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ICOMLicenseAgent methods ***/
+#define ICOMLicenseAgent_Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode) (This)->lpVtbl->Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode)
+#define ICOMLicenseAgent_GetFirstName(This,pbstrVal) (This)->lpVtbl->GetFirstName(This,pbstrVal)
+#define ICOMLicenseAgent_SetFirstName(This,bstrNewVal) (This)->lpVtbl->SetFirstName(This,bstrNewVal)
+#define ICOMLicenseAgent_GetLastName(This,pbstrVal) (This)->lpVtbl->GetLastName(This,pbstrVal)
+#define ICOMLicenseAgent_SetLastName(This,bstrNewVal) (This)->lpVtbl->SetLastName(This,bstrNewVal)
+#define ICOMLicenseAgent_GetOrgName(This,pbstrVal) (This)->lpVtbl->GetOrgName(This,pbstrVal)
+#define ICOMLicenseAgent_SetOrgName(This,bstrNewVal) (This)->lpVtbl->SetOrgName(This,bstrNewVal)
+#define ICOMLicenseAgent_GetEmail(This,pbstrVal) (This)->lpVtbl->GetEmail(This,pbstrVal)
+#define ICOMLicenseAgent_SetEmail(This,bstrNewVal) (This)->lpVtbl->SetEmail(This,bstrNewVal)
+#define ICOMLicenseAgent_GetPhone(This,pbstrVal) (This)->lpVtbl->GetPhone(This,pbstrVal)
+#define ICOMLicenseAgent_SetPhone(This,bstrNewVal) (This)->lpVtbl->SetPhone(This,bstrNewVal)
+#define ICOMLicenseAgent_GetAddress1(This,pbstrVal) (This)->lpVtbl->GetAddress1(This,pbstrVal)
+#define ICOMLicenseAgent_SetAddress1(This,bstrNewVal) (This)->lpVtbl->SetAddress1(This,bstrNewVal)
+#define ICOMLicenseAgent_GetCity(This,pbstrVal) (This)->lpVtbl->GetCity(This,pbstrVal)
+#define ICOMLicenseAgent_SetCity(This,bstrNewVal) (This)->lpVtbl->SetCity(This,bstrNewVal)
+#define ICOMLicenseAgent_GetState(This,pbstrVal) (This)->lpVtbl->GetState(This,pbstrVal)
+#define ICOMLicenseAgent_SetState(This,bstrNewVal) (This)->lpVtbl->SetState(This,bstrNewVal)
+#define ICOMLicenseAgent_GetCountryCode(This,pbstrVal) (This)->lpVtbl->GetCountryCode(This,pbstrVal)
+#define ICOMLicenseAgent_SetCountryCode(This,bstrNewVal) (This)->lpVtbl->SetCountryCode(This,bstrNewVal)
+#define ICOMLicenseAgent_GetCountryDesc(This,pbstrVal) (This)->lpVtbl->GetCountryDesc(This,pbstrVal)
+#define ICOMLicenseAgent_SetCountryDesc(This,bstrNewVal) (This)->lpVtbl->SetCountryDesc(This,bstrNewVal)
+#define ICOMLicenseAgent_GetZip(This,pbstrVal) (This)->lpVtbl->GetZip(This,pbstrVal)
+#define ICOMLicenseAgent_SetZip(This,bstrNewVal) (This)->lpVtbl->SetZip(This,bstrNewVal)
+#define ICOMLicenseAgent_GetIsoLanguage(This,pdwVal) (This)->lpVtbl->GetIsoLanguage(This,pdwVal)
+#define ICOMLicenseAgent_SetIsoLanguage(This,dwNewVal) (This)->lpVtbl->SetIsoLanguage(This,dwNewVal)
+#define ICOMLicenseAgent_GetMSUpdate(This,pbstrVal) (This)->lpVtbl->GetMSUpdate(This,pbstrVal)
+#define ICOMLicenseAgent_SetMSUpdate(This,bstrNewVal) (This)->lpVtbl->SetMSUpdate(This,bstrNewVal)
+#define ICOMLicenseAgent_GetMSOffer(This,pbstrVal) (This)->lpVtbl->GetMSOffer(This,pbstrVal)
+#define ICOMLicenseAgent_SetMSOffer(This,bstrNewVal) (This)->lpVtbl->SetMSOffer(This,bstrNewVal)
+#define ICOMLicenseAgent_GetOtherOffer(This,pbstrVal) (This)->lpVtbl->GetOtherOffer(This,pbstrVal)
+#define ICOMLicenseAgent_SetOtherOffer(This,bstrNewVal) (This)->lpVtbl->SetOtherOffer(This,bstrNewVal)
+#define ICOMLicenseAgent_GetAddress2(This,pbstrVal) (This)->lpVtbl->GetAddress2(This,pbstrVal)
+#define ICOMLicenseAgent_SetAddress2(This,bstrNewVal) (This)->lpVtbl->SetAddress2(This,bstrNewVal)
+#define ICOMLicenseAgent_AsyncProcessHandshakeRequest(This,bReviseCustInfo) (This)->lpVtbl->AsyncProcessHandshakeRequest(This,bReviseCustInfo)
+#define ICOMLicenseAgent_AsyncProcessNewLicenseRequest(This) (This)->lpVtbl->AsyncProcessNewLicenseRequest(This)
+#define ICOMLicenseAgent_AsyncProcessReissueLicenseRequest(This) (This)->lpVtbl->AsyncProcessReissueLicenseRequest(This)
+#define ICOMLicenseAgent_AsyncProcessReviseCustInfoRequest(This) (This)->lpVtbl->AsyncProcessReviseCustInfoRequest(This)
+#define ICOMLicenseAgent_GetAsyncProcessReturnCode(This,pdwRetCode) (This)->lpVtbl->GetAsyncProcessReturnCode(This,pdwRetCode)
+#define ICOMLicenseAgent_AsyncProcessDroppedLicenseRequest(This) (This)->lpVtbl->AsyncProcessDroppedLicenseRequest(This)
+#define ICOMLicenseAgent_GenerateInstallationId(This,pbstrVal) (This)->lpVtbl->GenerateInstallationId(This,pbstrVal)
+#define ICOMLicenseAgent_DepositConfirmationId(This,bstrVal,pdwRetCode) (This)->lpVtbl->DepositConfirmationId(This,bstrVal,pdwRetCode)
+#define ICOMLicenseAgent_GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft) (This)->lpVtbl->GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft)
+#define ICOMLicenseAgent_AsyncProcessRegistrationRequest(This) (This)->lpVtbl->AsyncProcessRegistrationRequest(This)
+#define ICOMLicenseAgent_ProcessHandshakeRequest(This,bReviseCustInfo) (This)->lpVtbl->ProcessHandshakeRequest(This,bReviseCustInfo)
+#define ICOMLicenseAgent_ProcessNewLicenseRequest(This) (This)->lpVtbl->ProcessNewLicenseRequest(This)
+#define ICOMLicenseAgent_ProcessDroppedLicenseRequest(This) (This)->lpVtbl->ProcessDroppedLicenseRequest(This)
+#define ICOMLicenseAgent_ProcessReissueLicenseRequest(This) (This)->lpVtbl->ProcessReissueLicenseRequest(This)
+#define ICOMLicenseAgent_ProcessReviseCustInfoRequest(This) (This)->lpVtbl->ProcessReviseCustInfoRequest(This)
+#define ICOMLicenseAgent_EnsureInternetConnection(This) (This)->lpVtbl->EnsureInternetConnection(This)
+#define ICOMLicenseAgent_SetProductKey(This,pszNewProductKey) (This)->lpVtbl->SetProductKey(This,pszNewProductKey)
+#define ICOMLicenseAgent_GetProductID(This,pbstrVal) (This)->lpVtbl->GetProductID(This,pbstrVal)
+#define ICOMLicenseAgent_VerifyCheckDigits(This,bstrCIDIID,pbValue) (This)->lpVtbl->VerifyCheckDigits(This,bstrCIDIID,pbValue)
+#else
+/*** IUnknown methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_QueryInterface(ICOMLicenseAgent* This,REFIID riid,void **ppvObject) {
+ return This->lpVtbl->QueryInterface(This,riid,ppvObject);
+}
+static __WIDL_INLINE ULONG ICOMLicenseAgent_AddRef(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AddRef(This);
+}
+static __WIDL_INLINE ULONG ICOMLicenseAgent_Release(ICOMLicenseAgent* This) {
+ return This->lpVtbl->Release(This);
+}
+/*** IDispatch methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetTypeInfoCount(ICOMLicenseAgent* This,UINT *pctinfo) {
+ return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetTypeInfo(ICOMLicenseAgent* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
+ return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetIDsOfNames(ICOMLicenseAgent* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
+ return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_Invoke(ICOMLicenseAgent* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
+ return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
+}
+/*** ICOMLicenseAgent methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_Initialize(ICOMLicenseAgent* This,ULONG dwBPC,ULONG dwMode,BSTR bstrLicSource,ULONG *pdwRetCode) {
+ return This->lpVtbl->Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetFirstName(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetFirstName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetFirstName(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetFirstName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetLastName(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetLastName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetLastName(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetLastName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetOrgName(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetOrgName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetOrgName(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetOrgName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetEmail(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetEmail(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetEmail(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetEmail(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetPhone(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetPhone(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetPhone(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetPhone(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAddress1(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetAddress1(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetAddress1(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetAddress1(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCity(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCity(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCity(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCity(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetState(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetState(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetState(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetState(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCountryCode(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCountryCode(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCountryCode(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCountryCode(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCountryDesc(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCountryDesc(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCountryDesc(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCountryDesc(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetZip(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetZip(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetZip(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetZip(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetIsoLanguage(ICOMLicenseAgent* This,ULONG *pdwVal) {
+ return This->lpVtbl->GetIsoLanguage(This,pdwVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetIsoLanguage(ICOMLicenseAgent* This,ULONG dwNewVal) {
+ return This->lpVtbl->SetIsoLanguage(This,dwNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetMSUpdate(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetMSUpdate(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetMSUpdate(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetMSUpdate(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetMSOffer(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetMSOffer(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetMSOffer(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetMSOffer(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetOtherOffer(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetOtherOffer(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetOtherOffer(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetOtherOffer(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAddress2(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetAddress2(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetAddress2(ICOMLicenseAgent* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetAddress2(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessHandshakeRequest(ICOMLicenseAgent* This,LONG bReviseCustInfo) {
+ return This->lpVtbl->AsyncProcessHandshakeRequest(This,bReviseCustInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessNewLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AsyncProcessNewLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessReissueLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AsyncProcessReissueLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessReviseCustInfoRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AsyncProcessReviseCustInfoRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAsyncProcessReturnCode(ICOMLicenseAgent* This,ULONG *pdwRetCode) {
+ return This->lpVtbl->GetAsyncProcessReturnCode(This,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessDroppedLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AsyncProcessDroppedLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GenerateInstallationId(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GenerateInstallationId(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_DepositConfirmationId(ICOMLicenseAgent* This,BSTR bstrVal,ULONG *pdwRetCode) {
+ return This->lpVtbl->DepositConfirmationId(This,bstrVal,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetExpirationInfo(ICOMLicenseAgent* This,ULONG *pdwWPALeft,ULONG *pdwEvalLeft) {
+ return This->lpVtbl->GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessRegistrationRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->AsyncProcessRegistrationRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessHandshakeRequest(ICOMLicenseAgent* This,LONG bReviseCustInfo) {
+ return This->lpVtbl->ProcessHandshakeRequest(This,bReviseCustInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessNewLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->ProcessNewLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessDroppedLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->ProcessDroppedLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessReissueLicenseRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->ProcessReissueLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessReviseCustInfoRequest(ICOMLicenseAgent* This) {
+ return This->lpVtbl->ProcessReviseCustInfoRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_EnsureInternetConnection(ICOMLicenseAgent* This) {
+ return This->lpVtbl->EnsureInternetConnection(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetProductKey(ICOMLicenseAgent* This,LPWSTR pszNewProductKey) {
+ return This->lpVtbl->SetProductKey(This,pszNewProductKey);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetProductID(ICOMLicenseAgent* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetProductID(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent_VerifyCheckDigits(ICOMLicenseAgent* This,BSTR bstrCIDIID,LONG *pbValue) {
+ return This->lpVtbl->VerifyCheckDigits(This,bstrCIDIID,pbValue);
+}
+#endif
+#endif
+
+#endif
+
+
+#endif /* __ICOMLicenseAgent_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * ICOMLicenseAgent2 interface
+ */
+#ifndef __ICOMLicenseAgent2_INTERFACE_DEFINED__
+#define __ICOMLicenseAgent2_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ICOMLicenseAgent2, 0x6a07c5a3, 0x9c67, 0x4bb6, 0xb0,0x20, 0xec,0xbe,0x7f,0xdf,0xd3,0x26);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+MIDL_INTERFACE("6a07c5a3-9c67-4bb6-b020-ecbe7fdfd326")
+ICOMLicenseAgent2 : public ICOMLicenseAgent
+{
+ virtual HRESULT STDMETHODCALLTYPE SetReminders(
+ LONG bValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetReminders(
+ LONG *pbValue) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetKeyType(
+ ULONG *pdwKeyType) = 0;
+
+};
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(ICOMLicenseAgent2, 0x6a07c5a3, 0x9c67, 0x4bb6, 0xb0,0x20, 0xec,0xbe,0x7f,0xdf,0xd3,0x26)
+#endif
+#else
+typedef struct ICOMLicenseAgent2Vtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ ICOMLicenseAgent2 *This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ ICOMLicenseAgent2 *This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ ICOMLicenseAgent2 *This);
+
+ /*** IDispatch methods ***/
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfoCount)(
+ ICOMLicenseAgent2 *This,
+ UINT *pctinfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetTypeInfo)(
+ ICOMLicenseAgent2 *This,
+ UINT iTInfo,
+ LCID lcid,
+ ITypeInfo **ppTInfo);
+
+ HRESULT (STDMETHODCALLTYPE *GetIDsOfNames)(
+ ICOMLicenseAgent2 *This,
+ REFIID riid,
+ LPOLESTR *rgszNames,
+ UINT cNames,
+ LCID lcid,
+ DISPID *rgDispId);
+
+ HRESULT (STDMETHODCALLTYPE *Invoke)(
+ ICOMLicenseAgent2 *This,
+ DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS *pDispParams,
+ VARIANT *pVarResult,
+ EXCEPINFO *pExcepInfo,
+ UINT *puArgErr);
+
+ /*** ICOMLicenseAgent methods ***/
+ HRESULT (STDMETHODCALLTYPE *Initialize)(
+ ICOMLicenseAgent2 *This,
+ ULONG dwBPC,
+ ULONG dwMode,
+ BSTR bstrLicSource,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *GetFirstName)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetFirstName)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetLastName)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetLastName)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetOrgName)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetOrgName)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetEmail)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetEmail)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetPhone)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetPhone)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetAddress1)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetAddress1)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCity)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCity)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetState)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetState)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCountryCode)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCountryCode)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetCountryDesc)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetCountryDesc)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetZip)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetZip)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetIsoLanguage)(
+ ICOMLicenseAgent2 *This,
+ ULONG *pdwVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetIsoLanguage)(
+ ICOMLicenseAgent2 *This,
+ ULONG dwNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetMSUpdate)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetMSUpdate)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetMSOffer)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetMSOffer)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetOtherOffer)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetOtherOffer)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *GetAddress2)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *SetAddress2)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrNewVal);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessHandshakeRequest)(
+ ICOMLicenseAgent2 *This,
+ LONG bReviseCustInfo);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessNewLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessReissueLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessReviseCustInfoRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *GetAsyncProcessReturnCode)(
+ ICOMLicenseAgent2 *This,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessDroppedLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *GenerateInstallationId)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *DepositConfirmationId)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrVal,
+ ULONG *pdwRetCode);
+
+ HRESULT (STDMETHODCALLTYPE *GetExpirationInfo)(
+ ICOMLicenseAgent2 *This,
+ ULONG *pdwWPALeft,
+ ULONG *pdwEvalLeft);
+
+ HRESULT (STDMETHODCALLTYPE *AsyncProcessRegistrationRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessHandshakeRequest)(
+ ICOMLicenseAgent2 *This,
+ LONG bReviseCustInfo);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessNewLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessDroppedLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessReissueLicenseRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *ProcessReviseCustInfoRequest)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *EnsureInternetConnection)(
+ ICOMLicenseAgent2 *This);
+
+ HRESULT (STDMETHODCALLTYPE *SetProductKey)(
+ ICOMLicenseAgent2 *This,
+ LPWSTR pszNewProductKey);
+
+ HRESULT (STDMETHODCALLTYPE *GetProductID)(
+ ICOMLicenseAgent2 *This,
+ BSTR *pbstrVal);
+
+ HRESULT (STDMETHODCALLTYPE *VerifyCheckDigits)(
+ ICOMLicenseAgent2 *This,
+ BSTR bstrCIDIID,
+ LONG *pbValue);
+
+ /*** ICOMLicenseAgent2 methods ***/
+ HRESULT (STDMETHODCALLTYPE *SetReminders)(
+ ICOMLicenseAgent2 *This,
+ LONG bValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetReminders)(
+ ICOMLicenseAgent2 *This,
+ LONG *pbValue);
+
+ HRESULT (STDMETHODCALLTYPE *GetKeyType)(
+ ICOMLicenseAgent2 *This,
+ ULONG *pdwKeyType);
+
+ END_INTERFACE
+} ICOMLicenseAgent2Vtbl;
+
+interface ICOMLicenseAgent2 {
+ CONST_VTBL ICOMLicenseAgent2Vtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+#ifndef WIDL_C_INLINE_WRAPPERS
+/*** IUnknown methods ***/
+#define ICOMLicenseAgent2_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define ICOMLicenseAgent2_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define ICOMLicenseAgent2_Release(This) (This)->lpVtbl->Release(This)
+/*** IDispatch methods ***/
+#define ICOMLicenseAgent2_GetTypeInfoCount(This,pctinfo) (This)->lpVtbl->GetTypeInfoCount(This,pctinfo)
+#define ICOMLicenseAgent2_GetTypeInfo(This,iTInfo,lcid,ppTInfo) (This)->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo)
+#define ICOMLicenseAgent2_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) (This)->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId)
+#define ICOMLicenseAgent2_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) (This)->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr)
+/*** ICOMLicenseAgent methods ***/
+#define ICOMLicenseAgent2_Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode) (This)->lpVtbl->Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode)
+#define ICOMLicenseAgent2_GetFirstName(This,pbstrVal) (This)->lpVtbl->GetFirstName(This,pbstrVal)
+#define ICOMLicenseAgent2_SetFirstName(This,bstrNewVal) (This)->lpVtbl->SetFirstName(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetLastName(This,pbstrVal) (This)->lpVtbl->GetLastName(This,pbstrVal)
+#define ICOMLicenseAgent2_SetLastName(This,bstrNewVal) (This)->lpVtbl->SetLastName(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetOrgName(This,pbstrVal) (This)->lpVtbl->GetOrgName(This,pbstrVal)
+#define ICOMLicenseAgent2_SetOrgName(This,bstrNewVal) (This)->lpVtbl->SetOrgName(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetEmail(This,pbstrVal) (This)->lpVtbl->GetEmail(This,pbstrVal)
+#define ICOMLicenseAgent2_SetEmail(This,bstrNewVal) (This)->lpVtbl->SetEmail(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetPhone(This,pbstrVal) (This)->lpVtbl->GetPhone(This,pbstrVal)
+#define ICOMLicenseAgent2_SetPhone(This,bstrNewVal) (This)->lpVtbl->SetPhone(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetAddress1(This,pbstrVal) (This)->lpVtbl->GetAddress1(This,pbstrVal)
+#define ICOMLicenseAgent2_SetAddress1(This,bstrNewVal) (This)->lpVtbl->SetAddress1(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetCity(This,pbstrVal) (This)->lpVtbl->GetCity(This,pbstrVal)
+#define ICOMLicenseAgent2_SetCity(This,bstrNewVal) (This)->lpVtbl->SetCity(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetState(This,pbstrVal) (This)->lpVtbl->GetState(This,pbstrVal)
+#define ICOMLicenseAgent2_SetState(This,bstrNewVal) (This)->lpVtbl->SetState(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetCountryCode(This,pbstrVal) (This)->lpVtbl->GetCountryCode(This,pbstrVal)
+#define ICOMLicenseAgent2_SetCountryCode(This,bstrNewVal) (This)->lpVtbl->SetCountryCode(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetCountryDesc(This,pbstrVal) (This)->lpVtbl->GetCountryDesc(This,pbstrVal)
+#define ICOMLicenseAgent2_SetCountryDesc(This,bstrNewVal) (This)->lpVtbl->SetCountryDesc(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetZip(This,pbstrVal) (This)->lpVtbl->GetZip(This,pbstrVal)
+#define ICOMLicenseAgent2_SetZip(This,bstrNewVal) (This)->lpVtbl->SetZip(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetIsoLanguage(This,pdwVal) (This)->lpVtbl->GetIsoLanguage(This,pdwVal)
+#define ICOMLicenseAgent2_SetIsoLanguage(This,dwNewVal) (This)->lpVtbl->SetIsoLanguage(This,dwNewVal)
+#define ICOMLicenseAgent2_GetMSUpdate(This,pbstrVal) (This)->lpVtbl->GetMSUpdate(This,pbstrVal)
+#define ICOMLicenseAgent2_SetMSUpdate(This,bstrNewVal) (This)->lpVtbl->SetMSUpdate(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetMSOffer(This,pbstrVal) (This)->lpVtbl->GetMSOffer(This,pbstrVal)
+#define ICOMLicenseAgent2_SetMSOffer(This,bstrNewVal) (This)->lpVtbl->SetMSOffer(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetOtherOffer(This,pbstrVal) (This)->lpVtbl->GetOtherOffer(This,pbstrVal)
+#define ICOMLicenseAgent2_SetOtherOffer(This,bstrNewVal) (This)->lpVtbl->SetOtherOffer(This,bstrNewVal)
+#define ICOMLicenseAgent2_GetAddress2(This,pbstrVal) (This)->lpVtbl->GetAddress2(This,pbstrVal)
+#define ICOMLicenseAgent2_SetAddress2(This,bstrNewVal) (This)->lpVtbl->SetAddress2(This,bstrNewVal)
+#define ICOMLicenseAgent2_AsyncProcessHandshakeRequest(This,bReviseCustInfo) (This)->lpVtbl->AsyncProcessHandshakeRequest(This,bReviseCustInfo)
+#define ICOMLicenseAgent2_AsyncProcessNewLicenseRequest(This) (This)->lpVtbl->AsyncProcessNewLicenseRequest(This)
+#define ICOMLicenseAgent2_AsyncProcessReissueLicenseRequest(This) (This)->lpVtbl->AsyncProcessReissueLicenseRequest(This)
+#define ICOMLicenseAgent2_AsyncProcessReviseCustInfoRequest(This) (This)->lpVtbl->AsyncProcessReviseCustInfoRequest(This)
+#define ICOMLicenseAgent2_GetAsyncProcessReturnCode(This,pdwRetCode) (This)->lpVtbl->GetAsyncProcessReturnCode(This,pdwRetCode)
+#define ICOMLicenseAgent2_AsyncProcessDroppedLicenseRequest(This) (This)->lpVtbl->AsyncProcessDroppedLicenseRequest(This)
+#define ICOMLicenseAgent2_GenerateInstallationId(This,pbstrVal) (This)->lpVtbl->GenerateInstallationId(This,pbstrVal)
+#define ICOMLicenseAgent2_DepositConfirmationId(This,bstrVal,pdwRetCode) (This)->lpVtbl->DepositConfirmationId(This,bstrVal,pdwRetCode)
+#define ICOMLicenseAgent2_GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft) (This)->lpVtbl->GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft)
+#define ICOMLicenseAgent2_AsyncProcessRegistrationRequest(This) (This)->lpVtbl->AsyncProcessRegistrationRequest(This)
+#define ICOMLicenseAgent2_ProcessHandshakeRequest(This,bReviseCustInfo) (This)->lpVtbl->ProcessHandshakeRequest(This,bReviseCustInfo)
+#define ICOMLicenseAgent2_ProcessNewLicenseRequest(This) (This)->lpVtbl->ProcessNewLicenseRequest(This)
+#define ICOMLicenseAgent2_ProcessDroppedLicenseRequest(This) (This)->lpVtbl->ProcessDroppedLicenseRequest(This)
+#define ICOMLicenseAgent2_ProcessReissueLicenseRequest(This) (This)->lpVtbl->ProcessReissueLicenseRequest(This)
+#define ICOMLicenseAgent2_ProcessReviseCustInfoRequest(This) (This)->lpVtbl->ProcessReviseCustInfoRequest(This)
+#define ICOMLicenseAgent2_EnsureInternetConnection(This) (This)->lpVtbl->EnsureInternetConnection(This)
+#define ICOMLicenseAgent2_SetProductKey(This,pszNewProductKey) (This)->lpVtbl->SetProductKey(This,pszNewProductKey)
+#define ICOMLicenseAgent2_GetProductID(This,pbstrVal) (This)->lpVtbl->GetProductID(This,pbstrVal)
+#define ICOMLicenseAgent2_VerifyCheckDigits(This,bstrCIDIID,pbValue) (This)->lpVtbl->VerifyCheckDigits(This,bstrCIDIID,pbValue)
+/*** ICOMLicenseAgent2 methods ***/
+#define ICOMLicenseAgent2_SetReminders(This,bValue) (This)->lpVtbl->SetReminders(This,bValue)
+#define ICOMLicenseAgent2_GetReminders(This,pbValue) (This)->lpVtbl->GetReminders(This,pbValue)
+#define ICOMLicenseAgent2_GetKeyType(This,pdwKeyType) (This)->lpVtbl->GetKeyType(This,pdwKeyType)
+#else
+/*** IUnknown methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_QueryInterface(ICOMLicenseAgent2* This,REFIID riid,void **ppvObject) {
+ return This->lpVtbl->QueryInterface(This,riid,ppvObject);
+}
+static __WIDL_INLINE ULONG ICOMLicenseAgent2_AddRef(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AddRef(This);
+}
+static __WIDL_INLINE ULONG ICOMLicenseAgent2_Release(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->Release(This);
+}
+/*** IDispatch methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetTypeInfoCount(ICOMLicenseAgent2* This,UINT *pctinfo) {
+ return This->lpVtbl->GetTypeInfoCount(This,pctinfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetTypeInfo(ICOMLicenseAgent2* This,UINT iTInfo,LCID lcid,ITypeInfo **ppTInfo) {
+ return This->lpVtbl->GetTypeInfo(This,iTInfo,lcid,ppTInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetIDsOfNames(ICOMLicenseAgent2* This,REFIID riid,LPOLESTR *rgszNames,UINT cNames,LCID lcid,DISPID *rgDispId) {
+ return This->lpVtbl->GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_Invoke(ICOMLicenseAgent2* This,DISPID dispIdMember,REFIID riid,LCID lcid,WORD wFlags,DISPPARAMS *pDispParams,VARIANT *pVarResult,EXCEPINFO *pExcepInfo,UINT *puArgErr) {
+ return This->lpVtbl->Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr);
+}
+/*** ICOMLicenseAgent methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_Initialize(ICOMLicenseAgent2* This,ULONG dwBPC,ULONG dwMode,BSTR bstrLicSource,ULONG *pdwRetCode) {
+ return This->lpVtbl->Initialize(This,dwBPC,dwMode,bstrLicSource,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetFirstName(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetFirstName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetFirstName(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetFirstName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetLastName(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetLastName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetLastName(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetLastName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetOrgName(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetOrgName(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetOrgName(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetOrgName(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetEmail(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetEmail(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetEmail(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetEmail(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetPhone(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetPhone(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetPhone(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetPhone(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAddress1(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetAddress1(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetAddress1(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetAddress1(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCity(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCity(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCity(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCity(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetState(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetState(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetState(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetState(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCountryCode(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCountryCode(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCountryCode(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCountryCode(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCountryDesc(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetCountryDesc(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCountryDesc(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetCountryDesc(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetZip(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetZip(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetZip(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetZip(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetIsoLanguage(ICOMLicenseAgent2* This,ULONG *pdwVal) {
+ return This->lpVtbl->GetIsoLanguage(This,pdwVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetIsoLanguage(ICOMLicenseAgent2* This,ULONG dwNewVal) {
+ return This->lpVtbl->SetIsoLanguage(This,dwNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetMSUpdate(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetMSUpdate(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetMSUpdate(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetMSUpdate(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetMSOffer(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetMSOffer(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetMSOffer(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetMSOffer(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetOtherOffer(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetOtherOffer(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetOtherOffer(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetOtherOffer(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAddress2(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetAddress2(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetAddress2(ICOMLicenseAgent2* This,BSTR bstrNewVal) {
+ return This->lpVtbl->SetAddress2(This,bstrNewVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessHandshakeRequest(ICOMLicenseAgent2* This,LONG bReviseCustInfo) {
+ return This->lpVtbl->AsyncProcessHandshakeRequest(This,bReviseCustInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessNewLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AsyncProcessNewLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessReissueLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AsyncProcessReissueLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessReviseCustInfoRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AsyncProcessReviseCustInfoRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAsyncProcessReturnCode(ICOMLicenseAgent2* This,ULONG *pdwRetCode) {
+ return This->lpVtbl->GetAsyncProcessReturnCode(This,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessDroppedLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AsyncProcessDroppedLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GenerateInstallationId(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GenerateInstallationId(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_DepositConfirmationId(ICOMLicenseAgent2* This,BSTR bstrVal,ULONG *pdwRetCode) {
+ return This->lpVtbl->DepositConfirmationId(This,bstrVal,pdwRetCode);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetExpirationInfo(ICOMLicenseAgent2* This,ULONG *pdwWPALeft,ULONG *pdwEvalLeft) {
+ return This->lpVtbl->GetExpirationInfo(This,pdwWPALeft,pdwEvalLeft);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessRegistrationRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->AsyncProcessRegistrationRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessHandshakeRequest(ICOMLicenseAgent2* This,LONG bReviseCustInfo) {
+ return This->lpVtbl->ProcessHandshakeRequest(This,bReviseCustInfo);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessNewLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->ProcessNewLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessDroppedLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->ProcessDroppedLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessReissueLicenseRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->ProcessReissueLicenseRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessReviseCustInfoRequest(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->ProcessReviseCustInfoRequest(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_EnsureInternetConnection(ICOMLicenseAgent2* This) {
+ return This->lpVtbl->EnsureInternetConnection(This);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetProductKey(ICOMLicenseAgent2* This,LPWSTR pszNewProductKey) {
+ return This->lpVtbl->SetProductKey(This,pszNewProductKey);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetProductID(ICOMLicenseAgent2* This,BSTR *pbstrVal) {
+ return This->lpVtbl->GetProductID(This,pbstrVal);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_VerifyCheckDigits(ICOMLicenseAgent2* This,BSTR bstrCIDIID,LONG *pbValue) {
+ return This->lpVtbl->VerifyCheckDigits(This,bstrCIDIID,pbValue);
+}
+/*** ICOMLicenseAgent2 methods ***/
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetReminders(ICOMLicenseAgent2* This,LONG bValue) {
+ return This->lpVtbl->SetReminders(This,bValue);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetReminders(ICOMLicenseAgent2* This,LONG *pbValue) {
+ return This->lpVtbl->GetReminders(This,pbValue);
+}
+static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetKeyType(ICOMLicenseAgent2* This,ULONG *pdwKeyType) {
+ return This->lpVtbl->GetKeyType(This,pdwKeyType);
+}
+#endif
+#endif
+
+#endif
+
+
+#endif /* __ICOMLicenseAgent2_INTERFACE_DEFINED__ */
+
+#endif /* __LICDLLLib_LIBRARY_DEFINED__ */
+/* Begin additional prototypes for all interfaces */
+
+ULONG __RPC_USER BSTR_UserSize (ULONG *, ULONG, BSTR *);
+unsigned char * __RPC_USER BSTR_UserMarshal (ULONG *, unsigned char *, BSTR *);
+unsigned char * __RPC_USER BSTR_UserUnmarshal(ULONG *, unsigned char *, BSTR *);
+void __RPC_USER BSTR_UserFree (ULONG *, BSTR *);
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __licdll_h__ */
diff --git a/include/licdll.idl b/include/licdll.idl
new file mode 100644
index 0000000..7a9be42
--- /dev/null
+++ b/include/licdll.idl
@@ -0,0 +1,170 @@
+
+import "oaidl.idl";
+
+// Generated .IDL file (by the OLE/COM Object Viewer)
+//
+// typelib filename: licdll.dll
+
+[
+ uuid(C7879482-F798-4A74-AF43-E887FBDCED40),
+ version(1.0),
+ helpstring("licdll 1.0 Type Library")
+]
+library LICDLLLib
+{
+ // TLib : // TLib : OLE Automation : {00020430-0000-0000-C000-000000000046}
+ importlib("stdole2.tlb");
+
+ // Forward declare all types defined in this typelib
+ interface ICOMLicenseAgent;
+ interface ICOMLicenseAgent2;
+
+ [
+ uuid(ACADF079-CBCD-4032-83F2-FA47C4DB096F),
+ helpstring("COMLicenseAgent Class")
+ ]
+ coclass COMLicenseAgent {
+ [default] interface ICOMLicenseAgent;
+ interface ICOMLicenseAgent2;
+ };
+
+ [
+ odl,
+ uuid(B8CBAD79-3F1F-481A-BB0C-E7BBD77BDDD1),
+ helpstring("ICOMLicenseAgent Interface"),
+ dual,
+ oleautomation
+ ]
+ interface ICOMLicenseAgent : IDispatch {
+ [id(0x00000001), helpstring("method Initialize")]
+ HRESULT Initialize(
+ [in] unsigned long dwBPC,
+ [in] unsigned long dwMode,
+ [in] BSTR bstrLicSource,
+ [out, retval] unsigned long* pdwRetCode);
+ [id(0x00000003), helpstring("method GetFirstName")]
+ HRESULT GetFirstName([out, retval] BSTR* pbstrVal);
+ [id(0x00000004), helpstring("method SetFirstName")]
+ HRESULT SetFirstName([in] BSTR bstrNewVal);
+ [id(0x00000005), helpstring("method GetLastName")]
+ HRESULT GetLastName([out, retval] BSTR* pbstrVal);
+ [id(0x00000006), helpstring("method SetLastName")]
+ HRESULT SetLastName([in] BSTR bstrNewVal);
+ [id(0x00000007), helpstring("method GetOrgName")]
+ HRESULT GetOrgName([out, retval] BSTR* pbstrVal);
+ [id(0x00000008), helpstring("method SetOrgName")]
+ HRESULT SetOrgName([in] BSTR bstrNewVal);
+ [id(0x00000009), helpstring("method GetEmail")]
+ HRESULT GetEmail([out, retval] BSTR* pbstrVal);
+ [id(0x0000000a), helpstring("method SetEmail")]
+ HRESULT SetEmail([in] BSTR bstrNewVal);
+ [id(0x0000000b), helpstring("method GetPhone")]
+ HRESULT GetPhone([out, retval] BSTR* pbstrVal);
+ [id(0x0000000c), helpstring("method SetPhone")]
+ HRESULT SetPhone([in] BSTR bstrNewVal);
+ [id(0x0000000d), helpstring("method GetAddress1")]
+ HRESULT GetAddress1([out, retval] BSTR* pbstrVal);
+ [id(0x0000000e), helpstring("method SetAddress1")]
+ HRESULT SetAddress1([in] BSTR bstrNewVal);
+ [id(0x0000000f), helpstring("method GetCity")]
+ HRESULT GetCity([out, retval] BSTR* pbstrVal);
+ [id(0x00000010), helpstring("method SetCity")]
+ HRESULT SetCity([in] BSTR bstrNewVal);
+ [id(0x00000011), helpstring("method GetState")]
+ HRESULT GetState([out, retval] BSTR* pbstrVal);
+ [id(0x00000012), helpstring("method SetState")]
+ HRESULT SetState([in] BSTR bstrNewVal);
+ [id(0x00000013), helpstring("method GetCountryCode")]
+ HRESULT GetCountryCode([out, retval] BSTR* pbstrVal);
+ [id(0x00000014), helpstring("method SetCountryCode")]
+ HRESULT SetCountryCode([in] BSTR bstrNewVal);
+ [id(0x00000015), helpstring("method GetCountryDesc")]
+ HRESULT GetCountryDesc([out, retval] BSTR* pbstrVal);
+ [id(0x00000016), helpstring("method SetCountryDesc")]
+ HRESULT SetCountryDesc([in] BSTR bstrNewVal);
+ [id(0x00000017), helpstring("method GetZip")]
+ HRESULT GetZip([out, retval] BSTR* pbstrVal);
+ [id(0x00000018), helpstring("method SetZip")]
+ HRESULT SetZip([in] BSTR bstrNewVal);
+ [id(0x00000019), helpstring("method GetIsoLanguage")]
+ HRESULT GetIsoLanguage([out, retval] unsigned long* pdwVal);
+ [id(0x0000001a), helpstring("method SetIsoLanguage")]
+ HRESULT SetIsoLanguage([in] unsigned long dwNewVal);
+ [id(0x00000020), helpstring("method GetMSUpdate")]
+ HRESULT GetMSUpdate([out, retval] BSTR* pbstrVal);
+ [id(0x00000021), helpstring("method SetMSUpdate")]
+ HRESULT SetMSUpdate([in] BSTR bstrNewVal);
+ [id(0x00000022), helpstring("method GetMSOffer")]
+ HRESULT GetMSOffer([out, retval] BSTR* pbstrVal);
+ [id(0x00000023), helpstring("method SetMSOffer")]
+ HRESULT SetMSOffer([in] BSTR bstrNewVal);
+ [id(0x00000024), helpstring("method GetOtherOffer")]
+ HRESULT GetOtherOffer([out, retval] BSTR* pbstrVal);
+ [id(0x00000025), helpstring("method SetOtherOffer")]
+ HRESULT SetOtherOffer([in] BSTR bstrNewVal);
+ [id(0x00000026), helpstring("method GetAddress2")]
+ HRESULT GetAddress2([out, retval] BSTR* pbstrVal);
+ [id(0x00000027), helpstring("method SetAddress2")]
+ HRESULT SetAddress2([in] BSTR bstrNewVal);
+ [id(0x00000052), helpstring("method AsyncProcessHandshakeRequest")]
+ HRESULT AsyncProcessHandshakeRequest([in] long bReviseCustInfo);
+ [id(0x00000053), helpstring("method AsyncProcessNewLicenseRequest")]
+ HRESULT AsyncProcessNewLicenseRequest();
+ [id(0x00000054), helpstring("method AsyncProcessReissueLicenseRequest")]
+ HRESULT AsyncProcessReissueLicenseRequest();
+ [id(0x00000056), helpstring("method AsyncProcessReviseCustInfoRequest")]
+ HRESULT AsyncProcessReviseCustInfoRequest();
+ [id(0x0000005a), helpstring("method GetAsyncProcessReturnCode")]
+ HRESULT GetAsyncProcessReturnCode([out, retval] unsigned long* pdwRetCode);
+ [id(0x0000005d), helpstring("method AsyncProcessDroppedLicenseRequest")]
+ HRESULT AsyncProcessDroppedLicenseRequest();
+ [id(0x00000064), helpstring("method GenerateInstallationId")]
+ HRESULT GenerateInstallationId([out, retval] BSTR* pbstrVal);
+ [id(0x00000065), helpstring("method DepositConfirmationId")]
+ HRESULT DepositConfirmationId(
+ [in] BSTR bstrVal,
+ [out, retval] unsigned long* pdwRetCode);
+ [id(0x00000066), helpstring("method GetExpirationInfo")]
+ HRESULT GetExpirationInfo(
+ [out] unsigned long* pdwWPALeft,
+ [out, retval] unsigned long* pdwEvalLeft);
+ [id(0x00000067), helpstring("method AsyncProcessRegistrationRequest")]
+ HRESULT AsyncProcessRegistrationRequest();
+ [id(0x00000068), helpstring("method ProcessHandshakeRequest")]
+ HRESULT ProcessHandshakeRequest([in] long bReviseCustInfo);
+ [id(0x00000069), helpstring("method ProcessNewLicenseRequest")]
+ HRESULT ProcessNewLicenseRequest();
+ [id(0x0000006a), helpstring("method ProcessDroppedLicenseRequest")]
+ HRESULT ProcessDroppedLicenseRequest();
+ [id(0x0000006b), helpstring("method ProcessReissueLicenseRequest")]
+ HRESULT ProcessReissueLicenseRequest();
+ [id(0x0000006d), helpstring("method ProcessReviseCustInfoRequest")]
+ HRESULT ProcessReviseCustInfoRequest();
+ [id(0x0000006e), helpstring("method EnsureInternetConnection")]
+ HRESULT EnsureInternetConnection();
+ [id(0x0000006f), helpstring("method SetProductKey")]
+ HRESULT SetProductKey([in] LPWSTR pszNewProductKey);
+ [id(0x00000070), helpstring("method GetProductID")]
+ HRESULT GetProductID([out, retval] BSTR* pbstrVal);
+ [id(0x00000071), helpstring("method VerifyCheckDigits")]
+ HRESULT VerifyCheckDigits(
+ BSTR bstrCIDIID,
+ [out, retval] long* pbValue);
+ };
+
+ [
+ odl,
+ uuid(6A07C5A3-9C67-4BB6-B020-ECBE7FDFD326),
+ helpstring("ICOMLicenseAgent Interface 2"),
+ dual,
+ oleautomation
+ ]
+ interface ICOMLicenseAgent2 : ICOMLicenseAgent {
+ [id(0x00000072), helpstring("method SetReminders")]
+ HRESULT SetReminders(long bValue);
+ [id(0x00000073), helpstring("method GetReminders")]
+ HRESULT GetReminders(long* pbValue);
+ [id(0x00000074), helpstring("method GetKeyType")]
+ HRESULT GetKeyType([out, retval] unsigned long* pdwKeyType);
+ };
+};
diff --git a/include/slpublic.h b/include/slpublic.h
new file mode 100644
index 0000000..f067cff
--- /dev/null
+++ b/include/slpublic.h
@@ -0,0 +1,33 @@
+#pragma once
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef GUID SLID;
+typedef PVOID HSLC;
+
+DEFINE_GUID(WINDOWS_SLID, 0x55c92734, 0xd682, 0x4d71, 0x98, 0x3e, 0xd6, 0xec, 0x3f, 0x16, 0x05, 0x9f);
+
+typedef enum _tagSLLICENSINGSTATUS {
+ SL_LICENSING_STATUS_UNLICENSED,
+ SL_LICENSING_STATUS_LICENSED,
+ SL_LICENSING_STATUS_IN_GRACE_PERIOD,
+ SL_LICENSING_STATUS_NOTIFICATION,
+ SL_LICENSING_STATUS_LAST
+} SLLICENSINGSTATUS;
+
+typedef struct _tagSL_LICENSING_STATUS {
+ SLID SkuId;
+ SLLICENSINGSTATUS eStatus;
+ DWORD dwGraceTime;
+ DWORD dwTotalGraceDays;
+ HRESULT hrReason;
+ UINT64 qwValidityExpiration;
+} SL_LICENSING_STATUS;
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/launcher/CplTasks.xml b/launcher/CplTasks.xml
new file mode 100644
index 0000000..945bae7
--- /dev/null
+++ b/launcher/CplTasks.xml
@@ -0,0 +1,18 @@
+
+
+
+
+ @"%ProgramFiles%\Legacy Update\LegacyUpdate.exe",-3
+ legacy update;legacyupdate;update;windows;microsoft;driver;security;software;
+ "%ProgramFiles%\Legacy Update\LegacyUpdate.exe"
+
+
+
+
+
+
+
+
+
+
+
diff --git a/launcher/InitRunOnce.c b/launcher/InitRunOnce.c
new file mode 100644
index 0000000..9268c9f
--- /dev/null
+++ b/launcher/InitRunOnce.c
@@ -0,0 +1,298 @@
+#include
+#include
+#include "MsgBox.h"
+#include "VersionInfo.h"
+#include "LoadImage.h"
+
+#define HK_RUNCMD 1
+
+typedef DWORD (__fastcall *_ThemeWaitForServiceReady)(DWORD timeout);
+typedef DWORD (__fastcall *_ThemeWatchForStart)();
+
+static const COLORREF WallpaperColorWin2k = RGB(58, 110, 165); // #3a6ea5
+static const COLORREF WallpaperColorWinXP = RGB( 0, 78, 152); // #004e98
+static const COLORREF WallpaperColorWin8 = RGB(32, 103, 178); // #2067b2
+static const COLORREF WallpaperColorWin10 = RGB(24, 0, 82); // #180052
+
+static const WCHAR RunOnceClassName[] = L"LegacyUpdateRunOnce";
+
+static HANDLE g_cmdHandle;
+
+static void StartThemes() {
+ // Ask UxInit.dll to ask the Themes service to start a session for this desktop. Themes doesn't automatically start a
+ // session for the SYSTEM desktop, so we need to ask it to. This matches what msoobe.exe does on first boot.
+
+ // Windows 7 moves this to UxInit.dll
+ HMODULE shsvcs = LoadLibrary(L"UxInit.dll");
+ if (!shsvcs) {
+ shsvcs = LoadLibrary(L"shsvcs.dll");
+ if (!shsvcs) {
+ return;
+ }
+ }
+
+ // Get functions by ordinals
+ _ThemeWaitForServiceReady $ThemeWaitForServiceReady = (_ThemeWaitForServiceReady)GetProcAddress(shsvcs, MAKEINTRESOURCEA(2));
+ _ThemeWatchForStart $ThemeWatchForStart = (_ThemeWatchForStart)GetProcAddress(shsvcs, MAKEINTRESOURCEA(1));
+
+ // 1. Wait up to 1000ms for Themes to start
+ if ($ThemeWaitForServiceReady) {
+ $ThemeWaitForServiceReady(1000);
+ }
+
+ // 2. Prompt Themes to start a session for the SYSTEM desktop
+ if ($ThemeWatchForStart) {
+ $ThemeWatchForStart();
+ }
+
+ FreeLibrary(shsvcs);
+}
+
+static BOOL RunCmd(LPPROCESS_INFORMATION processInfo) {
+ WCHAR cmd[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\cmd.exe", cmd, ARRAYSIZE(cmd));
+
+ STARTUPINFO startupInfo = {0};
+ startupInfo.cb = sizeof(startupInfo);
+
+ if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &startupInfo, processInfo)) {
+ MsgBox(NULL, L"Launching cmd.exe failed", NULL, MB_OK | MB_ICONERROR);
+ return FALSE;
+ }
+
+ CloseHandle(processInfo->hThread);
+ g_cmdHandle = processInfo->hProcess;
+ return TRUE;
+}
+
+static LRESULT CALLBACK RunOnceWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
+ switch (message) {
+ case WM_NCHITTEST:
+ // Don't accept any mouse input
+ return HTNOWHERE;
+
+ case WM_HOTKEY: {
+ // Shift-F10 to run cmd
+ if (wParam == HK_RUNCMD) {
+ DWORD exitCode;
+ if (!g_cmdHandle || (GetExitCodeProcess(g_cmdHandle, &exitCode) && exitCode != STILL_ACTIVE)) {
+ PROCESS_INFORMATION processInfo;
+ RunCmd(&processInfo);
+ }
+ }
+
+ break;
+ }
+
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ break;
+ }
+
+ return DefWindowProc(hwnd, message, wParam, lParam);;
+}
+
+static void CreateRunOnceWindow() {
+ // Init common controls
+ INITCOMMONCONTROLSEX initComctl = {0};
+ initComctl.dwSize = sizeof(initComctl);
+ initComctl.dwICC = ICC_WIN95_CLASSES;
+ InitCommonControlsEx(&initComctl);
+
+ // Create window
+ WNDCLASS wndClass = {0};
+ wndClass.style = CS_VREDRAW | CS_HREDRAW | CS_OWNDC | CS_NOCLOSE;
+ wndClass.lpfnWndProc = RunOnceWndProc;
+ wndClass.hInstance = GetModuleHandle(NULL);
+ wndClass.lpszClassName = RunOnceClassName;
+ wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);
+
+ if (!RegisterClass(&wndClass)) {
+ TRACE(L"RegisterClass failed: %d", GetLastError());
+ return;
+ }
+
+ HWND hwnd = CreateWindowEx(
+ WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE,
+ wndClass.lpszClassName,
+ L"Legacy Update",
+ WS_POPUP,
+ 0, 0, 0, 0,
+ NULL, NULL,
+ wndClass.hInstance,
+ NULL
+ );
+ if (!hwnd) {
+ TRACE(L"CreateWindow failed: %d", GetLastError());
+ return;
+ }
+
+ // Register hotkey
+ RegisterHotKey(hwnd, HK_RUNCMD, MOD_SHIFT, VK_F10);
+
+ // Check if the display is 8-bit color or lower
+ HDC dc = GetDC(NULL);
+ int bpp = GetDeviceCaps(dc, BITSPIXEL);
+ ReleaseDC(NULL, dc);
+ if (bpp >= 8) {
+ // Set the wallpaper color
+ COLORREF color = GetSysColor(COLOR_DESKTOP);
+ if (AtLeastWin10()) {
+ color = WallpaperColorWin10;
+ } else if (AtLeastWin8()) {
+ color = WallpaperColorWin8;
+ } else if ((IsWinXP2002() || IsWinXP2003()) && color == RGB(0, 0, 0)) {
+ // XP uses a black wallpaper in fast user switching mode. Override to the default blue.
+ color = WallpaperColorWinXP;
+ }
+ SetSysColors(1, (const INT[1]){COLOR_DESKTOP}, (const COLORREF[1]){color});
+
+ DWORD width = GetSystemMetrics(SM_CXSCREEN);
+ DWORD height = GetSystemMetrics(SM_CYSCREEN);
+ HBITMAP wallpaper;
+
+ if (IsWin7()) {
+ // 7: Bitmap in oobe dir
+ WCHAR bmpPath[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\oobe\\background.bmp", bmpPath, ARRAYSIZE(bmpPath));
+ wallpaper = LoadImage(NULL, bmpPath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ } else if (IsWinVista()) {
+ // Vista: Resources in ooberesources.dll
+ WCHAR ooberesPath[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\oobe\\ooberesources.dll", ooberesPath, ARRAYSIZE(ooberesPath));
+ HMODULE ooberes = LoadLibrary(ooberesPath);
+ if (ooberes) {
+ // Width logic is the same used by Vista msoobe.dll
+ LPWSTR resource = GetSystemMetrics(SM_CXSCREEN) < 1200 ? L"OOBE_BACKGROUND_0" : L"OOBE_BACKGROUND_LARGE_0";
+ wallpaper = LoadPNGResource(ooberes, resource, RT_RCDATA);
+ }
+ FreeLibrary(ooberes);
+ }
+
+ if (wallpaper) {
+ // Write to disk
+ WCHAR tempPath[MAX_PATH];
+ ExpandEnvironmentStrings(L"%ProgramData%\\Legacy Update\\background.bmp", tempPath, ARRAYSIZE(tempPath));
+ if (GetFileAttributes(tempPath) != INVALID_FILE_ATTRIBUTES || ScaleAndWriteToBMP(wallpaper, width, height, tempPath)) {
+ SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (PVOID)tempPath, SPIF_SENDWININICHANGE);
+ }
+
+ DeleteObject(wallpaper);
+ }
+ }
+
+ ShowWindow(hwnd, SW_SHOW);
+ UpdateWindow(hwnd);
+}
+
+static BOOL IsSystemUser() {
+ BOOL result = FALSE;
+ PTOKEN_USER tokenInfo;
+ PSID systemSid;
+ HANDLE token;
+ if (!OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, &token)) {
+ goto end;
+ }
+
+ DWORD tokenInfoLen;
+ GetTokenInformation(token, TokenUser, NULL, 0, &tokenInfoLen);
+ tokenInfo = (PTOKEN_USER)LocalAlloc(LPTR, tokenInfoLen);
+ if (!GetTokenInformation(token, TokenUser, tokenInfo, tokenInfoLen, &tokenInfoLen)) {
+ goto end;
+ }
+
+ DWORD sidSize = SECURITY_MAX_SID_SIZE;
+ systemSid = LocalAlloc(LPTR, sidSize);
+ if (!CreateWellKnownSid(WinLocalSystemSid, NULL, systemSid, &sidSize)) {
+ goto end;
+ }
+
+ result = EqualSid(tokenInfo->User.Sid, systemSid);
+
+end:
+ if (tokenInfo) {
+ LocalFree(tokenInfo);
+ }
+ if (systemSid) {
+ LocalFree(systemSid);
+ }
+ if (token) {
+ CloseHandle(token);
+ }
+ return result;
+}
+
+void RunOnce() {
+#ifndef _DEBUG
+ // Only relevant if we're SYSTEM
+ if (!IsSystemUser()) {
+ PostQuitMessage(1);
+ return;
+ }
+#endif
+
+ // Start Themes on this desktop
+ StartThemes();
+
+ // Find and hide the FirstUxWnd window, if it exists (Windows 7+)
+ HWND firstUxWnd = FindWindow(L"FirstUxWndClass", NULL);
+ if (firstUxWnd) {
+ ShowWindow(firstUxWnd, SW_HIDE);
+ }
+
+ // Set up our window
+ CreateRunOnceWindow();
+
+ // Construct path to LegacyUpdateSetup.exe
+ WCHAR setupPath[MAX_PATH];
+ GetModuleFileName(NULL, setupPath, ARRAYSIZE(setupPath));
+ wcsrchr(setupPath, L'\\')[1] = L'\0';
+ wcsncat(setupPath, L"LegacyUpdateSetup.exe", ARRAYSIZE(setupPath) - wcslen(setupPath) - 1);
+
+ // Execute and wait for completion
+ STARTUPINFO startupInfo = {0};
+ startupInfo.cb = sizeof(startupInfo);
+
+ PROCESS_INFORMATION processInfo = {0};
+ LPWSTR cmdLine = (LPWSTR)LocalAlloc(LPTR, 4096 * sizeof(WCHAR));
+ wsprintf(cmdLine, L"\"%ls\" /runonce", setupPath);
+ if (!CreateProcess(setupPath, cmdLine, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &startupInfo, &processInfo)) {
+#ifdef _DEBUG
+ // Run cmd.exe instead
+ if (!RunCmd(&processInfo)) {
+ PostQuitMessage(0);
+ return;
+ }
+#else
+ MsgBox(NULL, L"Continuing Legacy Update setup failed", NULL, MB_OK | MB_ICONERROR);
+ PostQuitMessage(0);
+ return;
+#endif
+ }
+
+ CloseHandle(processInfo.hThread);
+
+ // Wait for it to finish, while running a message loop
+ MSG msg;
+ while (WaitForSingleObject(processInfo.hProcess, 100) == WAIT_TIMEOUT) {
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ }
+ }
+
+ CloseHandle(processInfo.hProcess);
+
+ // Don't let SYSTEM cmd keep running beyond runonce
+ if (g_cmdHandle) {
+ TerminateProcess(g_cmdHandle, 0);
+ CloseHandle(g_cmdHandle);
+ }
+
+ // Show FirstUxWnd again
+ if (firstUxWnd) {
+ ShowWindow(firstUxWnd, SW_SHOW);
+ }
+
+ PostQuitMessage(0);
+}
diff --git a/launcher/LaunchUpdateSite.c b/launcher/LaunchUpdateSite.c
new file mode 100644
index 0000000..dda792e
--- /dev/null
+++ b/launcher/LaunchUpdateSite.c
@@ -0,0 +1,205 @@
+#include "stdafx.h"
+#include "main.h"
+#include "resource.h"
+#include
+#include "Exec.h"
+#include "HResult.h"
+#include "MsgBox.h"
+#include "RegisterServer.h"
+#include "Registry.h"
+#include "SelfElevate.h"
+#include "User.h"
+#include "VersionInfo.h"
+
+const LPWSTR UpdateSiteURLHttp = L"http://legacyupdate.net/windowsupdate/v6/";
+const LPWSTR UpdateSiteURLHttps = L"https://legacyupdate.net/windowsupdate/v6/";
+const LPWSTR UpdateSiteFirstRunFlag = L"?firstrun=true";
+
+DEFINE_GUID(IID_ILegacyUpdateCtrl, 0xC33085BB, 0xC3E1, 0x4D27, 0xA2, 0x14, 0xAF, 0x01, 0x95, 0x3D, 0xF5, 0xE5);
+DEFINE_GUID(CLSID_LegacyUpdateCtrl, 0xAD28E0DF, 0x5F5A, 0x40B5, 0x94, 0x32, 0x85, 0xEF, 0xD9, 0x7D, 0x1F, 0x9F);
+
+static const LPWSTR GetUpdateSiteURL() {
+ // Fallback: Use SSL only on Vista and up
+ BOOL useHTTPS = AtLeastWinVista();
+
+ // Get the Windows Update website URL set by Legacy Update setup
+ LPWSTR data;
+ DWORD size;
+ HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\WindowsUpdate", L"URL", KEY_WOW64_64KEY, &data, &size);
+ if (SUCCEEDED(hr)) {
+ // Return based on the URL value
+ if (wcscmp(data, UpdateSiteURLHttps) == 0) {
+ useHTTPS = TRUE;
+ } else if (wcscmp(data, UpdateSiteURLHttp) == 0) {
+ useHTTPS = FALSE;
+ }
+ LocalFree(data);
+ }
+
+ return useHTTPS ? UpdateSiteURLHttps : UpdateSiteURLHttp;
+}
+
+void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow) {
+ HRESULT hr = S_OK;
+ IWebBrowser2 *browser;
+ VARIANT url;
+ VARIANT flags;
+ VARIANT nullVariant;
+ LPTSTR siteURL;
+ HMONITOR monitor;
+
+ // If running on 2k/XP, make sure we're elevated. If not, show Run As prompt.
+ if (!AtLeastWinVista() && !IsUserAdmin()) {
+ LPWSTR args = (LPWSTR)LocalAlloc(LPTR, 512 * sizeof(WCHAR));
+ wsprintf(args, L"/launch %ls", argc > 0 ? argv[0] : L"");
+ hr = SelfElevate(args, NULL);
+
+ // Access denied happens when the user clicks No/Cancel.
+ if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) {
+ hr = S_OK;
+ }
+
+ goto end;
+ }
+
+ // Can we instantiate our own ActiveX control? If not, try to register it.
+ hr = CoCreateInstance(&CLSID_LegacyUpdateCtrl, NULL, CLSCTX_LOCAL_SERVER, &IID_ILegacyUpdateCtrl, (void **)&browser);
+ if (hr == REGDB_E_CLASSNOTREG) {
+ hr = RegisterServer(0, TRUE, TRUE);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ hr = CoCreateInstance(&CLSID_LegacyUpdateCtrl, NULL, CLSCTX_LOCAL_SERVER, &IID_ILegacyUpdateCtrl, (void **)&browser);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ IUnknown_Release(browser);
+ } else if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ // Spawn an IE window via the COM interface. This ensures the page opens in IE (ShellExecute uses
+ // default browser), and avoids hardcoding a path to iexplore.exe. Also conveniently allows testing
+ // on Windows 11 (iexplore.exe redirects to Edge, but COM still works). Same strategy as used by
+ // Wupdmgr.exe and Muweb.dll,LaunchMUSite.
+ hr = CoCreateInstance(&CLSID_InternetExplorer, NULL, CLSCTX_LOCAL_SERVER, &IID_IWebBrowser2, (void **)&browser);
+ if (hr == REGDB_E_CLASSNOTREG) {
+ // Handle case where the user has uninstalled Internet Explorer using Programs and Features.
+ OSVERSIONINFOEX *versionInfo = GetVersionInfo();
+
+ // Windows 8+: Directly prompt to reinstall IE using Fondue.exe.
+ if (AtLeastWin8()) {
+ SYSTEM_INFO systemInfo;
+ GetSystemInfo(&systemInfo);
+ LPCTSTR archSuffix = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 ? L"amd64" : L"x86";
+
+ WCHAR fondue[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\fondue.exe", fondue, ARRAYSIZE(fondue));
+
+ WCHAR fondueArgs[256];
+ wsprintf(fondueArgs, L"/enable-feature:Internet-Explorer-Optional-%ls", archSuffix);
+ hr = Exec(NULL, fondue, fondueArgs, NULL, SW_SHOWDEFAULT, FALSE, NULL);
+ if (SUCCEEDED(hr)) {
+ goto end;
+ }
+ }
+
+ // Tell the user what they need to do, then open the Optional Features dialog.
+ WCHAR message[4096];
+ LoadString(GetModuleHandle(NULL), IDS_IENOTINSTALLED, message, ARRAYSIZE(message));
+ MsgBox(NULL, message, NULL, MB_OK | MB_ICONEXCLAMATION);
+
+ WCHAR optionalFeatures[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\OptionalFeatures.exe", optionalFeatures, ARRAYSIZE(optionalFeatures));
+ Exec(NULL, optionalFeatures, NULL, NULL, SW_SHOWDEFAULT, FALSE, NULL);
+ hr = S_OK;
+ goto end;
+ } else if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ // Can we connect with https? WinInet will throw an error if not.
+ siteURL = GetUpdateSiteURL();
+
+ // Is this a first run launch? Append first run flag if so.
+ if (argc > 0 && lstrcmpi(argv[0], L"/firstrun") == 0) {
+ WCHAR newSiteURL[256];
+ wsprintf(newSiteURL, L"%s%s", siteURL, UpdateSiteFirstRunFlag);
+ siteURL = newSiteURL;
+ }
+
+ VariantInit(&url);
+ url.vt = VT_BSTR;
+ url.bstrVal = SysAllocString(siteURL);
+
+ VariantInit(&flags);
+ flags.vt = VT_I4;
+ flags.lVal = 0;
+
+ VariantInit(&nullVariant);
+
+ hr = IWebBrowser2_Navigate2(browser, &url, &flags, &nullVariant, &nullVariant, &nullVariant);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ HWND ieHwnd;
+ hr = IWebBrowser2_get_HWND(browser, (SHANDLE_PTR *)&ieHwnd);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ // Are we on a small display? If so, resize and maximise the window.
+ monitor = MonitorFromWindow(ieHwnd, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO monitorInfo;
+ monitorInfo.cbSize = sizeof(MONITORINFO);
+
+ if (GetMonitorInfo(monitor, &monitorInfo) > 0) {
+ LONG workWidth = monitorInfo.rcWork.right - monitorInfo.rcWork.left;
+ LONG workHeight = monitorInfo.rcWork.bottom - monitorInfo.rcWork.top;
+
+ LONG width, height;
+ IWebBrowser2_get_Width(browser, &width);
+ IWebBrowser2_get_Height(browser, &height);
+
+ if (width < 800) {
+ width = workWidth < 800 ? workWidth : 800;
+ IWebBrowser2_put_Width(browser, width);
+ }
+ if (height < 600) {
+ height = workHeight < 600 ? workHeight : 600;
+ IWebBrowser2_put_Height(browser, height);
+ }
+
+ LONG left, top;
+ IWebBrowser2_get_Left(browser, &left);
+ IWebBrowser2_get_Top(browser, &top);
+
+ if (left + width > workWidth) {
+ IWebBrowser2_put_Left(browser, 0);
+ }
+ if (top + height > workHeight) {
+ IWebBrowser2_put_Top(browser, 0);
+ }
+
+ if (workWidth <= 1152) {
+ ShowWindow(ieHwnd, SW_MAXIMIZE);
+ }
+ }
+
+ IWebBrowser2_put_Visible(browser, TRUE);
+
+ // Focus the window, since it seems to not always get focus as it should.
+ SetForegroundWindow(ieHwnd);
+
+end:
+ if (!SUCCEEDED(hr)) {
+ MsgBox(NULL, GetMessageForHresult(hr), NULL, MB_ICONEXCLAMATION);
+ }
+
+ browser = NULL;
+ CoUninitialize();
+ PostQuitMessage(0);
+}
diff --git a/launcher/Log.c b/launcher/Log.c
new file mode 100644
index 0000000..29969a0
--- /dev/null
+++ b/launcher/Log.c
@@ -0,0 +1,11 @@
+#include "WULog.h"
+#include "MsgBox.h"
+
+void LaunchLog(int nCmdShow) {
+ HRESULT hr = ViewWindowsUpdateLog(nCmdShow);
+ if (!SUCCEEDED(hr)) {
+ MsgBox(NULL, GetMessageForHresult(hr), NULL, MB_OK);
+ }
+
+ PostQuitMessage(hr);
+}
diff --git a/launcher/Makefile b/launcher/Makefile
new file mode 100644
index 0000000..90fbe21
--- /dev/null
+++ b/launcher/Makefile
@@ -0,0 +1,8 @@
+all:
+ +$(MAKE) -f Makefile.actual ARCH=32
+ +$(MAKE) -f Makefile.actual ARCH=64
+
+clean:
+ rm -rf obj
+
+.PHONY: all clean
diff --git a/launcher/Makefile.actual b/launcher/Makefile.actual
new file mode 100644
index 0000000..469444d
--- /dev/null
+++ b/launcher/Makefile.actual
@@ -0,0 +1,126 @@
+FILES = \
+ $(wildcard *.c) \
+ ../shared/Exec.c \
+ ../shared/HResult.c \
+ ../shared/LegacyUpdate.c \
+ ../shared/LoadImage.c \
+ ../shared/Registry.c \
+ ../shared/VersionInfo.c \
+ ../shared/Wow64.c
+RCFILES = resource.rc
+DEFFILES = ../LegacyUpdate/LegacyUpdate.def
+
+ARCH ?= 32
+
+ifeq ($(ARCH),64)
+TAG = x86_64
+else
+TAG = i686
+endif
+
+PREFIX = $(TAG)-w64-mingw32-
+
+BIN = obj/LegacyUpdate$(ARCH).exe
+OBJ = $(foreach file,$(FILES),obj/$(notdir $(basename $(file)).$(TAG).o))
+RES = $(foreach file,$(RCFILES),obj/$(notdir $(basename $(file)).$(TAG).res))
+DEFDLL = $(foreach file,$(DEFFILES),obj/lib$(notdir $(basename $(file)).$(TAG).a))
+
+CC = $(PREFIX)g++
+RC = $(PREFIX)windres
+DLLTOOL = $(PREFIX)dlltool
+
+override DEBUG := $(or $(DEBUG),1)
+
+CFLAGS = \
+ -mwindows \
+ -municode \
+ -DUNICODE \
+ -D_UNICODE \
+ $(if $(filter 1,$(DEBUG)),-D_DEBUG -g,-DNDEBUG -Os) \
+ -s \
+ -fPIE \
+ -ffunction-sections \
+ -fdata-sections \
+ -fno-unwind-tables \
+ -fno-asynchronous-unwind-tables \
+ -fno-exceptions \
+ -flto \
+ -Wno-write-strings \
+ -I../include \
+ -I../shared \
+ -include stdafx.h
+
+CXXFLAGS = \
+ $(CFLAGS) \
+ -std=c++11 \
+ -fno-rtti
+
+LDFLAGS = \
+ -nodefaultlibs \
+ -nostartfiles \
+ -nostdlib \
+ -Wl,--gc-sections \
+ -Wl,--no-seh \
+ -Wl,--nxcompat \
+ -Wl,--enable-auto-image-base \
+ -Wl,--enable-stdcall-fixup \
+ -Wl,--strip-all \
+ -Lobj \
+ -lmsvcrt \
+ -lgcc \
+ -lpsapi \
+ -lkernel32 \
+ -luser32 \
+ -lole32 \
+ -loleaut32 \
+ -ladvapi32 \
+ -lcomctl32 \
+ -lshell32 \
+ -lversion \
+ -lgdi32 \
+ -lmsimg32
+
+RCFLAGS = \
+ -O coff \
+ -I../shared
+
+ifeq ($(ARCH),64)
+ LDFLAGS += -Wl,-ewWinMain
+ RCFLAGS += -F pe-x86-64
+else
+ CFLAGS += -march=i486
+ LDFLAGS += -Wl,-e_wWinMain
+ RCFLAGS += -F pe-i386
+endif
+
+all: before-all $(DEFDLL) $(BIN)
+ifeq ($(SIGN),1)
+ ../build/sign.sh $(BIN)
+endif
+
+before-all:
+ mkdir -p obj
+
+$(BIN): $(OBJ) $(RES)
+ $(CC) $^ $(CFLAGS) $(LDFLAGS) -o $@
+
+obj/%.$(TAG).o: %.c
+ $(CC) -x c $< $(CFLAGS) -c -o $@
+
+obj/%.$(TAG).o: ../shared/%.c
+ $(CC) -x c $< $(CFLAGS) -c -o $@
+
+obj/%.$(TAG).res: %.rc
+ $(RC) $< $(RCFLAGS) -o $@
+
+obj/lib%.$(TAG).a: ../LegacyUpdate/%.def
+ $(DLLTOOL) -d $< -l $@ -D $(notdir $(basename $<).dll)
+
+clean:
+ rm -rf obj
+
+test:
+ +$(MAKE) DEBUG=$(DEBUG)
+ ./obj/LegacyUpdate.exe
+
+.PHONY: all before-all clean test
diff --git a/launcher/MsgBox.c b/launcher/MsgBox.c
new file mode 100644
index 0000000..1be81b1
--- /dev/null
+++ b/launcher/MsgBox.c
@@ -0,0 +1,82 @@
+#include "stdafx.h"
+#include "main.h"
+#include "resource.h"
+
+#undef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_VISTA
+#include
+
+typedef HRESULT (WINAPI *_TaskDialogIndirect)(const TASKDIALOGCONFIG *pTaskConfig, int *pnButton, int *pnRadioButton, BOOL *pfVerificationFlagChecked);
+
+static BOOL _loadedTaskDialog = FALSE;
+static _TaskDialogIndirect $TaskDialogIndirect;
+
+int MsgBox(HWND hwnd, LPCTSTR instruction, LPCTSTR body, UINT type) {
+ if (!_loadedTaskDialog) {
+ _loadedTaskDialog = TRUE;
+ $TaskDialogIndirect = (_TaskDialogIndirect)GetProcAddress(LoadLibrary(L"comctl32.dll"), "TaskDialogIndirect");
+ }
+
+ // Play the sound matching the icon, because MB_USERICON doesn't play a sound
+ MessageBeep(type & 0x000000F0);
+ type = (type & ~0x000000F0) | MB_USERICON;
+
+ if (!$TaskDialogIndirect) {
+ LPWSTR finalBody = (LPWSTR)instruction;
+ if (body && lstrlen(body) > 0) {
+ size_t length = lstrlen(instruction) + lstrlen(body) + 3;
+ finalBody = (LPWSTR)LocalAlloc(LPTR, length * sizeof(TCHAR));
+ wsprintf(finalBody, L"%s\n\n%s", instruction, body);
+ }
+
+ MSGBOXPARAMS params = { 0 };
+ params.cbSize = sizeof(MSGBOXPARAMS);
+ params.hwndOwner = hwnd;
+ params.hInstance = GetModuleHandle(NULL);
+ params.lpszText = finalBody;
+ params.lpszCaption = L"Legacy Update";
+ params.dwStyle = type;
+ params.lpszIcon = MAKEINTRESOURCE(IDI_APPICON);
+ int result = MessageBoxIndirect(¶ms);
+
+ if (finalBody != body) {
+ LocalFree(finalBody);
+ }
+
+ return result;
+ }
+
+ TASKDIALOG_COMMON_BUTTON_FLAGS buttons;
+ DWORD flags = TDF_POSITION_RELATIVE_TO_WINDOW;
+
+ switch (type & 0x0000000F) {
+ case MB_OK:
+ buttons = TDCBF_OK_BUTTON;
+ flags |= TDF_ALLOW_DIALOG_CANCELLATION;
+ break;
+ case MB_OKCANCEL:
+ buttons = TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON;
+ flags |= TDF_ALLOW_DIALOG_CANCELLATION;
+ break;
+ case MB_YESNO:
+ buttons = TDCBF_YES_BUTTON | TDCBF_NO_BUTTON;
+ break;
+ default:
+ break;
+ }
+
+ TASKDIALOGCONFIG config = { 0 };
+ config.cbSize = sizeof(TASKDIALOGCONFIG);
+ config.hwndParent = hwnd;
+ config.hInstance = GetModuleHandle(NULL);
+ config.dwFlags = flags;
+ config.dwCommonButtons = buttons;
+ config.pszWindowTitle = L"Legacy Update";
+ config.pszMainInstruction = instruction;
+ config.pszContent = body;
+ config.pszMainIcon = MAKEINTRESOURCE(IDI_APPICON);
+
+ int button;
+ $TaskDialogIndirect(&config, &button, NULL, NULL);
+ return button;
+}
diff --git a/launcher/MsgBox.h b/launcher/MsgBox.h
new file mode 100644
index 0000000..d8ac9c7
--- /dev/null
+++ b/launcher/MsgBox.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+int MsgBox(HWND hwnd, LPCTSTR instruction, LPCTSTR body, UINT type);
diff --git a/launcher/Options.c b/launcher/Options.c
new file mode 100644
index 0000000..4f502d5
--- /dev/null
+++ b/launcher/Options.c
@@ -0,0 +1,40 @@
+#include
+#include "Exec.h"
+#include "VersionInfo.h"
+#include "Wow64.h"
+
+void LaunchOptions(int nCmdShow) {
+#if !_WIN64
+ // Some issues arise from the working directory being SysWOW64 rather than System32. Notably,
+ // Windows Vista - 8.1 don't have wuauclt.exe in SysWOW64. Disable WOW64 redirection temporarily
+ // to work around this.
+ PVOID oldValue;
+ BOOL isRedirected = DisableWow64FsRedirection(&oldValue);
+#endif
+
+ HRESULT hr;
+
+ if (AtLeastWin10()) {
+ // Windows 10+: Open Settings app
+ hr = Exec(NULL, L"ms-settings:windowsupdate-options", NULL, NULL, SW_SHOWDEFAULT, FALSE, NULL);
+ } else if (AtLeastWinVista()) {
+ // Windows Vista, 7, 8: Open Windows Update control panel
+ WCHAR wuauclt[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\wuauclt.exe", wuauclt, ARRAYSIZE(wuauclt));
+ hr = Exec(NULL, wuauclt, L"/ShowOptions", NULL, SW_SHOWDEFAULT, FALSE, NULL);
+ } else {
+ // Windows 2000, XP: Open Automatic Updates control panel
+ WCHAR wuaucpl[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\wuaucpl.cpl", wuaucpl, ARRAYSIZE(wuaucpl));
+ hr = Exec(NULL, wuaucpl, NULL, NULL, SW_SHOWDEFAULT, FALSE, NULL);
+ }
+
+#if !_WIN64
+ // Revert WOW64 redirection if we changed it
+ if (isRedirected) {
+ RevertWow64FsRedirection(oldValue);
+ }
+#endif
+
+ PostQuitMessage(hr);
+}
diff --git a/launcher/RegisterServer.c b/launcher/RegisterServer.c
new file mode 100644
index 0000000..1391d9e
--- /dev/null
+++ b/launcher/RegisterServer.c
@@ -0,0 +1,153 @@
+#include
+#include "Exec.h"
+#include "HResult.h"
+#include "LegacyUpdate.h"
+#include "MsgBox.h"
+#include "Registry.h"
+#include "SelfElevate.h"
+#include "User.h"
+#include "VersionInfo.h"
+#include "Wow64.h"
+
+static HRESULT RegisterDllInternal(LPWSTR path, BOOL state) {
+ HMODULE module = LoadLibrary(path);
+ if (!module) {
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ HRESULT hr = S_OK;
+ FARPROC proc = GetProcAddress(module, state ? "DllRegisterServer" : "DllUnregisterServer");
+ if (!proc) {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ goto end;
+ }
+
+ hr = ((HRESULT (WINAPI *)())proc)();
+
+end:
+ if (module) {
+ FreeLibrary(module);
+ }
+
+ return hr;
+}
+
+static HRESULT RegisterDllExternal(LPWSTR path, BOOL state) {
+ WCHAR regsvr32[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\regsvr32.exe", regsvr32, ARRAYSIZE(regsvr32));
+
+ LPWSTR args = (LPWSTR)LocalAlloc(LPTR, (lstrlen(path) + 6) * sizeof(WCHAR));
+ wsprintf(args, L"/s %ls\"%ls\"", state ? L"" : L"/u ", path);
+
+ DWORD status;
+ HRESULT hr = Exec(NULL, regsvr32, args, NULL, SW_HIDE, TRUE, &status);
+ if (!SUCCEEDED(hr)) {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ return hr;
+ }
+
+ if (status != 0) {
+ // Run again without /s, so the user can see the error
+ wsprintf(args, L"%ls\"%ls\"", state ? L"" : L"/u ", path);
+ hr = Exec(NULL, regsvr32, args, NULL, SW_SHOWDEFAULT, TRUE, &status);
+ }
+
+ return status == 0 ? S_OK : E_FAIL;
+}
+
+HRESULT RegisterServer(HWND hwnd, BOOL state, BOOL forLaunch) {
+ // Ensure elevation
+ HRESULT hr = S_OK;
+ LPWSTR installPath;
+ LPWSTR dllPath;
+
+ if (!IsUserAdmin()) {
+ LPWSTR args = (LPWSTR)LocalAlloc(LPTR, 512 * sizeof(WCHAR));
+ wsprintf(args, L"%ls %i", state ? L"/regserver" : L"/unregserver", hwnd);
+ DWORD code;
+ hr = SelfElevate(args, &code);
+ if (!SUCCEEDED(hr)) {
+ // Ignore error on cancelling UAC dialog
+ if (hr == HRESULT_FROM_WIN32(ERROR_CANCELLED)) {
+ hr = S_OK;
+ }
+ goto end;
+ }
+
+ hr = HRESULT_FROM_WIN32(code);
+ goto end;
+ }
+
+ hr = GetInstallPath(&installPath);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ dllPath = (LPWSTR)LocalAlloc(LPTR, MAX_PATH * sizeof(WCHAR));
+ wsprintf(dllPath, L"%ls\\LegacyUpdate.dll", installPath);
+
+#ifdef _DEBUG
+ // Warn if registration path differs, to help with debugging
+ LPWSTR currentPath;
+ hr = GetRegistryString(HKEY_CLASSES_ROOT, L"CLSID\\{AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F}\\InprocServer32", NULL, KEY_WOW64_64KEY, ¤tPath, NULL);
+ if (SUCCEEDED(hr) && wcscmp(currentPath, dllPath) != 0) {
+ if (MsgBox(hwnd, L"DEBUG: Native dll currently registered at a different path. Override?", currentPath, MB_YESNO) != IDYES) {
+ hr = S_OK;
+ goto end;
+ }
+ }
+#endif
+
+ hr = RegisterDllInternal(dllPath, state);
+ if (!SUCCEEDED(hr)) {
+ // Try external registration
+ if (SUCCEEDED(RegisterDllExternal(dllPath, state))) {
+ hr = S_OK;
+ } else {
+ goto end;
+ }
+ }
+
+#if _WIN64
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ wsprintf(dllPath, L"%ls\\LegacyUpdate32.dll", installPath);
+
+#ifdef _DEBUG
+ // Warn if registration path differs, to help with debugging
+ hr = GetRegistryString(HKEY_CLASSES_ROOT, L"CLSID\\{AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F}\\InprocServer32", NULL, KEY_WOW64_32KEY, ¤tPath, NULL);
+ if (SUCCEEDED(hr) && wcscmp(currentPath, dllPath) != 0) {
+ if (MsgBox(hwnd, L"DEBUG: 32-bit dll currently registered at a different path. Override?", currentPath, MB_YESNO) != IDYES) {
+ hr = S_OK;
+ goto end;
+ }
+ }
+#endif
+
+ hr = RegisterDllExternal(dllPath, state);
+#endif
+
+end:
+ if (installPath) {
+ LocalFree(installPath);
+ }
+
+ if (dllPath) {
+ LocalFree(dllPath);
+ }
+
+ if (!SUCCEEDED(hr)) {
+ LPWSTR title = state
+ ? L"Failed to register Legacy Update ActiveX control"
+ : L"Failed to unregister Legacy Update ActiveX control";
+ MsgBox(hwnd, title, GetMessageForHresult(hr), MB_ICONERROR);
+ }
+
+ if (!forLaunch) {
+ PostQuitMessage(hr);
+ }
+
+ return hr;
+}
diff --git a/launcher/RegisterServer.h b/launcher/RegisterServer.h
new file mode 100644
index 0000000..d0eb6e7
--- /dev/null
+++ b/launcher/RegisterServer.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+HRESULT RegisterServer(HWND hwnd, BOOL state, BOOL forLaunch);
diff --git a/launcher/SelfElevate.c b/launcher/SelfElevate.c
new file mode 100644
index 0000000..51df3e0
--- /dev/null
+++ b/launcher/SelfElevate.c
@@ -0,0 +1,12 @@
+#include "SelfElevate.h"
+#include
+#include "Exec.h"
+#include "VersionInfo.h"
+
+HRESULT SelfElevate(LPWSTR args, LPDWORD code) {
+ LPWSTR fileName;
+ GetOwnFileName(&fileName);
+ HRESULT hr = Exec(L"runas", fileName, args, NULL, SW_SHOWDEFAULT, TRUE, code);
+ LocalFree(fileName);
+ return hr;
+}
diff --git a/launcher/SelfElevate.h b/launcher/SelfElevate.h
new file mode 100644
index 0000000..531edae
--- /dev/null
+++ b/launcher/SelfElevate.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+HRESULT SelfElevate(LPWSTR args, LPDWORD code);
diff --git a/launcher/main.c b/launcher/main.c
new file mode 100644
index 0000000..d2a6863
--- /dev/null
+++ b/launcher/main.c
@@ -0,0 +1,138 @@
+#include "stdafx.h"
+#include "main.h"
+#include "resource.h"
+#include
+#include
+#include "MsgBox.h"
+#include "RegisterServer.h"
+#include "Startup.h"
+
+HINSTANCE g_hInstance;
+
+extern void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow);
+extern void LaunchOptions(int nCmdShow);
+extern void LaunchLog(int nCmdShow);
+extern void RunOnce();
+
+typedef enum Action {
+ ActionLaunch,
+ ActionOptions,
+ ActionLog,
+ ActionRunOnce,
+ ActionRegServer,
+ ActionUnregServer
+} Action;
+
+static const LPWSTR actions[] = {
+ L"/launch",
+ L"/options",
+ L"/log",
+ L"/runonce",
+ L"/regserver",
+ L"/unregserver",
+ NULL
+};
+
+EXTERN_C __declspec(dllexport)
+int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine, int nCmdShow) {
+ g_hInstance = hInstance;
+ Startup();
+
+ HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
+ if (!SUCCEEDED(hr)) {
+ ExitProcess(hr);
+ return hr;
+ }
+
+ int argc;
+ LPWSTR *argv = CommandLineToArgvW(GetCommandLineW(), &argc);
+
+ LPWSTR actionFlag = L"/launch";
+ if (argc > 1) {
+ actionFlag = argv[1];
+ }
+
+ // All remaining args past the action
+ LPWSTR *flags = {0};
+ int flagsCount = 0;
+ if (argc > 2) {
+ flags = &argv[2];
+ flagsCount = argc - 2;
+ }
+
+ Action action = -1;
+
+ for (int i = 0; actions[i] != NULL; i++) {
+ if (wcscmp(actionFlag, actions[i]) == 0) {
+ action = i;
+ break;
+ }
+ }
+
+ switch (action) {
+ case ActionLaunch:
+ LaunchUpdateSite(flagsCount, flags, nCmdShow);
+ break;
+
+ case ActionOptions:
+ LaunchOptions(nCmdShow);
+ break;
+
+ case ActionLog:
+ LaunchLog(nCmdShow);
+ break;
+
+ case ActionRunOnce:
+ RunOnce();
+ break;
+
+ case ActionRegServer:
+ case ActionUnregServer: {
+ BOOL state = action == ActionRegServer;
+ HWND hwnd = flagsCount > 0 ? (HWND)(intptr_t)wcstol(flags[0], NULL, 10) : 0;
+ RegisterServer(hwnd, state, FALSE);
+ break;
+ }
+
+ default: {
+ const LPWSTR usage = L""
+ L"LegacyUpdate.exe [/launch|/regserver|/unregserver]\n"
+ L"\n"
+ L"/launch\n"
+ L" Launch Legacy Update website in Internet Explorer\n"
+ L"\n"
+ L"/options\n"
+ L" Open the Windows Update Options control panel\n"
+ L"\n"
+ L"/log\n"
+ L" Open the Windows Update log file\n"
+ L"\n"
+ L"/regserver\n"
+ L" Register ActiveX control\n"
+ L"\n"
+ L"/unregserver\n"
+ L" Unregister ActiveX control\n"
+ L"\n"
+ L"If no parameters are provided, /launch is assumed.";
+ MsgBox(NULL, L"LegacyUpdate.exe usage", usage, MB_OK);
+ PostQuitMessage(1);
+ break;
+ }
+ }
+
+ MSG msg;
+ while (GetMessage(&msg, NULL, 0, 0) == 1) {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+
+ switch (msg.message) {
+ case WM_QUIT:
+ case WM_DESTROY:
+ break;
+ }
+ }
+
+ CoUninitialize();
+ ExitProcess(msg.wParam);
+ return msg.wParam;
+}
diff --git a/launcher/main.h b/launcher/main.h
new file mode 100644
index 0000000..ab66e76
--- /dev/null
+++ b/launcher/main.h
@@ -0,0 +1 @@
+EXTERN_C HINSTANCE g_hInstance;
diff --git a/launcher/manifest.xml b/launcher/manifest.xml
new file mode 100644
index 0000000..7829b23
--- /dev/null
+++ b/launcher/manifest.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ PerMonitorV2
+
+
+
diff --git a/launcher/resource.h b/launcher/resource.h
new file mode 100644
index 0000000..d0fa0e2
--- /dev/null
+++ b/launcher/resource.h
@@ -0,0 +1,11 @@
+#define IDR_CPLTASKS 202
+
+#define IDI_APPICON 100
+
+#define IDS_LEGACYUPDATEOCX 1
+#define IDS_LEGACYUPDATE 2
+#define IDS_CHECKFORUPDATES 3
+#define IDS_CHECKFORUPDATES_ALT 4
+#define IDS_IENOTINSTALLED 5
+
+#define ID_MANIFEST 1
diff --git a/launcher/resource.rc b/launcher/resource.rc
new file mode 100644
index 0000000..e12b391
--- /dev/null
+++ b/launcher/resource.rc
@@ -0,0 +1,95 @@
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+#include
+#include "Version.h"
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (United States) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(65001)
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_BUILD
+ PRODUCTVERSION VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_BUILD
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904b0"
+ BEGIN
+ VALUE "CompanyName", "Hashbang Productions"
+ VALUE "FileDescription", "Legacy Update"
+ VALUE "FileVersion", VERSION_STRING
+ VALUE "InternalName", "LegacyUpdate.exe"
+ VALUE "LegalCopyright", "© Hashbang Productions. All rights reserved."
+ VALUE "OriginalFilename", "LegacyUpdate.exe"
+ VALUE "ProductName", "Legacy Update"
+ VALUE "ProductVersion", VERSION_STRING
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1200
+ END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_APPICON ICON "../LegacyUpdate/icon.ico"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// XML
+//
+
+IDR_CPLTASKS XML "CplTasks.xml"
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE
+BEGIN
+ IDS_LEGACYUPDATEOCX "Legacy Update Control"
+ IDS_LEGACYUPDATE "Legacy Update"
+ IDS_CHECKFORUPDATES "Check for updates"
+ IDS_CHECKFORUPDATES_ALT "Check for software and driver updates via Legacy Update."
+ IDS_IENOTINSTALLED "Internet Explorer is not installed. Use Optional Features in Control Panel to install it before using Legacy Update."
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Manifest
+//
+
+ID_MANIFEST RT_MANIFEST "manifest.xml"
+
+#endif // English (United States) resources
+/////////////////////////////////////////////////////////////////////////////
diff --git a/launcher/stdafx.h b/launcher/stdafx.h
new file mode 100644
index 0000000..8d28b3b
--- /dev/null
+++ b/launcher/stdafx.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#ifndef STRICT
+#define STRICT
+#endif
+
+#define WINVER _WIN32_WINNT_WIN2K
+#define _WIN32_WINNT _WIN32_WINNT_WIN2K
+
+// Use msvcrt stdio functions
+#define __USE_MINGW_ANSI_STDIO 0
+
+// Enable comctl 6.0 (visual styles)
+#define ISOLATION_AWARE_ENABLED 1
+
+// Enable COM C interfaces
+#define CINTERFACE
+#define COBJMACROS
+#define INITGUID
+
+#include "resource.h"
+#include
+#include "Trace.h"
diff --git a/nsisplugin/CloseIEWindows.c b/nsisplugin/CloseIEWindows.c
new file mode 100644
index 0000000..4299942
--- /dev/null
+++ b/nsisplugin/CloseIEWindows.c
@@ -0,0 +1,64 @@
+#include
+#include
+#include
+
+const LPWSTR LegacyUpdateSiteURLHttp = L"http://legacyupdate.net/";
+const LPWSTR LegacyUpdateSiteURLHttps = L"https://legacyupdate.net/";
+
+PLUGIN_METHOD(CloseIEWindows) {
+ PLUGIN_INIT();
+
+ // Find and close IE windows that might have the ActiveX control loaded
+ IShellWindows *windows;
+ HRESULT hr = CoCreateInstance(&CLSID_ShellWindows, NULL, CLSCTX_ALL, &IID_IShellWindows, (void **)&windows);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ long count;
+ hr = IShellWindows_get_Count(windows, &count);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ VARIANT index = {0};
+ index.vt = VT_I4;
+
+ for (long i = 0; i <= count; i++) {
+ IDispatch *item;
+ index.lVal = i;
+
+ hr = IShellWindows_Item(windows, index, &item);
+ if (!SUCCEEDED(hr) || !item) {
+ continue;
+ }
+
+ IWebBrowser2 *browser;
+ hr = IDispatch_QueryInterface(item, &IID_IWebBrowser2, (void **)&browser);
+ IDispatch_Release(item);
+ if (!SUCCEEDED(hr)) {
+ continue;
+ }
+
+ BSTR location;
+ hr = IWebBrowser2_get_LocationURL(browser, &location);
+ if (!SUCCEEDED(hr)) {
+ IWebBrowser2_Release(browser);
+ continue;
+ }
+
+ if (wcsstr(location, LegacyUpdateSiteURLHttp) != NULL || wcsstr(location, LegacyUpdateSiteURLHttps) != NULL) {
+ hr = IWebBrowser2_Quit(browser);
+ }
+
+ SysFreeString(location);
+ IWebBrowser2_Release(browser);
+ }
+
+end:
+ if (windows) {
+ IShellWindows_Release(windows);
+ }
+
+ pushint(hr);
+}
diff --git a/nsisplugin/DialogInit.c b/nsisplugin/DialogInit.c
new file mode 100644
index 0000000..7562090
--- /dev/null
+++ b/nsisplugin/DialogInit.c
@@ -0,0 +1,377 @@
+#include "stdafx.h"
+
+#undef _WIN32_WINNT
+#define _WIN32_WINNT _WIN32_WINNT_VISTA
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include "main.h"
+#include "LoadImage.h"
+#include "Registry.h"
+#include "VersionInfo.h"
+
+#ifndef WM_DWMCOMPOSITIONCHANGED
+#define WM_DWMCOMPOSITIONCHANGED 0x031e
+#endif
+
+#define DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1 19
+#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
+#define DWMWA_CAPTION_COLOR 35
+#define DWMWA_SYSTEMBACKDROP_TYPE 38
+#define DWMWA_COLOR_NONE 0xFFFFFFFE
+#define DWMSBT_MAINWINDOW 2
+
+#define IDI_BANNER_WORDMARK_LIGHT 1337
+#define IDI_BANNER_WORDMARK_DARK 1338
+#define IDI_BANNER_WORDMARK_GLOW 1339
+
+typedef HRESULT (WINAPI *_DwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS *pMarInset);
+typedef HRESULT (WINAPI *_DwmIsCompositionEnabled)(BOOL *pfEnabled);
+typedef HRESULT (WINAPI *_DwmDefWindowProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT *plResult);
+typedef HRESULT (WINAPI *_DwmSetWindowAttribute)(HWND hwnd, DWORD dwAttribute, LPCVOID pvAttribute, DWORD cbAttribute);
+typedef HRESULT (WINAPI *_SetWindowThemeAttribute)(HWND hwnd, enum WINDOWTHEMEATTRIBUTETYPE eAttribute, PVOID pvAttribute, DWORD cbAttribute);
+typedef BOOL (WINAPI *_IsThemeActive)();
+typedef HTHEME (WINAPI *_OpenThemeData)(HWND hwnd, LPCWSTR pszClassList);
+typedef HRESULT (WINAPI *_CloseThemeData)(HTHEME hTheme);
+typedef HRESULT (WINAPI *_DrawThemeBackground)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect);
+
+static _DwmExtendFrameIntoClientArea $DwmExtendFrameIntoClientArea;
+static _DwmIsCompositionEnabled $DwmIsCompositionEnabled;
+static _DwmDefWindowProc $DwmDefWindowProc;
+static _DwmSetWindowAttribute $DwmSetWindowAttribute;
+static _SetWindowThemeAttribute $SetWindowThemeAttribute;
+static _IsThemeActive $IsThemeActive;
+static _OpenThemeData $OpenThemeData;
+static _CloseThemeData $CloseThemeData;
+static _DrawThemeBackground $DrawThemeBackground;
+
+typedef enum Theme {
+ ThemeUnknown = -1,
+ ThemeClassic,
+ ThemeBasic,
+ ThemeAeroLight,
+ ThemeAeroDark
+} Theme;
+
+static HBITMAP g_bannerWordmark;
+static HBITMAP g_bannerWordmarkGlow;
+static HTHEME g_aeroTheme;
+static Theme g_theme = ThemeUnknown;
+
+static WNDPROC g_dialogOrigWndProc;
+static WNDPROC g_bannerOrigWndProc;
+static WNDPROC g_bottomOrigWndProc;
+
+static Theme GetTheme() {
+ BOOL enabled;
+ if (!$DwmIsCompositionEnabled || !$IsThemeActive || !SUCCEEDED($DwmIsCompositionEnabled(&enabled))) {
+ return ThemeClassic;
+ }
+
+ if (enabled) {
+ DWORD light = 1;
+ if (AtLeastWin10_1809()) {
+ GetRegistryDword(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", L"AppsUseLightTheme", 0, &light);
+ }
+ return light ? ThemeAeroLight : ThemeAeroDark;
+ }
+
+ return $IsThemeActive() ? ThemeBasic : ThemeClassic;
+}
+
+static void ConfigureWindow() {
+ HWND bannerWindow = GetDlgItem(g_hwndParent, 1046);
+ HWND bannerDivider = GetDlgItem(g_hwndParent, 1047);
+ HWND bottomDivider = GetDlgItem(g_hwndParent, 6900);
+ if (!bannerWindow || !bannerDivider || !bottomDivider) {
+ return;
+ }
+
+ Theme theme = GetTheme();
+ if (g_theme != theme) {
+ g_theme = theme;
+ MARGINS margins = {0};
+
+ if (theme >= ThemeAeroLight) {
+ // Set glass area
+ RECT rect;
+ GetWindowRect(bannerWindow, &rect);
+ margins.cyTopHeight = rect.bottom - rect.top;
+ }
+
+ if ($DwmExtendFrameIntoClientArea) {
+ $DwmExtendFrameIntoClientArea(g_hwndParent, &margins);
+ }
+
+ ShowWindow(bannerDivider, theme >= ThemeBasic ? SW_HIDE : SW_SHOW);
+ ShowWindow(bottomDivider, theme >= ThemeBasic ? SW_HIDE : SW_SHOW);
+
+ if (g_theme >= ThemeBasic) {
+ DWORD wordmark = g_theme == ThemeAeroDark ? IDI_BANNER_WORDMARK_DARK : IDI_BANNER_WORDMARK_LIGHT;
+ g_bannerWordmark = LoadPNGResource(NULL, MAKEINTRESOURCE(wordmark), L"PNG");
+ if (g_theme >= ThemeAeroLight && AtMostWin7()) {
+ g_bannerWordmarkGlow = LoadPNGResource(NULL, MAKEINTRESOURCE(IDI_BANNER_WORDMARK_GLOW), L"PNG");
+ }
+ } else {
+ DeleteObject(g_bannerWordmark);
+ DeleteObject(g_bannerWordmarkGlow);
+ g_bannerWordmark = NULL;
+ g_bannerWordmarkGlow = NULL;
+ }
+
+ // Set dark mode state
+ if (AtLeastWin10_1809() && $DwmSetWindowAttribute) {
+ DWORD attr = AtLeastWin10_2004() ? DWMWA_USE_IMMERSIVE_DARK_MODE : DWMWA_USE_IMMERSIVE_DARK_MODE_BEFORE_20H1;
+ DWORD value = g_theme == ThemeAeroDark;
+ $DwmSetWindowAttribute(g_hwndParent, attr, &value, sizeof(value));
+ }
+ }
+}
+
+static LRESULT CALLBACK BannerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ if (g_theme < ThemeBasic) {
+ return CallWindowProc(g_bannerOrigWndProc, hwnd, uMsg, wParam, lParam);
+ }
+
+ switch (uMsg) {
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd, &ps);
+ RECT rect;
+ GetClientRect(hwnd, &rect);
+
+ // Draw base color for glass area
+ FillRect(hdc, &rect, GetStockObject(BLACK_BRUSH));
+
+ // Draw Aero Basic titlebar
+ if (g_theme == ThemeBasic && g_aeroTheme && $DrawThemeBackground) {
+ int state = GetActiveWindow() == g_hwndParent ? AW_S_TITLEBAR_ACTIVE : AW_S_TITLEBAR_INACTIVE;
+ $DrawThemeBackground(g_aeroTheme, hdc, AW_TITLEBAR, state, &rect, NULL);
+ }
+
+ float scale = (float)GetDeviceCaps(hdc, LOGPIXELSX) / 96.0f;
+
+ BLENDFUNCTION blendFunc;
+ blendFunc.BlendOp = AC_SRC_OVER;
+ blendFunc.BlendFlags = 0;
+ blendFunc.SourceConstantAlpha = 0xFF;
+ blendFunc.AlphaFormat = AC_SRC_ALPHA;
+
+ // Draw wordmark with alpha blending
+ if (g_bannerWordmarkGlow) {
+ HDC hdcMem = CreateCompatibleDC(hdc);
+ HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_bannerWordmarkGlow);
+
+ BITMAP bitmap;
+ GetObject(g_bannerWordmarkGlow, sizeof(bitmap), &bitmap);
+
+ LONG width = bitmap.bmWidth * scale;
+ LONG height = bitmap.bmHeight * scale;
+ LONG x = (rect.right - rect.left - width) / 2;
+ LONG y = (rect.bottom - rect.top - height) / 2;
+
+ SetStretchBltMode(hdc, HALFTONE);
+ AlphaBlend(hdc,
+ x, y, width, height, hdcMem,
+ 0, 0, bitmap.bmWidth, bitmap.bmHeight, blendFunc);
+
+ SelectObject(hdcMem, hbmOld);
+ DeleteDC(hdcMem);
+ }
+
+ if (g_bannerWordmark) {
+ HDC hdcMem = CreateCompatibleDC(hdc);
+ HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, g_bannerWordmark);
+
+ BITMAP bitmap;
+ GetObject(g_bannerWordmark, sizeof(bitmap), &bitmap);
+
+ LONG width = bitmap.bmWidth * scale;
+ LONG height = bitmap.bmHeight * scale;
+ LONG x = (rect.right - rect.left - width) / 2;
+ LONG y = ((rect.bottom - rect.top - height) / 2) - (1 * scale);
+
+ SetStretchBltMode(hdc, HALFTONE);
+ AlphaBlend(hdc,
+ x, y, width, height, hdcMem,
+ 0, 0, bitmap.bmWidth, bitmap.bmHeight, blendFunc);
+
+ SelectObject(hdcMem, hbmOld);
+ DeleteDC(hdcMem);
+ }
+
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
+
+ case WM_ERASEBKGND:
+ return DefWindowProc(hwnd, uMsg, wParam, lParam);
+
+ case WM_NCHITTEST:
+ // Pass through to parent
+ return HTTRANSPARENT;
+ }
+
+ if (!g_bannerOrigWndProc) {
+ return 0;
+ }
+
+ return CallWindowProc(g_bannerOrigWndProc, hwnd, uMsg, wParam, lParam);
+}
+
+static LRESULT CALLBACK BottomWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ switch (uMsg) {
+ case WM_PAINT: {
+ // Draw command area background (grey with divider line)
+ if (g_theme < ThemeBasic || !g_aeroTheme || !$DrawThemeBackground) {
+ break;
+ }
+
+ PAINTSTRUCT ps;
+ HDC hdc = BeginPaint(hwnd, &ps);
+
+ RECT rect;
+ GetClientRect(hwnd, &rect);
+ $DrawThemeBackground(g_aeroTheme, hdc, AW_COMMANDAREA, 0, &rect, NULL);
+
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
+ }
+
+ if (!g_bottomOrigWndProc) {
+ return 0;
+ }
+
+ return CallWindowProc(g_bottomOrigWndProc, hwnd, uMsg, wParam, lParam);
+}
+
+static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) {
+ if (g_theme >= ThemeAeroLight && $DwmDefWindowProc) {
+ LRESULT lRet = 0;
+ if ($DwmDefWindowProc(hwnd, uMsg, wParam, lParam, &lRet)) {
+ return lRet;
+ }
+ }
+
+ switch (uMsg) {
+ case WM_THEMECHANGED:
+ case WM_DWMCOMPOSITIONCHANGED:
+ ConfigureWindow();
+ break;
+
+ case WM_ACTIVATE:
+ case WM_NCACTIVATE:
+ // Redraw banner on activation
+ if (g_theme == ThemeBasic) {
+ InvalidateRect(GetDlgItem(hwnd, 1046), NULL, FALSE);
+ }
+ break;
+
+ case WM_NCHITTEST: {
+ if (g_theme < ThemeBasic) {
+ break;
+ }
+
+ // Allow drag in the header area
+ HWND bannerWindow = GetDlgItem(hwnd, 1046);
+ if (!bannerWindow) {
+ break;
+ }
+
+ POINT hit = {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
+ ScreenToClient(hwnd, &hit);
+
+ RECT rect;
+ GetWindowRect(bannerWindow, &rect);
+ rect.right -= rect.left;
+ rect.bottom -= rect.top;
+ rect.left = 0;
+ rect.top = 0;
+
+ if (PtInRect(&rect, hit)) {
+ return HTCAPTION;
+ }
+ break;
+ }
+ }
+
+ if (!g_dialogOrigWndProc) {
+ return 0;
+ }
+
+ return CallWindowProc(g_dialogOrigWndProc, hwnd, uMsg, wParam, lParam);
+}
+
+static UINT_PTR NSISPluginCallback(enum NSPIM event) {
+ // Does nothing, but keeping a callback registered prevents NSIS from unloading the plugin
+ return 0;
+}
+
+PLUGIN_METHOD(DialogInit) {
+ PLUGIN_INIT();
+
+ if (g_dialogOrigWndProc) {
+ return;
+ }
+
+ extra->RegisterPluginCallback(g_hInstance, NSISPluginCallback);
+
+ // Get symbols
+ HMODULE dwmapi = LoadLibrary(L"dwmapi.dll");
+ if (dwmapi) {
+ $DwmExtendFrameIntoClientArea = (_DwmExtendFrameIntoClientArea)GetProcAddress(dwmapi, "DwmExtendFrameIntoClientArea");
+ $DwmIsCompositionEnabled = (_DwmIsCompositionEnabled)GetProcAddress(dwmapi, "DwmIsCompositionEnabled");
+ $DwmDefWindowProc = (_DwmDefWindowProc)GetProcAddress(dwmapi, "DwmDefWindowProc");
+ $DwmSetWindowAttribute = (_DwmSetWindowAttribute)GetProcAddress(dwmapi, "DwmSetWindowAttribute");
+ }
+
+ HMODULE uxtheme = LoadLibrary(L"uxtheme.dll");
+ if (uxtheme) {
+ $SetWindowThemeAttribute = (_SetWindowThemeAttribute)GetProcAddress(uxtheme, "SetWindowThemeAttribute");
+ $IsThemeActive = (_IsThemeActive)GetProcAddress(uxtheme, "IsThemeActive");
+ $OpenThemeData = (_OpenThemeData)GetProcAddress(uxtheme, "OpenThemeData");
+ $CloseThemeData = (_CloseThemeData)GetProcAddress(uxtheme, "CloseThemeData");
+ $DrawThemeBackground = (_DrawThemeBackground)GetProcAddress(uxtheme, "DrawThemeBackground");
+ }
+
+ // Get AeroWizard theme
+ if ($OpenThemeData) {
+ g_aeroTheme = $OpenThemeData(g_hwndParent, L"AeroWizard");
+ }
+
+ // Hide title caption/icon
+ if ($SetWindowThemeAttribute) {
+ WTA_OPTIONS options;
+ options.dwFlags = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON;
+ options.dwMask = WTNCA_NODRAWCAPTION | WTNCA_NODRAWICON;
+ $SetWindowThemeAttribute(g_hwndParent, WTA_NONCLIENT, &options, sizeof(options));
+ }
+
+ // Enable Acrylic blur
+ if (AtLeastWin11_21H1() && $DwmSetWindowAttribute) {
+ // I stole this undocumented 1029 attr from Microsoft Store's StoreInstaller.exe
+ BOOL modern = AtLeastWin11_22H2();
+ DWORD attr = modern ? DWMWA_SYSTEMBACKDROP_TYPE : 1029;
+ DWORD value = modern ? DWMSBT_MAINWINDOW : 1;
+ $DwmSetWindowAttribute(g_hwndParent, attr, &value, sizeof(value));
+
+ // Hide caption background
+ value = DWMWA_COLOR_NONE;
+ $DwmSetWindowAttribute(g_hwndParent, DWMWA_CAPTION_COLOR, &value, sizeof(value));
+ }
+
+ // Set up extended client frame
+ ConfigureWindow();
+
+ // Set up window procedures
+ HWND bannerWindow = GetDlgItem(g_hwndParent, 1046);
+ HWND bottomWindow = GetDlgItem(g_hwndParent, 6901);
+ g_dialogOrigWndProc = (WNDPROC)SetWindowLongPtr(g_hwndParent, GWLP_WNDPROC, (LONG_PTR)MainWndProc);
+ g_bannerOrigWndProc = (WNDPROC)SetWindowLongPtr(bannerWindow, GWLP_WNDPROC, (LONG_PTR)BannerWndProc);
+ g_bottomOrigWndProc = (WNDPROC)SetWindowLongPtr(bottomWindow, GWLP_WNDPROC, (LONG_PTR)BottomWndProc);
+}
diff --git a/nsisplugin/Exec.c b/nsisplugin/Exec.c
new file mode 100644
index 0000000..b77f484
--- /dev/null
+++ b/nsisplugin/Exec.c
@@ -0,0 +1,602 @@
+/*
+Copyright (C) 2002 Robert Rainwater
+Copyright (C) 2002-2023 Nullsoft and Contributors
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+*/
+#include
+#include
+#include
+#include // nsis plugin
+#include "main.h"
+
+#if defined(_MSC_VER) && !defined(GetVersion)
+#if _MSC_VER >= 1500
+FORCEINLINE DWORD NoDepr_GetVersion() { __pragma(warning(push))__pragma(warning(disable:4996)) DWORD r = GetVersion(); __pragma(warning(pop)) return r; }
+#define GetVersion NoDepr_GetVersion
+#endif //~ _MSC_VER >= 1500
+#endif //~ _MSC_VER
+
+#define TAB_REPLACE _T(" ")
+#define TAB_REPLACE_SIZE (sizeof(TAB_REPLACE) - sizeof(_T("")))
+#define TAB_REPLACE_CCH (TAB_REPLACE_SIZE / sizeof(_T("")))
+enum { MODE_IGNOREOUTPUT = 0, MODE_LINES = 1, MODE_STACK = 2 };
+
+#define LOOPTIMEOUT 100
+static HWND g_hwndList;
+
+static void ExecScript(BOOL log);
+static TCHAR *my_strstr(TCHAR *a, TCHAR *b);
+static unsigned int my_atoi(TCHAR *s);
+static int WINAPI AsExeWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow);
+
+PLUGIN_METHOD(Exec) {
+ PLUGIN_INIT();
+ ExecScript(MODE_IGNOREOUTPUT);
+}
+
+PLUGIN_METHOD(ExecToLog) {
+ PLUGIN_INIT();
+ ExecScript(extra->exec_flags->status_update & 1 ? MODE_LINES : MODE_IGNOREOUTPUT);
+}
+
+PLUGIN_METHOD(ExecToStack) {
+ PLUGIN_INIT();
+ ExecScript(MODE_STACK);
+}
+
+static BOOL IsLeadSurrogateUTF16(unsigned short c) { return c >= 0xd800 && c <= 0xdbff; }
+static BOOL IsTrailSurrogateUTF16(unsigned short c) { return c >= 0xdc00 && c <= 0xdfff; }
+
+static PWSTR MyCharNext(PCWSTR p)
+{
+ // Note: This is wrong for surrogate pair combining characters but CharNextW does
+ // not support surrogate pairs correctly so we have to manually handle the pairs.
+ if (!p[0]) return (PWSTR) p;
+ if (IsLeadSurrogateUTF16(p[0]) && IsTrailSurrogateUTF16(p[1])) return (PWSTR) p + 2; // Current is a surrogate pair, we incorrectly assume that it is not followed by combining characters.
+ if (IsLeadSurrogateUTF16(p[1]) && IsTrailSurrogateUTF16(p[2])) return (PWSTR) p + 1; // Next is a surrogate pair, we incorrectly assume that it is not a combining character for the current character.
+ return (CharNextW)(p);
+}
+#define CharNextW MyCharNext
+
+static void TruncateStringUTF16LE(LPWSTR Buffer, SIZE_T Length, LPCWSTR Overflow, SIZE_T lenOver) {
+ if (Length) {
+ LPWSTR p = &Buffer[Length - 1];
+ UINT stripBaseCharIfCuttingCombining = TRUE;
+
+ // CharNextW is buggy on XP&2003 but we don't care enough to call GetStringTypeW (http://archives.miloush.net/michkap/archive/2005/01/30/363420.html)
+ if (stripBaseCharIfCuttingCombining && lenOver) {
+ WCHAR buf[] = { *p, Overflow[0], lenOver > 1 ? Overflow[1] : L' ', L'\0' };
+ for (;;) {
+ BOOL comb = CharNextW(buf) > buf + 1;
+ if (!comb || p < Buffer) break;
+ *((WORD*)((BYTE*)&buf[1])) = *((WORD*)((BYTE*)&buf[0]));
+ buf[0] = *p;
+ *p-- = L'\0';
+ }
+ }
+
+ if (IsLeadSurrogateUTF16(*p)) {
+ *p = L'\0'; // Avoid incomplete pair
+ }
+ }
+}
+
+static void TruncateStringMB(UINT Codepage, LPSTR Buffer, SIZE_T Length, unsigned short OverflowCh) {
+ if (Length) {
+ CHAR *p = &Buffer[Length - 1], buf[] = { *p, ' ', ' ', '\0' };
+
+ if (CharNextExA(Codepage, buf, 0) > buf + 1) { // Remove incomplete DBCS character?
+ *p = '\0';
+ }
+ }
+}
+
+static BOOL IsWOW64() {
+#ifdef _WIN64
+ return FALSE;
+#else
+ typedef BOOL (WINAPI*ISWOW64PROCESS)(HANDLE, BOOL*);
+ ISWOW64PROCESS pfIsWow64Process;
+ typedef BOOL (WINAPI*ISWOW64PROCESS2)(HANDLE, USHORT*, USHORT*);
+ ISWOW64PROCESS2 pfIsWow64Process2;
+ HANDLE hProcess = GetCurrentProcess();
+ HMODULE hK32 = GetModuleHandleA("KERNEL32");
+ UINT_PTR retval;
+ USHORT appmach, image_file_machine_unknown = 0;
+ CHAR funcnam[16]
+#if defined(_MSC_VER) && (_MSC_VER-0 <= 1400)
+ = "IsWow64Process2"; // MOVSD * 4
+#else
+ ; lstrcpyA(funcnam, "IsWow64Process2");
+#endif
+ pfIsWow64Process2 = (ISWOW64PROCESS2) GetProcAddress(hK32, funcnam);
+ if (pfIsWow64Process2 && pfIsWow64Process2(hProcess, &appmach, NULL)) {
+ retval = image_file_machine_unknown != appmach;
+ }
+ else {
+ BOOL wow64;
+ pfIsWow64Process = (ISWOW64PROCESS) GetProcAddress(hK32, (funcnam[14] = '\0', funcnam));
+ retval = (UINT_PTR) pfIsWow64Process;
+ if (pfIsWow64Process && (retval = pfIsWow64Process(hProcess, &wow64))) {
+ retval = wow64;
+ }
+ }
+ return (BOOL) (UINT) retval;
+#endif
+}
+
+// Tim Kosse's LogMessage
+#ifdef UNICODE
+static void LogMessage(const TCHAR *pStr, BOOL bOEM) {
+#else
+static void LogMessage(TCHAR *pStr, BOOL bOEM) {
+#endif
+ LVITEM item;
+ int nItemCount;
+ if (!g_hwndList) return;
+ //if (!*pStr) return;
+#ifndef UNICODE
+ if (bOEM == TRUE) OemToCharBuff(pStr, pStr, lstrlen(pStr));
+#endif
+ nItemCount=(int) SendMessage(g_hwndList, LVM_GETITEMCOUNT, 0, 0);
+ item.mask=LVIF_TEXT;
+ item.pszText=(TCHAR *)pStr;
+ item.cchTextMax=0;
+ item.iItem=nItemCount, item.iSubItem=0;
+ ListView_InsertItem(g_hwndList, &item);
+ ListView_EnsureVisible(g_hwndList, item.iItem, 0);
+}
+
+
+void ExecScript(int mode) {
+ TCHAR szRet[128];
+ TCHAR meDLLPath[MAX_PATH];
+ TCHAR *g_exec, *executor;
+ TCHAR *pExec;
+ int ignoreData = mode == MODE_IGNOREOUTPUT;
+ int logMode = mode == MODE_LINES, stackMode = mode == MODE_STACK;
+ unsigned int to, tabExpandLength = logMode ? TAB_REPLACE_CCH : 0, codepage;
+ BOOL bOEM, forceNarrowInput = FALSE;
+
+ *szRet = _T('\0');
+
+ if (!IsWOW64()) {
+ TCHAR* p;
+ int nComSpecSize;
+
+ nComSpecSize = GetModuleFileName(g_hInstance, meDLLPath, MAX_PATH) + 2; // 2 chars for quotes
+ g_exec = (TCHAR *)GlobalAlloc(GPTR, sizeof(TCHAR) * (g_stringsize+nComSpecSize+2)); // 1 for space, 1 for null
+ p = meDLLPath + nComSpecSize - 2; // point p at null char of meDLLPath
+ *g_exec = _T('"');
+ executor = g_exec + 1;
+
+ // Look for the last '\' in path.
+ do
+ {
+ if (*p == _T('\\'))
+ break;
+ p = CharPrev(meDLLPath, p);
+ }
+ while (p > meDLLPath);
+ if (p == meDLLPath)
+ {
+ // bad path
+ pushstring(_T("error"));
+ GlobalFree(g_exec);
+ return;
+ }
+
+ *p = 0;
+ GetTempFileName(meDLLPath, _T("ns"), 0, executor); // executor = new temp file name in module path.
+ *p = _T('\\');
+ if (CopyFile(meDLLPath, executor, FALSE)) // copy current DLL to temp file in module path.
+ {
+ HANDLE hFile, hMapping;
+ LPBYTE pMapView;
+ PIMAGE_NT_HEADERS pNTHeaders;
+ hFile = CreateFile(executor, GENERIC_READ|GENERIC_WRITE, 0, NULL, OPEN_EXISTING,0, 0);
+ hMapping = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, NULL);
+ pMapView = MapViewOfFile(hMapping, FILE_MAP_WRITE, 0, 0, 0);
+ if (pMapView)
+ {
+ pNTHeaders = (PIMAGE_NT_HEADERS)(pMapView + ((PIMAGE_DOS_HEADER)pMapView)->e_lfanew);
+ // Turning the copied DLL into a stripped down executable.
+ pNTHeaders->FileHeader.Characteristics = IMAGE_FILE_32BIT_MACHINE | IMAGE_FILE_LOCAL_SYMS_STRIPPED |
+ IMAGE_FILE_LINE_NUMS_STRIPPED | IMAGE_FILE_EXECUTABLE_IMAGE;
+ // Windows character-mode user interface (CUI) subsystem.
+ pNTHeaders->OptionalHeader.Subsystem = IMAGE_SUBSYSTEM_WINDOWS_CUI;
+ // g_hInst is assumed to be the very base of the DLL in memory.
+ // WinMain will have the address of the WinMain function in memory.
+ // Getting the difference gets you the relative location of the
+ // WinMain function.
+ pNTHeaders->OptionalHeader.AddressOfEntryPoint = (DWORD) ((DWORD_PTR)AsExeWinMain - (DWORD_PTR)g_hInstance);
+ UnmapViewOfFile(pMapView);
+ }
+ CloseHandle(hMapping);
+ CloseHandle(hFile);
+ }
+
+ lstrcat(g_exec, _T("\""));
+
+ // add space
+ pExec = g_exec + lstrlen(g_exec);
+ *pExec = _T(' ');
+ pExec++;
+ } else {
+ executor = NULL;
+ g_exec = (TCHAR *)GlobalAlloc(GPTR, sizeof(TCHAR) * (g_stringsize+1)); // 1 for NULL
+ pExec = g_exec;
+ }
+
+ to = 0; // default is no timeout
+ bOEM = FALSE; // default is no OEM->ANSI conversion
+
+ g_hwndList = NULL;
+
+ // g_hwndParent = the caller, usually NSIS installer.
+ if (g_hwndParent) // The window class name for dialog boxes is "#32770"
+ g_hwndList = FindWindowEx(FindWindowEx(g_hwndParent, NULL, _T("#32770"), NULL), NULL, _T("SysListView32"), NULL);
+
+ // g_exec is the complete command to run: It has the copy of this DLL turned
+ // into an executable right now.
+
+params:
+ // Get the command I need to run from the NSIS stack.
+ popstring(pExec);
+ if (my_strstr(pExec, _T("/TIMEOUT=")) == pExec) {
+ TCHAR *szTimeout = pExec + 9;
+ to = my_atoi(szTimeout);
+ *pExec = 0;
+ goto params;
+ }
+ if (!lstrcmpi(pExec, _T("/OEM"))) {
+ bOEM = forceNarrowInput = TRUE;
+ *pExec = 0;
+ goto params;
+ }
+ if (!lstrcmpi(pExec, _T("/MBCS"))) {
+ forceNarrowInput = TRUE;
+ *pExec = 0;
+ goto params;
+ }
+
+ if (!pExec[0])
+ {
+ pushstring(_T("error"));
+ if (pExec-2 >= g_exec)
+ *(pExec-2) = _T('\0'); // skip space and quote
+ if (executor) DeleteFile(executor);
+ GlobalFree(g_exec);
+ return;
+ }
+
+ // Got all the params off the stack.
+
+ {
+ STARTUPINFO si = { sizeof(si), };
+ SECURITY_ATTRIBUTES sa = { sizeof(sa), };
+ SECURITY_DESCRIPTOR sd = { 0, };
+ PROCESS_INFORMATION pi;
+ const BOOL isNT = sizeof(void*) > 4 || (GetVersion() < 0x80000000);
+ HANDLE newstdout = 0, read_stdout = 0;
+ HANDLE newstdin = 0, read_stdin = 0;
+ int utfSource = sizeof(TCHAR) > 1 && !forceNarrowInput ? -1 : FALSE, utfOutput = sizeof(TCHAR) > 1;
+ DWORD cbRead, dwLastOutput;
+ DWORD dwExit = 0, waitResult = WAIT_TIMEOUT;
+ static BYTE bufSrc[1024];
+ BYTE *pSrc;
+ SIZE_T cbSrcTot = sizeof(bufSrc), cbSrc = 0, cbSrcFree;
+ TCHAR *bufOutput = 0, *pNewAlloc, *pD;
+ SIZE_T cchAlloc, cbAlloc, cchFree;
+#ifndef _MSC_VER // Avoid GCC "may be used uninitialized in this function" warnings
+ pD = NULL;
+ cchAlloc = 0;
+#endif
+
+ pi.hProcess = pi.hThread = NULL;
+ codepage = bOEM ? CP_OEMCP : CP_ACP;
+
+ if (!ignoreData) {
+ cbAlloc = stackMode ? (g_stringsize * sizeof(TCHAR)) : sizeof(bufSrc) * 4, cchAlloc = cbAlloc / sizeof(TCHAR);
+ pD = bufOutput = GlobalAlloc(GPTR, cbAlloc + sizeof(TCHAR)); // Include "hidden" space for a \0
+ if (!bufOutput) {
+ lstrcpy(szRet, _T("error"));
+ goto done;
+ }
+ *bufOutput = _T('\0');
+ }
+
+ sa.bInheritHandle = TRUE;
+ sa.lpSecurityDescriptor = NULL;
+ if (isNT) {
+ InitializeSecurityDescriptor(&sd, SECURITY_DESCRIPTOR_REVISION);
+ SetSecurityDescriptorDacl(&sd, TRUE, NULL, FALSE);
+ sa.lpSecurityDescriptor = &sd;
+ }
+
+ if (!CreatePipe(&read_stdout, &newstdout, &sa, 0)) {
+ lstrcpy(szRet, _T("error"));
+ goto done;
+ }
+ if (!CreatePipe(&read_stdin, &newstdin, &sa, 0)) {
+ lstrcpy(szRet, _T("error"));
+ goto done;
+ }
+
+ GetStartupInfo(&si); // Why?
+ si.dwFlags = STARTF_USESTDHANDLES|STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE;
+ si.hStdInput = newstdin;
+ si.hStdOutput = newstdout;
+ si.hStdError = newstdout;
+ if (!CreateProcess(NULL, g_exec, NULL, NULL, TRUE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi)) {
+ lstrcpy(szRet, _T("error"));
+ goto done;
+ }
+
+ // Now I'm talking with an executable copy of myself.
+ dwLastOutput = GetTickCount();
+ for (;;) {
+ TCHAR bufCh[2];
+waitForProcess:
+ waitResult = WaitForSingleObject(pi.hProcess, 0);
+ GetExitCodeProcess(pi.hProcess, &dwExit);
+readMore:
+ PeekNamedPipe(read_stdout, 0, 0, 0, &cbRead, NULL);
+ if (!cbRead) {
+ if (waitResult == WAIT_OBJECT_0) {
+ break; // No data in the pipe and process ended, we are done
+ }
+ if (to && GetTickCount() > dwLastOutput+to) {
+ TerminateProcess(pi.hProcess, -1);
+ lstrcpy(szRet, _T("timeout"));
+ }
+ else {
+ Sleep(LOOPTIMEOUT);
+ }
+ continue;
+ }
+
+ dwLastOutput = GetTickCount();
+ ReadFile(read_stdout, bufSrc + cbSrc, (DWORD) (cbSrcFree = cbSrcTot - cbSrc), &cbRead, NULL);
+ cbSrcFree -= cbRead, cbSrc = cbSrcTot - cbSrcFree;
+ pSrc = bufSrc;
+
+ if (utfSource < 0 && cbSrc) { // Simple UTF-16LE detection
+#ifdef UNICODE
+ utfSource = IsTextUnicode(pSrc, (UINT) (cbSrc & ~1), NULL) != FALSE;
+#else
+ utfSource = (cbSrc >= 3 && pSrc[0] && !pSrc[1]) || (cbSrc > 4 && pSrc[2] && !pSrc[3]); // Lame latin-only test
+ utfSource |= (cbSrc > 3 && pSrc[0] == 0xFF && pSrc[1] == 0xFE && (pSrc[2] | pSrc[3])); // Lame BOM test
+#endif
+ }
+
+ if (ignoreData) {
+ cbSrc = 0; // Overwrite the whole buffer every read
+ continue;
+ }
+
+ if (!cbRead) {
+ continue; // No new data, read more before trying to parse
+ }
+
+parseLines:
+ cchFree = cchAlloc - (pD - bufOutput);
+ for (;;) {
+ DWORD cbSrcChar = 1, cchDstChar, i;
+ *pD = _T('\0'); // Terminate output buffer because we can unexpectedly run out of data
+ if (!cbSrc) {
+ goto readMore;
+ }
+
+ if (utfSource) { // UTF-16LE --> ?:
+ if (cbSrc < 2) {
+ goto readMore;
+ }
+ if (utfOutput) { // UTF-16LE --> UTF-16LE:
+ bufCh[0] = ((TCHAR*)pSrc)[0], cbSrcChar = sizeof(WCHAR), cchDstChar = 1; // We only care about certain ASCII characters so we don't bother dealing with surrogate pairs.
+ }
+ else { // UTF-16LE --> DBCS
+ // TODO: This is tricky because we need the complete base character (or surrogate pair) and all the trailing combining characters for a grapheme in the buffer before we can call WideCharToMultiByte.
+ utfOutput = FALSE; // For now we just treat it as DBCS
+ continue;
+ }
+ }
+ else { // DBCS --> ?:
+ if (utfOutput) { // DBCS --> UTF-16LE:
+ BOOL isMb = IsDBCSLeadByteEx(codepage, ((CHAR*)pSrc)[0]);
+ if (isMb && cbSrc < ++cbSrcChar) {
+ goto readMore;
+ }
+ cchDstChar = MultiByteToWideChar(codepage, 0, (CHAR*)pSrc, cbSrcChar, (WCHAR*) bufCh, 2);
+ }
+ else { // DBCS --> DBCS:
+ bufCh[0] = ((CHAR*)pSrc)[0], cchDstChar = 1; // Note: OEM codepage will be converted by LogMessage
+ }
+ }
+
+ if (bufCh[0] == _T('\t') && tabExpandLength) { // Expand tab to spaces?
+ if (cchFree < tabExpandLength) {
+ goto resizeOutputBuffer;
+ }
+ lstrcpy(pD, TAB_REPLACE);
+ pD += tabExpandLength, cchFree -= tabExpandLength;
+ }
+ else if (bufCh[0] == _T('\r') && logMode) {
+ // Eating it
+ }
+ else if (bufCh[0] == _T('\n') && logMode) {
+ LogMessage(bufOutput, bOEM); // Output has already been \0 terminated
+ *(pD = bufOutput) = _T('\0'), cchFree = cchAlloc;
+ }
+ else {
+ if (cchFree < cchDstChar) {
+ SIZE_T cchOrgOffset;
+resizeOutputBuffer:
+ if (stackMode) {
+ ignoreData = TRUE; // Buffer was already maximum for the NSIS stack, we cannot handle more data
+ if (utfOutput)
+ TruncateStringUTF16LE((LPWSTR) bufOutput, pD - bufOutput, (LPCWSTR) bufCh, cchDstChar);
+ else
+ TruncateStringMB(codepage, (LPSTR) bufOutput, pD - bufOutput, bufCh[0]);
+ goto waitForProcess;
+ }
+ cchAlloc += 1024, cbAlloc = cchAlloc / sizeof(TCHAR);
+ pNewAlloc = GlobalReAlloc(bufOutput, cbAlloc + sizeof(TCHAR),GPTR|GMEM_MOVEABLE); // Include "hidden" space for a \0
+ if (!pNewAlloc) {
+ lstrcpy(szRet, _T("error"));
+ ignoreData = TRUE;
+ goto waitForProcess;
+ }
+ cchOrgOffset = pD - bufOutput;
+ *(pD = (bufOutput = pNewAlloc) + cchOrgOffset) = _T('\0');
+ goto parseLines;
+ }
+ for (i = 0; i < cchDstChar; ++i) {
+ *pD++ = bufCh[i], --cchFree;
+ }
+ }
+ pSrc += cbSrcChar, cbSrc -= cbSrcChar;
+ }
+ }
+
+done:
+ if (stackMode) pushstring(bufOutput);
+ if (logMode && *bufOutput) LogMessage(bufOutput,bOEM); // Write remaining output
+ if (dwExit == STATUS_ILLEGAL_INSTRUCTION)
+ lstrcpy(szRet, _T("error"));
+ if (!szRet[0]) wsprintf(szRet,_T("%d"),dwExit);
+ pushstring(szRet);
+ CloseHandle(pi.hThread);
+ CloseHandle(pi.hProcess);
+ CloseHandle(newstdout);
+ CloseHandle(read_stdout);
+ CloseHandle(newstdin);
+ CloseHandle(read_stdin);
+ if (pExec-2 >= g_exec)
+ *(pExec-2) = _T('\0'); // skip space and quote
+ if (executor)
+ DeleteFile(executor);
+ GlobalFree(g_exec);
+ if (bufOutput)
+ GlobalFree(bufOutput);
+ }
+}
+
+static TCHAR *my_strstr(TCHAR *a, TCHAR *b)
+{
+ int l = lstrlen(b);
+ while (lstrlen(a) >= l)
+ {
+ TCHAR c = a[l];
+ a[l] = 0;
+ if (!lstrcmpi(a, b))
+ {
+ a[l] = c;
+ return a;
+ }
+ a[l] = c;
+ a = CharNext(a);
+ }
+ return NULL;
+}
+
+static unsigned int my_atoi(TCHAR *s) {
+ unsigned int v=0;
+ if (*s == _T('0') && (s[1] == _T('x') || s[1] == _T('X'))) {
+ s+=2;
+ for (;;) {
+ int c=*s++;
+ if (c >= _T('0') && c <= _T('9')) c-=_T('0');
+ else if (c >= _T('a') && c <= _T('f')) c-=_T('a')-10;
+ else if (c >= _T('A') && c <= _T('F')) c-=_T('A')-10;
+ else break;
+ v<<=4;
+ v+=c;
+ }
+ }
+ else if (*s == _T('0') && s[1] <= _T('7') && s[1] >= _T('0')) {
+ s++;
+ for (;;) {
+ int c=*s++;
+ if (c >= _T('0') && c <= _T('7')) c-=_T('0');
+ else break;
+ v<<=3;
+ v+=c;
+ }
+ }
+ else {
+ for (;;) {
+ int c=*s++ - _T('0');
+ if (c < 0 || c > 9) break;
+ v*=10;
+ v+=c;
+ }
+ }
+ return (int)v;
+}
+
+int WINAPI AsExeWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
+{
+ DWORD Ret;
+ STARTUPINFO si = {0};
+ PROCESS_INFORMATION pi = {0};
+ TCHAR command_line[1024]; //BUGBUG
+ TCHAR seekchar=_T(' ');
+ TCHAR *cmdline;
+
+ si.cb = sizeof(si);
+ // Make child process use this app's standard files. Not needed because the handles
+ // we created when executing this process were inheritable.
+ //si.dwFlags = STARTF_USESTDHANDLES;
+ //si.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
+ //si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
+ //si.hStdError = GetStdHandle (STD_ERROR_HANDLE);
+ lstrcpyn(command_line, GetCommandLine(), 1024);
+
+ cmdline = command_line;
+ if (*cmdline == _T('\"')) seekchar = *cmdline++;
+
+ while (*cmdline && *cmdline != seekchar) cmdline=CharNext(cmdline);
+ cmdline=CharNext(cmdline);
+ // skip any spaces before the arguments
+ while (*cmdline && *cmdline == _T(' ')) cmdline++;
+
+ Ret = CreateProcess (NULL, cmdline,
+ NULL, NULL,
+ TRUE, 0,
+ NULL, NULL,
+ &si, &pi
+ );
+
+ if (Ret)
+ {
+ WaitForSingleObject(pi.hProcess, INFINITE);
+ GetExitCodeProcess(pi.hProcess, &Ret);
+ CloseHandle (pi.hProcess);
+ CloseHandle (pi.hThread);
+ ExitProcess(Ret);
+ }
+ else
+ {
+ ExitProcess(STATUS_ILLEGAL_INSTRUCTION);
+ }
+
+ return 0; // dummy
+}
diff --git a/nsisplugin/IsActivated.c b/nsisplugin/IsActivated.c
new file mode 100644
index 0000000..7090366
--- /dev/null
+++ b/nsisplugin/IsActivated.c
@@ -0,0 +1,122 @@
+#include
+#include
+#include "main.h"
+#include "WMI.h"
+#include "VersionInfo.h"
+#include "licdll.h"
+#include
+
+typedef HRESULT (WINAPI *_SLOpen)(HSLC *);
+typedef HRESULT (WINAPI *_SLGetLicensingStatusInformation)(HSLC, const SLID *, DWORD, DWORD, UINT *, SL_LICENSING_STATUS **);
+typedef HRESULT (WINAPI *_SLClose)(HSLC);
+
+static _SLOpen $SLOpen;
+static _SLClose $SLClose;
+static _SLGetLicensingStatusInformation $SLGetLicensingStatusInformation;
+
+static BOOL g_loadedLicenseStatus = FALSE;
+static BOOL g_isActivated = TRUE;
+
+PLUGIN_METHOD(IsActivated) {
+ PLUGIN_INIT();
+
+ // Get the Operating System Version information as well as the CPU architecture.
+ // We'll need this so that we activate the correct COM object on 64-bit versions
+ // of Windows XP and Windows Server 2003.
+ OSVERSIONINFOEX* versionInfo = GetVersionInfo();
+ SYSTEM_INFO systemInfo;
+ GetSystemInfo(&systemInfo);
+
+ // Activation is irrelevant prior to XP
+ if (g_loadedLicenseStatus || !AtLeastWinXP2002()) {
+ pushint(g_isActivated);
+ return;
+ }
+
+ g_loadedLicenseStatus = TRUE;
+
+ if (AtLeastWinVista()) {
+ // Vista+: Ask the Software Licensing Service
+ if (!$SLOpen) {
+ HMODULE slc = LoadLibrary(L"slc.dll");
+ $SLOpen = (_SLOpen)GetProcAddress(slc, "SLOpen");
+ $SLClose = (_SLClose)GetProcAddress(slc, "SLClose");
+ $SLGetLicensingStatusInformation = (_SLGetLicensingStatusInformation)GetProcAddress(slc, "SLGetLicensingStatusInformation");
+ }
+
+ if (!$SLOpen || !$SLClose || !$SLGetLicensingStatusInformation) {
+ TRACE(L"Failed to load slc.dll");
+ pushint(1);
+ return;
+ }
+
+ HSLC slc;
+ SL_LICENSING_STATUS *status;
+ UINT count;
+ HRESULT hr = $SLOpen(&slc);
+ if (!SUCCEEDED(hr)) {
+ goto end_slc;
+ }
+
+ hr = $SLGetLicensingStatusInformation(slc, &WINDOWS_SLID, 0, 0, &count, &status);
+ if (!SUCCEEDED(hr) || count == 0) {
+ goto end_slc;
+ }
+
+ // Iterate through all statuses until we find one in Licensed status.
+ g_isActivated = FALSE;
+ for (int i = 0; i < count; i++) {
+ if (status[i].eStatus == SL_LICENSING_STATUS_LICENSED) {
+ g_isActivated = TRUE;
+ break;
+ }
+ }
+
+end_slc:
+ if (status) {
+ LocalFree(status);
+ }
+ if (slc) {
+ $SLClose(slc);
+ }
+ } else {
+ // XP: Use private API
+ ICOMLicenseAgent *agent;
+ HRESULT hr;
+
+ // On XP and Server 2003 x64, we need to pass a different argument to CoCreateInstance.
+ if (systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) {
+ hr = CoCreateInstance(&CLSID_COMLicenseAgent, NULL, CLSCTX_INPROC_SERVER | CLSCTX_ACTIVATE_64_BIT_SERVER, &IID_ICOMLicenseAgent, (void **)&agent);
+ } else {
+ hr = CoCreateInstance(&CLSID_COMLicenseAgent, NULL, CLSCTX_INPROC_SERVER, &IID_ICOMLicenseAgent, (void **)&agent);
+ }
+
+ if (!SUCCEEDED(hr)) {
+ TRACE(L"COMLicenseAgent load failed: %x", hr);
+ goto end_xp;
+ }
+
+ ULONG result;
+ hr = ICOMLicenseAgent_Initialize(agent, 0xC475, 3, NULL, &result);
+ if (!SUCCEEDED(hr) || result != 0) {
+ TRACE(L"COMLicenseAgent init failed: %x", hr);
+ goto end_xp;
+ }
+
+ ULONG wpaLeft, evalLeft;
+ hr = ICOMLicenseAgent_GetExpirationInfo(agent, &wpaLeft, &evalLeft);
+ if (!SUCCEEDED(hr)) {
+ TRACE(L"COMLicenseAgent GetExpirationInfo failed: %x", hr);
+ goto end_xp;
+ }
+
+ g_isActivated = wpaLeft == MAXLONG;
+
+end_xp:
+ if (agent) {
+ ICOMLicenseAgent_Release(agent);
+ }
+ }
+
+ pushint(g_isActivated);
+}
diff --git a/nsisplugin/IsAdmin.c b/nsisplugin/IsAdmin.c
new file mode 100644
index 0000000..61b7ded
--- /dev/null
+++ b/nsisplugin/IsAdmin.c
@@ -0,0 +1,9 @@
+#include
+#include
+#include "User.h"
+
+PLUGIN_METHOD(IsAdmin) {
+ PLUGIN_INIT();
+
+ pushint(IsUserAdmin());
+}
diff --git a/nsisplugin/UpdateRoots.c b/nsisplugin/UpdateRoots.c
new file mode 100644
index 0000000..177a0e1
--- /dev/null
+++ b/nsisplugin/UpdateRoots.c
@@ -0,0 +1,67 @@
+#include
+#include
+#include
+#include "HResult.h"
+
+PLUGIN_METHOD(UpdateRoots) {
+ PLUGIN_INIT();
+
+ HRESULT hr = E_FAIL;
+ WCHAR stateStr[1024], store[1024], path[1024];
+ popstring(stateStr);
+ popstring(store);
+ popstring(path);
+
+ if (!stateStr || !store || !path) {
+ pushint(E_INVALIDARG);
+ return;
+ }
+
+ BOOL add;
+ if (lstrcmpi(stateStr, L"/update") == 0) {
+ add = TRUE;
+ } else if (lstrcmpi(stateStr, L"/delete") == 0) {
+ add = FALSE;
+ } else {
+ pushint(E_INVALIDARG);
+ return;
+ }
+
+ HCERTSTORE srcStore = CertOpenStore(CERT_STORE_PROV_FILENAME_W, 0, 0, CERT_STORE_READONLY_FLAG, path);
+ if (!srcStore) {
+ TRACE(L"CertOpenStore for %ls failed: %08x", path, hr);
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ goto end;
+ }
+
+ HCERTSTORE dstStore = CertOpenStore(CERT_STORE_PROV_SYSTEM_REGISTRY_W, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, store);
+ if (!dstStore) {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ TRACE(L"CertOpenStore for %ls failed: %08x", store, hr);
+ goto end;
+ }
+
+ PCCERT_CONTEXT cert = NULL;
+ while ((cert = CertEnumCertificatesInStore(srcStore, cert)) != NULL) {
+ BOOL result = add
+ ? CertAddCertificateContextToStore(dstStore, cert, CERT_STORE_ADD_REPLACE_EXISTING, NULL)
+ : CertDeleteCertificateFromStore(CertDuplicateCertificateContext(cert));
+ if (!result) {
+ TRACE(L"cert %ls in %ls failed: %d\n", add ? L"add" : L"delete", store, GetLastError());
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ goto end;
+ }
+ }
+
+ hr = S_OK;
+
+end:
+ if (srcStore) {
+ CertCloseStore(srcStore, 0);
+ }
+ if (dstStore) {
+ CertCloseStore(dstStore, 0);
+ }
+
+ pushint(hr);
+}
diff --git a/setup/ActiveXPage.nsh b/setup/ActiveXPage.nsh
new file mode 100644
index 0000000..8ba0841
--- /dev/null
+++ b/setup/ActiveXPage.nsh
@@ -0,0 +1,99 @@
+Var Dialog
+Var Dialog.Y
+
+Function ActiveXPage
+ ; Skip in runonce
+ ${If} ${IsRunOnce}
+ ${OrIf} ${IsPostInstall}
+ Abort
+ ${EndIf}
+
+ ; Skip if not required
+ ${If} ${AtLeastWin7}
+ ; TODO: Fix ordering of setup.nsi so we can do this
+ ; ${OrIfNot} ${SectionIsSelected} ${LEGACYUPDATE}
+ Abort
+ ${EndIf}
+
+ !insertmacro MUI_HEADER_TEXT "How do you want to use Windows Update?" ""
+
+ nsDialogs::Create 1018
+ Pop $Dialog
+
+ ${AeroWizardDialogControl} $Dialog
+
+ StrCpy $Dialog.Y 0
+
+ ${NSD_CreateLabel} 0 $Dialog.Y -1u 24u "Legacy Update configures Windows Update to use the Legacy Update proxy server, resolving connection issues to the official Microsoft Windows Update service. You can choose between two options to access Windows Update."
+ Pop $0
+ ${AeroWizardDialogControl} $0
+
+ IntOp $Dialog.Y $Dialog.Y + 60
+
+ ${NSD_CreateIcon} 3u $Dialog.Y 4u 4u ""
+ Pop $0
+ ${AeroWizardDialogControl} $0
+ ${NSD_SetIconFromInstaller} $0 103
+
+ ${NSD_CreateRadioButton} 30u $Dialog.Y -30u 10u "Use the Legacy Update website"
+ Pop $0
+ ${AeroWizardDialogControl} $0
+ ${NSD_OnClick} $0 ActiveXPageSelectionChanged
+ SendMessage $0 ${BM_SETCHECK} ${BST_CHECKED} 0
+
+ ${NSD_SetFocus} $0
+
+ ${If} ${AtLeastWinVista}
+ StrCpy $0 "The Legacy Update website is a replacement for the original Windows Update website. If you select this, you can still use the Windows Update Control Panel."
+ ${Else}
+ StrCpy $0 "The Legacy Update website is a replacement for the original Windows Update website, allowing you to download optional updates and drivers."
+ ${EndIf}
+
+ IntOp $Dialog.Y $Dialog.Y + 17
+
+ ${NSD_CreateLabel} 41u $Dialog.Y -41u 24u "$0"
+ Pop $0
+ ${AeroWizardDialogControl} $0
+
+ IntOp $Dialog.Y $Dialog.Y + 50
+
+ ${NSD_CreateIcon} 3u $Dialog.Y 4u 4u ""
+ Pop $0
+ ${AeroWizardDialogControl} $0
+
+ ${If} ${AtLeastWinVista}
+ ${NSD_SetIcon} $0 "$WINDIR\System32\wucltux.dll" $1
+ StrCpy $1 "Use the Windows Update Control Panel"
+ StrCpy $2 "Legacy Update is compatible with the built-in Windows Update Control Panel. Make sure to check for updates $\"managed by your system administrator$\" to use the Legacy Update proxy server."
+ ${Else}
+ ${NSD_SetIcon} $0 "res://$WINDIR\System32\wupdmgr.exe/#Icon/APPICON" $1
+ StrCpy $1 "Use Automatic Updates"
+ StrCpy $2 "Use the built-in Automatic Updates feature to download and install updates. You will only be able to download critical updates."
+ ${EndIf}
+
+ ${NSD_CreateRadioButton} 30u $Dialog.Y -30u 10u "$1"
+ Pop $0
+ ${AeroWizardDialogControl} $0
+ ${NSD_OnClick} $0 ActiveXPageSelectionChanged
+
+ IntOp $Dialog.Y $Dialog.Y + 17
+
+ ${NSD_CreateLabel} 41u $Dialog.Y -41u 24u "$2"
+ Pop $0
+ ${AeroWizardDialogControl} $0
+
+ nsDialogs::Show
+ Call AeroWizardOnShow
+FunctionEnd
+
+Function ActiveXPageSelectionChanged
+ Pop $0
+ ${NSD_GetState} $0 $0
+
+ ; TODO: Fix ordering of setup.nsi so we can do this
+ ${If} $0 == ${BST_CHECKED}
+ ; !insertmacro UnselectSection ${ACTIVEX}
+ ${Else}
+ ; !insertmacro SelectSection ${ACTIVEX}
+ ${EndIf}
+FunctionEnd
diff --git a/setup/DownloadVista78.nsh b/setup/DownloadVista78.nsh
new file mode 100644
index 0000000..e31dd50
--- /dev/null
+++ b/setup/DownloadVista78.nsh
@@ -0,0 +1,170 @@
+Function NeedsPackage
+ Pop $0
+ ClearErrors
+ FindFirst $R0 $R1 "$WINDIR\servicing\Packages\$0~31bf3856ad364e35~*"
+ FindClose $R0
+ ${If} ${Errors}
+ Push 1
+ ${Else}
+ Push 0
+ ${EndIf}
+FunctionEnd
+
+!macro SPHandler kbid pkg title
+ Function Needs${kbid}
+ Push ${pkg}
+ Call NeedsPackage
+ FunctionEnd
+
+ Function Download${kbid}
+ Call Needs${kbid}
+ Pop $0
+ ${If} $0 == 1
+ Call GetArch
+ Pop $0
+ ReadINIStr $0 $PLUGINSDIR\Patches.ini "${kbid}" $0
+ ReadINIStr $1 $PLUGINSDIR\Patches.ini "${kbid}" Prefix
+ !insertmacro Download "${title}" "$1$0" "${kbid}.exe" 1
+ ${EndIf}
+ FunctionEnd
+
+ Function Install${kbid}
+ ${If} ${NeedsPatch} ${kbid}
+ Call Download${kbid}
+ !insertmacro InstallSP "${title}" "${kbid}.exe"
+ ${EndIf}
+ FunctionEnd
+!macroend
+
+!macro MSUHandler kbid title
+ Function Needs${kbid}
+ Push Package_for_${kbid}
+ Call NeedsPackage
+ FunctionEnd
+
+ Function Download${kbid}
+ ${If} ${NeedsPatch} ${kbid}
+ Call GetArch
+ Pop $0
+ ReadINIStr $1 $PLUGINSDIR\Patches.ini "${kbid}" $0
+ ReadINIStr $2 $PLUGINSDIR\Patches.ini "${kbid}" Prefix
+ !insertmacro DownloadMSU "${kbid}" "${title}" "$2$1"
+ ${EndIf}
+ FunctionEnd
+
+ Function Install${kbid}
+ ${If} ${NeedsPatch} ${kbid}
+ Call Download${kbid}
+ !insertmacro InstallMSU "${kbid}" "${title}"
+ ${EndIf}
+ FunctionEnd
+!macroend
+
+; Service Packs
+!insertmacro SPHandler "VistaSP1" "VistaSP1-KB936330" "Windows Vista $(SP) 1"
+!insertmacro SPHandler "VistaSP2" "VistaSP2-KB948465" "Windows Vista $(SP) 2"
+!insertmacro SPHandler "Win7SP1" "Windows7SP1-KB976933" "Windows 7 $(SP) 1"
+
+; Windows Vista post-SP2 update combination that fixes WU indefinitely checking for updates
+!insertmacro MSUHandler "KB3205638" "$(SecUpd) for Windows Vista"
+!insertmacro MSUHandler "KB4012583" "$(SecUpd) for Windows Vista"
+!insertmacro MSUHandler "KB4015195" "$(SecUpd) for Windows Vista"
+!insertmacro MSUHandler "KB4015380" "$(SecUpd) for Windows Vista"
+
+; Internet Explorer 9 for Windows Vista
+!insertmacro MSUHandler "KB971512" "$(Update) for Windows Vista"
+!insertmacro MSUHandler "KB2117917" "$(PUS) for Windows Vista"
+
+!insertmacro NeedsFileVersionHandler "IE9" "mshtml.dll" "9.0.8112.16421"
+!insertmacro PatchHandler "IE9" "$(IE) 9 for Windows Vista" ${PATCH_FLAGS_OTHER} "/passive /norestart /update-no /closeprograms"
+
+; Windows Vista Servicing Stack Update
+!insertmacro MSUHandler "KB4493730" "2019-04 $(SSU) for Windows $(SRV) 2008"
+
+; Windows 7 Servicing Stack Update
+!insertmacro MSUHandler "KB3138612" "2016-03 $(SSU) for Windows 7"
+!insertmacro MSUHandler "KB4474419" "$(SHA2) for Windows 7"
+!insertmacro MSUHandler "KB4490628" "2019-03 $(SSU) for Windows 7"
+
+; Windows Home Server 2011 Update Rollup 4
+!insertmacro MSUHandler "KB2757011" "$(SectionWHS2011U4)"
+
+; Windows 8 Servicing Stack
+!insertmacro MSUHandler "KB4598297" "2021-01 $(SSU) for Windows $(SRV) 2012"
+
+; Windows 8.1 Servicing Stack
+!insertmacro MSUHandler "KB3021910" "2015-04 $(SSU) for Windows 8.1"
+
+; Windows 8.1 Update 1
+!insertmacro MSUHandler "KB2919355" "Windows 8.1 $(Update) 1"
+!insertmacro MSUHandler "KB2932046" "Windows 8.1 $(Update) 1"
+!insertmacro MSUHandler "KB2959977" "Windows 8.1 $(Update) 1"
+!insertmacro MSUHandler "KB2937592" "Windows 8.1 $(Update) 1"
+!insertmacro MSUHandler "KB2934018" "Windows 8.1 $(Update) 1"
+
+; Windows 8.1 Update 3
+; TODO
+; !insertmacro MSUHandler "KB2934018" "Windows 8.1 $(Update) 3"
+
+Function NeedsVistaPostSP2
+ ${If} ${NeedsPatch} KB3205638
+ ${OrIf} ${NeedsPatch} KB4012583
+ ${OrIf} ${NeedsPatch} KB4015195
+ ${OrIf} ${NeedsPatch} KB4015380
+ ${OrIf} ${NeedsPatch} KB4493730
+ Push 1
+ ${Else}
+ Push 0
+ ${EndIf}
+FunctionEnd
+
+Function NeedsWin7PostSP1
+ ${If} ${NeedsPatch} KB3138612
+ ${OrIf} ${NeedsPatch} KB4474419
+ ${OrIf} ${NeedsPatch} KB4490628
+ Push 1
+ ${Else}
+ Push 0
+ ${EndIf}
+FunctionEnd
+
+Function NeedsWin81Update1
+ ${If} ${NeedsPatch} KB2919355
+ ${OrIf} ${NeedsPatch} KB2932046
+ ${OrIf} ${NeedsPatch} KB2937592
+ ${OrIf} ${NeedsPatch} KB2934018
+ Push 1
+ ${Else}
+ Push 0
+ ${EndIf}
+FunctionEnd
+
+; TODO
+; Function NeedsWin81Update3
+; Call GetArch
+; Pop $0
+; ${If} $0 == "arm"
+; ${AndIf} ${NeedsPatch} KB2934018
+; Push 1
+; ${Else}
+; Push 0
+; ${EndIf}
+; FunctionEnd
+
+; Weird prerequisite to Update 1 that fixes the main KB2919355 update failing to install
+Function DownloadClearCompressionFlag
+ ${If} ${NeedsPatch} KB2919355
+ Call GetArch
+ Pop $0
+ ReadINIStr $0 $PLUGINSDIR\Patches.ini ClearCompressionFlag $0
+ ReadINIStr $1 $PLUGINSDIR\Patches.ini ClearCompressionFlag Prefix
+ !insertmacro Download "Windows 8.1 $(Update) 1 $(PrepTool)" "$1$0" "ClearCompressionFlag.exe" 1
+ ${EndIf}
+FunctionEnd
+
+Function InstallClearCompressionFlag
+ ${If} ${NeedsPatch} KB2919355
+ Call DownloadClearCompressionFlag
+ !insertmacro Install "Windows 8.1 $(Update) 1 $(PrepTool)" "ClearCompressionFlag.exe" ""
+ ${EndIf}
+FunctionEnd
diff --git a/setup/Makefile b/setup/Makefile
new file mode 100644
index 0000000..b0e16ec
--- /dev/null
+++ b/setup/Makefile
@@ -0,0 +1,32 @@
+DEBUG ?= 1
+SIGN ?= 0
+CI ?= 0
+
+MAKENSIS = makensis
+NSISFLAGS = -DDEBUG=$(DEBUG) -DSIGN=$(SIGN) -DCI=$(CI)
+
+all:
+ +$(MAKE) -C ../nsisplugin
+ +$(MAKE) setup
+ +$(MAKE) activex
+
+setup:
+ $(MAKENSIS) $(NSISFLAGS) setup.nsi
+
+activex:
+ifeq ($(SIGN),1)
+ cp LegacyUpdate-*.exe codebase/setup.exe
+ cd codebase && makecab.exe /f lucontrl.ddf
+ ../build/sign.sh codebase/lucontrl.cab
+ rm codebase/setup.exe codebase/setup.rpt
+endif
+
+clean:
+ +$(MAKE) -C ../nsisplugin clean
+ rm -f LegacyUpdate-*.exe codebase/{lucontrl.cab,setup.exe,setup.rpt}
+
+test:
+ +$(MAKE)
+ sudo.exe LegacyUpdate-*.exe
+
+.PHONY: all nsisplugin setup activex clean
diff --git a/setup/Strings.nsh b/setup/Strings.nsh
new file mode 100644
index 0000000..19b5e5f
--- /dev/null
+++ b/setup/Strings.nsh
@@ -0,0 +1,201 @@
+!insertmacro MUI_LANGUAGE "English"
+
+; Dialog
+MiscButtonText "Back" "Next" "Cancel" "Close"
+
+; Log
+LangString ^ExecShell ${LANG_ENGLISH} "Execute: "
+LangString ^Completed ${LANG_ENGLISH} "Done"
+LangString Downloading ${LANG_ENGLISH} "Downloading "
+LangString Extracting ${LANG_ENGLISH} "Extracting "
+LangString Installing ${LANG_ENGLISH} "Installing "
+LangString ExitCode ${LANG_ENGLISH} "Exit code: "
+
+LangString RestartRequired ${LANG_ENGLISH} "Success - restart required"
+LangString AlreadyInstalled ${LANG_ENGLISH} "Installation skipped - already installed"
+LangString NotApplicable ${LANG_ENGLISH} "Installation skipped - not applicable"
+
+; Download
+LangString DownloadStatusSingle ${LANG_ENGLISH} "{TIMEREMAINING} left - {RECVSIZE} of {FILESIZE} ({SPEED})"
+LangString DownloadStatusMulti ${LANG_ENGLISH} "{TIMEREMAINING} left - {TOTALRECVSIZE} of {TOTALFILESIZE} ({SPEED})"
+
+; Startup errors
+LangString MsgBoxUsage ${LANG_ENGLISH} \
+ "Usage: setup.exe [/S] [/v] [/passive] [/norestart]$\r$\n\
+ $\r$\n\
+ /S$\tExecute Legacy Update setup silently.$\r$\n\
+ /v$\tDisplay verbose details during installation.$\r$\n\
+ /passive$\tInstall without user interaction.$\r$\n\
+ /norestart$\tDisable automatic restart during installation.$\r$\n\
+ $\r$\n\
+ If no flags are passed, Legacy Update will launch its full user interface.$\r$\n\
+ For more information on these flags, visit legacyupdate.net."
+
+LangString MsgBoxElevationRequired ${LANG_ENGLISH} \
+ "Log on as an administrator to install Legacy Update."
+
+LangString MsgBoxOldWinVersion ${LANG_ENGLISH} \
+ "Legacy Update requires Windows 2000 or later.$\r$\n\
+ $\r$\n\
+ You might be interested in Windows Update Restored instead.$\r$\n\
+ Would you like to go to ${WUR_WEBSITE} now?"
+
+LangString MsgBoxBetaOS ${LANG_ENGLISH} \
+ "The current version of Windows is a beta build. Legacy Update may not work correctly on this version of Windows.$\r$\n\
+ $\r$\n\
+ Continue anyway?"
+
+LangString MsgBoxCompatMode ${LANG_ENGLISH} \
+ "A compatibility mode has been set on this program. Legacy Update will not work correctly in compatibility mode.$\r$\n\
+ $\r$\n\
+ Disable it in the Properties dialog of this file and try again."
+
+LangString MsgBoxPluginFailed ${LANG_ENGLISH} \
+ "Setup failed to initialize.$\r$\n\
+ $\r$\n\
+ The file may be corrupt. Try downloading Legacy Update again."
+
+; Install errors
+FileErrorText \
+ 'Unable to write to "$0".$\r$\n\
+ $\r$\n\
+ If Internet Explorer is open, close it and click Retry.' \
+ 'Unable to write to "$0".$\r$\n\
+ $\r$\n\
+ If Internet Explorer is open, close it and click Retry.'
+
+LangString MsgBoxDownloadAbort ${LANG_ENGLISH} \
+ "Cancelling will terminate Legacy Update setup."
+
+LangString MsgBoxDownloadFailed ${LANG_ENGLISH} \
+ "$2 failed to download.$\r$\n\
+ $\r$\n\
+ $0 ($1)"
+
+LangString MsgBoxInstallFailed ${LANG_ENGLISH} \
+ "$2 failed to install.$\r$\n\
+ $\r$\n\
+ $1 ($0)"
+
+LangString MsgBoxPatchNotFound ${LANG_ENGLISH} \
+ "$0 failed to install.$\r$\n\
+ $\r$\n\
+ The installed Windows language and/or architecture is not supported."
+
+LangString MsgBoxMUFailed ${LANG_ENGLISH} \
+ "Failed to enable Microsoft Update.$\r$\n\
+ $\r$\n\
+ $1 ($0)"
+
+; Warnings
+LangString MsgBoxWES09NotSSE2 ${LANG_ENGLISH} \
+ "Your processor does not support the Streaming SIMD Extensions 2 (SSE2) instruction set, which is required to install Windows Embedded 2009 updates released after May 2018.$\r$\n\
+ Processors that initially implemented SSE2 instructions include the Intel Pentium 4, Pentium M, and AMD Athlon 64.$\r$\n\
+ $\r$\n\
+ To protect your Windows installation from becoming corrupted by incompatible updates, this option will be disabled."
+
+LangString MsgBoxActivateXP2002NotSP3 ${LANG_ENGLISH} \
+ "Windows XP must be updated to Service Pack 3 to activate over the internet. The Service Pack 3 update action will be enabled."
+
+LangString MsgBoxActivateXP2003NotSP2 ${LANG_ENGLISH} \
+ "Windows XP Professional x64 Edition or Windows Server 2003 must be updated to Service Pack 2 to activate over the internet. The Service Pack 2 update action will be enabled."
+
+LangString MsgBoxVistaSPInstall ${LANG_ENGLISH} \
+ "Your computer will restart several times to install Windows Vista Service Pack 2. Your screen may appear blank for an extended period of time. Do not turn off your computer during this process."
+
+LangString MsgBoxWUA2000Datacenter ${LANG_ENGLISH} \
+ "Windows Update Agent is not supported on Windows 2000 Datacenter Server. The Legacy Update action will be disabled."
+
+; Statuses
+LangString StatusRestarting ${LANG_ENGLISH} "Restarting..."
+LangString StatusRestartingWUAU ${LANG_ENGLISH} "Restarting Windows Update service..."
+LangString StatusCheckingSSL ${LANG_ENGLISH} "Checking SSL connectivity..."
+LangString StatusCbsInstalling ${LANG_ENGLISH} "Configuring updates..."
+
+; Sections
+LangString Setup ${LANG_ENGLISH} "Setup"
+LangString IE ${LANG_ENGLISH} "Internet Explorer"
+LangString PRO ${LANG_ENGLISH} "Professional"
+LangString P64 ${LANG_ENGLISH} "Professional x64 Edition"
+LangString EMB ${LANG_ENGLISH} "Embedded"
+LangString SRV ${LANG_ENGLISH} "Server"
+LangString SP ${LANG_ENGLISH} "Service Pack"
+LangString SSU ${LANG_ENGLISH} "Servicing Stack Update"
+LangString WUA ${LANG_ENGLISH} "Windows Update Agent"
+LangString SecUpd ${LANG_ENGLISH} "Security Update"
+LangString Update ${LANG_ENGLISH} "Update"
+LangString Rollup ${LANG_ENGLISH} "Update Rollup"
+LangString PrepTool ${LANG_ENGLISH} "Preparation Tool"
+LangString PUS ${LANG_ENGLISH} "Platform Update Supplement"
+LangString SHA2 ${LANG_ENGLISH} "SHA-2 Code Signing Support Update"
+LangString CTL ${LANG_ENGLISH} "Certificate Trust List"
+
+LangString SectionWES09 ${LANG_ENGLISH} "Enable Windows Embedded 2009 updates"
+LangString SectionWHS2011U4 ${LANG_ENGLISH} "Windows Home Server 2011 $(Rollup) 4"
+LangString SectionW2KUR1 ${LANG_ENGLISH} "Update Rollup 1 for Windows 2000 $(SP) 4"
+LangString SectionSSU ${LANG_ENGLISH} "Windows Servicing Stack update"
+LangString SectionWUA ${LANG_ENGLISH} "Windows Update Agent update"
+LangString SectionRootCerts ${LANG_ENGLISH} "Root certificates store update"
+LangString SectionEnableMU ${LANG_ENGLISH} "Enable Microsoft Update"
+LangString SectionActivate ${LANG_ENGLISH} "Activate Windows"
+
+LangString SectionReboots ${LANG_ENGLISH} \
+ "Your computer will restart automatically to complete installation."
+LangString SectionSupEULA ${LANG_ENGLISH} \
+ "By installing, you are agreeing to the Supplemental End User License Agreement for this update."
+LangString SectionMSLT ${LANG_ENGLISH} \
+ "By installing, you are agreeing to the Microsoft Software License Terms for this update."
+
+LangString SectionW2KSP4Desc ${LANG_ENGLISH} \
+ "Updates Windows 2000 to Service Pack 4 with Update Rollup 1, as required to install the Windows Update Agent.$\r$\n$(SectionReboots) $(SectionSupEULA)"
+LangString SectionIE6SP1Desc ${LANG_ENGLISH} \
+ "Updates Internet Explorer to 6.0 SP1, as required for Legacy Update.$\r$\n$(SectionReboots) $(SectionSupEULA)"
+LangString SectionXPSP3Desc ${LANG_ENGLISH} \
+ "Updates Windows XP to Service Pack 3. Required if you would like to activate Windows online. $(SectionReboots) $(SectionSupEULA)"
+LangString SectionXPESP3Desc ${LANG_ENGLISH} \
+ "Updates Windows XP Embedded to Service Pack 3. Required if you would like to activate Windows online. $(SectionReboots) $(SectionSupEULA)"
+LangString SectionWES09Desc ${LANG_ENGLISH} \
+ "Configures Windows to appear as Windows Embedded POSReady 2009 to Windows Update, enabling access to Windows XP security updates released between 2014 and 2019. Please note that Microsoft officially advises against doing this."
+LangString Section2003SP2Desc ${LANG_ENGLISH} \
+ "Updates Windows XP Professional x64 Edition or Windows Server 2003 to Service Pack 2. Required if you would like to activate Windows online. $(SectionReboots) $(SectionSupEULA)"
+LangString SectionVistaSP2Desc ${LANG_ENGLISH} \
+ "Updates Windows Vista or Windows Server 2008 to Service Pack 2, as required to install the Windows Update Agent. $(SectionReboots) $(SectionMSLT)"
+LangString SectionVistaSSUDesc ${LANG_ENGLISH} \
+ "Updates Windows Vista or Windows Server 2008 with additional updates required to resolve issues with the Windows Update Agent.$\r$\n$(SectionReboots)"
+LangString SectionVistaIE9Desc ${LANG_ENGLISH} \
+ "Updates Internet Explorer to 9.0.$\r$\n$(SectionReboots) $(SectionMSLT)"
+LangString SectionWin7SP1Desc ${LANG_ENGLISH} \
+ "Updates Windows 7 or Windows Server 2008 R2 to Service Pack 1, as required to install the Windows Update Agent. $(SectionReboots) $(SectionMSLT)"
+LangString SectionWin7SSUDesc ${LANG_ENGLISH} \
+ "Updates Windows 7 or Windows Server 2008 R2 with additional updates required to resolve issues with the Windows Update Agent.$\r$\n$(SectionReboots)"
+LangString SectionWin8SSUDesc ${LANG_ENGLISH} \
+ "Updates Windows 8 or Windows Server 2012 with additional updates required to resolve issues with the Windows Update Agent.$\r$\n$(SectionReboots)"
+LangString SectionWin81U1Desc ${LANG_ENGLISH} \
+ "Updates Windows 8.1 to Update 1, as required to resolve issues with the Windows Update Agent. Also required to upgrade to Windows 10.$\r$\n$(SectionReboots)"
+LangString SectionWin81SSUDesc ${LANG_ENGLISH} \
+ "Updates Windows 8.1 or Windows Server 2012 R2 with additional updates required to resolve issues with the Windows Update Agent.$\r$\n$(SectionReboots)"
+LangString SectionWHS2011U4Desc ${LANG_ENGLISH} \
+ "Updates Windows Home Server 2011 to Update Rollup 4 to resolve issues with the Windows Update Agent. Also fixes data corruption problems.$\r$\n$(SectionReboots)"
+LangString SectionWUADesc ${LANG_ENGLISH} \
+ "Updates the Windows Update Agent to the latest version, as required for Legacy Update."
+LangString SectionRootCertsDesc ${LANG_ENGLISH} \
+ "Updates the root certificate store to the latest from Microsoft, and enables additional modern security features. Root certificates are used to verify the security of encrypted (https) connections. This fixes connection issues with some websites."
+LangString SectionWin7MUDesc ${LANG_ENGLISH} \
+ "Configures Windows Update to receive updates for Microsoft Office and other Microsoft software."
+LangString SectionActivateDesc ${LANG_ENGLISH} \
+ "Your copy of Windows is not activated. If you update the root certificates store, Windows Product Activation can be completed over the internet. Legacy Update can start the activation wizard after installation so you can activate your copy of Windows."
+LangString SectionActiveX2KXPDesc ${LANG_ENGLISH} \
+ "Installs the Legacy Update ActiveX control, enabling access to the full Windows Update interface via the legacyupdate.net website."
+LangString SectionActiveXVista78Desc ${LANG_ENGLISH} \
+ "Installs the Legacy Update ActiveX control, enabling access to the classic Windows Update interface via the legacyupdate.net website. Not required if you want to use the built-in Windows Update Control Panel."
+LangString SectionActiveXWin10Desc ${LANG_ENGLISH} \
+ "Installs the Legacy Update ActiveX control, enabling access to the classic Windows Update interface via the legacyupdate.net website."
+
+; LangString SectionLegacyUpdateDesc ${LANG_ENGLISH} \
+; "Installs Legacy Update, enabling access to Windows Update."
+; LangString SectionWUServerDesc ${LANG_ENGLISH} \
+; "Configures Windows Update to use the Legacy Update proxy server, resolving connection issues to the official Microsoft Windows Update service."
+
+LangString SectionAllowOSUpgrade ${LANG_ENGLISH} "Allow OS Upgrade"
+LangString SectionAllowOSUpgradeDesc ${LANG_ENGLISH} \
+ "Configures Windows Update to deliver the latest feature update. It can help upgrading from Windows 7 to 10 or from Windows 10 to Windows 11."
diff --git a/setup/banner-wordmark-classic.bmp b/setup/banner-wordmark-classic.bmp
new file mode 100644
index 0000000..fff839c
Binary files /dev/null and b/setup/banner-wordmark-classic.bmp differ
diff --git a/setup/banner-wordmark-dark.png b/setup/banner-wordmark-dark.png
new file mode 100644
index 0000000..9a17e96
Binary files /dev/null and b/setup/banner-wordmark-dark.png differ
diff --git a/setup/banner-wordmark-glow.png b/setup/banner-wordmark-glow.png
new file mode 100644
index 0000000..d51b6ee
Binary files /dev/null and b/setup/banner-wordmark-glow.png differ
diff --git a/setup/banner-wordmark-light.png b/setup/banner-wordmark-light.png
new file mode 100644
index 0000000..a43604c
Binary files /dev/null and b/setup/banner-wordmark-light.png differ
diff --git a/setup/setup.nsi b/setup/setup.nsi
index 71c760f..340bd56 100644
--- a/setup/setup.nsi
+++ b/setup/setup.nsi
@@ -115,8 +115,8 @@ Var /GLOBAL UninstallInstalled
!include Strings.nsh
; Uncomment lines below to enable code signing when compiling under Windows
-; !uninstfinalize 'sign.cmd "certPath" certPassword "Legacy Update - Vichingo455 Mod" "%1"' = 0
-; !finalize 'sign.cmd "certPath" certPassword "Legacy Update - Vichingo455 Mod" "%1"' = 0
+; !uninstfinalize 'sign.cmd certFile certPassword "Legacy Update - Vichingo455 Mod" "%1"' = 0
+; !finalize 'sign.cmd certFile certPassword "Legacy Update - Vichingo455 Mod" "%1"' = 0
!macro RestartWUAUService
${DetailPrint} "$(StatusRestartingWUAU)"
diff --git a/shared/Exec.c b/shared/Exec.c
new file mode 100644
index 0000000..5552fc9
--- /dev/null
+++ b/shared/Exec.c
@@ -0,0 +1,43 @@
+#include "stdafx.h"
+#include "Exec.h"
+
+HRESULT Exec(LPWSTR verb, LPWSTR file, LPWSTR params, LPWSTR workingDir, WORD show, BOOL wait, LPDWORD exitCode) {
+ SHELLEXECUTEINFO execInfo = {0};
+ execInfo.cbSize = sizeof(execInfo);
+ execInfo.lpVerb = verb;
+ execInfo.lpFile = file;
+ execInfo.lpParameters = params;
+ execInfo.lpDirectory = workingDir;
+ execInfo.nShow = show;
+ return ExecEx(&execInfo, wait, exitCode);
+}
+
+HRESULT ExecEx(LPSHELLEXECUTEINFO execInfo, BOOL wait, LPDWORD exitCode) {
+ if (wait) {
+ execInfo->fMask |= SEE_MASK_NOCLOSEPROCESS;
+ }
+
+ if (!ShellExecuteEx(execInfo)) {
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ HRESULT hr = S_OK;
+
+ if (wait) {
+ if (execInfo->hProcess == NULL) {
+ TRACE(L"ShellExecuteEx() didn't return a handle: %u", GetLastError());
+ hr = E_FAIL;
+ }
+
+ WaitForSingleObject(execInfo->hProcess, INFINITE);
+
+ if (exitCode != NULL && GetExitCodeProcess(execInfo->hProcess, exitCode) == 0) {
+ hr = HRESULT_FROM_WIN32(GetLastError());
+ TRACE(L"GetExitCodeProcess() failed: %p\n", hr);
+ }
+
+ CloseHandle(execInfo->hProcess);
+ }
+
+ return hr;
+}
diff --git a/shared/Exec.h b/shared/Exec.h
new file mode 100644
index 0000000..70d63c4
--- /dev/null
+++ b/shared/Exec.h
@@ -0,0 +1,7 @@
+#pragma once
+
+#include
+#include
+
+EXTERN_C HRESULT Exec(LPWSTR verb, LPWSTR file, LPWSTR params, LPWSTR workingDir, WORD show, BOOL wait, LPDWORD exitCode);
+EXTERN_C HRESULT ExecEx(LPSHELLEXECUTEINFO execInfo, BOOL wait, LPDWORD exitCode);
diff --git a/shared/GetPidForName.c b/shared/GetPidForName.c
new file mode 100644
index 0000000..dcbdf0d
--- /dev/null
+++ b/shared/GetPidForName.c
@@ -0,0 +1,36 @@
+#include "stdafx.h"
+#include
+#include "GetPidForName.h"
+
+#pragma comment(lib, "psapi.lib")
+
+DWORD GetPidForName(const LPTSTR process) {
+ // Yes, eat all of our SHRTs!
+ DWORD pids[SHRT_MAX];
+ DWORD bytesReturned;
+ if (!EnumProcesses(pids, sizeof(pids), &bytesReturned)) {
+ return 0;
+ }
+
+ DWORD count = bytesReturned / sizeof(DWORD);
+ for (DWORD i = 0; i < count; ++i) {
+ HANDLE handle = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | PROCESS_VM_READ, FALSE, pids[i]);
+ if (handle) {
+ WCHAR path[MAX_PATH];
+ if (GetModuleBaseName(handle, NULL, path, ARRAYSIZE(path))) {
+ LPWSTR basename = wcsrchr(path, L'\\');
+ if (basename) {
+ basename += 1;
+ CharLowerBuffW(basename, (DWORD)wcslen(basename));
+ if (_wcsicmp(process, basename) == 0) {
+ CloseHandle(handle);
+ return pids[i];
+ }
+ }
+ }
+ CloseHandle(handle);
+ }
+ }
+
+ return 0;
+}
diff --git a/shared/GetPidForName.h b/shared/GetPidForName.h
new file mode 100644
index 0000000..8727dd1
--- /dev/null
+++ b/shared/GetPidForName.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+EXTERN_C DWORD GetPidForName(LPTSTR process);
diff --git a/shared/LegacyUpdate.c b/shared/LegacyUpdate.c
new file mode 100644
index 0000000..392c305
--- /dev/null
+++ b/shared/LegacyUpdate.c
@@ -0,0 +1,31 @@
+#include "stdafx.h"
+#include
+#include "Registry.h"
+
+static LPWSTR _installPath;
+
+EXTERN_C HRESULT GetInstallPath(LPWSTR *path) {
+ *path = (LPWSTR)LocalAlloc(LPTR, MAX_PATH * sizeof(WCHAR));
+ HRESULT hr = S_OK;
+
+ if (!_installPath) {
+ DWORD size = 0;
+ hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\LegacyUpdate", L"InstallLocation", KEY_WOW64_64KEY, &_installPath, &size);
+ if (SUCCEEDED(hr)) {
+ lstrcpy(*path, _installPath);
+ return S_OK;
+ }
+
+ // Do our best to guess where it should be
+ LPWSTR programFiles;
+ hr = GetRegistryString(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\CurrentVersion", L"ProgramFilesDir", KEY_WOW64_64KEY, &programFiles, &size);
+ if (SUCCEEDED(hr)) {
+ _installPath = (LPWSTR)LocalAlloc(LPTR, MAX_PATH * sizeof(WCHAR));
+ wsprintf(_installPath, L"%ls\\Legacy Update", programFiles);
+ LocalFree(programFiles);
+ }
+ }
+
+ lstrcpy(*path, _installPath);
+ return hr;
+}
diff --git a/shared/LegacyUpdate.h b/shared/LegacyUpdate.h
new file mode 100644
index 0000000..0402d0e
--- /dev/null
+++ b/shared/LegacyUpdate.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+EXTERN_C HRESULT GetInstallPath(LPWSTR *path);
diff --git a/shared/LoadImage.c b/shared/LoadImage.c
new file mode 100644
index 0000000..8cbe8c0
--- /dev/null
+++ b/shared/LoadImage.c
@@ -0,0 +1,256 @@
+#include
+#include
+#include
+
+// Adapted from https://faithlife.codes/blog/2008/09/displaying_a_splash_screen_with_c_part_i/
+// 1. Get resource as an IStream
+// 2. Use Windows Imaging Component to load the PNG
+// 3. Convert the WIC bitmap to an HBITMAP
+// Why does loading a PNG need to be so difficult?
+
+typedef HRESULT (WINAPI *_WICConvertBitmapSource)(REFWICPixelFormatGUID dstFormat, IWICBitmapSource *pISrc, IWICBitmapSource **ppIDst);
+
+static _WICConvertBitmapSource $WICConvertBitmapSource;
+
+static HGLOBAL GetRawResource(HINSTANCE hInstance, LPWSTR name, LPWSTR type) {
+ HRSRC resource = FindResource(hInstance, name, type);
+ if (!resource) {
+ TRACE(L"FindResource failed: %d", GetLastError());
+ return NULL;
+ }
+
+ DWORD resourceSize = SizeofResource(hInstance, resource);
+ HGLOBAL imageHandle = LoadResource(hInstance, resource);
+ if (!imageHandle) {
+ TRACE(L"LoadResource failed: %d", GetLastError());
+ return NULL;
+ }
+
+ LPVOID sourceResourceData = LockResource(imageHandle);
+ if (!sourceResourceData) {
+ TRACE(L"LockResource failed: %d", GetLastError());
+ return NULL;
+ }
+
+ HGLOBAL resourceDataHandle = GlobalAlloc(GMEM_MOVEABLE, resourceSize);
+ if (!resourceDataHandle) {
+ TRACE(L"GlobalAlloc failed: %d", GetLastError());
+ return NULL;
+ }
+
+ LPVOID resourceData = GlobalLock(resourceDataHandle);
+ if (!resourceData) {
+ TRACE(L"GlobalLock failed: %d", GetLastError());
+ GlobalFree(resourceDataHandle);
+ return NULL;
+ }
+
+ CopyMemory(resourceData, sourceResourceData, resourceSize);
+ GlobalUnlock(resourceDataHandle);
+ return resourceDataHandle;
+}
+
+static IStream *GetResourceStream(HINSTANCE hInstance, LPWSTR name, LPWSTR type) {
+ IStream *stream;
+ HGLOBAL resource = GetRawResource(hInstance, name, type);
+ if (!resource) {
+ TRACE(L"GetResource failed: %d", GetLastError());
+ return NULL;
+ }
+
+ if (SUCCEEDED(CreateStreamOnHGlobal(resource, TRUE, &stream))) {
+ return stream;
+ }
+
+ GlobalFree(resource);
+ return NULL;
+}
+
+static IWICBitmapSource *GetWICBitmap(IStream *imageStream) {
+ IWICBitmapSource *bitmap;
+ IWICBitmapDecoder *decoder;
+ UINT frameCount;
+ IWICBitmapFrameDecode *frame;
+
+ if (!SUCCEEDED(CoCreateInstance(&CLSID_WICPngDecoder, NULL, CLSCTX_INPROC_SERVER, &IID_IWICBitmapDecoder, (LPVOID *)&decoder))) {
+ return NULL;
+ }
+
+ if (!SUCCEEDED(IWICBitmapDecoder_Initialize(decoder, imageStream, WICDecodeMetadataCacheOnLoad))) {
+ goto end;
+ }
+
+ if (!SUCCEEDED(IWICBitmapDecoder_GetFrameCount(decoder, &frameCount)) || frameCount != 1) {
+ goto end;
+ }
+
+ if (!SUCCEEDED(IWICBitmapDecoder_GetFrame(decoder, 0, &frame))) {
+ goto end;
+ }
+
+ $WICConvertBitmapSource(&GUID_WICPixelFormat32bppPBGRA, (IWICBitmapSource *)frame, &bitmap);
+ IWICBitmapFrameDecode_Release(frame);
+
+end:
+ IWICBitmapDecoder_Release(decoder);
+ return bitmap;
+}
+
+static HBITMAP GetHBitmapForWICBitmap(IWICBitmapSource *bitmap) {
+ HBITMAP hBitmap;
+ UINT width, height;
+ if (!SUCCEEDED(IWICBitmapSource_GetSize(bitmap, &width, &height)) || width == 0 || height == 0) {
+ return NULL;
+ }
+
+ BITMAPINFO bminfo;
+ ZeroMemory(&bminfo, sizeof(bminfo));
+ bminfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bminfo.bmiHeader.biWidth = width;
+ bminfo.bmiHeader.biHeight = -(LONG)height;
+ bminfo.bmiHeader.biPlanes = 1;
+ bminfo.bmiHeader.biBitCount = 32;
+ bminfo.bmiHeader.biCompression = BI_RGB;
+
+ void *imageBits;
+ HDC screenDC = GetDC(NULL);
+ hBitmap = CreateDIBSection(screenDC, &bminfo, DIB_RGB_COLORS, &imageBits, NULL, 0);
+ ReleaseDC(NULL, screenDC);
+ if (!hBitmap) {
+ return NULL;
+ }
+
+ UINT stride = width * 4;
+ UINT imageSize = stride * height;
+ if (!SUCCEEDED(IWICBitmapSource_CopyPixels(bitmap, NULL, stride, imageSize, (BYTE*)imageBits))) {
+ DeleteObject(hBitmap);
+ return NULL;
+ }
+
+ return hBitmap;
+}
+
+HBITMAP LoadPNGResource(HINSTANCE hInstance, LPWSTR resourceName, LPWSTR resourceType) {
+ if (!$WICConvertBitmapSource) {
+ $WICConvertBitmapSource = (_WICConvertBitmapSource)GetProcAddress(LoadLibrary(L"windowscodecs.dll"), "WICConvertBitmapSource");
+ if (!$WICConvertBitmapSource) {
+ return NULL;
+ }
+ }
+
+ IStream *imageStream = GetResourceStream(hInstance, resourceName, resourceType);
+ if (!imageStream) {
+ TRACE(L"GetResourceStream failed: %d", GetLastError());
+ return NULL;
+ }
+
+ IWICBitmapSource *bitmap = GetWICBitmap(imageStream);
+ if (!bitmap) {
+ TRACE(L"GetWICBitmap failed: %d", GetLastError());
+ IStream_Release(imageStream);
+ return NULL;
+ }
+
+ HBITMAP result = GetHBitmapForWICBitmap(bitmap);
+ IWICBitmapSource_Release(bitmap);
+ IStream_Release(imageStream);
+ return result;
+}
+
+BOOL ScaleAndWriteToBMP(HBITMAP hBitmap, DWORD width, DWORD height, LPWSTR outputPath) {
+ BOOL result = FALSE;
+ if (!hBitmap) {
+ TRACE(L"Null bitmap");
+ return FALSE;
+ }
+
+ HDC hdc = GetDC(NULL);
+ HDC hdcMem = CreateCompatibleDC(hdc);
+ HBITMAP scaledBitmap = CreateCompatibleBitmap(hdc, width, height);
+ if (!scaledBitmap) {
+ TRACE(L"CreateCompatibleBitmap failed: %d", GetLastError());
+ goto end;
+ }
+
+ BITMAP bmp;
+ if (!GetObject(hBitmap, sizeof(BITMAP), &bmp)) {
+ TRACE(L"GetObject failed: %d", GetLastError());
+ goto end;
+ }
+
+ HBITMAP hOld = (HBITMAP)SelectObject(hdcMem, hBitmap);
+ HDC hdcMemScaled = CreateCompatibleDC(hdc);
+ HBITMAP hOldScaled = (HBITMAP)SelectObject(hdcMemScaled, scaledBitmap);
+ SetStretchBltMode(hdcMemScaled, HALFTONE);
+
+ if (!StretchBlt(hdcMemScaled,
+ 0, 0, width, height, hdcMem,
+ 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY)) {
+ TRACE(L"StretchBlt failed: %d", GetLastError());
+ goto end;
+ }
+
+ BITMAPINFOHEADER bmih = {0};
+ bmih.biSize = sizeof(BITMAPINFOHEADER);
+ bmih.biWidth = width;
+ bmih.biHeight = height;
+ bmih.biPlanes = 1;
+ bmih.biBitCount = bmp.bmBitsPixel;
+ bmih.biCompression = BI_RGB;
+ bmih.biSizeImage = ((width * bmp.bmBitsPixel + 31) / 32) * 4 * height;
+
+ BITMAPFILEHEADER bmfh = {0};
+ bmfh.bfType = 0x4D42;
+ bmfh.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
+ bmfh.bfSize = bmfh.bfOffBits + bmih.biSizeImage;
+
+ HGLOBAL handle = GlobalAlloc(GMEM_MOVEABLE, bmih.biSizeImage);
+ if (!handle) {
+ TRACE(L"GlobalAlloc failed: %d", GetLastError());
+ goto end;
+ }
+
+ BYTE *bitmapData = (BYTE *)GlobalLock(handle);
+ if (!bitmapData) {
+ TRACE(L"GlobalLock failed: %d", GetLastError());
+ goto end;
+ }
+
+ if (!GetDIBits(hdcMemScaled, scaledBitmap, 0, height, bitmapData, (BITMAPINFO *)&bmih, DIB_RGB_COLORS)) {
+ TRACE(L"GetDIBits failed: %d", GetLastError());
+ goto end;
+ }
+
+ HANDLE file = CreateFile(outputPath, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
+ if (file == INVALID_HANDLE_VALUE) {
+ TRACE(L"CreateFile failed: %d", GetLastError());
+ goto end;
+ }
+
+ DWORD written;
+ if (!WriteFile(file, &bmfh, sizeof(BITMAPFILEHEADER), &written, NULL) ||
+ !WriteFile(file, &bmih, sizeof(BITMAPINFOHEADER), &written, NULL) ||
+ !WriteFile(file, bitmapData, bmih.biSizeImage, &written, NULL)) {
+ TRACE(L"WriteFile failed: %d", GetLastError());
+ goto end;
+ }
+
+ result = TRUE;
+
+end:
+ if (file && file != INVALID_HANDLE_VALUE) {
+ CloseHandle(file);
+ }
+ if (scaledBitmap) {
+ DeleteObject(scaledBitmap);
+ }
+ if (handle) {
+ GlobalUnlock(handle);
+ GlobalFree(handle);
+ }
+ ReleaseDC(NULL, hdc);
+ DeleteDC(hdcMem);
+ DeleteDC(hdcMemScaled);
+
+ return result;
+}
diff --git a/shared/LoadImage.h b/shared/LoadImage.h
new file mode 100644
index 0000000..6a54730
--- /dev/null
+++ b/shared/LoadImage.h
@@ -0,0 +1,4 @@
+#include
+
+HBITMAP LoadPNGResource(HINSTANCE hInstance, LPWSTR resourceName, LPWSTR resourceType);
+BOOL ScaleAndWriteToBMP(HBITMAP hBitmap, DWORD width, DWORD height, LPWSTR outputPath);
diff --git a/shared/Registry.c b/shared/Registry.c
new file mode 100644
index 0000000..4659b2a
--- /dev/null
+++ b/shared/Registry.c
@@ -0,0 +1,93 @@
+#include "stdafx.h"
+#include "Registry.h"
+#include "VersionInfo.h"
+#include
+
+static ALWAYS_INLINE REGSAM GetWow64Flag(REGSAM options) {
+#ifdef _WIN64
+ return options;
+#else
+ if (AtLeastWinXP2002()) {
+ return options;
+ }
+
+ // Filter out WOW64 keys, which are not supported on Windows 2000
+ return options & ~(KEY_WOW64_64KEY | KEY_WOW64_32KEY);
+#endif
+}
+
+HRESULT GetRegistryString(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueName, REGSAM options, LPWSTR *data, LPDWORD size) {
+ HKEY subkey;
+ HRESULT hr = HRESULT_FROM_WIN32(RegOpenKeyEx(key, subkeyPath, 0, GetWow64Flag(KEY_READ | options), &subkey));
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ if (data) {
+ DWORD length = 512 * sizeof(WCHAR);
+ LPWSTR buffer = (LPWSTR)LocalAlloc(LPTR, length);
+ if (!buffer) {
+ hr = E_OUTOFMEMORY;
+ goto end;
+ }
+
+ LSTATUS status;
+ do {
+ status = RegQueryValueEx(subkey, valueName, NULL, NULL, (BYTE *)buffer, &length);
+ if (status == ERROR_MORE_DATA) {
+ length += 256 * sizeof(WCHAR);
+ LPWSTR newBuffer = (LPWSTR)LocalReAlloc(buffer, length, LMEM_MOVEABLE);
+ if (!newBuffer) {
+ LocalFree(buffer);
+ hr = E_OUTOFMEMORY;
+ goto end;
+ }
+
+ buffer = newBuffer;
+ } else if (status != ERROR_SUCCESS) {
+ hr = HRESULT_FROM_WIN32(status);
+ LocalFree(buffer);
+ goto end;
+ }
+ } while (status == ERROR_MORE_DATA);
+
+ *data = buffer;
+
+ if (size) {
+ *size = length / sizeof(WCHAR);
+ }
+ }
+
+end:
+ if (subkey) {
+ RegCloseKey(subkey);
+ }
+ if (!SUCCEEDED(hr)) {
+ if (data) {
+ *data = NULL;
+ }
+ if (size) {
+ *size = 0;
+ }
+ }
+ return hr;
+}
+
+HRESULT GetRegistryDword(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueName, REGSAM options, LPDWORD data) {
+ HKEY subkey;
+ HRESULT hr = HRESULT_FROM_WIN32(RegOpenKeyEx(key, subkeyPath, 0, GetWow64Flag(KEY_READ | options), &subkey));
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ if (data) {
+ DWORD length = sizeof(DWORD);
+ hr = HRESULT_FROM_WIN32(RegQueryValueEx(subkey, valueName, NULL, NULL, (LPBYTE)data, &length));
+ }
+
+end:
+ if (subkey) {
+ RegCloseKey(subkey);
+ }
+ return hr;
+}
diff --git a/shared/Registry.h b/shared/Registry.h
new file mode 100644
index 0000000..c4dc70e
--- /dev/null
+++ b/shared/Registry.h
@@ -0,0 +1,6 @@
+#pragma once
+
+#include
+
+EXTERN_C HRESULT GetRegistryString(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueName, REGSAM options, LPWSTR *data, LPDWORD size);
+EXTERN_C HRESULT GetRegistryDword(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueName, REGSAM options, LPDWORD data);
diff --git a/shared/Startup.h b/shared/Startup.h
new file mode 100644
index 0000000..f78cae3
--- /dev/null
+++ b/shared/Startup.h
@@ -0,0 +1,45 @@
+#pragma once
+
+#include
+
+typedef void (WINAPI *_SetDefaultDllDirectories)(DWORD DirectoryFlags);
+typedef BOOL (WINAPI *_SetDllDirectoryW)(LPWSTR);
+
+static inline void HardenDllSearchPaths() {
+ // Try our best to secure DLL search paths to just system32
+ WCHAR path[MAX_PATH];
+
+ // Reset %windir% and %SystemRoot%
+ GetWindowsDirectory(path, ARRAYSIZE(path));
+ SetEnvironmentVariable(L"WINDIR", path);
+ SetEnvironmentVariable(L"SystemRoot", path);
+
+ // Reset %PATH% to just system32
+ ZeroMemory(path, sizeof(path));
+ GetSystemDirectory(path, ARRAYSIZE(path));
+ SetEnvironmentVariable(L"PATH", path);
+
+ wcscat(path, L"\\kernel32.dll");
+ HMODULE kernel32 = GetModuleHandle(path);
+ if (!kernel32) {
+ return;
+ }
+
+ // Windows Vista SP2+/7 SP1+ with KB2533623
+ _SetDefaultDllDirectories $SetDefaultDllDirectories = (_SetDefaultDllDirectories)GetProcAddress(kernel32, "SetDefaultDllDirectories");
+ if ($SetDefaultDllDirectories) {
+ $SetDefaultDllDirectories(LOAD_LIBRARY_SEARCH_SYSTEM32);
+ return;
+ }
+
+ // Windows XP SP1+
+ _SetDllDirectoryW $SetDllDirectoryW = (_SetDllDirectoryW)GetProcAddress(kernel32, "SetDllDirectoryW");
+ if ($SetDllDirectoryW) {
+ $SetDllDirectoryW(L"");
+ return;
+ }
+}
+
+static inline void Startup() {
+ HardenDllSearchPaths();
+}
diff --git a/shared/Trace.h b/shared/Trace.h
new file mode 100644
index 0000000..3574874
--- /dev/null
+++ b/shared/Trace.h
@@ -0,0 +1,16 @@
+#pragma once
+
+#if defined(ATLTRACE)
+ #define TRACE ATLTRACE
+#elif defined(_DEBUG)
+ // Yeah, sue me lol
+ #define TRACE(...) { \
+ LPWSTR __traceMsg = (LPWSTR)LocalAlloc(LPTR, 4096 * sizeof(WCHAR)); \
+ wsprintf(__traceMsg, L"%hs(%d): %hs: ", __FILE__, __LINE__, __FUNCTION__); \
+ wsprintf(__traceMsg + wcslen(__traceMsg), __VA_ARGS__); \
+ MessageBox(NULL, __traceMsg, L"Debug", MB_OK); \
+ LocalFree(__traceMsg); \
+ }
+#else
+ #define TRACE(...)
+#endif
diff --git a/shared/User.h b/shared/User.h
new file mode 100644
index 0000000..bb418ee
--- /dev/null
+++ b/shared/User.h
@@ -0,0 +1,20 @@
+#pragma once
+
+#include
+
+static inline BOOL IsUserAdmin() {
+ SID_IDENTIFIER_AUTHORITY authority = SECURITY_NT_AUTHORITY;
+ PSID adminsSid;
+ BOOL result = FALSE;
+
+ if (!AllocateAndInitializeSid(&authority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &adminsSid)) {
+ return FALSE;
+ }
+
+ if (!CheckTokenMembership(NULL, adminsSid, &result)) {
+ result = FALSE;
+ }
+
+ FreeSid(adminsSid);
+ return result;
+}
diff --git a/shared/Version.h b/shared/Version.h
new file mode 100644
index 0000000..7b05a77
--- /dev/null
+++ b/shared/Version.h
@@ -0,0 +1,6 @@
+#define VERSION_MAJOR 1
+#define VERSION_MINOR 11
+#define VERSION_PATCH 0
+#define VERSION_BUILD 0
+
+#define VERSION_STRING "1.11"
diff --git a/shared/VersionInfo.c b/shared/VersionInfo.c
new file mode 100644
index 0000000..4873aa3
--- /dev/null
+++ b/shared/VersionInfo.c
@@ -0,0 +1,44 @@
+#include "stdafx.h"
+#include "VersionInfo.h"
+
+static BOOL _loadedOwnVersion = FALSE;
+static LPWSTR _version;
+
+HRESULT GetOwnVersion(LPWSTR *version) {
+ if (!_loadedOwnVersion) {
+ _loadedOwnVersion = TRUE;
+
+ LPWSTR filename;
+ GetOwnFileName(&filename);
+
+ DWORD verHandle;
+ DWORD verInfoSize = GetFileVersionInfoSize(filename, &verHandle);
+ if (verInfoSize == 0) {
+ LocalFree(filename);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ LPVOID verInfo = LocalAlloc(LPTR, verInfoSize);
+ if (!GetFileVersionInfo(filename, verHandle, verInfoSize, verInfo)) {
+ LocalFree(filename);
+ LocalFree(verInfo);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ LocalFree(filename);
+
+ LPWSTR value;
+ UINT size;
+ if (!VerQueryValue(verInfo, L"\\StringFileInfo\\040904B0\\ProductVersion", (LPVOID *)&value, &size)) {
+ LocalFree(verInfo);
+ return HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ _version = (LPWSTR)LocalAlloc(LPTR, (wcslen(value) + 1) * sizeof(WCHAR));
+ wcscpy(_version, value);
+ LocalFree(verInfo);
+ }
+
+ *version = _version;
+ return _version == NULL ? E_FAIL : S_OK;
+}
diff --git a/shared/WMI.c b/shared/WMI.c
new file mode 100644
index 0000000..c1e744a
--- /dev/null
+++ b/shared/WMI.c
@@ -0,0 +1,79 @@
+#include "stdafx.h"
+#include "WMI.h"
+#include
+
+#pragma comment(lib, "wbemuuid.lib")
+
+#ifdef __cplusplus
+ #define our_CLSID_WbemLocator CLSID_WbemLocator
+ #define our_IID_IWbemLocator IID_IWbemLocator
+ #define IWbemLocator_ConnectServer(obj, ...) obj->ConnectServer(__VA_ARGS__)
+ #define IWbemServices_ExecQuery(obj, ...) obj->ExecQuery(__VA_ARGS__)
+ #define IEnumWbemClassObject_Next(obj, ...) obj->Next(__VA_ARGS__)
+ #define IWbemClassObject_Get(obj, ...) obj->Get(__VA_ARGS__)
+ #define IWbemClassObject_Release(obj) obj->Release()
+ #define IEnumWbemClassObject_Release(obj) obj->Release()
+ #define IWbemServices_Release(obj) obj->Release()
+ #define IWbemLocator_Release(obj) obj->Release()
+#else
+ #define our_CLSID_WbemLocator &CLSID_WbemLocator
+ #define our_IID_IWbemLocator &IID_IWbemLocator
+#endif
+
+HRESULT QueryWMIProperty(LPWSTR query, LPWSTR property, LPVARIANT value) {
+ IWbemLocator *locator = NULL;
+ IWbemServices *services = NULL;
+ IEnumWbemClassObject *enumerator = NULL;
+ IWbemClassObject *object = NULL;
+ HRESULT hr = CoCreateInstance(our_CLSID_WbemLocator, NULL, CLSCTX_INPROC_SERVER, our_IID_IWbemLocator, (void **)&locator);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ BSTR server = SysAllocString(L"ROOT\\CIMV2");
+ hr = IWbemLocator_ConnectServer(locator, server, NULL, NULL, NULL, 0, NULL, NULL, &services);
+ SysFreeString(server);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ hr = CoSetProxyBlanket((IUnknown *)services, RPC_C_AUTHN_WINNT, RPC_C_AUTHZ_NONE, NULL, RPC_C_AUTHN_LEVEL_CALL, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ BSTR wql = SysAllocString(L"WQL");
+ BSTR queryBstr = SysAllocString(query);
+ hr = IWbemServices_ExecQuery(services, wql, queryBstr, WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &enumerator);
+ SysFreeString(wql);
+ SysFreeString(queryBstr);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ ULONG uReturn = 0;
+ hr = IEnumWbemClassObject_Next(enumerator, WBEM_INFINITE, 1, &object, &uReturn);
+ if (!SUCCEEDED(hr)) {
+ goto end;
+ }
+
+ BSTR propBstr = SysAllocString(property);
+ hr = IWbemClassObject_Get(object, propBstr, 0, value, NULL, NULL);
+ SysFreeString(propBstr);
+
+end:
+ if (object) {
+ IWbemClassObject_Release(object);
+ }
+ if (enumerator) {
+ IEnumWbemClassObject_Release(enumerator);
+ }
+ if (services) {
+ IWbemServices_Release(services);
+ }
+ if (locator) {
+ IWbemLocator_Release(locator);
+ }
+
+ return hr;
+}
diff --git a/shared/WULog.h b/shared/WULog.h
new file mode 100644
index 0000000..ca1d17b
--- /dev/null
+++ b/shared/WULog.h
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "stdafx.h"
+#include
+#include
+#include "Exec.h"
+#include "HResult.h"
+#include "VersionInfo.h"
+
+static inline HRESULT ViewWindowsUpdateLog(int nCmdShow) {
+ WCHAR windir[MAX_PATH];
+ HRESULT hr = SHGetFolderPath(0, CSIDL_WINDOWS, NULL, 0, windir);
+ if (!SUCCEEDED(hr)) {
+ TRACE(L"SHGetFolderPath() failed: %ls\n", GetMessageForHresult(hr));
+ return hr;
+ }
+
+ LPWSTR workDir = windir;
+
+ if (AtLeastWin10()) {
+ // Windows 10 moves WU/USO logs to ETW. The ETW logs can be converted back to a plain-text .log
+ // using a cmdlet.
+ WCHAR powershell[MAX_PATH];
+ ExpandEnvironmentStrings(L"%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe", powershell, ARRAYSIZE(powershell));
+
+ DWORD code;
+ HRESULT hr = Exec(NULL, powershell, L"-Command Get-WindowsUpdateLog", windir, nCmdShow, TRUE, &code);
+ if (!SUCCEEDED(hr) || code != 0) {
+ return hr;
+ }
+
+ // On success, the log is written to Desktop\WindowsUpdate.log.
+ WCHAR desktop[MAX_PATH];
+ hr = SHGetFolderPath(0, CSIDL_DESKTOP, NULL, 0, desktop);
+ if (!SUCCEEDED(hr)) {
+ TRACE(L"SHGetFolderPath() failed: %ls\n", GetMessageForHresult(hr));
+ return hr;
+ }
+
+ workDir = desktop;
+ }
+
+ return Exec(L"open", L"WindowsUpdate.log", NULL, workDir, nCmdShow, FALSE, NULL);
+}
diff --git a/shared/Wow64.c b/shared/Wow64.c
new file mode 100644
index 0000000..ac133c7
--- /dev/null
+++ b/shared/Wow64.c
@@ -0,0 +1,45 @@
+#include "stdafx.h"
+#include "Wow64.h"
+
+typedef BOOL (WINAPI *_Wow64DisableWow64FsRedirection)(PVOID *OldValue);
+typedef BOOL (WINAPI *_Wow64RevertWow64FsRedirection)(PVOID OldValue);
+
+static BOOL _loadedWow64;
+static _Wow64DisableWow64FsRedirection $Wow64DisableWow64FsRedirection;
+static _Wow64RevertWow64FsRedirection $Wow64RevertWow64FsRedirection;
+
+#if _WIN64
+// Not needed
+#define DisableWow64FsRedirection(OldValue) TRUE
+#define RevertWow64FsRedirection(OldValue) TRUE
+#else
+static void LoadWow64Symbols() {
+ if (!_loadedWow64) {
+ _loadedWow64 = TRUE;
+
+ HMODULE kernel32 = GetModuleHandle(L"kernel32.dll");
+ $Wow64DisableWow64FsRedirection = (_Wow64DisableWow64FsRedirection)GetProcAddress(kernel32, "Wow64DisableWow64FsRedirection");
+ $Wow64RevertWow64FsRedirection = (_Wow64RevertWow64FsRedirection)GetProcAddress(kernel32, "Wow64RevertWow64FsRedirection");
+ }
+}
+
+BOOL DisableWow64FsRedirection(PVOID *OldValue) {
+ LoadWow64Symbols();
+
+ if ($Wow64DisableWow64FsRedirection) {
+ return $Wow64DisableWow64FsRedirection(OldValue);
+ } else {
+ return TRUE;
+ }
+}
+
+BOOL RevertWow64FsRedirection(PVOID OldValue) {
+ LoadWow64Symbols();
+
+ if ($Wow64RevertWow64FsRedirection) {
+ return $Wow64RevertWow64FsRedirection(OldValue);
+ } else {
+ return TRUE;
+ }
+}
+#endif
diff --git a/shared/Wow64.h b/shared/Wow64.h
new file mode 100644
index 0000000..95b0655
--- /dev/null
+++ b/shared/Wow64.h
@@ -0,0 +1,6 @@
+#pragma once
+
+#include
+
+BOOL DisableWow64FsRedirection(PVOID *OldValue);
+BOOL RevertWow64FsRedirection(PVOID OldValue);