Full Code of kirb/LegacyUpdate for AI

main aa9588ac9647 cached
179 files
1.4 MB
419.4k tokens
719 symbols
1 requests
Download .txt
Showing preview only (1,487K chars total). Download the full file or copy to clipboard to get everything.
Repository: kirb/LegacyUpdate
Branch: main
Commit: aa9588ac9647
Files: 179
Total size: 1.4 MB

Directory structure:
gitextract_cbt5iapr/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01-bug_report.yml
│   │   ├── 02-update_issue.yml
│   │   ├── 03-download_center_issue.yml
│   │   ├── 04-feature_suggestion.yml
│   │   └── config.yml
│   └── workflows/
│       ├── build-nt4.yml
│       └── build.yml
├── .gitignore
├── .idea/
│   └── .idea.LegacyUpdate/
│       └── .idea/
│           ├── .gitignore
│           ├── discord.xml
│           ├── indexLayout.xml
│           └── vcs.xml
├── .vscode/
│   ├── c_cpp_properties.json
│   └── settings.json
├── LICENSE.md
├── LegacyUpdate/
│   ├── ClassFactory.cpp
│   ├── ClassFactory.h
│   ├── Compat.cpp
│   ├── Compat.h
│   ├── ElevationHelper.cpp
│   ├── ElevationHelper.h
│   ├── IUpdateInstaller4.h
│   ├── LaunchUpdateSite.cpp
│   ├── LegacyUpdate.def
│   ├── LegacyUpdate.idl
│   ├── LegacyUpdate.rc
│   ├── LegacyUpdate.vcxproj
│   ├── LegacyUpdate.vcxproj.filters
│   ├── LegacyUpdateCtrl.cpp
│   ├── LegacyUpdateCtrl.h
│   ├── Makefile
│   ├── NGen.cpp
│   ├── NGen.h
│   ├── ProductName.cpp
│   ├── ProductName.h
│   ├── ProgressBarControl.cpp
│   ├── ProgressBarControl.h
│   ├── ProgressBarControl.html
│   ├── Utils.cpp
│   ├── Utils.h
│   ├── dlldatax.c
│   ├── dlldatax.h
│   ├── dllmain.cpp
│   ├── dllmain.h
│   ├── resource.h
│   ├── stdafx.h
│   ├── wuapi.idl
│   ├── wuerror.mc
│   └── wuguid.cpp
├── LegacyUpdate.sln
├── Makefile
├── README.md
├── build/
│   ├── fix-nsis.sh
│   ├── get-nt4-patches.sh
│   ├── getvc.cmd
│   ├── shared.mk
│   ├── sign.cmd
│   └── sign.sh
├── include/
│   ├── com/
│   │   ├── ComClass.h
│   │   ├── ComPtr.h
│   │   ├── IDispatchImpl.h
│   │   ├── IOleInPlaceActiveObjectImpl.h
│   │   ├── IOleInPlaceObjectImpl.h
│   │   ├── IOleObjectImpl.h
│   │   ├── IQuickActivateImpl.h
│   │   ├── IUnknownImpl.h
│   │   ├── IViewObjectExImpl.h
│   │   └── helpers.h
│   ├── com.h
│   ├── licdll.h
│   ├── licdll.idl
│   ├── nsis/
│   │   ├── api.h
│   │   ├── nsis_tchar.h
│   │   ├── pluginapi.c
│   │   └── pluginapi.h
│   ├── slpublic.h
│   ├── wuapi.h
│   └── wuerror.h
├── launcher/
│   ├── CplTasks.xml
│   ├── InitRunOnce.c
│   ├── LaunchLog.c
│   ├── LaunchUpdateSite.c
│   ├── Makefile
│   ├── MsgBox.c
│   ├── MsgBox.h
│   ├── Options.c
│   ├── RegisterServer.c
│   ├── RegisterServer.h
│   ├── SelfElevate.c
│   ├── SelfElevate.h
│   ├── main.c
│   ├── main.h
│   ├── manifest.xml
│   ├── resource.h
│   ├── resource.rc
│   └── stdafx.h
├── nsisplugin/
│   ├── CloseIEWindows.c
│   ├── DialogInit.c
│   ├── EnableMicrosoftUpdate.c
│   ├── Exec.c
│   ├── IsActivated.c
│   ├── IsAdmin.c
│   ├── IsMultiCPU.c
│   ├── IsServerCore.c
│   ├── Makefile
│   ├── MessageForHresult.c
│   ├── NeedsRootsUpdate.c
│   ├── RebootPage.c
│   ├── TaskbarProgress.c
│   ├── UpdateRoots.c
│   ├── VerifyFileHash.c
│   ├── WriteLog.c
│   ├── main.c
│   ├── main.h
│   ├── resource.h
│   ├── resource.rc
│   ├── sha256.c
│   ├── sha256.h
│   └── stdafx.h
├── setup/
│   ├── ActiveX.inf
│   ├── ActiveXPage.nsh
│   ├── AeroWizard.nsh
│   ├── Common.nsh
│   ├── Constants.nsh
│   ├── Download2KXP.nsh
│   ├── DownloadIE.nsh
│   ├── DownloadNT4.nsh
│   ├── DownloadVista78.nsh
│   ├── DownloadWUA.nsh
│   ├── Makefile
│   ├── NT4USB.nsh
│   ├── PatchInstall.nsh
│   ├── Patches.ini
│   ├── PatchesNT4.ini
│   ├── RebootPage.nsh
│   ├── RunOnce.nsh
│   ├── Strings.nsh
│   ├── UpdateRoots.nsh
│   ├── Win32.nsh
│   ├── WinVer.nsh
│   ├── codebase/
│   │   ├── lucontrl.ddf
│   │   ├── setup.inf
│   │   └── test.html
│   ├── patches/
│   │   └── .gitignore
│   ├── resource.c
│   ├── resource.h
│   ├── resource.rc
│   ├── setup-nt4.nsi
│   ├── setup.nsi
│   └── stdafx.h
└── shared/
    ├── Exec.c
    ├── Exec.h
    ├── HResult.c
    ├── HResult.h
    ├── LegacyUpdate.c
    ├── LegacyUpdate.h
    ├── LoadImage.c
    ├── LoadImage.h
    ├── Log.c
    ├── Log.h
    ├── ProductInfo.c
    ├── ProductInfo.h
    ├── Registry.c
    ├── Registry.h
    ├── Startup.h
    ├── Trace.h
    ├── User.h
    ├── Version.h
    ├── VersionInfo.h
    ├── ViewLog.c
    ├── ViewLog.h
    ├── WMI.c
    ├── WMI.h
    ├── Wow64.c
    ├── Wow64.h
    └── stdafx.h

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# 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

================================================
FILE: .gitattributes
================================================
*         text=auto eol=lf
*.sln     eol=crlf
*.vcxproj eol=crlf


================================================
FILE: .github/FUNDING.yml
================================================
github: kirb
ko_fi: adamdemasi
patreon: adamdemasi
custom: ["https://paypal.me/HashbangProductions"]


================================================
FILE: .github/ISSUE_TEMPLATE/01-bug_report.yml
================================================
name: "Bug Report"
description: "Report something that isn’t working as expected"
labels: ["Bug", "Needs triage"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you for taking the time to report a bug! To help us resolve the problem quickly, please fill out the details below as best as you can.
  - type: markdown
    attributes:
      value: |
        ---
        ### Describe the issue
  - type: textarea
    id: actual
    attributes:
      label: "What is happening?"
      description: "Describe the issue you’re experiencing. If you have screenshots or log files, please paste them here."
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: "What should have happened?"
      description: "What did you expect to happen instead?"
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: "Steps to reproduce the issue"
      description: "Write the step-by-step instructions that lead to the bug happening."
      placeholder: |
        1. …
        2. …
        3. …
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Provide as many of these details as possible
  - type: dropdown
    id: os
    attributes:
      label: "Operating System"
      options:
        - Not applicable
        - Windows NT 4.0
        - Windows 2000
        - Windows XP
        - Windows Server 2003
        - Windows Vista/Windows Server 2008
        - Windows 7/Windows Server 2008 R2
        - Windows 8/Windows Server 2012
        - Windows 8.1/Windows Server 2012 R2
        - Windows 10
        - Windows 11
    validations:
      required: true
  - type: dropdown
    id: sp
    attributes:
      label: "Service Pack"
      options:
        - Not applicable
        - Don’t know
        - RTM
        - SP1
        - SP2
        - SP3
        - SP4
        - SP5
        - SP6
    validations:
      required: true
  - type: dropdown
    id: arch
    attributes:
      label: "Architecture"
      description: "Which architecture edition of Windows are you using?"
      options:
        - Not applicable
        - Don’t know
        - 32-bit (x86)
        - 64-bit (x64)
        - Itanium (ia64)
    validations:
      required: true
  - type: dropdown
    id: vm
    attributes:
      label: "Virtual Machine"
      description: "Are you running Windows in a virtual machine or emulator?"
      options:
        - Not applicable
        - "No"
        - Yes, 86Box
        - Yes, Hyper-V
        - Yes, Parallels
        - Yes, QEMU/KVM
        - Yes, UTM
        - Yes, VirtualBox
        - Yes, Virtual PC
        - Yes, VMware
        - Yes, something else
    validations:
      required: true
  - type: dropdown
    id: hardware
    attributes:
      label: "Hardware"
      description: "Select the option that best describes the hardware you are using."
      options:
        - Not applicable
        - Don’t know
        - 386
        - 486
        - Intel Pentium
        - AMD K5/K6
        - Cyrix 5x86/6x86
        - Intel P6 (Pentium Pro/II/III)
        - AMD K7 (e.g. Athlon XP)
        - Cyrix III
        - Intel Pentium 4
        - Intel Pentium M
        - AMD K8 (e.g. Athlon 64)
        - Intel Pentium D
        - Intel Core
        - Intel Core 2
        - AMD K10 (e.g. Phenom)
        - Intel Core i
        - AMD Bulldozer
        - AMD Ryzen/Threadripper
        - Other (please describe below)
    validations:
      required: true
  - type: dropdown
    id: software
    attributes:
      label: "Software Installed"
      description: "Select all other Microsoft software installed on your system. If any others are installed that aren’t listed here, please describe them below."
      multiple: true
      options:
        - Not applicable
        - Office XP (2002)
        - Office 2003
        - Office 2007
        - Office 2010
        - Office 2013 or later
        - Visual Studio .NET 2002
        - Visual Studio .NET 2003
        - Visual Studio 2005
        - Visual Studio 2008
        - Visual Studio 2010
        - Visual Studio 2012 or later
        - SQL Server 2000
        - SQL Server 2005
        - SQL Server 2008
        - SQL Server 2012 or later
        - Exchange Server 2000
        - Exchange Server 2003
        - Exchange Server 2007
        - Exchange Server 2010 or later
  - type: markdown
    attributes:
      value: |
        ---
        ### Any other details that might be relevant?
  - type: textarea
    id: notes
    attributes:
      label: "Other details"
      description: "You can list hardware specifications here if you know them."
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Before you submit…
        Please check [Legacy Update Help](https://legacyupdate.net/help/) to learn more about common issues, and [search for issues](https://github.com/LegacyUpdate/LegacyUpdate/issues) that could be similar to this one. It helps us to keep this project organised. Thanks!
  - type: checkboxes
    id: terms
    attributes:
      label: Confirmation
      options:
        - label: "I have checked that this issue hasn’t already been reported"
          required: true


================================================
FILE: .github/ISSUE_TEMPLATE/02-update_issue.yml
================================================
name: "Update Issue"
description: "Report a problem with an update"
labels: ["Needs triage"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you for taking the time to report a problem! To help us resolve the problem quickly, please fill out the details below as best as you can.
  - type: input
    id: update
    attributes:
      label: "Update"
      description: "Provide the name or KB number of the update(s) you’re reporting an issue with."
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Describe the issue
        If applicable, please include the error code from Windows Update:
        * From the Legacy Update website: Click “Update History”, then click ![Error and question mark icon](https://legacyupdate.net/windowsupdate/v6/shared/images/status_failed.gif) next to the failed update.
        * From the Windows Update control panel: Click “View update history”, then double-click the failed update.
  - type: textarea
    id: actual
    attributes:
      label: "What is happening?"
      description: "Describe the issue you’re experiencing. If you have screenshots or log files, please paste them here."
    validations:
      required: true
  - type: textarea
    id: expected
    attributes:
      label: "What should have happened?"
      description: "What did you expect to happen instead?"
    validations:
      required: true
  - type: textarea
    id: steps
    attributes:
      label: "Steps to reproduce the issue"
      description: "Write the step-by-step instructions that lead to the bug happening."
      placeholder: |
        1. …
        2. …
        3. …
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Provide as many of these details as possible
  - type: dropdown
    id: os
    attributes:
      label: "Operating System"
      options:
        - Not applicable
        - Windows NT 4.0
        - Windows 2000
        - Windows XP
        - Windows Server 2003
        - Windows Vista/Windows Server 2008
        - Windows 7/Windows Server 2008 R2
        - Windows 8/Windows Server 2012
        - Windows 8.1/Windows Server 2012 R2
        - Windows 10
        - Windows 11
    validations:
      required: true
  - type: dropdown
    id: sp
    attributes:
      label: "Service Pack"
      options:
        - Not applicable
        - Don’t know
        - RTM
        - SP1
        - SP2
        - SP3
        - SP4
        - SP5
        - SP6
    validations:
      required: true
  - type: dropdown
    id: arch
    attributes:
      label: "Architecture"
      description: "Which architecture edition of Windows are you using?"
      options:
        - Not applicable
        - Don’t know
        - 32-bit (x86)
        - 64-bit (x64)
        - Itanium (ia64)
    validations:
      required: true
  - type: dropdown
    id: vm
    attributes:
      label: "Virtual Machine"
      description: "Are you running Windows in a virtual machine or emulator?"
      options:
        - Not applicable
        - "No"
        - Yes, 86Box
        - Yes, Hyper-V
        - Yes, Parallels
        - Yes, QEMU/KVM
        - Yes, UTM
        - Yes, VirtualBox
        - Yes, Virtual PC
        - Yes, VMware
        - Yes, something else
    validations:
      required: true
  - type: dropdown
    id: hardware
    attributes:
      label: "Hardware"
      description: "Select the option that best describes the hardware you are using."
      options:
        - Not applicable
        - Don’t know
        - 386
        - 486
        - Intel Pentium
        - AMD K5/K6
        - Cyrix 5x86/6x86
        - Intel P6 (Pentium Pro/II/III)
        - AMD K7 (e.g. Athlon XP)
        - Cyrix III
        - Intel Pentium 4
        - Intel Pentium M
        - AMD K8 (e.g. Athlon 64)
        - Intel Pentium D
        - Intel Core
        - Intel Core 2
        - AMD K10 (e.g. Phenom)
        - Intel Core i
        - AMD Bulldozer
        - AMD Ryzen/Threadripper
        - Other (please describe below)
    validations:
      required: true
  - type: dropdown
    id: software
    attributes:
      label: "Software"
      description: "Select the software this issue is relevant to. If it isn’t listed here, please describe below."
      options:
        - Not applicable
        - Office XP (2002)
        - Office 2003
        - Office 2007
        - Office 2010
        - Office 2013 or later
        - Visual Studio .NET 2002
        - Visual Studio .NET 2003
        - Visual Studio 2005
        - Visual Studio 2008
        - Visual Studio 2010
        - Visual Studio 2012 or later
        - SQL Server 2000
        - SQL Server 2005
        - SQL Server 2008
        - SQL Server 2012 or later
        - Exchange Server 2000
        - Exchange Server 2003
        - Exchange Server 2007
        - Exchange Server 2010 or later
        - Other
    validations:
      required: true
  - type: dropdown
    id: software-arch
    attributes:
      label: "Software Architecture"
      description: "Which architecture edition of the software are you using?"
      options:
        - Not applicable
        - Don’t know
        - 32-bit (x86)
        - 64-bit (x64)
        - Itanium (ia64)
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Any other details that might be relevant?
  - type: textarea
    id: notes
    attributes:
      label: "Other details"
      description: "You can list hardware specifications here if you know them."
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Before you submit…
        Please check [Legacy Update Help](https://legacyupdate.net/help/) to learn more about common issues, and [search for issues](https://github.com/LegacyUpdate/LegacyUpdate/issues) that could be similar to this one. It helps us to keep this project organised. Thanks!
  - type: checkboxes
    id: terms
    attributes:
      label: Confirmation
      options:
        - label: "I have checked that this issue hasn’t already been reported"
          required: true


================================================
FILE: .github/ISSUE_TEMPLATE/03-download_center_issue.yml
================================================
name: "Download Center Issue"
description: "Report a problem with the Microsoft Download Center Archive"
labels: ["Component: Download Center", "Needs triage"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you for taking the time to report a bug! To help us resolve the problem quickly, please fill out the details below as best as you can.
  - type: input
    id: url
    attributes:
      label: "URL"
      description: "Paste the link to the download page you’re reporting an issue with."
    validations:
      required: true
  - type: dropdown
    id: type
    attributes:
      label: "Type of Issue"
      options:
        - File missing (not shown on the page)
        - File deleted (404 Not Found)
        - File corrupted (error when downloading)
        - Incorrect metadata
        - Other
    validations:
      required: true
  - type: textarea
    id: notes
    attributes:
      label: "Details"
      description: "Include more information about the issue."
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Before you submit…
        Please check [Legacy Update Help](https://legacyupdate.net/help/) to learn more about common issues, and [search for issues](https://github.com/LegacyUpdate/LegacyUpdate/issues) that could be similar to this one. It helps us to keep this project organised. Thanks!
  - type: checkboxes
    id: terms
    attributes:
      label: Confirmation
      options:
        - label: "I have checked that this issue hasn’t already been reported"
          required: true


================================================
FILE: .github/ISSUE_TEMPLATE/04-feature_suggestion.yml
================================================
name: "Feature Suggestion"
description: "Suggest a feature to be added to Legacy Update"
labels: ["Enhancement", "Needs triage"]
body:
  - type: markdown
    attributes:
      value: |
        Thank you for taking the time to suggest a feature! To help us understand your idea better, please fill out the details below as best as you can.
  - type: dropdown
    id: component
    attributes:
      label: "Component"
      description: "Which part of Legacy Update does this apply to?"
      options:
        - ActiveX control
        - Download Center Archive
        - Update server (WSUS)
        - Update website
        - Setup
        - Other
    validations:
      required: true
  - type: textarea
    id: notes
    attributes:
      label: "Details"
      description: "Describe the feature you would like to see. How will it work? Does it fix an issue?"
    validations:
      required: true
  - type: markdown
    attributes:
      value: |
        ---
        ### Before you submit…
        Please check [Legacy Update Help](https://legacyupdate.net/help/) to learn more about common issues, and [search for issues](https://github.com/LegacyUpdate/LegacyUpdate/issues) that could be similar to this one. It helps us to keep this project organised. Thanks!
  - type: checkboxes
    id: terms
    attributes:
      label: Confirmation
      options:
        - label: "I have checked that this issue hasn’t already been reported"
          required: true


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
  - name: Legacy Update Help
    url: https://legacyupdate.net/help/
    about: Many common issues are already answered on our website.
  - name: Get help on GitHub Discussions
    url: https://github.com/orgs/LegacyUpdate/discussions
    about: If this isn’t a bug with Legacy Update, you can post in our community discussion forum.
  - name: Get help on Discord
    url: https://legacyupdate.net/discord
    about: If you prefer Discord, you can create a support thread in our Discord community.


================================================
FILE: .github/workflows/build-nt4.yml
================================================
name: Build Legacy Update NT

on:
  push:
    branches: []
  pull_request:
    branches: []
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v6

    - name: Set up
      run: |
        sudo apt-get update -q
        sudo apt-get install -qy curl make mingw-w64-x86-64-dev nsis p7zip-full upx-ucl unzip

    - name: MinGW toolchain cache
      id: mingw-cache
      uses: actions/cache@v5
      with:
        path: |
          /opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686
          /opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64
        key: gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0

    - name: Install MinGW toolchain
      if: steps.mingw-cache.outputs.cache-hit != 'true'
      run: |
        curl -fsSL https://linuxfromscratch.org/~renodr/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686.tar.xz -o /tmp/mingw32.tar.xz
        curl -fsSL https://linuxfromscratch.org/~renodr/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64.tar.xz -o /tmp/mingw64.tar.xz
        sudo tar -xf /tmp/mingw32.tar.xz -C /opt
        sudo tar -xf /tmp/mingw64.tar.xz -C /opt
        rm /tmp/mingw{32,64}.tar.xz

    - name: NSIS cache
      id: nsis-cache
      uses: actions/cache@v5
      with:
        path: /opt/nsis-3.11
        key: nsis-3.11

    - name: Install custom NSIS package
      if: steps.nsis-cache.outputs.cache-hit != 'true'
      run: |
        curl -fsSL https://linuxfromscratch.org/~renodr/nsis-3.11-lfsci-2.tar.xz -o /tmp/nsis-3.11.tar.xz
        sudo tar -xf /tmp/nsis-3.11.tar.xz -C /opt
        rm /tmp/nsis-3.11.tar.xz

    - name: Patches cache
      id: patches-cache
      uses: actions/cache@v4
      with:
        path: setup/patches/
        key: nt4-patches-${{hashFiles('setup/patches/**')}}

    - name: Download patches
      if: steps.patches-cache.outputs.cache-hit != 'true'
      run: |
        ./build/get-nt4-patches.sh

    - name: Build
      id: build
      run: |
        export PATH=/opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686/bin:$PATH
        export PATH=/opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64/bin:$PATH
        export PATH=/opt/nsis-3.11/bin:$PATH
        make -j$(nproc) CI=1 DEBUG=0 nt4

    - name: Upload Build Artifact
      uses: actions/upload-artifact@v7
      with:
        path: |
          setup/LegacyUpdateNT-*.exe


================================================
FILE: .github/workflows/build.yml
================================================
name: Build Legacy Update

on:
  push:
    branches: []
  pull_request:
    branches: []
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/checkout@v6

    - name: Set up
      run: |
        sudo apt-get update -q
        sudo apt-get install -qy --no-install-recommends curl libwine-dev make mingw-w64-tools mingw-w64-x86-64-dev nsis p7zip-full upx-ucl unzip

    - name: MinGW toolchain cache
      id: mingw-cache
      uses: actions/cache@v5
      with:
        path: |
          /opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686
          /opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64
        key: gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0

    - name: Install MinGW toolchain
      if: steps.mingw-cache.outputs.cache-hit != 'true'
      run: |
        curl -fsSL https://linuxfromscratch.org/~renodr/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686.tar.xz -o /tmp/mingw32.tar.xz
        curl -fsSL https://linuxfromscratch.org/~renodr/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64.tar.xz -o /tmp/mingw64.tar.xz
        sudo tar -xf /tmp/mingw32.tar.xz -C /opt
        sudo tar -xf /tmp/mingw64.tar.xz -C /opt
        rm /tmp/mingw{32,64}.tar.xz

    - name: NSIS cache
      id: nsis-cache
      uses: actions/cache@v5
      with:
        path: /opt/nsis-3.11
        key: nsis-3.11

    - name: Install custom NSIS package
      if: steps.nsis-cache.outputs.cache-hit != 'true'
      run: |
        curl -fsSL https://linuxfromscratch.org/~renodr/nsis-3.11-lfsci-2.tar.xz -o /tmp/nsis-3.11.tar.xz
        sudo tar -xf /tmp/nsis-3.11.tar.xz -C /opt
        rm /tmp/nsis-3.11.tar.xz

    - name: Build
      id: build
      run: |
        export PATH=/opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-i686/bin:$PATH
        export PATH=/opt/gcc-15.2-20260228-binutils-2.46.0-mingw-v13.0.0-x86_64/bin:$PATH
        export PATH=/opt/nsis-3.11/bin:$PATH
        make -j$(nproc) CI=1 DEBUG=0

    - name: Upload Build Artifact
      uses: actions/upload-artifact@v7
      with:
        path: |
          setup/LegacyUpdate-*.exe


================================================
FILE: .gitignore
================================================
## 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/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


================================================
FILE: .idea/.idea.LegacyUpdate/.idea/.gitignore
================================================
# 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


================================================
FILE: .idea/.idea.LegacyUpdate/.idea/discord.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="DiscordProjectSettings">
    <option name="show" value="PROJECT" />
    <option name="description" value="" />
  </component>
</project>

================================================
FILE: .idea/.idea.LegacyUpdate/.idea/indexLayout.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="UserContentModel">
    <attachedFolders>
      <Path>.</Path>
    </attachedFolders>
    <explicitIncludes />
    <explicitExcludes />
  </component>
</project>

================================================
FILE: .idea/.idea.LegacyUpdate/.idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="VcsDirectoryMappings">
    <mapping directory="" vcs="Git" />
  </component>
</project>

================================================
FILE: .vscode/c_cpp_properties.json
================================================
{
    "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": [
                "-mwindows",
                "-municode",
                "-fPIE",
                "-fno-unwind-tables",
                "-fno-asynchronous-unwind-tables",
                "-fno-exceptions",
                "-Wall",
                "-Wextra",
                "-Wpedantic",
                "-Wno-unused-parameter",
                "-Wno-unused-variable",
                "-Wno-unknown-pragmas",
                "-Wno-cast-function-type",
                "-Wno-missing-field-initializers",
                "-Iobj",
                "-include stdafx.h"
            ],
            "defines": [
                "UNICODE",
                "_UNICODE"
            ]
        }
    ],
    "version": 4
}


================================================
FILE: .vscode/settings.json
================================================
{
	"files.associations": {
		"*.rc": "cpp",
		"*.idl": "cpp"
	}
}


================================================
FILE: LICENSE.md
================================================

                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


================================================
FILE: LegacyUpdate/ClassFactory.cpp
================================================
#include "ClassFactory.h"
#include "LegacyUpdate_i.h"
#include "LegacyUpdateCtrl.h"
#include "ElevationHelper.h"
#include "ProgressBarControl.h"
#include "dllmain.h"
#include <new>

STDMETHODIMP CClassFactory::Create(IUnknown *pUnkOuter, REFIID riid, void **ppv) {
	if (pUnkOuter != NULL) {
		return CLASS_E_NOAGGREGATION;
	}

	CClassFactory *pThis = (CClassFactory *)CoTaskMemAlloc(sizeof(CClassFactory));
	if (pThis == NULL) {
		return E_OUTOFMEMORY;
	}

	new(pThis) CClassFactory();
	HRESULT hr = pThis->QueryInterface(riid, ppv);
	CHECK_HR_OR_RETURN(L"QueryInterface");
	pThis->Release();
	return hr;
}

CClassFactory::~CClassFactory(void) {
}

STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, void **ppvObject) {
	if (ppvObject == NULL) {
		return E_POINTER;
	}

	*ppvObject = NULL;

	if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory)) {
		*ppvObject = this;
		AddRef();
		return S_OK;
	}

	return E_NOINTERFACE;
}

STDMETHODIMP_(ULONG) CClassFactory::AddRef(void) {
	return InterlockedIncrement(&m_refCount);
}

STDMETHODIMP_(ULONG) CClassFactory::Release(void) {
	ULONG count = InterlockedDecrement(&m_refCount);
	if (count == 0) {
		this->~CClassFactory();
		CoTaskMemFree(this);
	}
	return count;
}

STDMETHODIMP CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject) {
	return createFunc(pUnkOuter, riid, ppvObject);
}

STDMETHODIMP CClassFactory::LockServer(BOOL fLock) {
	if (fLock) {
		InterlockedIncrement(&g_serverLocks);
	} else {
		InterlockedDecrement(&g_serverLocks);
	}
	return S_OK;
}


================================================
FILE: LegacyUpdate/ClassFactory.h
================================================
#pragma once

#include "com.h"

STDMETHODIMP CreateClassFactory(IUnknown *pUnkOuter, REFIID riid, void **ppv);

class DECLSPEC_NOVTABLE CClassFactory : public IClassFactory {
public:
	CClassFactory() :
		m_refCount(1),
		createFunc(NULL),
		clsid(NULL) {}

	virtual ~CClassFactory();

	static STDMETHODIMP Create(IUnknown *pUnkOuter, REFIID riid, void **ppv);

private:
	LONG m_refCount;

public:
	STDMETHODIMP (*createFunc)(IUnknown *pUnkOuter, REFIID riid, void **ppv);
	const GUID *clsid;

	// IUnknown
	STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
	STDMETHODIMP_(ULONG) AddRef();
	STDMETHODIMP_(ULONG) Release();

	// IClassFactory
	STDMETHODIMP CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject);
	STDMETHODIMP LockServer(BOOL fLock);
};


================================================
FILE: LegacyUpdate/Compat.cpp
================================================
#include "Compat.h"
#include <windows.h>
#include <shellscalingapi.h>
#include "resource.h"
#include "ProductInfo.h"

typedef BOOL (WINAPI *_SetProcessDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
typedef HRESULT (WINAPI *_SetProcessDpiAwareness)(PROCESS_DPI_AWARENESS);
typedef void (WINAPI *_SetProcessDPIAware)();

typedef HANDLE (WINAPI *_CreateActCtxW)(const ACTCTX *);
typedef BOOL (WINAPI *_ActivateActCtx)(HANDLE, ULONG_PTR *);
typedef BOOL (WINAPI *_DeactivateActCtx)(DWORD, ULONG_PTR);
typedef void (WINAPI *_ReleaseActCtx)(HANDLE);
typedef BOOL (WINAPI *_GetCurrentActCtx)(HANDLE *);

static BOOL actCtxLoaded = FALSE;
static _CreateActCtxW $CreateActCtx;
static _ActivateActCtx $ActivateActCtx;
static _DeactivateActCtx $DeactivateActCtx;
static _ReleaseActCtx $ReleaseActCtx;
static _GetCurrentActCtx $GetCurrentActCtx;

static BOOL comctlLoaded = FALSE;
static HMODULE hComctl32 = NULL;

void BecomeDPIAware(void) {
	// Make the process DPI-aware... hopefully
	// Windows 10 1703+ per-monitor v2
	_SetProcessDpiAwarenessContext $SetProcessDpiAwarenessContext = (_SetProcessDpiAwarenessContext)GetProcAddress(LoadLibrary(L"user32.dll"), "SetProcessDpiAwarenessContext");
	if ($SetProcessDpiAwarenessContext) {
		$SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
		return;
	}

	// Windows 8.1 - 10 1607 per-monitor v1
	_SetProcessDpiAwareness $SetProcessDpiAwareness = (_SetProcessDpiAwareness)GetProcAddress(LoadLibrary(L"shcore.dll"), "SetProcessDpiAwareness");
	if ($SetProcessDpiAwareness) {
		$SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE);
		return;
	}

	// Windows Vista - 8
	_SetProcessDPIAware $SetProcessDPIAware = (_SetProcessDPIAware)GetProcAddress(LoadLibrary(L"user32.dll"), "SetProcessDPIAware");
	if ($SetProcessDPIAware) {
		$SetProcessDPIAware();
	}
}

// Handling for SxS contexts (mainly for comctl 6.0)
void IsolationAwareStart(ULONG_PTR *cookie) {
	*cookie = 0;

	if (!actCtxLoaded) {
		actCtxLoaded = TRUE;
		HMODULE kernel32 = GetModuleHandle(L"kernel32.dll");
		$CreateActCtx = (_CreateActCtxW)GetProcAddress(kernel32, "CreateActCtxW");
		$ActivateActCtx = (_ActivateActCtx)GetProcAddress(kernel32, "ActivateActCtx");
		$DeactivateActCtx = (_DeactivateActCtx)GetProcAddress(kernel32, "DeactivateActCtx");
		$ReleaseActCtx = (_ReleaseActCtx)GetProcAddress(kernel32, "ReleaseActCtx");
		$GetCurrentActCtx = (_GetCurrentActCtx)GetProcAddress(kernel32, "GetCurrentActCtx");
	}

	if (!$CreateActCtx || !$ActivateActCtx || !$ReleaseActCtx) {
		return;
	}

	// Borrowing the manifest from shell32.dll
	WCHAR shell32[MAX_PATH];
	GetModuleFileName(GetModuleHandle(L"shell32.dll"), shell32, ARRAYSIZE(shell32));

	ACTCTX actCtx = {0};
	actCtx.cbSize = sizeof(actCtx);
	actCtx.dwFlags = ACTCTX_FLAG_RESOURCE_NAME_VALID;
	actCtx.lpSource = shell32;
	actCtx.lpResourceName = MAKEINTRESOURCE(124);

	HANDLE hActCtx = $CreateActCtx(&actCtx);
	if (hActCtx != INVALID_HANDLE_VALUE) {
		if (!$ActivateActCtx(hActCtx, cookie)) {
			$ReleaseActCtx(hActCtx);
			hActCtx = INVALID_HANDLE_VALUE;
		}
	}
}

void IsolationAwareEnd(ULONG_PTR *cookie) {
	if (!$DeactivateActCtx || !$GetCurrentActCtx) {
		return;
	}

	if (*cookie != 0) {
		HANDLE hActCtx = INVALID_HANDLE_VALUE;
		if ($GetCurrentActCtx(&hActCtx) && hActCtx != INVALID_HANDLE_VALUE) {
			$DeactivateActCtx(0, *cookie);
			$ReleaseActCtx(hActCtx);
		}
		*cookie = 0;
	}
}


================================================
FILE: LegacyUpdate/Compat.h
================================================
#pragma once

void BecomeDPIAware();
void IsolationAwareStart(ULONG_PTR *cookie);
void IsolationAwareEnd(ULONG_PTR *cookie);


================================================
FILE: LegacyUpdate/ElevationHelper.cpp
================================================
// ElevationHelper.cpp : Implementation of CElevationHelper

#include "ElevationHelper.h"
#include "Compat.h"
#include "HResult.h"
#include "LegacyUpdate.h"
#include "NGen.h"
#include "Registry.h"
#include "Utils.h"
#include "VersionInfo.h"
#include <strsafe.h>
#include <new>
#include "IUpdateInstaller4.h"

const WCHAR *permittedProgIDs[] = {
	L"Microsoft.Update."
};

DEFINE_UUIDOF(CElevationHelper, CLSID_ElevationHelper);

BOOL ProgIDIsPermitted(PWSTR progID) {
	if (progID == NULL) {
		return FALSE;
	}

	for (DWORD i = 0; i < ARRAYSIZE(permittedProgIDs); i++) {
		if (wcsncmp(progID, permittedProgIDs[i], wcslen(permittedProgIDs[i])) == 0) {
			return TRUE;
		}
	}

	return FALSE;
}

STDMETHODIMP CoCreateInstanceAsAdmin(HWND hwnd, REFCLSID rclsid, REFIID riid, void **ppv) {
	WCHAR clsidString[39];
	StringFromGUID2(rclsid, clsidString, ARRAYSIZE(clsidString));

	WCHAR monikerName[67];
	wsprintf(monikerName, L"Elevation:Administrator!new:%ls", clsidString);

	BIND_OPTS3 bindOpts;
	ZeroMemory(&bindOpts, sizeof(bindOpts));
	bindOpts.cbStruct = sizeof(bindOpts);
	bindOpts.hwnd = hwnd;
	bindOpts.dwClassContext = CLSCTX_LOCAL_SERVER;
	return CoGetObject(monikerName, (BIND_OPTS *)&bindOpts, riid, ppv);
}

STDMETHODIMP CElevationHelper::Create(IUnknown *pUnkOuter, REFIID riid, void **ppv) {
	if (pUnkOuter != NULL) {
		return CLASS_E_NOAGGREGATION;
	}

	CElevationHelper *pThis = (CElevationHelper *)CoTaskMemAlloc(sizeof(CElevationHelper));
	if (pThis == NULL) {
		return E_OUTOFMEMORY;
	}

	new(pThis) CElevationHelper();
	// TODO: Only do this if we're in dllhost
	BecomeDPIAware();
	HRESULT hr = pThis->QueryInterface(riid, ppv);
	CHECK_HR_OR_RETURN(L"QueryInterface");
	pThis->Release();
	return hr;
}

CElevationHelper::~CElevationHelper(void) {
}

STDMETHODIMP CElevationHelper::UpdateRegistry(BOOL bRegister) {
	if (bRegister) {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper", NULL, REG_SZ, (LPVOID)L"Legacy Update Elevation Helper"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper\\CurVer", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ElevationHelper.1"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper.1", NULL, REG_SZ, (LPVOID)L"Legacy Update Elevation Helper"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper.1\\CLSID", NULL, REG_SZ, (LPVOID)L"%CLSID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, REG_SZ, (LPVOID)L"Legacy Update Elevation Helper"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", L"AppID", REG_SZ, (LPVOID)L"%APPID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", L"LocalizedString", REG_SZ, (LPVOID)L"@%MODULE%,-1"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\ProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ElevationHelper.1"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\VersionIndependentProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ElevationHelper"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", NULL, REG_SZ, (LPVOID)L"%MODULE%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", L"ThreadingModel", REG_SZ, (LPVOID)L"Apartment"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\TypeLib", NULL, REG_SZ, (LPVOID)L"%LIBID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Version", NULL, REG_SZ, (LPVOID)L"1.0"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Elevation", L"Enabled", REG_DWORD, (LPVOID)1},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Elevation", L"IconReference", REG_SZ, (LPVOID)L"@%INSTALLPATH%\\LegacyUpdate.exe,-100"},
			{}
		};
		return SetRegistryEntries(entries);
	} else {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ElevationHelper.1", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, 0, DELETE_KEY},
			{}
		};
		return SetRegistryEntries(entries);
	}
}

#pragma mark - IUnknown

STDMETHODIMP CElevationHelper::QueryInterface(REFIID riid, void **ppvObject) {
	if (ppvObject == NULL) {
		return E_POINTER;
	}

	*ppvObject = NULL;

	return IDispatchImpl<IElevationHelper, &LIBID_LegacyUpdateLib>::QueryInterface(riid, ppvObject);
}

STDMETHODIMP_(ULONG) CElevationHelper::AddRef(void) {
	return InterlockedIncrement(&m_refCount);
}

STDMETHODIMP_(ULONG) CElevationHelper::Release(void) {
	ULONG count = InterlockedDecrement(&m_refCount);
	if (count == 0) {
		this->~CElevationHelper();
		CoTaskMemFree(this);
	}
	return count;
}

#pragma mark - IElevationHelper

STDMETHODIMP CElevationHelper::CreateObject(BSTR progID, IDispatch **retval) {
	if (progID == NULL || retval == NULL) {
		return E_INVALIDARG;
	}

	*retval = NULL;
	HRESULT hr = S_OK;
	CComPtr<IDispatch> object;
	CLSID clsid;

	if (!ProgIDIsPermitted(progID)) {
		return E_ACCESSDENIED;
	}

	hr = CLSIDFromProgID(progID, &clsid);
	CHECK_HR_OR_RETURN(L"CLSIDFromProgID");

	hr = object.CoCreateInstance(clsid, IID_IDispatch, NULL, CLSCTX_INPROC_SERVER);
	CHECK_HR_OR_RETURN(L"CoCreateInstance");

	*retval = object.Detach();
	return hr;
}

STDMETHODIMP CElevationHelper::SetBrowserHwnd(IUpdateInstaller *installer, HWND hwnd) {
	if (installer == NULL) {
		return E_INVALIDARG;
	}

	CComPtr<IUpdateInstaller> updateInstaller;
	HRESULT hr = installer->QueryInterface(IID_IUpdateInstaller, (void **)&updateInstaller);
	CHECK_HR_OR_RETURN(L"QueryInterface IID_IUpdateInstaller");

	hr = updateInstaller->put_ParentHwnd(hwnd);
	CHECK_HR_OR_RETURN(L"put_ParentHwnd");

	return S_OK;
}

STDMETHODIMP CElevationHelper::Reboot(void) {
	// Calling Commit() is recommended on Windows 10, to ensure feature updates are properly prepared prior to the reboot.
	// If IUpdateInstaller4 doesn't exist, we can skip this.
	CComPtr<IUpdateInstaller4> installer;
	HRESULT hr = installer.CoCreateInstance(CLSID_UpdateInstaller, NULL, CLSCTX_INPROC_SERVER);
	if (SUCCEEDED(hr) && hr != REGDB_E_CLASSNOTREG) {
		hr = installer->Commit(0);
		CHECK_HR_OR_GOTO_END(L"Commit");
	}

end:
	return ::Reboot();
}

STDMETHODIMP CElevationHelper::BeforeUpdate(void) {
	return PauseResumeNGenQueue(FALSE);
}

STDMETHODIMP CElevationHelper::AfterUpdate(void) {
	return PauseResumeNGenQueue(TRUE);
}


================================================
FILE: LegacyUpdate/ElevationHelper.h
================================================
#pragma once

// ElevationHelper.h : Declaration of the CElevationHelper class.

#include "resource.h"
#include "com.h"
#include "LegacyUpdate_i.h"

BOOL ProgIDIsPermitted(PWSTR progID);
STDMETHODIMP CoCreateInstanceAsAdmin(HWND hwnd, REFCLSID rclsid, REFIID riid, void **ppv);

class DECLSPEC_NOVTABLE CElevationHelper :
	public IDispatchImpl<IElevationHelper, &LIBID_LegacyUpdateLib> {
public:
	CElevationHelper() :
		m_refCount(1) {}

	virtual ~CElevationHelper();

	static STDMETHODIMP Create(IUnknown *pUnkOuter, REFIID riid, void **ppv);
	static STDMETHODIMP UpdateRegistry(BOOL bRegister);

private:
	LONG m_refCount;

public:
	// IUnknown
	STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
	STDMETHODIMP_(ULONG) AddRef();
	STDMETHODIMP_(ULONG) Release();

	// IElevationHelper
	STDMETHODIMP CreateObject(BSTR progID, IDispatch **retval);
	STDMETHODIMP SetBrowserHwnd(IUpdateInstaller *installer, HWND hwnd);
	STDMETHODIMP Reboot();
	STDMETHODIMP BeforeUpdate();
	STDMETHODIMP AfterUpdate();
};


================================================
FILE: LegacyUpdate/IUpdateInstaller4.h
================================================
#pragma once
#include <wuapi.h>

// 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__ */


================================================
FILE: LegacyUpdate/LaunchUpdateSite.cpp
================================================
#include "Exec.h"
#include "HResult.h"
#include "Utils.h"
#include <comdef.h>

// Function signature required by Rundll32.exe.
EXTERN_C __declspec(dllexport)
void CALLBACK LaunchUpdateSite(HWND hwnd, HINSTANCE hInstance, LPSTR lpszCmdLine, int nCmdShow) {
	HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
	if (!SUCCEEDED(hr)) {
		goto end;
	}

	// This just calls LegacyUpdate.exe now for backwards compatibility.
	hr = StartLauncher(L"/launch", TRUE);

end:
	if (!SUCCEEDED(hr)) {
		LPWSTR message = GetMessageForHresult(hr);
		MessageBox(NULL, message, L"Legacy Update", MB_OK | MB_ICONERROR);
		LocalFree(message);
	}

	CoUninitialize();
}


================================================
FILE: LegacyUpdate/LegacyUpdate.def
================================================
; LegacyUpdate.def : Declares the module parameters.

EXPORTS
	; Registration
	DllCanUnloadNow      PRIVATE
	DllGetClassObject    PRIVATE
	DllRegisterServer    PRIVATE
	DllUnregisterServer  PRIVATE

	; Rundll32
	LaunchUpdateSite     PRIVATE

	; Internal use
	GetMessageForHresult


================================================
FILE: LegacyUpdate/LegacyUpdate.idl
================================================
// LegacyUpdate.idl : IDL source for LegacyUpdate
//

// This file will be processed by the MIDL tool to
// produce the type library (LegacyUpdate.tlb) and marshalling code.

#include <olectl.h>
#include <idispids.h>
import "oaidl.idl";
import "ocidl.idl";
import "wuapi.idl";

typedef enum OSVersionField {
	e_majorVer = 0,
	e_minorVer = 1,
	e_buildNumber = 2,
	e_platform = 3,
	e_SPMajor = 4,
	e_SPMinor = 5,
	e_productSuite = 6,
	e_productType = 7,
	e_systemMetric = 8,
	e_SPVersionString = 9,
	e_controlVersionString = 10,
	e_VistaProductType = 11,
	e_productName = 12,
	e_displayVersion = 13,
	e_maxOSVersionFieldValue = 13
} OSVersionField;

typedef enum UserType {
	e_nonAdmin = 0,
	e_admin = 2,
	e_elevated = 3
} UserType;

typedef enum ViewLogType {
	e_legacyUpdate = 0,
	e_legacyUpdateLocal = 1,
	e_legacyUpdateLocalLow = 2,
	e_windowsUpdate = 3,
} ViewLogType;

[
	object,
	uuid(C33085BB-C3E1-4D27-A214-AF01953DF5E5),
	dual,
	nonextensible,
	helpstring("ILegacyUpdateCtrl Interface"),
	pointer_default(unique)
]
interface ILegacyUpdateCtrl : IDispatch {
	[id(1)]  HRESULT CheckControl([out, retval] VARIANT_BOOL *retval);
	[id(2)]  HRESULT MessageForHresult(LONG inHresult, [out, retval] BSTR *retval);
	[id(3)]  HRESULT GetOSVersionInfo(OSVersionField osField, LONG systemMetric, [out, retval] VARIANT *retval);
	[id(14)] HRESULT RequestElevation(void);
	[id(4)]  HRESULT CreateObject(BSTR progID, [out, retval] IDispatch **retval);
	[id(15)] HRESULT SetBrowserHwnd(IUpdateInstaller *installer);
	[id(5)]  HRESULT GetUserType([out, retval] UserType *retval);
	[id(8)]  HRESULT RebootIfRequired(void);
	[id(18)] HRESULT ViewLog(ViewLogType logType);
	[id(9)]  HRESULT ViewWindowsUpdateLog(void);
	[id(13)] HRESULT OpenWindowsUpdateSettings(void);
	[id(16)] HRESULT BeforeUpdate(void);
	[id(17)] HRESULT AfterUpdate(void);

	[id(6),  propget] HRESULT IsRebootRequired([out, retval] VARIANT_BOOL *retval);
	[id(7),  propget] HRESULT IsWindowsUpdateDisabled([out, retval] VARIANT_BOOL *retval);
	[id(10), propget] HRESULT IsUsingWsusServer([out, retval] VARIANT_BOOL *retval);
	[id(11), propget] HRESULT WsusServerUrl([out, retval] BSTR *retval);
	[id(12), propget] HRESULT WsusStatusServerUrl([out, retval] BSTR *retval);
};

[
	object,
	uuid(4524BFBF-70BD-4EAC-AD33-6BADA4FB0638),
	dual,
	nonextensible,
	pointer_default(unique)
]
interface IProgressBarControl : IDispatch
{
	[id(1), propget] HRESULT Value([out, retval] SHORT *retval);
	[id(1), propput] HRESULT Value([in] SHORT newVal);
};

[
	object,
	uuid(3236E684-0E4B-4780-9F31-F1983F5AB78D),
	dual,
	nonextensible,
	pointer_default(unique),
	oleautomation
]
interface IElevationHelper : IDispatch
{
	[id(1)] HRESULT CreateObject(BSTR progID, [out, retval] IDispatch **retval);
	[id(5)] HRESULT SetBrowserHwnd(IUpdateInstaller *installer, HWND hwnd);
	[id(2)] HRESULT Reboot(void);
	[id(3)] HRESULT BeforeUpdate(void);
	[id(4)] HRESULT AfterUpdate(void);
};

[
	uuid(05D22F33-C7C3-4C90-BDD9-CEDC86EA8FBE),
	version(1.0),
	helpstring("Legacy Update Control")
]
library LegacyUpdateLib {
	importlib("stdole2.tlb");

	[
		uuid(AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F),
		control,
		helpstring("LegacyUpdateCtrl Class")
	]
	coclass LegacyUpdateCtrl {
		[default] interface ILegacyUpdateCtrl;
	};

	[
		uuid(7B875A2F-2DFB-4D38-91F5-5C0BFB74C377),
		control,
		helpstring("ProgressBarControl Class")
	]
	coclass ProgressBarControl
	{
		[default] interface IProgressBarControl;
	};

	[
		uuid(84F517AD-6438-478F-BEA8-F0B808DC257F),
		helpstring("ElevationHelper Class")
	]
	coclass ElevationHelper
	{
		[default] interface IElevationHelper;
	};
};


================================================
FILE: LegacyUpdate/LegacyUpdate.rc
================================================
#include "resource.h"
#include <windows.h>
#include "Version.h"

/////////////////////////////////////////////////////////////////////////////
// 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
 PRODUCTVERSION VERSION
 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
 FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE
#else
 FILEFLAGS 0
#endif
 FILEOS VOS_NT_WINDOWS32
 FILETYPE VFT_APP
 FILESUBTYPE VFT2_UNKNOWN
BEGIN
	BLOCK "StringFileInfo"
	BEGIN
		BLOCK "040904b0"
		BEGIN
			VALUE "CompanyName", "Hashbang Productions"
			VALUE "FileDescription", "Legacy Update"
			VALUE "FileVersion", VERSION_STRING
			VALUE "InternalName", "LegacyUpdate.dll"
			VALUE "LegalCopyright", "© Hashbang Productions. All rights reserved."
			VALUE "OriginalFilename", "LegacyUpdate.dll"
			VALUE "ProductName", "Legacy Update"
			VALUE "ProductVersion", VERSION_STRING
		END
	END
	BLOCK "VarFileInfo"
	BEGIN
		VALUE "Translation", 0x0409, 0x04b0
	END
END


/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE
BEGIN
	IDS_LEGACYUPDATE        "Legacy Update"
END

#endif    // English (United States) resources
/////////////////////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////////////////////////////
//
// Type Library
//

ID_TYPELIB              TYPELIB                 "LegacyUpdate.tlb"

#include "wuerror.rc"


================================================
FILE: LegacyUpdate/LegacyUpdate.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <VCProjectVersion>17.0</VCProjectVersion>
    <Keyword>Win32Proj</Keyword>
    <ProjectGuid>{e9142706-8e21-4ece-80f8-d3f7b95c6f27}</ProjectGuid>
    <RootNamespace>LegacyUpdate</RootNamespace>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
    <ConfigurationType>Application</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v143</PlatformToolset>
    <WholeProgramOptimization>true</WholeProgramOptimization>
    <CharacterSet>Unicode</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="Shared">
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <WarningLevel>Level3</WarningLevel>
      <FunctionLevelLinking>true</FunctionLevelLinking>
      <IntrinsicFunctions>true</IntrinsicFunctions>
      <SDLCheck>true</SDLCheck>
      <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <ConformanceMode>true</ConformanceMode>
    </ClCompile>
    <Link>
      <SubSystem>Console</SubSystem>
      <GenerateDebugInformation>true</GenerateDebugInformation>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: LegacyUpdate/LegacyUpdate.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    </Filter>
    <Filter Include="Header Files">
      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
      <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
    </Filter>
  </ItemGroup>
</Project>

================================================
FILE: LegacyUpdate/LegacyUpdateCtrl.cpp
================================================
// LegacyUpdateCtrl.cpp : Implementation of the CLegacyUpdateCtrl ActiveX Control class.

#include "LegacyUpdateCtrl.h"
#include "Compat.h"
#include "ElevationHelper.h"
#include "Exec.h"
#include "HResult.h"
#include "LegacyUpdate.h"
#include "ProductInfo.h"
#include "ProductName.h"
#include "Registry.h"
#include "User.h"
#include "Utils.h"
#include "Version.h"
#include "VersionInfo.h"
#include "ViewLog.h"
#include <new>
#include <oleidl.h>
#include <shlobj.h>
#include <wuapi.h>

const WCHAR *permittedHosts[] = {
	L"legacyupdate.net",
	L"test.legacyupdate.net"
};

#define LEGACYUPDATECTRL_MISCSTATUS (OLEMISC_RECOMPOSEONRESIZE | OLEMISC_CANTLINKINSIDE | OLEMISC_INSIDEOUT | OLEMISC_ACTIVATEWHENVISIBLE | OLEMISC_SETCLIENTSITEFIRST)

DEFINE_UUIDOF(CLegacyUpdateCtrl, CLSID_LegacyUpdateCtrl);

STDMETHODIMP CLegacyUpdateCtrl::Create(IUnknown *pUnkOuter, REFIID riid, void **ppv) {
	if (pUnkOuter != NULL) {
		return CLASS_E_NOAGGREGATION;
	}

	CLegacyUpdateCtrl *pThis = (CLegacyUpdateCtrl *)CoTaskMemAlloc(sizeof(CLegacyUpdateCtrl));
	if (pThis == NULL) {
		return E_OUTOFMEMORY;
	}

	new(pThis) CLegacyUpdateCtrl();
	HRESULT hr = pThis->QueryInterface(riid, ppv);
	pThis->Release();

	return hr;
}

CLegacyUpdateCtrl::~CLegacyUpdateCtrl(void) {
	if (m_clientSite) {
		m_clientSite->Release();
		m_clientSite = NULL;
	}
	if (m_adviseSink) {
		m_adviseSink->Release();
		m_adviseSink = NULL;
	}
	if (m_elevatedHelper) {
		m_elevatedHelper->Release();
		m_elevatedHelper = NULL;
	}
	if (m_nonElevatedHelper) {
		m_nonElevatedHelper->Release();
		m_nonElevatedHelper = NULL;
	}
}

STDMETHODIMP CLegacyUpdateCtrl::UpdateRegistry(BOOL bRegister) {
	if (bRegister) {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control", NULL, REG_SZ, (LPVOID)L"Legacy Update Control"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control\\CurVer", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.Control.1"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control.1", NULL, REG_SZ, (LPVOID)L"Legacy Update Control"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control.1\\CLSID", NULL, REG_SZ, (LPVOID)L"%CLSID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, REG_SZ, (LPVOID)L"Legacy Update Control"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", L"AppID", REG_SZ, (LPVOID)L"%APPID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\ProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.Control.1"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\VersionIndependentProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.Control"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Programmable", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", NULL, REG_SZ, (LPVOID)L"%MODULE%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", L"ThreadingModel", REG_SZ, (LPVOID)L"Apartment"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Control", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\TypeLib", NULL, REG_SZ, (LPVOID)L"%LIBID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Version", NULL, REG_SZ, (LPVOID)L"1.0"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\MiscStatus", NULL, REG_DWORD, (LPVOID)LEGACYUPDATECTRL_MISCSTATUS},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Implemented Categories\\{7DD95801-9882-11CF-9FA9-00AA006C42C4}", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Implemented Categories\\{7DD95802-9882-11CF-9FA9-00AA006C42C4}", NULL, REG_SZ, NULL},
			{}
		};
		return SetRegistryEntries(entries);
	} else {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.Control.1", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, 0, DELETE_KEY},
			{}
		};
		return SetRegistryEntries(entries);
	}
}

#pragma mark - IUnknown

STDMETHODIMP CLegacyUpdateCtrl::QueryInterface(REFIID riid, void **ppvObject) {
	if (ppvObject == NULL) {
		return E_POINTER;
	}

	*ppvObject = NULL;

	if (IsEqualIID(riid, IID_IOleObject)) {
		*ppvObject = &m_IOleObject;
		AddRef();
		return S_OK;
	}

	return IDispatchImpl<ILegacyUpdateCtrl, &LIBID_LegacyUpdateLib>::QueryInterface(riid, ppvObject);
}

STDMETHODIMP_(ULONG) CLegacyUpdateCtrl::AddRef(void) {
	return InterlockedIncrement(&m_refCount);
}

STDMETHODIMP_(ULONG) CLegacyUpdateCtrl::Release(void) {
	ULONG count = InterlockedDecrement(&m_refCount);
	if (count == 0) {
		this->~CLegacyUpdateCtrl();
		CoTaskMemFree(this);
	}
	return count;
}

#pragma mark - ILegacyUpdateCtrl

STDMETHODIMP CLegacyUpdateCtrl::GetHTMLDocument(IHTMLDocument2 **retval) {
	if (m_clientSite == NULL) {
		return E_ACCESSDENIED;
	}

	CComPtr<IOleContainer> container;
	HRESULT hr = m_clientSite->GetContainer(&container);
	CHECK_HR_OR_RETURN(L"GetContainer");

	hr = container->QueryInterface(IID_IHTMLDocument2, (void **)retval);
	CHECK_HR_OR_RETURN(L"QueryInterface IID_IHTMLDocument2");
	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::IsPermitted(void) {
	CComPtr<IHTMLDocument2> document;
	CComPtr<IHTMLLocation> location;
	BSTR host = NULL;
	HRESULT hr = GetHTMLDocument(&document);
	if (!SUCCEEDED(hr)) {
#ifdef _DEBUG
		// Allow debugging outside of IE (e.g. via PowerShell)
		TRACE(L"GetHTMLDocument() failed - allowing anyway due to debug build");
		return S_OK;
#else
		goto end;
#endif
	}

	hr = document->get_location(&location);
	CHECK_HR_OR_GOTO_END(L"get_location");
	if (location == NULL) {
		hr = E_ACCESSDENIED;
		goto end;
	}

	hr = location->get_host(&host);
	CHECK_HR_OR_GOTO_END(L"get_host");

	for (DWORD i = 0; i < ARRAYSIZE(permittedHosts); i++) {
		if (wcscmp(host, permittedHosts[i]) == 0) {
			SysFreeString(host);
			return S_OK;
		}
	}

end:
	if (host) {
		SysFreeString(host);
	}
	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::GetIEWindowHWND(HWND *retval) {
	*retval = NULL;

	if (m_clientSite == NULL) {
		return E_FAIL;
	}

	CComPtr<IOleWindow> oleWindow;
	HRESULT hr = m_clientSite->QueryInterface(IID_IOleWindow, (void **)&oleWindow);
	CHECK_HR_OR_RETURN(L"QueryInterface");

	hr = oleWindow->GetWindow(retval);
	CHECK_HR_OR_RETURN(L"GetWindow");
	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::GetElevatedHelper(IElevationHelper **retval) {
	IElevationHelper *elevatedHelper = m_elevatedHelper ? m_elevatedHelper : m_nonElevatedHelper;
	if (elevatedHelper == NULL) {
		// Use the helper directly, without elevation. It's the responsibility of the caller to ensure it
		// is already running as admin on 2k/XP, or that it has requested elevation on Vista+.
		HRESULT hr = CoCreateInstance(CLSID_ElevationHelper, NULL, CLSCTX_INPROC_SERVER, IID_IElevationHelper, (void **)&elevatedHelper);
		CHECK_HR_OR_RETURN(L"CoCreateInstance");
		if (elevatedHelper == NULL) {
			return E_POINTER;
		}

		m_nonElevatedHelper = elevatedHelper;
	}

	*retval = elevatedHelper;
	return S_OK;
}

#define DoIsPermittedCheck(void) { \
		HRESULT hr = IsPermitted(); \
		if (!SUCCEEDED(hr)) { \
			return hr; \
		} \
	}

STDMETHODIMP CLegacyUpdateCtrl::CheckControl(VARIANT_BOOL *retval) {
	if (retval == NULL) {
		return E_POINTER;
	}

	DoIsPermittedCheck();
	*retval = VARIANT_TRUE;
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::MessageForHresult(LONG inHresult, BSTR *retval) {
	DoIsPermittedCheck();
	LPWSTR message = GetMessageForHresult(inHresult);
	*retval = SysAllocString(message);
	LocalFree(message);
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::GetOSVersionInfo(OSVersionField osField, LONG systemMetric, VARIANT *retval) {
	DoIsPermittedCheck();

	VariantInit(retval);
	OSVERSIONINFOEX *versionInfo = GetVersionInfo();

	switch (osField) {
	case e_majorVer:
		retval->vt = VT_UI4;
		retval->ulVal = versionInfo->dwMajorVersion;
		break;

	case e_minorVer:
		retval->vt = VT_UI4;
		retval->ulVal = versionInfo->dwMinorVersion;
		break;

	case e_buildNumber:
		retval->vt = VT_UI4;
		retval->ulVal = versionInfo->dwBuildNumber;
		break;

	case e_platform:
		retval->vt = VT_UI4;
		retval->ulVal = versionInfo->dwPlatformId;
		break;

	case e_SPMajor:
		retval->vt = VT_I4;
		retval->lVal = versionInfo->wServicePackMajor;
		break;

	case e_SPMinor:
		retval->vt = VT_I4;
		retval->lVal = versionInfo->wServicePackMinor;
		break;

	case e_productSuite:
		retval->vt = VT_I4;
		retval->lVal = versionInfo->wSuiteMask;
		break;

	case e_productType:
		retval->vt = VT_I4;
		retval->lVal = versionInfo->wProductType;
		break;

	case e_systemMetric:
		retval->vt = VT_I4;
		retval->lVal = GetSystemMetrics(systemMetric);
		break;

	case e_SPVersionString: {
		LPWSTR data = NULL;
		DWORD size = 0;
		HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, REGPATH_WINNT, L"BuildLab", KEY_WOW64_64KEY, &data, &size);
		retval->vt = VT_BSTR;
		retval->bstrVal = SUCCEEDED(hr)
			? SysAllocStringLen(data, size - 1)
			// BuildLab doesn't exist on Windows 2000.
			: SysAllocString(versionInfo->szCSDVersion);
		if (data) {
			LocalFree(data);
		}
		break;
	}

	case e_controlVersionString:
		retval->vt = VT_BSTR;
		retval->bstrVal = SysAllocString(L"" VERSION_STRING);
		break;

	case e_VistaProductType: {
		DWORD productType = 0;
		GetVistaProductInfo(versionInfo->dwMajorVersion, versionInfo->dwMinorVersion, versionInfo->wServicePackMajor, versionInfo->wServicePackMinor, &productType);
		retval->vt = VT_UI4;
		retval->ulVal = productType;
		break;
	}

	case e_productName:
		return GetOSProductName(retval);

	case e_displayVersion: {
		LPWSTR data = NULL;
		DWORD size = 0;
		HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, REGPATH_WINNT, L"DisplayVersion", KEY_WOW64_64KEY, &data, &size);
		if (SUCCEEDED(hr)) {
			retval->vt = VT_BSTR;
			retval->bstrVal = SysAllocStringLen(data, size - 1);
			LocalFree(data);
		}
		break;
	}
	}

	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::RequestElevation(void) {
	DoIsPermittedCheck();

	if (m_elevatedHelper != NULL || !AtLeastWinVista()) {
		return S_OK;
	}

	// https://learn.microsoft.com/en-us/windows/win32/com/the-com-elevation-moniker
	HWND hwnd;
	GetIEWindowHWND(&hwnd);
	HRESULT hr = CoCreateInstanceAsAdmin(hwnd, CLSID_ElevationHelper, IID_IElevationHelper, (void**)&m_elevatedHelper);
	CHECK_HR_OR_RETURN(L"CoCreateInstanceAsAdmin");
	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::CreateObject(BSTR progID, IDispatch **retval) {
	DoIsPermittedCheck();

	if (progID == NULL) {
		return E_INVALIDARG;
	}

	if (!ProgIDIsPermitted(progID)) {
		return E_ACCESSDENIED;
	}

	IElevationHelper *elevatedHelper;
	HRESULT hr = GetElevatedHelper(&elevatedHelper);
	CHECK_HR_OR_RETURN(L"GetElevatedHelper");

	return elevatedHelper->CreateObject(progID, retval);
}

STDMETHODIMP CLegacyUpdateCtrl::SetBrowserHwnd(IUpdateInstaller *installer) {
	DoIsPermittedCheck();

	if (installer == NULL) {
		return E_INVALIDARG;
	}

	IElevationHelper *elevatedHelper;
	HRESULT hr = GetElevatedHelper(&elevatedHelper);
	CHECK_HR_OR_RETURN(L"GetElevatedHelper");

	HWND hwnd;
	hr = GetIEWindowHWND(&hwnd);
	CHECK_HR_OR_RETURN(L"GetIEWindowHWND");

	return elevatedHelper->SetBrowserHwnd(installer, hwnd);
}

STDMETHODIMP CLegacyUpdateCtrl::GetUserType(UserType *retval) {
	DoIsPermittedCheck();

	if (IsUserAdmin()) {
		// Entire process is elevated.
		*retval = e_admin;
	} else if (m_elevatedHelper != NULL) {
		// Our control has successfully received elevation.
		*retval = e_elevated;
	} else {
		// The control has no admin rights (although it may not have requested them yet).
		*retval = e_nonAdmin;
	}

	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::get_IsRebootRequired(VARIANT_BOOL *retval) {
	DoIsPermittedCheck();

	// Ask WU itself whether a reboot is required
	CComPtr<ISystemInformation> systemInfo;
	if (SUCCEEDED(systemInfo.CoCreateInstance(CLSID_SystemInformation, NULL, CLSCTX_INPROC_SERVER))) {
		if (SUCCEEDED(systemInfo->get_RebootRequired(retval)) && *retval == VARIANT_TRUE) {
			return S_OK;
		}
	}

	// Check reboot flag in registry
	HKEY subkey = NULL;
	HRESULT hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGPATH_WU_REBOOTREQUIRED, 0, GetRegistryWow64Flag(KEY_READ | KEY_WOW64_64KEY), &subkey));
	if (SUCCEEDED(hr)) {
		RegCloseKey(subkey);
		*retval = VARIANT_TRUE;
		return S_OK;
	}

	*retval = VARIANT_FALSE;
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::get_IsWindowsUpdateDisabled(VARIANT_BOOL *retval) {
	DoIsPermittedCheck();

	// Future note: These are in HKCU on NT; HKLM on 9x.
	// Remove links and access to Windows Update
	DWORD value = 0;
	HRESULT hr = GetRegistryDword(HKEY_CURRENT_USER, REGPATH_POLICIES_EXPLORER, L"NoWindowsUpdate", KEY_WOW64_64KEY, &value);
	if (SUCCEEDED(hr) && value == 1) {
		*retval = VARIANT_TRUE;
		return S_OK;
	}

	// Remove access to use all Windows Update features
	hr = GetRegistryDword(HKEY_CURRENT_USER, REGPATH_POLICIES_WU, L"DisableWindowsUpdateAccess", KEY_WOW64_64KEY, &value);
	if (SUCCEEDED(hr) && value == 1) {
		*retval = VARIANT_TRUE;
		return S_OK;
	}

	*retval = VARIANT_FALSE;
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::RebootIfRequired(void) {
	DoIsPermittedCheck();

	VARIANT_BOOL isRebootRequired = VARIANT_FALSE;
	HRESULT hr = get_IsRebootRequired(&isRebootRequired);
	if (SUCCEEDED(hr) && isRebootRequired == VARIANT_TRUE) {
		IElevationHelper *elevatedHelper;
		hr = GetElevatedHelper(&elevatedHelper);
		CHECK_HR_OR_RETURN(L"GetElevatedHelper");

		hr = elevatedHelper->Reboot();
		CHECK_HR_OR_RETURN(L"Reboot");
	}

	return hr;
}

static LPCWSTR logTypeParams[] = {
	L"/log system",
	L"/log local",
	L"/log locallow",
	L"/log windowsupdate"
};

STDMETHODIMP CLegacyUpdateCtrl::ViewLog(ViewLogType logType) {
	DoIsPermittedCheck();

	if (logType < 0 || logType >= ARRAYSIZE(logTypeParams)) {
		return E_INVALIDARG;
	}

	HRESULT hr = StartLauncher(logTypeParams[logType], FALSE);
	if (!SUCCEEDED(hr)) {
		// Try directly
		hr = ::ViewLog((LogAction)logType, SW_SHOWDEFAULT, TRUE);
	}

	CHECK_HR_OR_RETURN(L"ViewLog");
	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::ViewWindowsUpdateLog(void) {
	return ViewLog(e_windowsUpdate);
}

STDMETHODIMP CLegacyUpdateCtrl::OpenWindowsUpdateSettings(void) {
	DoIsPermittedCheck();

	HRESULT hr = StartLauncher(L"/options", FALSE);
	if (!SUCCEEDED(hr)) {
		TRACE(L"OpenWindowsUpdateSettings() failed, falling back: %08x", hr);

		// Might happen if the site isn't trusted, and the user rejected the IE medium integrity prompt.
		// Use the basic Automatic Updates dialog directly from COM.
		CComPtr<IAutomaticUpdates> automaticUpdates;
		hr = automaticUpdates.CoCreateInstance(CLSID_AutomaticUpdates, NULL, CLSCTX_INPROC_SERVER);
		CHECK_HR_OR_RETURN(L"CoCreateInstance CLSID_AutomaticUpdates");

		hr = automaticUpdates->ShowSettingsDialog();
		CHECK_HR_OR_RETURN(L"ShowSettingsDialog");
	}

	return hr;
}

STDMETHODIMP CLegacyUpdateCtrl::get_IsUsingWsusServer(VARIANT_BOOL *retval) {
	DoIsPermittedCheck();

	DWORD useWUServer = 0;
	HRESULT hr = GetRegistryDword(HKEY_LOCAL_MACHINE, REGPATH_POLICIES_WU_AU, L"UseWUServer", KEY_WOW64_64KEY, &useWUServer);
	*retval = SUCCEEDED(hr) && useWUServer == 1 ? VARIANT_TRUE : VARIANT_FALSE;
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::get_WsusServerUrl(BSTR *retval) {
	DoIsPermittedCheck();

	LPWSTR data = NULL;
	DWORD size = 0;
	HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, REGPATH_POLICIES_WU, L"WUServer", KEY_WOW64_64KEY, &data, &size);
	*retval = SUCCEEDED(hr) ? SysAllocStringLen(data, size - 1) : NULL;
	if (data) {
		LocalFree(data);
	}
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::get_WsusStatusServerUrl(BSTR *retval) {
	DoIsPermittedCheck();

	LPWSTR data = NULL;
	DWORD size = 0;
	HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, REGPATH_POLICIES_WU, L"WUStatusServer", KEY_WOW64_64KEY, &data, &size);
	*retval = SUCCEEDED(hr) ? SysAllocStringLen(data, size - 1) : NULL;
	if (data) {
		LocalFree(data);
	}
	return S_OK;
}

STDMETHODIMP CLegacyUpdateCtrl::BeforeUpdate(void) {
	DoIsPermittedCheck();

	IElevationHelper *elevatedHelper;
	HRESULT hr = GetElevatedHelper(&elevatedHelper);
	CHECK_HR_OR_RETURN(L"GetElevatedHelper");

	return elevatedHelper->BeforeUpdate();
}

STDMETHODIMP CLegacyUpdateCtrl::AfterUpdate(void) {
	DoIsPermittedCheck();

	IElevationHelper *elevatedHelper;
	HRESULT hr = GetElevatedHelper(&elevatedHelper);
	CHECK_HR_OR_RETURN(L"GetElevatedHelper");

	return elevatedHelper->AfterUpdate();
}


================================================
FILE: LegacyUpdate/LegacyUpdateCtrl.h
================================================
#pragma once

// LegacyUpdateCtrl.h : Declaration of the CLegacyUpdateCtrl ActiveX Control class.

// CLegacyUpdateCtrl : See LegacyUpdateCtrl.cpp for implementation.

#include <mshtml.h>
#include <wuapi.h>
#include "resource.h"
#include "com.h"
#include "LegacyUpdate_i.h"

class CLegacyUpdateCtrl;

class DECLSPEC_NOVTABLE CLegacyUpdateCtrl_IOleObject :
	public IOleObjectImpl<CLegacyUpdateCtrl> {
public:
	CLegacyUpdateCtrl_IOleObject(CLegacyUpdateCtrl *pParent) :
		IOleObjectImpl<CLegacyUpdateCtrl>(pParent) {}
};

class DECLSPEC_NOVTABLE CLegacyUpdateCtrl :
	public IDispatchImpl<ILegacyUpdateCtrl, &LIBID_LegacyUpdateLib> {
public:
	CLegacyUpdateCtrl() :
		m_IOleObject(this),
		m_refCount(1),
		m_clientSite(NULL),
		m_adviseSink(NULL),
		m_elevatedHelper(NULL),
		m_nonElevatedHelper(NULL) {}

	virtual ~CLegacyUpdateCtrl();

	static STDMETHODIMP Create(IUnknown *pUnkOuter, REFIID riid, void **ppv);
	static STDMETHODIMP UpdateRegistry(BOOL bRegister);

private:
	CLegacyUpdateCtrl_IOleObject m_IOleObject;
	LONG m_refCount;

public:
	// IUnknown
	STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
	STDMETHODIMP_(ULONG) AddRef();
	STDMETHODIMP_(ULONG) Release();

	IOleClientSite *m_clientSite;
	IAdviseSink *m_adviseSink;

private:
	IElevationHelper *m_elevatedHelper;
	IElevationHelper *m_nonElevatedHelper;

	STDMETHODIMP GetHTMLDocument(IHTMLDocument2 **retval);
	STDMETHODIMP IsPermitted();
	STDMETHODIMP GetIEWindowHWND(HWND *retval);
	STDMETHODIMP GetElevatedHelper(IElevationHelper **retval);

public:
	// ILegacyUpdateCtrl
	STDMETHODIMP CheckControl(VARIANT_BOOL *retval);
	STDMETHODIMP MessageForHresult(LONG inHresult, BSTR *retval);
	STDMETHODIMP GetOSVersionInfo(OSVersionField osField, LONG systemMetric, VARIANT *retval);
	STDMETHODIMP RequestElevation();
	STDMETHODIMP CreateObject(BSTR progID, IDispatch **retval);
	STDMETHODIMP SetBrowserHwnd(IUpdateInstaller *installer);
	STDMETHODIMP GetUserType(UserType *retval);
	STDMETHODIMP get_IsRebootRequired(VARIANT_BOOL *retval);
	STDMETHODIMP get_IsWindowsUpdateDisabled(VARIANT_BOOL *retval);
	STDMETHODIMP RebootIfRequired();
	STDMETHODIMP ViewLog(ViewLogType logType);
	STDMETHODIMP ViewWindowsUpdateLog();
	STDMETHODIMP OpenWindowsUpdateSettings();
	STDMETHODIMP get_IsUsingWsusServer(VARIANT_BOOL *retval);
	STDMETHODIMP get_WsusServerUrl(BSTR *retval);
	STDMETHODIMP get_WsusStatusServerUrl(BSTR *retval);
	STDMETHODIMP BeforeUpdate();
	STDMETHODIMP AfterUpdate();
};


================================================
FILE: LegacyUpdate/Makefile
================================================
FILES    = \
	$(wildcard *.cpp) \
	dlldatax.c \
	../shared/Exec.c \
	../shared/HResult.c \
	../shared/LegacyUpdate.c \
	../shared/Log.c \
	../shared/ProductInfo.c \
	../shared/Registry.c \
	../shared/ViewLog.c \
	../shared/WMI.c \
	../shared/Wow64.c \
	$(OBJDIR)/LegacyUpdate_i.c

RCFILES  = LegacyUpdate.rc
MCFILES  = wuerror.mc
IDLFILES = LegacyUpdate.idl

BIN      = obj/LegacyUpdate$(ARCH).dll
DEF      = LegacyUpdate.def

C_LANG   = c++
CXX_LANG = c++

all:: all-archs

all-archs: all-32 all-64

include ../build/shared.mk

CFLAGS  += \
	-DLOG_NAME="\"Control\""

LDFLAGS += \
	-shared \
	-lkernel32 \
	-luser32 \
	-lgdi32 \
	-lole32 \
	-loleaut32 \
	-ladvapi32 \
	-lshell32 \
	-lcomctl32 \
	-lpsapi \
	-lwbemuuid \
	-luuid \
	-lshlwapi \
	-lrpcrt4 \
	-lrpcns4

ifeq ($(ARCH),64)
	LDFLAGS += -Wl,-eDllMain
else
	LDFLAGS += -Wl,-e_DllMain
endif

$(OBJ): $(OBJDIR)/LegacyUpdate_i.h

$(OBJDIR)/dlldatax.o: dlldatax.c $(DLLDATA) $(IDL_P)
	$(CC) -x c $< $(filter-out -Wpedantic, $(CFLAGS)) -c -o $@

.PHONY: all all-archs all-32 all-64


================================================
FILE: LegacyUpdate/NGen.cpp
================================================
#include "NGen.h"
#include "Exec.h"
#include "VersionInfo.h"
#include "Wow64.h"
#include <shlwapi.h>

STDMETHODIMP PauseResumeNGenQueue(BOOL state) {
	// Only necessary prior to Windows 8
	if (AtLeastWin8()) {
		return S_OK;
	}

	// If resuming but the system is already shutting down, ignore because it will process on boot
	if (state && GetSystemMetrics(SM_SHUTTINGDOWN)) {
		return S_OK;
	}

	// Pause and resume .NET Framework global assembly cache (GAC) and NGen queue
	static LPCWSTR versions[] = {
		L"v4.0.30319",
		L"v2.0.50727"
	};

	SYSTEM_INFO systemInfo;
	OurGetNativeSystemInfo(&systemInfo);
	BOOL hasFramework64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 || systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_IA64;

	HRESULT hr = S_OK;

	for (DWORD i = 0; i < ARRAYSIZE(versions); i++) {
		for (int j = 0; j < 2; j++) {
			if (j == 1 && !hasFramework64) {
				break;
			}

			WCHAR path[MAX_PATH], expandedPath[MAX_PATH];
			wsprintf(path, L"%%SystemRoot%%\\Microsoft.NET\\Framework%ls\\%ls\\ngen.exe", j == 1 ? L"64": L"", versions[i]);
			ExpandEnvironmentStrings(path, expandedPath, ARRAYSIZE(expandedPath));

			if (PathFileExists(expandedPath)) {
				SHELLEXECUTEINFO execInfo = {0};
				execInfo.cbSize = sizeof(execInfo);
				execInfo.fMask = SEE_MASK_FLAG_NO_UI;
				execInfo.lpFile = expandedPath;
				execInfo.lpParameters = state ? L"queue pause" : L"queue continue";
				execInfo.nShow = SW_HIDE;
				hr = ExecEx(&execInfo, TRUE, NULL);

				if (SUCCEEDED(hr)) {
					break;
				}
			}
		}
	}

	return hr;
}


================================================
FILE: LegacyUpdate/NGen.h
================================================
#pragma once

STDMETHODIMP PauseResumeNGenQueue(BOOL state);


================================================
FILE: LegacyUpdate/ProductName.cpp
================================================
#include <comdef.h>
#include <shlwapi.h>
#include "Registry.h"
#include "VersionInfo.h"
#include "WMI.h"
#include "Wow64.h"

typedef WINBOOL (__stdcall *_IsOS)(DWORD dwOS);

static VARIANT _productName;

typedef struct {
	LPCWSTR library;
	UINT stringID;
} WinNT5BrandString;

typedef struct {
	DWORD version;
	DWORD osFlag;
	WORD archFlag;
	UINT stringIDs[3];
} WinNT5Variant;

#define STR_WINXP             1
#define STR_SRV03             2
#define STR_IA64              3
#define STR_EMBEDDED          4
#define STR_HOME              5
#define STR_PRO               6
#define STR_STANDARD          7
#define STR_ENTERPRISE        8
#define STR_DATACENTER        9
#define STR_BLADE            10
#define STR_SBS              11

#define STR_TABLETPC2005     12

#define STR_WIN              13

#define STR_TABLETPC         14
#define STR_MEDIACENTER      15
#define STR_STARTER          16
#define STR_EMBPOS           17
#define STR_WINFLP           18
#define STR_EMBSTD2009       19
#define STR_EMBPOS2009       20

#define STR_PROIA64          21
#define STR_STANDARDIA64     22
#define STR_ENTERPRISEIA64   23
#define STR_DATACENTERIA64   24
#define STR_PROX64           25
#define STR_STANDARDX64      26
#define STR_ENTERPRISEX64    27
#define STR_DATACENTERX64    28

#define STR_SRV03R2          29

#define STR_APPLIANCE        30

#define STR_STORAGESERVER_1  31
#define STR_STORAGESERVER_2  32
#define STR_UDSSERVER_2      33

#define STR_COMPUTECLUSTER_1 34
#define STR_COMPUTECLUSTER_2 35
#define STR_COMPUTECLUSTER_3 36

#define STR_HOMESERVER_1     37
#define STR_HOMESERVER_2     38

static const WinNT5BrandString nt5BrandStrings[] = {
	// Skip index 0
	{},

	// Base editions
	{L"sysdm.cpl",      180}, // "Microsoft Windows XP"
	{L"sysdm.cpl",      181}, // "Microsoft Windows Server 2003"
	{L"sysdm.cpl",      188}, // "64-Bit Edition"
	{L"sysdm.cpl",      189}, // "Embedded"
	{L"sysdm.cpl",      190}, // "Home Edition"
	{L"sysdm.cpl",      191}, // "Professional"
	{L"sysdm.cpl",      192}, // "Standard Edition"
	{L"sysdm.cpl",      193}, // "Enterprise Edition"
	{L"sysdm.cpl",      194}, // "Datacenter Edition"
	{L"sysdm.cpl",      196}, // "Web Edition"
	{L"sysdm.cpl",      197}, // "for Small Business Server"

	// Post-SP1
	{L"xpsp2res.dll", 13813}, // "Tablet PC Edition 2005"

	// Post-SP2
	{L"xpsp3res.dll",  2000}, // "Microsoft Windows"

	// XP
	{L"winbrand.dll",  2000}, // "Tablet PC Edition"
	{L"winbrand.dll",  2001}, // "Media Center Edition"
	{L"winbrand.dll",  2002}, // "Starter Edition"
	{L"winbrand.dll",  2003}, // "Embedded for Point of Service"
	{L"winbrand.dll",  2004}, // "Fundamentals for Legacy PCs"
	{L"winbrand.dll",  2005}, // "Windows Embedded Standard"
	{L"winbrand.dll",  2006}, // "Embedded POSReady 2009"

	// Server 2003
	{L"ws03res.dll",   4600}, // "Microsoft(R) Windows(R) XP 64-Bit Edition for Itanium-based Systems"
	{L"ws03res.dll",   4601}, // "Microsoft(R) Windows(R) Server 2003, Standard Edition for 64-Bit Itanium-based Systems"
	{L"ws03res.dll",   4602}, // "Microsoft(R) Windows(R) Server 2003, Enterprise Edition for 64-Bit Itanium-based Systems"
	{L"ws03res.dll",   4603}, // "Microsoft(R) Windows(R) Server 2003, Datacenter Edition for 64-Bit Itanium-based Systems"
	{L"ws03res.dll",  13812}, // "Professional x64 Edition"
	{L"ws03res.dll",  13814}, // "Standard x64 Edition"
	{L"ws03res.dll",  13815}, // "Enterprise x64 Edition"
	{L"ws03res.dll",  13816}, // "Datacenter x64 Edition"

	// R2
	{L"r2brand.dll",   1101}, // "Microsoft Windows Server 2003 R2"

	// Appliance Server
	{L"winbrand.dll",  2002}, // "Appliance Server"

	// Storage Server
	{L"wssbrand.dll",  1101}, // "Microsoft"
	{L"wssbrand.dll",  1102}, // "Windows Storage Server 2003 R2"
	{L"wssbrand.dll",  1104}, // "Windows UDS Server 2003"

	// Compute Cluster
	{L"hpcbrand.dll",  1101}, // "Microsoft"
	{L"hpcbrand.dll",  1102}, // "Windows Server 2003"
	{L"hpcbrand.dll",  1103}, // "Compute Cluster Edition"

	// Home Server
	{L"whsbrand.dll",  1101}, // "Microsoft"
	{L"whsbrand.dll",  1102}  // "Windows Home Server"
};

static const WinNT5Variant nt5Variants[] = {
	// XP
	// "XP Reloaded" editions - also identifies as OS_PROFESSIONAL
	{MAXDWORD, OS_TABLETPC,       MAXWORD,                      {STR_WINXP, STR_TABLETPC}},      // "Microsoft Windows XP Tablet PC Edition"
	{MAXDWORD, OS_MEDIACENTER,    MAXWORD,                      {STR_WINXP, STR_MEDIACENTER}},   // "Microsoft Windows XP Media Center Edition"
	{MAXDWORD, OS_STARTER,        MAXWORD,                      {STR_WINXP, STR_STARTER}},       // "Microsoft Windows XP Starter Edition"
	// Embedded editions - also identifies as OS_EMBEDDED and OS_PROFESSIONAL
	{0x0501,   OS_EMBPOS,         MAXWORD,                      {STR_WIN,   STR_EMBPOS}},        // "Microsoft Windows Embedded for Point of Service"
	{MAXDWORD, OS_WINFLP,         MAXWORD,                      {STR_WIN,   STR_WINFLP}},        // "Microsoft Windows Fundamentals for Legacy PCs"
	{MAXDWORD, OS_EMBSTD2009,     MAXWORD,                      {STR_WIN,   STR_EMBSTD2009}},    // "Microsoft Windows Embedded Standard"
	{MAXDWORD, OS_EMBPOS2009,     MAXWORD,                      {STR_WIN,   STR_EMBPOS2009}},    // "Microsoft Windows Embedded POSReady 2009"
	{MAXDWORD, OS_EMBEDDED,       MAXWORD,                      {STR_WINXP, STR_EMBEDDED}},      // "Microsoft Windows XP Embedded"
	// Base editions
	{MAXDWORD, OS_HOME,           MAXWORD,                      {STR_WINXP, STR_HOME}},          // "Microsoft Windows XP Home Edition"
	{MAXDWORD, OS_PROFESSIONAL,   PROCESSOR_ARCHITECTURE_AMD64, {STR_WINXP, STR_PROX64}},        // "Microsoft Windows XP Professional x64 Edition"
	{MAXDWORD, OS_PROFESSIONAL,   PROCESSOR_ARCHITECTURE_IA64,  {STR_WINXP, STR_PRO, STR_IA64}}, // "Microsoft Windows XP Professional 64-Bit Edition"
	{MAXDWORD, OS_PROFESSIONAL,   MAXWORD,                      {STR_WINXP, STR_PRO}},           // "Microsoft Windows XP Professional"

	// Server 2003
	// Neutral
	{MAXDWORD, OS_APPLIANCE,      MAXWORD,                      {STR_SRV03, STR_APPLIANCE}},     // "Microsoft Windows Server 2003, Appliance Server"
	{MAXDWORD, OS_STORAGESERVER,  MAXWORD,                      {STR_STORAGESERVER_1, STR_STORAGESERVER_2}}, // "Microsoft Windows Storage Server 2003 R2"
	{MAXDWORD, OS_COMPUTECLUSTER, MAXWORD,                      {STR_COMPUTECLUSTER_1, STR_COMPUTECLUSTER_2, STR_COMPUTECLUSTER_3}}, // "Microsoft Windows Server 2003 Compute Cluster Edition"
	{0x0502,   OS_HOMESERVER,     MAXWORD,                      {STR_HOMESERVER_1, STR_HOMESERVER_2}}, // "Microsoft Windows Home Server"
	// Base editions
	{MAXDWORD, OS_SMALLBUSINESSSERVER, MAXWORD,                 {STR_SRV03, STR_SBS}},           // "Microsoft Windows Server 2003 for Small Business Server"
	// Itanium
	{MAXDWORD, OS_SERVER,         PROCESSOR_ARCHITECTURE_IA64,  {STR_STANDARDIA64}},             // "Microsoft(R) Windows(R) Server 2003, Standard Edition for 64-Bit Itanium-based Systems"
	{MAXDWORD, OS_ADVSERVER,      PROCESSOR_ARCHITECTURE_IA64,  {STR_ENTERPRISEIA64}},           // "Microsoft(R) Windows(R) Server 2003, Enterprise Edition for 64-Bit Itanium-based Systems"
	{MAXDWORD, OS_DATACENTER,     PROCESSOR_ARCHITECTURE_IA64,  {STR_DATACENTERIA64}},           // "Microsoft(R) Windows(R) Server 2003, Datacenter Edition for 64-Bit Itanium-based Systems"
	// x64
	{MAXDWORD, OS_SERVER,         PROCESSOR_ARCHITECTURE_AMD64, {STR_SRV03, STR_STANDARDX64}},   // "Microsoft Windows Server 2003, Standard x64 Edition"
	{MAXDWORD, OS_ADVSERVER,      PROCESSOR_ARCHITECTURE_AMD64, {STR_SRV03, STR_ENTERPRISEX64}}, // "Microsoft Windows Server 2003, Enterprise x64 Edition"
	{MAXDWORD, OS_DATACENTER,     PROCESSOR_ARCHITECTURE_AMD64, {STR_SRV03, STR_DATACENTERX64}}, // "Microsoft Windows Server 2003, Datacenter x64 Edition"
	// x86
	{MAXDWORD, OS_SERVER,         MAXWORD,                      {STR_SRV03, STR_STANDARD}},      // "Microsoft Windows Server 2003, Standard Edition"
	{MAXDWORD, OS_ADVSERVER,      MAXWORD,                      {STR_SRV03, STR_ENTERPRISE}},    // "Microsoft Windows Server 2003, Enterprise Edition"
	{MAXDWORD, OS_WEBSERVER,      MAXWORD,                      {STR_SRV03, STR_BLADE}},         // "Microsoft Windows Server 2003, Web Edition"
	{MAXDWORD, OS_DATACENTER,     MAXWORD,                      {STR_SRV03, STR_DATACENTER}},    // "Microsoft Windows Server 2003, Datacenter Edition"

	// Fallbacks
	{0x0501,   MAXDWORD,          MAXWORD,                      {STR_WINXP}},                    // "Microsoft Windows XP"
	{0x0502,   MAXDWORD,          MAXWORD,                      {STR_SRV03}},                    // "Microsoft Windows Server 2003"
};

HRESULT GetOSProductName(LPVARIANT productName) {
	if (_productName.vt == VT_EMPTY) {
		VariantInit(&_productName);

		// Handle the absolute disaster of Windows XP/Server 2003 edition branding
		WORD winver = GetWinVer();
		if (HIBYTE(winver) == 5 && LOBYTE(winver) != 0) {
			_IsOS $IsOS = (_IsOS)GetProcAddress(LoadLibrary(L"shlwapi.dll"), MAKEINTRESOURCEA(437));
			if (!$IsOS) {
				return E_FAIL;
			}

			SYSTEM_INFO systemInfo;
			OurGetNativeSystemInfo(&systemInfo);

			WinNT5Variant variant = {};
			for (DWORD i = 0; i < ARRAYSIZE(nt5Variants); i++) {
				WinNT5Variant thisVariant = nt5Variants[i];
				if ((thisVariant.version == MAXDWORD || thisVariant.version == winver) &&
					(thisVariant.archFlag == MAXWORD || thisVariant.archFlag == systemInfo.wProcessorArchitecture) &&
					(thisVariant.osFlag == MAXDWORD || $IsOS(thisVariant.osFlag))) {
					variant = thisVariant;
					break;
				}
			}

			if (variant.version != 0) {
				WCHAR brandStr[1024];
				ZeroMemory(brandStr, ARRAYSIZE(brandStr));

				for (DWORD i = 0; variant.stringIDs[i] != 0; i++) {
					UINT id = variant.stringIDs[i];

					// If Server 2003 R2, override to R2 string
					if (id == STR_SRV03 && $IsOS(OS_SERVERR2)) {
						id = STR_SRV03R2;
					}

					// If XP Tablet PC SP2, override to 2005 string
					if (id == STR_TABLETPC && GetVersionInfo()->wServicePackMajor >= 2) {
						id = STR_TABLETPC2005;
					}

					WinNT5BrandString brandString = nt5BrandStrings[id];
					WCHAR str[340];
					HMODULE dll = LoadLibraryEx(brandString.library, NULL, LOAD_LIBRARY_AS_DATAFILE);
					if (dll) {
						LoadString(dll, brandString.stringID, str, ARRAYSIZE(str));
						FreeLibrary(dll);
					}

					// If Server 2003 (except SBS), add comma
					if (i == 1) {
						UINT lastID = variant.stringIDs[i - 1];
						if (lastID == STR_SRV03 && !$IsOS(OS_SMALLBUSINESSSERVER)) {
							wcscat(brandStr, L",");
						}
					}

					if (i > 0) {
						wcscat(brandStr, L" ");
					}

					wcscat(brandStr, str);
				}

				if (wcslen(brandStr) > 0) {
					_productName.vt = VT_BSTR;
					_productName.bstrVal = SysAllocString(brandStr);
				}
			}
		}

		if (_productName.vt == VT_EMPTY) {
			// Get from WMI
			HRESULT hr = QueryWMIProperty(L"SELECT Caption FROM Win32_OperatingSystem", L"Caption", &_productName);
			CHECK_HR_OR_RETURN(L"QueryWMIProperty");
		}

		if (_productName.vt == VT_EMPTY) {
			// Get from registry
			LPWSTR data = NULL;
			DWORD size = 0;
			HRESULT hr = GetRegistryString(HKEY_LOCAL_MACHINE, REGPATH_WINNT, L"ProductName", KEY_WOW64_64KEY, &data, &size);
			CHECK_HR_OR_RETURN(L"GetRegistryString");

			_productName.vt = VT_BSTR;
			_productName.bstrVal = SysAllocStringLen(data, size - 1);
			LocalFree(data);
		}
	}

	VariantCopy(productName, &_productName);
	return S_OK;
}


================================================
FILE: LegacyUpdate/ProductName.h
================================================
#pragma once

HRESULT GetOSProductName(LPVARIANT productName);


================================================
FILE: LegacyUpdate/ProgressBarControl.cpp
================================================
// ProgressBarControl.cpp : Implementation of CProgressBarControl

#include "ProgressBarControl.h"
#include <commctrl.h>
#include <new>
#include "Compat.h"
#include "Registry.h"
#include "resource.h"
#include "VersionInfo.h"

#define PROGRESSBARCONTROL_MISCSTATUS (OLEMISC_RECOMPOSEONRESIZE | OLEMISC_CANTLINKINSIDE | OLEMISC_INSIDEOUT | OLEMISC_ACTIVATEWHENVISIBLE | OLEMISC_SETCLIENTSITEFIRST | OLEMISC_NOUIACTIVATE)

DEFINE_UUIDOF(CProgressBarControl, CLSID_ProgressBarControl);

STDMETHODIMP CProgressBarControl::Create(IUnknown *pUnkOuter, REFIID riid, void **ppv) {
	if (pUnkOuter != NULL) {
		return CLASS_E_NOAGGREGATION;
	}

	CProgressBarControl *pThis = (CProgressBarControl *)CoTaskMemAlloc(sizeof(CProgressBarControl));
	if (pThis == NULL) {
		return E_OUTOFMEMORY;
	}

	new(pThis) CProgressBarControl();
	HRESULT hr = pThis->QueryInterface(riid, ppv);
	CHECK_HR_OR_RETURN(L"QueryInterface");
	pThis->Release();

	return hr;
}

CProgressBarControl::~CProgressBarControl(void) {
	DestroyControlWindow();
	if (m_clientSite) {
		m_clientSite->Release();
		m_clientSite = NULL;
	}
	if (m_adviseSink) {
		m_adviseSink->Release();
		m_adviseSink = NULL;
	}
}

STDMETHODIMP CProgressBarControl::UpdateRegistry(BOOL bRegister) {
	if (bRegister) {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar", NULL, REG_SZ, (LPVOID)L"Legacy Update Progress Bar Control"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar\\CurVer", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ProgressBar.1"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar.1", NULL, REG_SZ, (LPVOID)L"Legacy Update Progress Bar Control"},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar.1\\CLSID", NULL, REG_SZ, (LPVOID)L"%CLSID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, REG_SZ, (LPVOID)L"Legacy Update Progress Bar Control"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", L"AppID", REG_SZ, (LPVOID)L"%APPID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\ProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ProgressBar.1"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\VersionIndependentProgID", NULL, REG_SZ, (LPVOID)L"LegacyUpdate.ProgressBar"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Programmable", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", NULL, REG_SZ, (LPVOID)L"%MODULE%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\InprocServer32", L"ThreadingModel", REG_SZ, (LPVOID)L"Apartment"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Control", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\TypeLib", NULL, REG_SZ, (LPVOID)L"%LIBID%"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Version", NULL, REG_SZ, (LPVOID)L"1.0"},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\MiscStatus", NULL, REG_DWORD, (LPVOID)PROGRESSBARCONTROL_MISCSTATUS},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Implemented Categories\\{7DD95801-9882-11CF-9FA9-00AA006C42C4}", NULL, REG_SZ, NULL},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%\\Implemented Categories\\{7DD95802-9882-11CF-9FA9-00AA006C42C4}", NULL, REG_SZ, NULL},
			{}
		};
		return SetRegistryEntries(entries);
	} else {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"LegacyUpdate.ProgressBar.1", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"CLSID\\%CLSID%", NULL, 0, DELETE_KEY},
			{}
		};
		return SetRegistryEntries(entries);
	}
}

#pragma mark - IUnknown

STDMETHODIMP CProgressBarControl::QueryInterface(REFIID riid, void **ppvObject) {
	if (ppvObject == NULL) {
		return E_POINTER;
	}

	*ppvObject = NULL;

	if (IsEqualIID(riid, IID_IOleObject)) {
		*ppvObject = (IOleObject *)&m_IOleObject;
		AddRef();
		return S_OK;
	} else if (IsEqualIID(riid, IID_IViewObject) || IsEqualIID(riid, IID_IViewObject2) || IsEqualIID(riid, IID_IViewObjectEx)) {
		*ppvObject = (IViewObjectEx *)&m_IViewObjectEx;
		AddRef();
		return S_OK;
	} else if (IsEqualIID(riid, IID_IOleInPlaceObject) || IsEqualIID(riid, IID_IOleWindow) || IsEqualIID(riid, IID_IOleInPlaceObjectWindowless)) {
		*ppvObject = (IOleInPlaceObject *)&m_IOleInPlaceObject;
		AddRef();
		return S_OK;
	} else if (IsEqualIID(riid, IID_IOleInPlaceActiveObject)) {
		*ppvObject = (IOleInPlaceActiveObject *)&m_IOleInPlaceActiveObject;
		AddRef();
		return S_OK;
	} else if (IsEqualIID(riid, IID_IQuickActivate)) {
		*ppvObject = (IQuickActivate *)&m_IQuickActivateImpl;
		AddRef();
		return S_OK;
	}

	return IDispatchImpl<IProgressBarControl, &LIBID_LegacyUpdateLib>::QueryInterface(riid, ppvObject);
}

STDMETHODIMP_(ULONG) CProgressBarControl::AddRef(void) {
	return InterlockedIncrement(&m_refCount);
}

STDMETHODIMP_(ULONG) CProgressBarControl::Release(void) {
	ULONG count = InterlockedDecrement(&m_refCount);
	if (count == 0) {
		this->~CProgressBarControl();
		CoTaskMemFree(this);
	}
	return count;
}

#pragma mark - IOleObject

STDMETHODIMP CProgressBarControl_IOleObject::GetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
	if (psizel == NULL) {
		return E_POINTER;
	}

	if (dwDrawAspect != DVASPECT_CONTENT) {
		return DV_E_DVASPECT;
	}

	// Convert to HIMETRIC
	HDC hdc = GetDC(NULL);
	int ppiX = GetDeviceCaps(hdc, LOGPIXELSX);
	int ppiY = GetDeviceCaps(hdc, LOGPIXELSY);
	ReleaseDC(NULL, hdc);

	psizel->cx = MAP_PIX_TO_LOGHIM(m_pParent->m_width, ppiX);
	psizel->cy = MAP_PIX_TO_LOGHIM(m_pParent->m_height, ppiY);
	return S_OK;
}

STDMETHODIMP CProgressBarControl_IOleObject::SetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
	if (psizel == NULL) {
		return E_POINTER;
	}

	if (dwDrawAspect != DVASPECT_CONTENT) {
		return DV_E_DVASPECT;
	}

	// Convert from HIMETRIC
	HDC hdc = GetDC(NULL);
	int ppiX = GetDeviceCaps(hdc, LOGPIXELSX);
	int ppiY = GetDeviceCaps(hdc, LOGPIXELSY);
	ReleaseDC(NULL, hdc);

	m_pParent->m_width = MAP_LOGHIM_TO_PIX(psizel->cx, ppiX);
	m_pParent->m_height = MAP_LOGHIM_TO_PIX(psizel->cy, ppiY);

	if (m_pParent->m_innerHwnd) {
		SetWindowPos(
			m_pParent->m_innerHwnd, NULL,
			0, 0,
			m_pParent->m_width, m_pParent->m_height,
			SWP_NOZORDER | SWP_NOACTIVATE
		);
	}

	return S_OK;
}

STDMETHODIMP CProgressBarControl_IOleObject::DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) {
	switch (iVerb) {
	case OLEIVERB_INPLACEACTIVATE:
	case OLEIVERB_UIACTIVATE:
	case OLEIVERB_SHOW:
		if (hwndParent && lprcPosRect) {
			HRESULT hr = m_pParent->CreateControlWindow(hwndParent, lprcPosRect);
			CHECK_HR_OR_RETURN(L"CreateControlWindow");
		}
		return S_OK;

	case OLEIVERB_HIDE:
		return S_OK;

	default:
		return OLEOBJ_S_INVALIDVERB;
	}
}

STDMETHODIMP CProgressBarControl_IOleObject::GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus) {
	if (pdwStatus == NULL) {
		return E_POINTER;
	}

	if (dwAspect == DVASPECT_CONTENT) {
		*pdwStatus = PROGRESSBARCONTROL_MISCSTATUS;
		return S_OK;
	}

	*pdwStatus = 0;
	return S_OK;
}

STDMETHODIMP CProgressBarControl_IOleObject::Close(DWORD dwSaveOption) {
	m_pParent->DestroyControlWindow();
	return IOleObjectImpl<CProgressBarControl>::Close(dwSaveOption);
}

STDMETHODIMP CProgressBarControl::CreateControlWindow(HWND hParent, const RECT *pRect) {
	m_width = pRect->right - pRect->left;
	m_height = pRect->bottom - pRect->top;

	if (m_innerHwnd) {
		if (m_hwnd == hParent) {
			// Just update the position
			SetWindowPos(
				m_innerHwnd, NULL,
				pRect->left, pRect->top,
				m_width, m_height,
				SWP_NOZORDER | SWP_NOACTIVATE
			);
			return S_OK;
		} else {
			// Parent changed, start over
			DestroyControlWindow();
		}
	}

	m_hwnd = hParent;

	// Bind to our manifest to ensure we get visual styles and marquee
	ULONG_PTR cookie;
	IsolationAwareStart(&cookie);

	// Load and init comctl (hopefully 6.0)
	LoadLibrary(L"comctl32.dll");

	INITCOMMONCONTROLSEX initComctl = {0};
	initComctl.dwSize = sizeof(initComctl);
	initComctl.dwICC = ICC_PROGRESS_CLASS;
	InitCommonControlsEx(&initComctl);

	// Create progress bar window
	m_innerHwnd = CreateWindowEx(
		WS_EX_CLIENTEDGE,
		PROGRESS_CLASS,
		NULL,
		WS_CHILD | WS_VISIBLE,
		0, 0,
		m_width, m_height,
		m_hwnd,
		NULL,
		OWN_MODULE,
		NULL
	);
	IsolationAwareEnd(&cookie);
	if (!m_innerHwnd) {
		return E_FAIL;
	}

	return put_Value(-1);
}

STDMETHODIMP CProgressBarControl::DestroyControlWindow(void) {
	if (m_innerHwnd) {
		DestroyWindow(m_innerHwnd);
		m_innerHwnd = NULL;
	}

	m_hwnd = NULL;

	return S_OK;
}

#pragma mark - IViewObjectEx

STDMETHODIMP CProgressBarControl::OnDraw(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue) {
	if (lprcBounds == NULL || hdcDraw == NULL) {
		return E_POINTER;
	}

	switch (dwDrawAspect) {
	case DVASPECT_CONTENT:
	case DVASPECT_OPAQUE:
	case DVASPECT_TRANSPARENT:
		break;

	default:
		return DV_E_DVASPECT;
	}

	if (m_innerHwnd) {
		// Set size
		LONG width = lprcBounds->right - lprcBounds->left;
		LONG height = lprcBounds->bottom - lprcBounds->top;
		SetWindowPos(
			m_innerHwnd, NULL,
			lprcBounds->left, lprcBounds->top,
			width, height,
			SWP_NOZORDER | SWP_NOACTIVATE
		);
	}

	return S_OK;
}

#pragma mark - IOleInPlaceObject

STDMETHODIMP CProgressBarControl_IOleInPlaceObject::SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect) {
	if (lprcPosRect == NULL) {
		return E_POINTER;
	}

	m_pParent->m_width = lprcPosRect->right - lprcPosRect->left;
	m_pParent->m_height = lprcPosRect->bottom - lprcPosRect->top;
	return S_OK;
}

#pragma mark - IOleInPlaceActiveObject

STDMETHODIMP CProgressBarControl_IOleInPlaceActiveObject::ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow) {
	if (prcBorder && m_pParent->m_innerHwnd) {
		LONG width = prcBorder->right - prcBorder->left;
		LONG height = prcBorder->bottom - prcBorder->top;

		m_pParent->m_width = width;
		m_pParent->m_height = height;

		SetWindowPos(
			m_pParent->m_innerHwnd, NULL,
			prcBorder->left, prcBorder->top,
			width, height,
			SWP_NOZORDER | SWP_NOACTIVATE
		);
	}

	return S_OK;
}

#pragma mark - Helper methods

STDMETHODIMP CProgressBarControl::InvalidateContainer(void) {
	if (m_adviseSink) {
		m_adviseSink->OnViewChange(DVASPECT_CONTENT, -1);
	}

	if (m_clientSite) {
		CComPtr<IOleInPlaceSiteWindowless> inPlaceSiteWindowless;
		m_clientSite->QueryInterface(IID_IOleInPlaceSiteWindowless, (void**)&inPlaceSiteWindowless);
		if (inPlaceSiteWindowless) {
			inPlaceSiteWindowless->InvalidateRect(NULL, TRUE);
		} else {
			CComPtr<IOleInPlaceSite> inPlaceSite;
			m_clientSite->QueryInterface(IID_IOleInPlaceSite, (void**)&inPlaceSite);
			if (inPlaceSite) {
				HWND containerHwnd;
				if (SUCCEEDED(inPlaceSite->GetWindow(&containerHwnd)) && containerHwnd) {
					InvalidateRect(containerHwnd, NULL, TRUE);
				}
			}
		}
	}

	return S_OK;
}

#pragma mark - IProgressBarControl

STDMETHODIMP CProgressBarControl::get_Value(SHORT *pValue) {
	if (pValue == NULL) {
		return E_POINTER;
	}

	if (m_innerHwnd == NULL) {
		*pValue = 0;
		return S_OK;
	}

	if (GetWindowLongPtr(m_innerHwnd, GWL_STYLE) & PBS_MARQUEE) {
		// Marquee - no value
		*pValue = -1;
	} else {
		// Normal - return PBM_GETPOS
		*pValue = (SHORT)SendMessage(m_innerHwnd, PBM_GETPOS, 0, 0);
	}

	return S_OK;
}

STDMETHODIMP CProgressBarControl::put_Value(SHORT value) {
	if (m_innerHwnd == NULL) {
		return E_FAIL;
	}

	ULONG_PTR cookie;
	IsolationAwareStart(&cookie);

	if (value == -1) {
		// Marquee style
		SetWindowLongPtr(m_innerHwnd, GWL_STYLE, GetWindowLongPtr(m_innerHwnd, GWL_STYLE) | PBS_MARQUEE);
		SendMessage(m_innerHwnd, PBM_SETMARQUEE, TRUE, 100);
	} else {
		// Normal style
		SHORT oldValue = -1;
		get_Value(&oldValue);
		if (oldValue == -1) {
			SendMessage(m_innerHwnd, PBM_SETMARQUEE, FALSE, 0);
			SetWindowLongPtr(m_innerHwnd, GWL_STYLE, GetWindowLongPtr(m_innerHwnd, GWL_STYLE) & ~PBS_MARQUEE);
			SendMessage(m_innerHwnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100));
		}

		SendMessage(m_innerHwnd, PBM_SETPOS, value, 0);
	}

	IsolationAwareEnd(&cookie);
	InvalidateContainer();

	return S_OK;
}


================================================
FILE: LegacyUpdate/ProgressBarControl.h
================================================
#pragma once

// ProgressBarControl.h : Declaration of the CProgressBarControl class.

#include "resource.h"
#include "com.h"
#include "LegacyUpdate_i.h"

class CProgressBarControl;

class DECLSPEC_NOVTABLE CProgressBarControl_IOleObject :
	public IOleObjectImpl<CProgressBarControl> {
public:
	CProgressBarControl_IOleObject(CProgressBarControl *pParent) :
		IOleObjectImpl<CProgressBarControl>(pParent) {}

	STDMETHODIMP GetExtent(DWORD dwDrawAspect, SIZEL *psizel);
	STDMETHODIMP SetExtent(DWORD dwDrawAspect, SIZEL *psizel);
	STDMETHODIMP DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite, LONG lindex, HWND hwndParent, LPCRECT lprcPosRect);
	STDMETHODIMP GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus);
	STDMETHODIMP Close(DWORD dwSaveOption);
};

class DECLSPEC_NOVTABLE CProgressBarControl_IViewObjectEx :
	public IViewObjectExImpl<CProgressBarControl> {
public:
	CProgressBarControl_IViewObjectEx(CProgressBarControl *pParent) :
		IViewObjectExImpl<CProgressBarControl>(pParent) {}
};

class DECLSPEC_NOVTABLE CProgressBarControl_IOleInPlaceObject :
	public IOleInPlaceObjectImpl<CProgressBarControl> {
public:
	CProgressBarControl_IOleInPlaceObject(CProgressBarControl *pParent) :
		IOleInPlaceObjectImpl<CProgressBarControl>(pParent) {}

	STDMETHODIMP SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect);
};

class DECLSPEC_NOVTABLE CProgressBarControl_IOleInPlaceActiveObject :
	public IOleInPlaceActiveObjectImpl<CProgressBarControl> {
public:
	CProgressBarControl_IOleInPlaceActiveObject(CProgressBarControl *pParent) :
		IOleInPlaceActiveObjectImpl<CProgressBarControl>(pParent) {}

	// IOleInPlaceActiveObject
	STDMETHODIMP ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fFrameWindow);
};

class DECLSPEC_NOVTABLE CProgressBarControl_IQuickActivateImpl :
	public IQuickActivateImpl<CProgressBarControl> {
public:
	CProgressBarControl_IQuickActivateImpl(CProgressBarControl *pParent) :
		IQuickActivateImpl<CProgressBarControl>(pParent) {}
};

class DECLSPEC_NOVTABLE CProgressBarControl :
	public IDispatchImpl<IProgressBarControl, &LIBID_LegacyUpdateLib> {
public:
	CProgressBarControl() :
		m_IOleObject(this),
		m_IViewObjectEx(this),
		m_IOleInPlaceObject(this),
		m_IOleInPlaceActiveObject(this),
		m_IQuickActivateImpl(this),
		m_refCount(1),
		m_hwnd(NULL),
		m_innerHwnd(NULL),
		m_width(0),
		m_height(0),
		m_clientSite(NULL),
		m_adviseSink(NULL) {
	}

	virtual ~CProgressBarControl();

	static STDMETHODIMP Create(IUnknown *pUnkOuter, REFIID riid, void **ppv);
	static STDMETHODIMP UpdateRegistry(BOOL bRegister);

public:
	CProgressBarControl_IOleObject m_IOleObject;
	CProgressBarControl_IViewObjectEx m_IViewObjectEx;
	CProgressBarControl_IOleInPlaceObject m_IOleInPlaceObject;
	CProgressBarControl_IOleInPlaceActiveObject m_IOleInPlaceActiveObject;
	CProgressBarControl_IQuickActivateImpl m_IQuickActivateImpl;

private:
	LONG m_refCount;

public:
	HWND m_hwnd;
	HWND m_innerHwnd;
	LONG m_width;
	LONG m_height;
	IOleClientSite *m_clientSite;
	IAdviseSink *m_adviseSink;

	// IUnknown
	STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject);
	STDMETHODIMP_(ULONG) AddRef();
	STDMETHODIMP_(ULONG) Release();

	// IProgressBarControl
	STDMETHODIMP get_Value(SHORT *pValue);
	STDMETHODIMP put_Value(SHORT value);

	// Helpers
	STDMETHODIMP CreateControlWindow(HWND hParent, const RECT *pRect);
	STDMETHODIMP DestroyControlWindow();
	STDMETHODIMP OnDraw(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), ULONG_PTR dwContinue);
	STDMETHODIMP InvalidateContainer();
};


================================================
FILE: LegacyUpdate/ProgressBarControl.html
================================================
<!DOCTYPE html>
<html>
<head>
	<title>ATL test page for object ProgressBarControl</title>
	<meta http-equiv="X-UA-Compatible" content="IE=8">
	<meta http-equiv="MSThemeCompatible" content="yes">
</head>
<body>
	<div style="border: 1px solid #555; width: 200px; height: 150px; margin: 100px; overflow: scroll;">
		<div style="height: 50px;"></div>
		<object id="ProgressBarControl" classid="CLSID:7b875a2f-2dfb-4d38-91f5-5c0bfb74c377" width="208" height="14"></object>
		<div style="padding-top: 200px;"></div>
		.
	</div>

	<div id="Value">-1</div>

	<button onclick="marquee()">Marquee</button>
	<button onclick="normal()">Normal</button>
	<button onclick="zero()">Zero</button>
	<button onclick="stop()">Stop</button>

	<script>
		var timer = -1;
		var value = -1;

		function stop() {
			if (timer !== -1) {
				clearTimeout(timer);
				timer = -1;
			}
		}

		function update(marquee) {
			if (marquee) {
				value = -1;
			} else {
				value = value === 100 ? 0 : value + 1;
			}

			ProgressBarControl.Value = value;
			Value.innerText = value;

			if (marquee) {
				stop();
			} else {
				timer = setTimeout(update, 100, false);
			}
		}

		function marquee() {
			stop();
			update(true);
		}

		function normal() {
			stop();
			update(false);
		}

		function zero() {
			stop();
			value = 100;
			update(false);
		}
	</script>
</body>
</html>


================================================
FILE: LegacyUpdate/Utils.cpp
================================================
#include "Utils.h"
#include <shlwapi.h>
#include <winreg.h>
#include "Exec.h"
#include "LegacyUpdate.h"
#include "ViewLog.h"

#ifndef SHUTDOWN_RESTART
#define SHUTDOWN_RESTART 0x00000004
#endif

#ifndef SHUTDOWN_INSTALL_UPDATES
#define SHUTDOWN_INSTALL_UPDATES 0x00000040
#endif

typedef DWORD (WINAPI *_InitiateShutdownW)(LPWSTR lpMachineName, LPWSTR lpMessage, DWORD dwGracePeriod, DWORD dwShutdownFlags, DWORD dwReason);

HRESULT StartLauncher(LPCWSTR params, BOOL wait) {
	LPWSTR path = NULL;
	HRESULT hr = GetInstallPath(&path);
	CHECK_HR_OR_RETURN(L"GetInstallPath");

	PathAppend(path, L"LegacyUpdate.exe");

	DWORD code = 0;
	hr = Exec(NULL, path, params, NULL, SW_SHOWDEFAULT, wait, &code);
	CHECK_HR_OR_GOTO_END(L"Exec");
	hr = HRESULT_FROM_WIN32(code);

end:
	LocalFree(path);
	return hr;
}

HRESULT Reboot(void) {
	HRESULT hr = E_FAIL;

	HANDLE token = NULL;
	TOKEN_PRIVILEGES privileges;
	LUID shutdownLuid;
	_InitiateShutdownW $InitiateShutdownW = (_InitiateShutdownW)GetProcAddress(GetModuleHandle(L"advapi32.dll"), "InitiateShutdownW");

	// Make sure we have permission to shut down
	if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &token)) {
		hr = HRESULT_FROM_WIN32(GetLastError());
		CHECK_HR_OR_GOTO_END(L"OpenProcessToken");
	}

	if (!LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME, &shutdownLuid)) {
		hr = HRESULT_FROM_WIN32(GetLastError());
		CHECK_HR_OR_GOTO_END(L"LookupPrivilegeValue");
	}

	// Ask the system nicely to give us shutdown privilege
	privileges.PrivilegeCount = 1;
	privileges.Privileges[0].Luid = shutdownLuid;
	privileges.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

	if (!AdjustTokenPrivileges(token, FALSE, &privileges, 0, NULL, NULL)) {
		hr = HRESULT_FROM_WIN32(GetLastError());
		CHECK_HR_OR_GOTO_END(L"AdjustTokenPrivileges");
	}

	// Reboot with reason "Operating System: Security fix (Unplanned)", ensuring to install updates.
	// Try InitiateShutdown first (Vista+)
	if ($InitiateShutdownW) {
		hr = HRESULT_FROM_WIN32($InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_RESTART | SHUTDOWN_INSTALL_UPDATES, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX));
	}

	// Try InitiateSystemShutdownEx (2k/XP)
	if (!SUCCEEDED(hr)) {
		TRACE(L"InitiateShutdown failed: %08x", hr);

		if (InitiateSystemShutdownEx(NULL, NULL, 0, FALSE, TRUE, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX) == 0) {
			hr = HRESULT_FROM_WIN32(GetLastError());
			CHECK_HR_OR_GOTO_END(L"InitiateSystemShutdownEx");
		}
	}

	// Last-ditch attempt ExitWindowsEx (only guaranteed to work for the current logged in user)
	if (!SUCCEEDED(hr) && !ExitWindowsEx(EWX_REBOOT | EWX_FORCEIFHUNG, SHTDN_REASON_MAJOR_OPERATINGSYSTEM | SHTDN_REASON_MINOR_SECURITYFIX)) {
		hr = HRESULT_FROM_WIN32(GetLastError());
		CHECK_HR_OR_GOTO_END(L"ExitWindowsEx");
	}

end:
	if (token) {
		CloseHandle(token);
	}

	return hr;
}

void operator delete(void *ptr) {
	free(ptr);
}


================================================
FILE: LegacyUpdate/Utils.h
================================================
#pragma once

HRESULT StartLauncher(LPCWSTR params, BOOL wait);
HRESULT Reboot();


================================================
FILE: LegacyUpdate/dlldatax.c
================================================
// wrapper for dlldata.c

#include <windows.h>
#include <ole2.h>

#define REGISTER_PROXY_DLL
#define USE_STUBLESS_PROXY
#define PROXY_DELEGATION
#define ENTRY_PREFIX Prx

#include <rpcproxy.h>

#include "LegacyUpdate_i.h"
#include "LegacyUpdate_dlldata.c"
#include "LegacyUpdate_p.c"


================================================
FILE: LegacyUpdate/dlldatax.h
================================================
#pragma once

EXTERN_C BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved);
EXTERN_C STDAPI PrxDllCanUnloadNow(void);
EXTERN_C STDAPI PrxDllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv);
EXTERN_C STDAPI PrxDllRegisterServer(void);
EXTERN_C STDAPI PrxDllUnregisterServer(void);


================================================
FILE: LegacyUpdate/dllmain.cpp
================================================
// dllmain.cpp : Implementation of DLL Exports.

#include "LegacyUpdate_i.h"
#include "dllmain.h"
#include "dlldatax.h"
#include "ClassFactory.h"
#include "ElevationHelper.h"
#include "ElevationHelper.h"
#include "LegacyUpdate.h"
#include "LegacyUpdateCtrl.h"
#include "ProgressBarControl.h"
#include "Registry.h"
#include "VersionInfo.h"
#include <strsafe.h>
#include <shlwapi.h>

static LPCWSTR APPID_LegacyUpdateLib = L"{D0A82CD0-B6F0-4101-83ED-DA47D0D04830}";

HINSTANCE g_hInstance = NULL;
LONG g_serverLocks = 0;

typedef struct ClassEntry {
	const GUID *clsid;
	STDMETHODIMP (*createFunc)(IUnknown *pUnkOuter, REFIID riid, void **ppv);
	STDMETHODIMP (*updateRegistryFunc)(BOOL bRegister);
} ClassEntry;

static ClassEntry g_classEntries[] = {
	{&CLSID_LegacyUpdateCtrl,   &CLegacyUpdateCtrl::Create,   &CLegacyUpdateCtrl::UpdateRegistry},
	{&CLSID_ElevationHelper,    &CElevationHelper::Create,    &CElevationHelper::UpdateRegistry},
	{&CLSID_ProgressBarControl, &CProgressBarControl::Create, &CProgressBarControl::UpdateRegistry}
};

// DLL Entry Point
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) {
	if (!PrxDllMain(hInstance, dwReason, lpReserved)) {
		return FALSE;
	}

	switch (dwReason) {
	case DLL_PROCESS_ATTACH:
		g_hInstance = hInstance;
		DisableThreadLibraryCalls(hInstance);
		OpenLog();
		break;

	case DLL_PROCESS_DETACH:
		g_hInstance = NULL;
		CloseLog();
		break;
	}

	return TRUE;
}

// Used to determine whether the DLL can be unloaded by OLE
STDAPI DllCanUnloadNow(void) {
	HRESULT hr = PrxDllCanUnloadNow();
	if (hr != S_OK) {
		return hr;
	}

	return g_serverLocks == 0 ? S_OK : S_FALSE;
}

// Returns a class factory to create an object of the requested type
STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
	if (PrxDllGetClassObject(rclsid, riid, ppv) == S_OK) {
		return S_OK;
	}

	if (ppv == NULL) {
		return E_POINTER;
	}

	*ppv = NULL;

	for (DWORD i = 0; i < ARRAYSIZE(g_classEntries); i++) {
		if (IsEqualCLSID(rclsid, *g_classEntries[i].clsid)) {
			CClassFactory *pFactory;
			HRESULT hr = CClassFactory::Create(NULL, riid, (void **)&pFactory);
			if (pFactory == NULL) {
				return E_OUTOFMEMORY;
			}

			pFactory->createFunc = g_classEntries[i].createFunc;
			pFactory->clsid = g_classEntries[i].clsid;

			*ppv = pFactory;
			return hr;
		}
	}

	return CLASS_E_CLASSNOTAVAILABLE;
}

// Shared register/unregister method
STDAPI UpdateRegistration(BOOL state) {
	HRESULT hr = OleInitialize(NULL);
	BOOL oleInitialized = SUCCEEDED(hr);
	if (hr != RPC_E_CHANGED_MODE && hr != CO_E_ALREADYINITIALIZED) {
		CHECK_HR_OR_RETURN(L"OleInitialize");
	}

	LPWSTR installPath = NULL, filename = NULL, libid = NULL;
	hr = GetInstallPath(&installPath);
	CHECK_HR_OR_GOTO_END(L"GetInstallPath");

	hr = GetOwnFileName(&filename);
	CHECK_HR_OR_GOTO_END(L"GetOwnFileName");

	// Register type library
	if (state) {
		CComPtr<ITypeLib> typeLib;
		hr = LoadTypeLib(filename, &typeLib);
		CHECK_HR_OR_GOTO_END(L"LoadTypeLib");

		hr = RegisterTypeLib(typeLib, filename, NULL);
		CHECK_HR_OR_GOTO_END(L"RegisterTypeLib");
	} else {
		CComPtr<ITypeLib> typeLib;
		hr = LoadRegTypeLib(LIBID_LegacyUpdateLib, 1, 0, LOCALE_NEUTRAL, &typeLib);
		if (hr != TYPE_E_LIBNOTREGISTERED) {
			CHECK_HR_OR_GOTO_END(L"LoadRegTypeLib");

			TLIBATTR *attrs;
			hr = typeLib->GetLibAttr(&attrs);
			CHECK_HR_OR_GOTO_END(L"GetLibAttr");

			hr = UnRegisterTypeLib(attrs->guid, attrs->wMajorVerNum, attrs->wMinorVerNum, attrs->lcid, attrs->syskind);
			typeLib->ReleaseTLibAttr(attrs);
			CHECK_HR_OR_GOTO_END(L"UnRegisterTypeLib");
		}
	}

	// Set vars used for expansions
	hr = StringFromCLSID(LIBID_LegacyUpdateLib, &libid);
	CHECK_HR_OR_GOTO_END(L"StringFromCLSID");

	SetEnvironmentVariable(L"APPID", APPID_LegacyUpdateLib);
	SetEnvironmentVariable(L"LIBID", libid);
	SetEnvironmentVariable(L"MODULE", filename);
	SetEnvironmentVariable(L"INSTALLPATH", installPath);

	CoTaskMemFree(libid);

	// Main
	if (state) {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"AppID\\%APPID%", NULL, REG_SZ, (LPVOID)L"Legacy Update Control"},
			{HKEY_CLASSES_ROOT, L"AppID\\%APPID%", L"DllSurrogate", REG_SZ, (LPVOID)L""},
			{HKEY_CLASSES_ROOT, L"AppID\\LegacyUpdate.dll", L"AppID", REG_SZ, (LPVOID)L"%APPID%"},
			{}
		};
		hr = SetRegistryEntries(entries);
	} else {
		RegistryEntry entries[] = {
			{HKEY_CLASSES_ROOT, L"AppID\\%APPID%", NULL, 0, DELETE_KEY},
			{HKEY_CLASSES_ROOT, L"AppID\\LegacyUpdate.dll", NULL, 0, DELETE_KEY},
			{}
		};
		hr = SetRegistryEntries(entries);
	}

	CHECK_HR_OR_GOTO_END(L"SetRegistryEntries main");

	// Register classes
	for (DWORD i = 0; i < ARRAYSIZE(g_classEntries); i++) {
		ClassEntry entry = g_classEntries[i];
		LPWSTR clsidStr;
		hr = StringFromCLSID(*entry.clsid, &clsidStr);
		CHECK_HR_OR_GOTO_END(L"StringFromCLSID");

		SetEnvironmentVariable(L"CLSID", clsidStr);
		CoTaskMemFree(clsidStr);

		hr = entry.updateRegistryFunc(state);
		CHECK_HR_OR_GOTO_END(L"SetRegistryEntries class");
	}

	// Register proxy
	hr = state ? PrxDllRegisterServer() : PrxDllUnregisterServer();
	CHECK_HR_OR_GOTO_END(L"Proxy registration");

end:
	// Clean up environment
	static LPCWSTR envVars[] = {L"APPID", L"LIBID", L"MODULE", L"INSTALLPATH", L"CLSID"};
	for (DWORD i = 0; i < ARRAYSIZE(envVars); i++) {
		SetEnvironmentVariable(envVars[i], NULL);
	}

	if (installPath) {
		LocalFree(installPath);
	}
	if (filename) {
		LocalFree(filename);
	}

	if (oleInitialized) {
		OleUninitialize();
	}
	return hr;
}

// DllRegisterServer - Adds entries to the system registry
STDAPI DllRegisterServer(void) {
	LOG(L"DllRegisterServer");
	return UpdateRegistration(TRUE);
}

// DllUnregisterServer - Removes entries from the system registry
STDAPI DllUnregisterServer(void) {
	LOG(L"DllUnregisterServer");
	return UpdateRegistration(FALSE);
}

// DllInstall - Adds/Removes entries to the system registry per machine only.
STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) {
	LOG(L"DllInstall(%d)", bInstall);
	return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED);
}


================================================
FILE: LegacyUpdate/dllmain.h
================================================
#pragma once

// dllmain.h : Declaration of module class.

extern HINSTANCE g_hInstance;
extern LONG g_serverLocks;


================================================
FILE: LegacyUpdate/resource.h
================================================
#define IDS_LEGACYUPDATE                1

#define ID_TYPELIB                      1


================================================
FILE: LegacyUpdate/stdafx.h
================================================
#pragma once

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently,
// but are changed infrequently

#define STRICT

#define WINVER       _WIN32_WINNT_WIN2K
#define _WIN32_WINNT _WIN32_WINNT_WIN2K

// Use msvcrt stdio functions
#define __USE_MINGW_ANSI_STDIO 0

#include "resource.h"
#include "Trace.h"
#include <windows.h>


================================================
FILE: LegacyUpdate/wuapi.idl
================================================
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;
	};
};


================================================
FILE: LegacyUpdate/wuerror.mc
================================================
;// 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     = WindowsUpda
Download .txt
gitextract_cbt5iapr/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── 01-bug_report.yml
│   │   ├── 02-update_issue.yml
│   │   ├── 03-download_center_issue.yml
│   │   ├── 04-feature_suggestion.yml
│   │   └── config.yml
│   └── workflows/
│       ├── build-nt4.yml
│       └── build.yml
├── .gitignore
├── .idea/
│   └── .idea.LegacyUpdate/
│       └── .idea/
│           ├── .gitignore
│           ├── discord.xml
│           ├── indexLayout.xml
│           └── vcs.xml
├── .vscode/
│   ├── c_cpp_properties.json
│   └── settings.json
├── LICENSE.md
├── LegacyUpdate/
│   ├── ClassFactory.cpp
│   ├── ClassFactory.h
│   ├── Compat.cpp
│   ├── Compat.h
│   ├── ElevationHelper.cpp
│   ├── ElevationHelper.h
│   ├── IUpdateInstaller4.h
│   ├── LaunchUpdateSite.cpp
│   ├── LegacyUpdate.def
│   ├── LegacyUpdate.idl
│   ├── LegacyUpdate.rc
│   ├── LegacyUpdate.vcxproj
│   ├── LegacyUpdate.vcxproj.filters
│   ├── LegacyUpdateCtrl.cpp
│   ├── LegacyUpdateCtrl.h
│   ├── Makefile
│   ├── NGen.cpp
│   ├── NGen.h
│   ├── ProductName.cpp
│   ├── ProductName.h
│   ├── ProgressBarControl.cpp
│   ├── ProgressBarControl.h
│   ├── ProgressBarControl.html
│   ├── Utils.cpp
│   ├── Utils.h
│   ├── dlldatax.c
│   ├── dlldatax.h
│   ├── dllmain.cpp
│   ├── dllmain.h
│   ├── resource.h
│   ├── stdafx.h
│   ├── wuapi.idl
│   ├── wuerror.mc
│   └── wuguid.cpp
├── LegacyUpdate.sln
├── Makefile
├── README.md
├── build/
│   ├── fix-nsis.sh
│   ├── get-nt4-patches.sh
│   ├── getvc.cmd
│   ├── shared.mk
│   ├── sign.cmd
│   └── sign.sh
├── include/
│   ├── com/
│   │   ├── ComClass.h
│   │   ├── ComPtr.h
│   │   ├── IDispatchImpl.h
│   │   ├── IOleInPlaceActiveObjectImpl.h
│   │   ├── IOleInPlaceObjectImpl.h
│   │   ├── IOleObjectImpl.h
│   │   ├── IQuickActivateImpl.h
│   │   ├── IUnknownImpl.h
│   │   ├── IViewObjectExImpl.h
│   │   └── helpers.h
│   ├── com.h
│   ├── licdll.h
│   ├── licdll.idl
│   ├── nsis/
│   │   ├── api.h
│   │   ├── nsis_tchar.h
│   │   ├── pluginapi.c
│   │   └── pluginapi.h
│   ├── slpublic.h
│   ├── wuapi.h
│   └── wuerror.h
├── launcher/
│   ├── CplTasks.xml
│   ├── InitRunOnce.c
│   ├── LaunchLog.c
│   ├── LaunchUpdateSite.c
│   ├── Makefile
│   ├── MsgBox.c
│   ├── MsgBox.h
│   ├── Options.c
│   ├── RegisterServer.c
│   ├── RegisterServer.h
│   ├── SelfElevate.c
│   ├── SelfElevate.h
│   ├── main.c
│   ├── main.h
│   ├── manifest.xml
│   ├── resource.h
│   ├── resource.rc
│   └── stdafx.h
├── nsisplugin/
│   ├── CloseIEWindows.c
│   ├── DialogInit.c
│   ├── EnableMicrosoftUpdate.c
│   ├── Exec.c
│   ├── IsActivated.c
│   ├── IsAdmin.c
│   ├── IsMultiCPU.c
│   ├── IsServerCore.c
│   ├── Makefile
│   ├── MessageForHresult.c
│   ├── NeedsRootsUpdate.c
│   ├── RebootPage.c
│   ├── TaskbarProgress.c
│   ├── UpdateRoots.c
│   ├── VerifyFileHash.c
│   ├── WriteLog.c
│   ├── main.c
│   ├── main.h
│   ├── resource.h
│   ├── resource.rc
│   ├── sha256.c
│   ├── sha256.h
│   └── stdafx.h
├── setup/
│   ├── ActiveX.inf
│   ├── ActiveXPage.nsh
│   ├── AeroWizard.nsh
│   ├── Common.nsh
│   ├── Constants.nsh
│   ├── Download2KXP.nsh
│   ├── DownloadIE.nsh
│   ├── DownloadNT4.nsh
│   ├── DownloadVista78.nsh
│   ├── DownloadWUA.nsh
│   ├── Makefile
│   ├── NT4USB.nsh
│   ├── PatchInstall.nsh
│   ├── Patches.ini
│   ├── PatchesNT4.ini
│   ├── RebootPage.nsh
│   ├── RunOnce.nsh
│   ├── Strings.nsh
│   ├── UpdateRoots.nsh
│   ├── Win32.nsh
│   ├── WinVer.nsh
│   ├── codebase/
│   │   ├── lucontrl.ddf
│   │   ├── setup.inf
│   │   └── test.html
│   ├── patches/
│   │   └── .gitignore
│   ├── resource.c
│   ├── resource.h
│   ├── resource.rc
│   ├── setup-nt4.nsi
│   ├── setup.nsi
│   └── stdafx.h
└── shared/
    ├── Exec.c
    ├── Exec.h
    ├── HResult.c
    ├── HResult.h
    ├── LegacyUpdate.c
    ├── LegacyUpdate.h
    ├── LoadImage.c
    ├── LoadImage.h
    ├── Log.c
    ├── Log.h
    ├── ProductInfo.c
    ├── ProductInfo.h
    ├── Registry.c
    ├── Registry.h
    ├── Startup.h
    ├── Trace.h
    ├── User.h
    ├── Version.h
    ├── VersionInfo.h
    ├── ViewLog.c
    ├── ViewLog.h
    ├── WMI.c
    ├── WMI.h
    ├── Wow64.c
    ├── Wow64.h
    └── stdafx.h
Download .txt
SYMBOL INDEX (719 symbols across 69 files)

FILE: LegacyUpdate/ClassFactory.cpp
  function STDMETHODIMP (line 9) | STDMETHODIMP CClassFactory::Create(IUnknown *pUnkOuter, REFIID riid, voi...
  function STDMETHODIMP (line 29) | STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, void **ppvObject) {
  function STDMETHODIMP (line 58) | STDMETHODIMP CClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID r...
  function STDMETHODIMP (line 62) | STDMETHODIMP CClassFactory::LockServer(BOOL fLock) {

FILE: LegacyUpdate/Compat.cpp
  function BecomeDPIAware (line 27) | void BecomeDPIAware(void) {
  function IsolationAwareStart (line 51) | void IsolationAwareStart(ULONG_PTR *cookie) {
  function IsolationAwareEnd (line 87) | void IsolationAwareEnd(ULONG_PTR *cookie) {

FILE: LegacyUpdate/ElevationHelper.cpp
  function BOOL (line 21) | BOOL ProgIDIsPermitted(PWSTR progID) {
  function STDMETHODIMP (line 35) | STDMETHODIMP CoCreateInstanceAsAdmin(HWND hwnd, REFCLSID rclsid, REFIID ...
  function STDMETHODIMP (line 50) | STDMETHODIMP CElevationHelper::Create(IUnknown *pUnkOuter, REFIID riid, ...
  function STDMETHODIMP (line 72) | STDMETHODIMP CElevationHelper::UpdateRegistry(BOOL bRegister) {
  function STDMETHODIMP (line 106) | STDMETHODIMP CElevationHelper::QueryInterface(REFIID riid, void **ppvObj...
  function STDMETHODIMP (line 131) | STDMETHODIMP CElevationHelper::CreateObject(BSTR progID, IDispatch **ret...
  function STDMETHODIMP (line 155) | STDMETHODIMP CElevationHelper::SetBrowserHwnd(IUpdateInstaller *installe...
  function STDMETHODIMP (line 170) | STDMETHODIMP CElevationHelper::Reboot(void) {
  function STDMETHODIMP (line 184) | STDMETHODIMP CElevationHelper::BeforeUpdate(void) {
  function STDMETHODIMP (line 188) | STDMETHODIMP CElevationHelper::AfterUpdate(void) {

FILE: LegacyUpdate/IUpdateInstaller4.h
  type interface (line 8) | typedef interface IUpdateInstaller3
  type interface (line 14) | typedef interface IUpdateInstaller4
  type IUpdateInstaller3Vtbl (line 50) | typedef struct IUpdateInstaller3Vtbl
  function interface (line 215) | interface IUpdateInstaller3
  type IUpdateInstaller4Vtbl (line 359) | typedef struct IUpdateInstaller4Vtbl
  function interface (line 528) | interface IUpdateInstaller4

FILE: LegacyUpdate/LaunchUpdateSite.cpp
  function EXTERN_C (line 7) | EXTERN_C __declspec(dllexport)

FILE: LegacyUpdate/LegacyUpdateCtrl.cpp
  function STDMETHODIMP (line 31) | STDMETHODIMP CLegacyUpdateCtrl::Create(IUnknown *pUnkOuter, REFIID riid,...
  function STDMETHODIMP (line 67) | STDMETHODIMP CLegacyUpdateCtrl::UpdateRegistry(BOOL bRegister) {
  function STDMETHODIMP (line 103) | STDMETHODIMP CLegacyUpdateCtrl::QueryInterface(REFIID riid, void **ppvOb...
  function STDMETHODIMP (line 134) | STDMETHODIMP CLegacyUpdateCtrl::GetHTMLDocument(IHTMLDocument2 **retval) {
  function STDMETHODIMP (line 148) | STDMETHODIMP CLegacyUpdateCtrl::IsPermitted(void) {
  function STDMETHODIMP (line 187) | STDMETHODIMP CLegacyUpdateCtrl::GetIEWindowHWND(HWND *retval) {
  function STDMETHODIMP (line 203) | STDMETHODIMP CLegacyUpdateCtrl::GetElevatedHelper(IElevationHelper **ret...
  function STDMETHODIMP (line 228) | STDMETHODIMP CLegacyUpdateCtrl::CheckControl(VARIANT_BOOL *retval) {
  function STDMETHODIMP (line 238) | STDMETHODIMP CLegacyUpdateCtrl::MessageForHresult(LONG inHresult, BSTR *...
  function STDMETHODIMP (line 246) | STDMETHODIMP CLegacyUpdateCtrl::GetOSVersionInfo(OSVersionField osField,...
  function STDMETHODIMP (line 345) | STDMETHODIMP CLegacyUpdateCtrl::RequestElevation(void) {
  function STDMETHODIMP (line 360) | STDMETHODIMP CLegacyUpdateCtrl::CreateObject(BSTR progID, IDispatch **re...
  function STDMETHODIMP (line 378) | STDMETHODIMP CLegacyUpdateCtrl::SetBrowserHwnd(IUpdateInstaller *install...
  function STDMETHODIMP (line 396) | STDMETHODIMP CLegacyUpdateCtrl::GetUserType(UserType *retval) {
  function STDMETHODIMP (line 413) | STDMETHODIMP CLegacyUpdateCtrl::get_IsRebootRequired(VARIANT_BOOL *retva...
  function STDMETHODIMP (line 437) | STDMETHODIMP CLegacyUpdateCtrl::get_IsWindowsUpdateDisabled(VARIANT_BOOL...
  function STDMETHODIMP (line 460) | STDMETHODIMP CLegacyUpdateCtrl::RebootIfRequired(void) {
  function STDMETHODIMP (line 484) | STDMETHODIMP CLegacyUpdateCtrl::ViewLog(ViewLogType logType) {
  function STDMETHODIMP (line 501) | STDMETHODIMP CLegacyUpdateCtrl::ViewWindowsUpdateLog(void) {
  function STDMETHODIMP (line 505) | STDMETHODIMP CLegacyUpdateCtrl::OpenWindowsUpdateSettings(void) {
  function STDMETHODIMP (line 525) | STDMETHODIMP CLegacyUpdateCtrl::get_IsUsingWsusServer(VARIANT_BOOL *retv...
  function STDMETHODIMP (line 534) | STDMETHODIMP CLegacyUpdateCtrl::get_WsusServerUrl(BSTR *retval) {
  function STDMETHODIMP (line 547) | STDMETHODIMP CLegacyUpdateCtrl::get_WsusStatusServerUrl(BSTR *retval) {
  function STDMETHODIMP (line 560) | STDMETHODIMP CLegacyUpdateCtrl::BeforeUpdate(void) {
  function STDMETHODIMP (line 570) | STDMETHODIMP CLegacyUpdateCtrl::AfterUpdate(void) {

FILE: LegacyUpdate/NGen.cpp
  function STDMETHODIMP (line 7) | STDMETHODIMP PauseResumeNGenQueue(BOOL state) {

FILE: LegacyUpdate/ProductName.cpp
  function HRESULT (line 180) | HRESULT GetOSProductName(LPVARIANT productName) {

FILE: LegacyUpdate/ProgressBarControl.cpp
  function STDMETHODIMP (line 15) | STDMETHODIMP CProgressBarControl::Create(IUnknown *pUnkOuter, REFIID rii...
  function STDMETHODIMP (line 45) | STDMETHODIMP CProgressBarControl::UpdateRegistry(BOOL bRegister) {
  function STDMETHODIMP (line 81) | STDMETHODIMP CProgressBarControl::QueryInterface(REFIID riid, void **ppv...
  function STDMETHODIMP (line 128) | STDMETHODIMP CProgressBarControl_IOleObject::GetExtent(DWORD dwDrawAspec...
  function STDMETHODIMP (line 148) | STDMETHODIMP CProgressBarControl_IOleObject::SetExtent(DWORD dwDrawAspec...
  function STDMETHODIMP (line 178) | STDMETHODIMP CProgressBarControl_IOleObject::DoVerb(LONG iVerb, LPMSG lp...
  function STDMETHODIMP (line 197) | STDMETHODIMP CProgressBarControl_IOleObject::GetMiscStatus(DWORD dwAspec...
  function STDMETHODIMP (line 211) | STDMETHODIMP CProgressBarControl_IOleObject::Close(DWORD dwSaveOption) {
  function STDMETHODIMP (line 216) | STDMETHODIMP CProgressBarControl::CreateControlWindow(HWND hParent, cons...
  function STDMETHODIMP (line 271) | STDMETHODIMP CProgressBarControl::DestroyControlWindow(void) {
  function STDMETHODIMP (line 284) | STDMETHODIMP CProgressBarControl::OnDraw(DWORD dwDrawAspect, LONG lindex...
  function STDMETHODIMP (line 316) | STDMETHODIMP CProgressBarControl_IOleInPlaceObject::SetObjectRects(LPCRE...
  function STDMETHODIMP (line 328) | STDMETHODIMP CProgressBarControl_IOleInPlaceActiveObject::ResizeBorder(L...
  function STDMETHODIMP (line 349) | STDMETHODIMP CProgressBarControl::InvalidateContainer(void) {
  function STDMETHODIMP (line 376) | STDMETHODIMP CProgressBarControl::get_Value(SHORT *pValue) {
  function STDMETHODIMP (line 397) | STDMETHODIMP CProgressBarControl::put_Value(SHORT value) {

FILE: LegacyUpdate/Utils.cpp
  function HRESULT (line 18) | HRESULT StartLauncher(LPCWSTR params, BOOL wait) {
  function HRESULT (line 35) | HRESULT Reboot(void) {

FILE: LegacyUpdate/dllmain.cpp
  type ClassEntry (line 22) | struct ClassEntry {
  function BOOL (line 35) | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserv...
  function STDAPI (line 57) | STDAPI DllCanUnloadNow(void) {
  function STDAPI (line 67) | STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) {
  function STDAPI (line 98) | STDAPI UpdateRegistration(BOOL state) {
  function STDAPI (line 206) | STDAPI DllRegisterServer(void) {
  function STDAPI (line 212) | STDAPI DllUnregisterServer(void) {
  function STDAPI (line 218) | STDAPI DllInstall(BOOL bInstall, LPCWSTR pszCmdLine) {

FILE: include/com/ComClass.h
  function STDMETHODIMP (line 16) | STDMETHODIMP QueryInterface(REFIID riid, void **ppvObject) {
  function AddRef (line 20) | STDMETHODIMP_(ULONG) AddRef(void) {
  function Release (line 24) | STDMETHODIMP_(ULONG) Release(void) {

FILE: include/com/ComPtr.h
  function CComPtr (line 16) | CComPtr(void) {
  function operator (line 41) | operator TInterface *(void) {

FILE: include/com/IDispatchImpl.h
  function STDMETHODIMP (line 34) | STDMETHODIMP GetTypeInfoCount(UINT *pctinfo) {
  function STDMETHODIMP (line 42) | STDMETHODIMP GetTypeInfo(UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo) {
  function STDMETHODIMP (line 71) | STDMETHODIMP GetIDsOfNames(REFIID riid, LPOLESTR *rgszNames, UINT cNames...
  function STDMETHODIMP (line 87) | STDMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID lcid, WORD wF...

FILE: include/com/IOleInPlaceActiveObjectImpl.h
  function STDMETHODIMP (line 14) | STDMETHODIMP GetWindow(HWND *phwnd) {
  function STDMETHODIMP (line 22) | STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) {
  function STDMETHODIMP (line 27) | STDMETHODIMP TranslateAccelerator(LPMSG lpmsg) {
  function STDMETHODIMP (line 31) | STDMETHODIMP OnFrameWindowActivate(WINBOOL fActivate) {
  function STDMETHODIMP (line 35) | STDMETHODIMP OnDocWindowActivate(WINBOOL fActivate) {
  function STDMETHODIMP (line 39) | STDMETHODIMP ResizeBorder(LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWin...
  function STDMETHODIMP (line 43) | STDMETHODIMP EnableModeless(WINBOOL fEnable) {

FILE: include/com/IOleInPlaceObjectImpl.h
  function STDMETHODIMP (line 14) | STDMETHODIMP GetWindow(HWND *phwnd) {
  function STDMETHODIMP (line 22) | STDMETHODIMP ContextSensitiveHelp(BOOL fEnterMode) {
  function STDMETHODIMP (line 27) | STDMETHODIMP InPlaceDeactivate(void) {
  function STDMETHODIMP (line 31) | STDMETHODIMP UIDeactivate(void) {
  function STDMETHODIMP (line 35) | STDMETHODIMP SetObjectRects(LPCRECT lprcPosRect, LPCRECT lprcClipRect) {
  function STDMETHODIMP (line 53) | STDMETHODIMP ReactivateAndUndo(void) {

FILE: include/com/IOleObjectImpl.h
  function STDMETHODIMP (line 14) | STDMETHODIMP SetClientSite(IOleClientSite *pClientSite) {
  function STDMETHODIMP (line 25) | STDMETHODIMP GetClientSite(IOleClientSite **ppClientSite) {
  function STDMETHODIMP (line 40) | STDMETHODIMP SetHostNames(LPCOLESTR szContainerApp, LPCOLESTR szContaine...
  function STDMETHODIMP (line 44) | STDMETHODIMP Close(DWORD dwSaveOption) {
  function STDMETHODIMP (line 52) | STDMETHODIMP SetMoniker(DWORD dwWhichMoniker, IMoniker *pmk) {
  function STDMETHODIMP (line 56) | STDMETHODIMP GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker, IMoniker *...
  function STDMETHODIMP (line 60) | STDMETHODIMP InitFromData(IDataObject *pDataObject, BOOL fCreation, DWOR...
  function STDMETHODIMP (line 64) | STDMETHODIMP GetClipboardData(DWORD dwReserved, IDataObject **ppDataObje...
  function STDMETHODIMP (line 68) | STDMETHODIMP DoVerb(LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite...
  function STDMETHODIMP (line 80) | STDMETHODIMP EnumVerbs(IEnumOLEVERB **ppEnumOleVerb) {
  function STDMETHODIMP (line 87) | STDMETHODIMP Update(void) {
  function STDMETHODIMP (line 91) | STDMETHODIMP IsUpToDate(void) {
  function STDMETHODIMP (line 95) | STDMETHODIMP GetUserClassID(CLSID *pClsid) {
  function STDMETHODIMP (line 103) | STDMETHODIMP GetUserType(DWORD dwFormOfType, LPOLESTR *pszUserType) {
  function STDMETHODIMP (line 110) | STDMETHODIMP SetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
  function STDMETHODIMP (line 114) | STDMETHODIMP GetExtent(DWORD dwDrawAspect, SIZEL *psizel) {
  function STDMETHODIMP (line 123) | STDMETHODIMP Advise(IAdviseSink *pAdvSink, DWORD *pdwConnection) {
  function STDMETHODIMP (line 127) | STDMETHODIMP Unadvise(DWORD dwConnection) {
  function STDMETHODIMP (line 131) | STDMETHODIMP EnumAdvise(IEnumSTATDATA **ppenumAdvise) {
  function STDMETHODIMP (line 135) | STDMETHODIMP GetMiscStatus(DWORD dwAspect, DWORD *pdwStatus) {
  function STDMETHODIMP (line 139) | STDMETHODIMP SetColorScheme(LOGPALETTE *pLogpal) {

FILE: include/com/IQuickActivateImpl.h
  function STDMETHODIMP (line 14) | STDMETHODIMP QuickActivate(QACONTAINER *pQaContainer, QACONTROL *pQaCont...
  function STDMETHODIMP (line 35) | STDMETHODIMP SetContentExtent(LPSIZEL pSizel) {
  function STDMETHODIMP (line 45) | STDMETHODIMP GetContentExtent(LPSIZEL pSizel) {

FILE: include/com/IUnknownImpl.h
  function class (line 8) | class IUnknownImpl {

FILE: include/com/IViewObjectExImpl.h
  function STDMETHODIMP (line 14) | STDMETHODIMP Draw(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTAR...
  function STDMETHODIMP (line 18) | STDMETHODIMP GetColorSet(DWORD dwDrawAspect, LONG lindex, void *pvAspect...
  function STDMETHODIMP (line 26) | STDMETHODIMP Freeze(DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWO...
  function STDMETHODIMP (line 30) | STDMETHODIMP Unfreeze(DWORD dwFreeze) {
  function STDMETHODIMP (line 34) | STDMETHODIMP SetAdvise(DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) {
  function STDMETHODIMP (line 45) | STDMETHODIMP GetAdvise(DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAd...
  function STDMETHODIMP (line 59) | STDMETHODIMP GetExtent(DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd,...
  function STDMETHODIMP (line 89) | STDMETHODIMP GetRect(DWORD dwAspect, LPRECTL pRect) {
  function STDMETHODIMP (line 111) | STDMETHODIMP GetViewStatus(DWORD *pdwStatus) {
  function STDMETHODIMP (line 119) | STDMETHODIMP QueryHitPoint(DWORD dwAspect, LPCRECT pRectBounds, POINT pt...
  function STDMETHODIMP (line 127) | STDMETHODIMP QueryHitRect(DWORD dwAspect, LPCRECT pRectBounds, LPCRECT p...
  function STDMETHODIMP (line 135) | STDMETHODIMP GetNaturalExtent(DWORD dwAspect, LONG lindex, DVTARGETDEVIC...

FILE: include/licdll.h
  type class (line 32) | typedef class COMLicenseAgent
  type COMLicenseAgent (line 34) | typedef struct COMLicenseAgent COMLicenseAgent;
  type interface (line 40) | typedef interface ICOMLicenseAgent
  type interface (line 48) | typedef interface ICOMLicenseAgent2
  type interface (line 69) | typedef interface ICOMLicenseAgent
  type interface (line 77) | typedef interface ICOMLicenseAgent2
  type ICOMLicenseAgentVtbl (line 274) | typedef struct ICOMLicenseAgentVtbl {
  function interface (line 527) | interface ICOMLicenseAgent {
  function __WIDL_INLINE (line 597) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_QueryInterface(ICOMLicense...
  function __WIDL_INLINE (line 600) | static __WIDL_INLINE ULONG ICOMLicenseAgent_AddRef(ICOMLicenseAgent* Thi...
  function __WIDL_INLINE (line 603) | static __WIDL_INLINE ULONG ICOMLicenseAgent_Release(ICOMLicenseAgent* Th...
  function __WIDL_INLINE (line 607) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetTypeInfoCount(ICOMLicen...
  function __WIDL_INLINE (line 610) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetTypeInfo(ICOMLicenseAge...
  function __WIDL_INLINE (line 613) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetIDsOfNames(ICOMLicenseA...
  function __WIDL_INLINE (line 616) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_Invoke(ICOMLicenseAgent* T...
  function __WIDL_INLINE (line 620) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_Initialize(ICOMLicenseAgen...
  function __WIDL_INLINE (line 623) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetFirstName(ICOMLicenseAg...
  function __WIDL_INLINE (line 626) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetFirstName(ICOMLicenseAg...
  function __WIDL_INLINE (line 629) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetLastName(ICOMLicenseAge...
  function __WIDL_INLINE (line 632) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetLastName(ICOMLicenseAge...
  function __WIDL_INLINE (line 635) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetOrgName(ICOMLicenseAgen...
  function __WIDL_INLINE (line 638) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetOrgName(ICOMLicenseAgen...
  function __WIDL_INLINE (line 641) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetEmail(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 644) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetEmail(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 647) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetPhone(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 650) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetPhone(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 653) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAddress1(ICOMLicenseAge...
  function __WIDL_INLINE (line 656) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetAddress1(ICOMLicenseAge...
  function __WIDL_INLINE (line 659) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCity(ICOMLicenseAgent* ...
  function __WIDL_INLINE (line 662) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCity(ICOMLicenseAgent* ...
  function __WIDL_INLINE (line 665) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetState(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 668) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetState(ICOMLicenseAgent*...
  function __WIDL_INLINE (line 671) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCountryCode(ICOMLicense...
  function __WIDL_INLINE (line 674) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCountryCode(ICOMLicense...
  function __WIDL_INLINE (line 677) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetCountryDesc(ICOMLicense...
  function __WIDL_INLINE (line 680) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetCountryDesc(ICOMLicense...
  function __WIDL_INLINE (line 683) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetZip(ICOMLicenseAgent* T...
  function __WIDL_INLINE (line 686) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetZip(ICOMLicenseAgent* T...
  function __WIDL_INLINE (line 689) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetIsoLanguage(ICOMLicense...
  function __WIDL_INLINE (line 692) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetIsoLanguage(ICOMLicense...
  function __WIDL_INLINE (line 695) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetMSUpdate(ICOMLicenseAge...
  function __WIDL_INLINE (line 698) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetMSUpdate(ICOMLicenseAge...
  function __WIDL_INLINE (line 701) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetMSOffer(ICOMLicenseAgen...
  function __WIDL_INLINE (line 704) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetMSOffer(ICOMLicenseAgen...
  function __WIDL_INLINE (line 707) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetOtherOffer(ICOMLicenseA...
  function __WIDL_INLINE (line 710) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetOtherOffer(ICOMLicenseA...
  function __WIDL_INLINE (line 713) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAddress2(ICOMLicenseAge...
  function __WIDL_INLINE (line 716) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetAddress2(ICOMLicenseAge...
  function __WIDL_INLINE (line 719) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessHandshakeReque...
  function __WIDL_INLINE (line 722) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessNewLicenseRequ...
  function __WIDL_INLINE (line 725) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessReissueLicense...
  function __WIDL_INLINE (line 728) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessReviseCustInfo...
  function __WIDL_INLINE (line 731) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetAsyncProcessReturnCode(...
  function __WIDL_INLINE (line 734) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessDroppedLicense...
  function __WIDL_INLINE (line 737) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GenerateInstallationId(ICO...
  function __WIDL_INLINE (line 740) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_DepositConfirmationId(ICOM...
  function __WIDL_INLINE (line 743) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetExpirationInfo(ICOMLice...
  function __WIDL_INLINE (line 746) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_AsyncProcessRegistrationRe...
  function __WIDL_INLINE (line 749) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessHandshakeRequest(IC...
  function __WIDL_INLINE (line 752) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessNewLicenseRequest(I...
  function __WIDL_INLINE (line 755) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessDroppedLicenseReque...
  function __WIDL_INLINE (line 758) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessReissueLicenseReque...
  function __WIDL_INLINE (line 761) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_ProcessReviseCustInfoReque...
  function __WIDL_INLINE (line 764) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_EnsureInternetConnection(I...
  function __WIDL_INLINE (line 767) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_SetProductKey(ICOMLicenseA...
  function __WIDL_INLINE (line 770) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_GetProductID(ICOMLicenseAg...
  function __WIDL_INLINE (line 773) | static __WIDL_INLINE HRESULT ICOMLicenseAgent_VerifyCheckDigits(ICOMLice...
  type ICOMLicenseAgent2Vtbl (line 809) | typedef struct ICOMLicenseAgent2Vtbl {
  function interface (line 1075) | interface ICOMLicenseAgent2 {
  function __WIDL_INLINE (line 1149) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_QueryInterface(ICOMLicens...
  function __WIDL_INLINE (line 1152) | static __WIDL_INLINE ULONG ICOMLicenseAgent2_AddRef(ICOMLicenseAgent2* T...
  function __WIDL_INLINE (line 1155) | static __WIDL_INLINE ULONG ICOMLicenseAgent2_Release(ICOMLicenseAgent2* ...
  function __WIDL_INLINE (line 1159) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetTypeInfoCount(ICOMLice...
  function __WIDL_INLINE (line 1162) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetTypeInfo(ICOMLicenseAg...
  function __WIDL_INLINE (line 1165) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetIDsOfNames(ICOMLicense...
  function __WIDL_INLINE (line 1168) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_Invoke(ICOMLicenseAgent2*...
  function __WIDL_INLINE (line 1172) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_Initialize(ICOMLicenseAge...
  function __WIDL_INLINE (line 1175) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetFirstName(ICOMLicenseA...
  function __WIDL_INLINE (line 1178) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetFirstName(ICOMLicenseA...
  function __WIDL_INLINE (line 1181) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetLastName(ICOMLicenseAg...
  function __WIDL_INLINE (line 1184) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetLastName(ICOMLicenseAg...
  function __WIDL_INLINE (line 1187) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetOrgName(ICOMLicenseAge...
  function __WIDL_INLINE (line 1190) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetOrgName(ICOMLicenseAge...
  function __WIDL_INLINE (line 1193) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetEmail(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1196) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetEmail(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1199) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetPhone(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1202) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetPhone(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1205) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAddress1(ICOMLicenseAg...
  function __WIDL_INLINE (line 1208) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetAddress1(ICOMLicenseAg...
  function __WIDL_INLINE (line 1211) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCity(ICOMLicenseAgent2...
  function __WIDL_INLINE (line 1214) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCity(ICOMLicenseAgent2...
  function __WIDL_INLINE (line 1217) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetState(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1220) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetState(ICOMLicenseAgent...
  function __WIDL_INLINE (line 1223) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCountryCode(ICOMLicens...
  function __WIDL_INLINE (line 1226) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCountryCode(ICOMLicens...
  function __WIDL_INLINE (line 1229) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetCountryDesc(ICOMLicens...
  function __WIDL_INLINE (line 1232) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetCountryDesc(ICOMLicens...
  function __WIDL_INLINE (line 1235) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetZip(ICOMLicenseAgent2*...
  function __WIDL_INLINE (line 1238) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetZip(ICOMLicenseAgent2*...
  function __WIDL_INLINE (line 1241) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetIsoLanguage(ICOMLicens...
  function __WIDL_INLINE (line 1244) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetIsoLanguage(ICOMLicens...
  function __WIDL_INLINE (line 1247) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetMSUpdate(ICOMLicenseAg...
  function __WIDL_INLINE (line 1250) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetMSUpdate(ICOMLicenseAg...
  function __WIDL_INLINE (line 1253) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetMSOffer(ICOMLicenseAge...
  function __WIDL_INLINE (line 1256) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetMSOffer(ICOMLicenseAge...
  function __WIDL_INLINE (line 1259) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetOtherOffer(ICOMLicense...
  function __WIDL_INLINE (line 1262) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetOtherOffer(ICOMLicense...
  function __WIDL_INLINE (line 1265) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAddress2(ICOMLicenseAg...
  function __WIDL_INLINE (line 1268) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetAddress2(ICOMLicenseAg...
  function __WIDL_INLINE (line 1271) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessHandshakeRequ...
  function __WIDL_INLINE (line 1274) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessNewLicenseReq...
  function __WIDL_INLINE (line 1277) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessReissueLicens...
  function __WIDL_INLINE (line 1280) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessReviseCustInf...
  function __WIDL_INLINE (line 1283) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetAsyncProcessReturnCode...
  function __WIDL_INLINE (line 1286) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessDroppedLicens...
  function __WIDL_INLINE (line 1289) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GenerateInstallationId(IC...
  function __WIDL_INLINE (line 1292) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_DepositConfirmationId(ICO...
  function __WIDL_INLINE (line 1295) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetExpirationInfo(ICOMLic...
  function __WIDL_INLINE (line 1298) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_AsyncProcessRegistrationR...
  function __WIDL_INLINE (line 1301) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessHandshakeRequest(I...
  function __WIDL_INLINE (line 1304) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessNewLicenseRequest(...
  function __WIDL_INLINE (line 1307) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessDroppedLicenseRequ...
  function __WIDL_INLINE (line 1310) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessReissueLicenseRequ...
  function __WIDL_INLINE (line 1313) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_ProcessReviseCustInfoRequ...
  function __WIDL_INLINE (line 1316) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_EnsureInternetConnection(...
  function __WIDL_INLINE (line 1319) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetProductKey(ICOMLicense...
  function __WIDL_INLINE (line 1322) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetProductID(ICOMLicenseA...
  function __WIDL_INLINE (line 1325) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_VerifyCheckDigits(ICOMLic...
  function __WIDL_INLINE (line 1329) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_SetReminders(ICOMLicenseA...
  function __WIDL_INLINE (line 1332) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetReminders(ICOMLicenseA...
  function __WIDL_INLINE (line 1335) | static __WIDL_INLINE HRESULT ICOMLicenseAgent2_GetKeyType(ICOMLicenseAge...

FILE: include/nsis/api.h
  type NSPIM (line 28) | enum NSPIM
  type UINT_PTR (line 37) | typedef UINT_PTR (*NSISPLUGINCALLBACK)(enum NSPIM);
  type exec_flags_t (line 41) | typedef struct
  type extra_parameters (line 66) | typedef struct {

FILE: include/nsis/nsis_tchar.h
  type TCHAR (line 29) | typedef unsigned short TCHAR;
  type wchar_t (line 31) | typedef wchar_t TCHAR;
  type TCHAR (line 135) | typedef char TCHAR;

FILE: include/nsis/pluginapi.c
  function popstring (line 28) | int NSISCALL popstring(LPTSTR str)
  function popstringn (line 39) | int NSISCALL popstringn(LPTSTR str, int maxlen)
  function pushstring (line 50) | void NSISCALL pushstring(LPCTSTR str)
  function LPTSTR (line 60) | LPTSTR NSISCALL getuservariable(const int varnum)
  function setuservariable (line 66) | void NSISCALL setuservariable(const int varnum, LPCTSTR var)
  function PopStringA (line 73) | int NSISCALL PopStringA(LPSTR ansiStr)
  function PopStringNA (line 82) | int NSISCALL PopStringNA(LPSTR ansiStr, int maxlen)
  function PushStringA (line 92) | void NSISCALL PushStringA(LPCSTR ansiStr)
  function GetUserVariableW (line 101) | void NSISCALL GetUserVariableW(const int varnum, LPWSTR wideStr)
  function GetUserVariableA (line 106) | void NSISCALL GetUserVariableA(const int varnum, LPSTR ansiStr)
  function SetUserVariableA (line 112) | void NSISCALL SetUserVariableA(const int varnum, LPCSTR ansiStr)
  function PopStringW (line 123) | int NSISCALL PopStringW(LPWSTR wideStr)
  function PopStringNW (line 132) | int NSISCALL PopStringNW(LPWSTR wideStr, int maxlen)
  function PushStringW (line 142) | void NSISCALL PushStringW(LPWSTR wideStr)
  function GetUserVariableW (line 150) | void NSISCALL GetUserVariableW(const int varnum, LPWSTR wideStr)
  function GetUserVariableA (line 156) | void NSISCALL GetUserVariableA(const int varnum, LPSTR ansiStr)
  function SetUserVariableW (line 161) | void NSISCALL SetUserVariableW(const int varnum, LPCWSTR wideStr)
  function INT_PTR (line 173) | INT_PTR NSISCALL nsishelper_str_to_ptr(LPCTSTR s)
  function myatou (line 218) | unsigned int NSISCALL myatou(LPCTSTR s)
  function myatoi_or (line 233) | int NSISCALL myatoi_or(LPCTSTR s)
  function INT_PTR (line 284) | INT_PTR NSISCALL popintptr(void)
  function popint_or (line 292) | int NSISCALL popint_or(void)
  function pushintptr (line 300) | void NSISCALL pushintptr(INT_PTR value)

FILE: include/nsis/pluginapi.h
  type stack_t (line 20) | typedef struct _stack_t {

FILE: include/slpublic.h
  type GUID (line 9) | typedef GUID SLID;
  type PVOID (line 10) | typedef PVOID HSLC;
  type SLLICENSINGSTATUS (line 14) | typedef enum _tagSLLICENSINGSTATUS {
  type SL_LICENSING_STATUS (line 22) | typedef struct _tagSL_LICENSING_STATUS {

FILE: include/wuapi.h
  type interface (line 53) | typedef interface IUpdateLockdown
  type interface (line 59) | typedef interface IStringCollection
  type interface (line 65) | typedef interface IWebProxy IWebProxy;
  type interface (line 71) | typedef interface ISystemInformation
  type interface (line 77) | typedef interface IWindowsUpdateAgentInfo
  type interface (line 83) | typedef interface IAutomaticUpdatesResults
  type interface (line 89) | typedef interface IAutomaticUpdatesSettings
  type interface (line 95) | typedef interface IAutomaticUpdatesSettings2
  type interface (line 101) | typedef interface IAutomaticUpdatesSettings3
  type interface (line 107) | typedef interface IAutomaticUpdates
  type interface (line 113) | typedef interface IAutomaticUpdates2
  type interface (line 119) | typedef interface IUpdateIdentity
  type interface (line 125) | typedef interface IImageInformation
  type interface (line 131) | typedef interface ICategory ICategory;
  type interface (line 137) | typedef interface ICategoryCollection
  type interface (line 143) | typedef interface IInstallationBehavior
  type interface (line 149) | typedef interface IUpdateDownloadContent
  type interface (line 155) | typedef interface IUpdateDownloadContent2
  type interface (line 161) | typedef interface IUpdateDownloadContentCollection
  type interface (line 167) | typedef interface IUpdate IUpdate;
  type interface (line 173) | typedef interface IWindowsDriverUpdate
  type interface (line 179) | typedef interface IUpdate2 IUpdate2;
  type interface (line 185) | typedef interface IUpdate3 IUpdate3;
  type interface (line 191) | typedef interface IUpdate4 IUpdate4;
  type interface (line 197) | typedef interface IUpdate5 IUpdate5;
  type interface (line 203) | typedef interface IWindowsDriverUpdate2
  type interface (line 209) | typedef interface IWindowsDriverUpdate3
  type interface (line 215) | typedef interface IWindowsDriverUpdateEntry
  type interface (line 221) | typedef interface IWindowsDriverUpdateEntryCollection
  type interface (line 227) | typedef interface IWindowsDriverUpdate4
  type interface (line 233) | typedef interface IWindowsDriverUpdate5
  type interface (line 239) | typedef interface IUpdateCollection
  type interface (line 245) | typedef interface IUpdateException
  type interface (line 251) | typedef interface IInvalidProductLicenseException
  type interface (line 257) | typedef interface IUpdateExceptionCollection
  type interface (line 263) | typedef interface ISearchResult
  type interface (line 269) | typedef interface ISearchJob
  type interface (line 275) | typedef interface ISearchCompletedCallbackArgs
  type interface (line 281) | typedef interface ISearchCompletedCallback
  type interface (line 287) | typedef interface IUpdateHistoryEntry
  type interface (line 293) | typedef interface IUpdateHistoryEntry2
  type interface (line 299) | typedef interface IUpdateHistoryEntryCollection
  type interface (line 305) | typedef interface IUpdateSearcher
  type interface (line 311) | typedef interface IUpdateSearcher2
  type interface (line 317) | typedef interface IUpdateSearcher3
  type interface (line 323) | typedef interface IUpdateDownloadResult
  type interface (line 329) | typedef interface IDownloadResult
  type interface (line 335) | typedef interface IDownloadProgress
  type interface (line 341) | typedef interface IDownloadJob
  type interface (line 347) | typedef interface IDownloadCompletedCallbackArgs
  type interface (line 353) | typedef interface IDownloadCompletedCallback
  type interface (line 359) | typedef interface IDownloadProgressChangedCallbackArgs
  type interface (line 365) | typedef interface IDownloadProgressChangedCallback
  type interface (line 371) | typedef interface IUpdateDownloader
  type interface (line 377) | typedef interface IUpdateInstallationResult
  type interface (line 383) | typedef interface IInstallationResult
  type interface (line 389) | typedef interface IInstallationProgress
  type interface (line 395) | typedef interface IInstallationJob
  type interface (line 401) | typedef interface IInstallationCompletedCallbackArgs
  type interface (line 407) | typedef interface IInstallationCompletedCallback
  type interface (line 413) | typedef interface IInstallationProgressChangedCallbackArgs
  type interface (line 419) | typedef interface IInstallationProgressChangedCallback
  type interface (line 425) | typedef interface IUpdateInstaller
  type interface (line 431) | typedef interface IUpdateInstaller2
  type interface (line 437) | typedef interface IUpdateSession
  type interface (line 443) | typedef interface IUpdateSession2
  type interface (line 449) | typedef interface IUpdateSession3
  type interface (line 455) | typedef interface IUpdateService
  type interface (line 461) | typedef interface IUpdateService2
  type interface (line 467) | typedef interface IUpdateServiceCollection
  type interface (line 473) | typedef interface IUpdateServiceRegistration
  type interface (line 479) | typedef interface IUpdateServiceManager
  type interface (line 485) | typedef interface IUpdateServiceManager2
  type interface (line 491) | typedef interface IInstallationAgent
  type interface (line 497) | typedef interface IUpdateLockdown
  type interface (line 503) | typedef interface IUpdateException
  type interface (line 509) | typedef interface IInvalidProductLicenseException
  type interface (line 515) | typedef interface IAutomaticUpdatesSettings
  type interface (line 521) | typedef interface IAutomaticUpdatesSettings2
  type interface (line 527) | typedef interface IAutomaticUpdatesSettings3
  type interface (line 533) | typedef interface IUpdate IUpdate;
  type interface (line 539) | typedef interface IUpdate2 IUpdate2;
  type interface (line 545) | typedef interface IUpdate3 IUpdate3;
  type interface (line 551) | typedef interface IWindowsDriverUpdateEntry
  type interface (line 557) | typedef interface IWindowsDriverUpdateEntryCollection
  type interface (line 563) | typedef interface IUpdate4 IUpdate4;
  type interface (line 569) | typedef interface IUpdate5 IUpdate5;
  type interface (line 575) | typedef interface IWindowsDriverUpdate
  type interface (line 581) | typedef interface IWindowsDriverUpdate2
  type interface (line 587) | typedef interface IWindowsDriverUpdate3
  type interface (line 593) | typedef interface IWindowsDriverUpdate4
  type interface (line 599) | typedef interface IWindowsDriverUpdate5
  type interface (line 605) | typedef interface ISearchCompletedCallback
  type interface (line 611) | typedef interface IDownloadCompletedCallback
  type interface (line 617) | typedef interface IDownloadProgressChangedCallback
  type interface (line 623) | typedef interface IInstallationCompletedCallback
  type interface (line 629) | typedef interface IInstallationProgressChangedCallback
  type interface (line 635) | typedef interface IUpdateHistoryEntry
  type interface (line 641) | typedef interface IUpdateHistoryEntry2
  type interface (line 647) | typedef interface IUpdateDownloadContent
  type interface (line 653) | typedef interface IUpdateDownloadContent2
  type class (line 661) | typedef class StringCollection
  type StringCollection (line 663) | typedef struct StringCollection StringCollection;
  type class (line 673) | typedef class UpdateSearcher
  type UpdateSearcher (line 675) | typedef struct UpdateSearcher UpdateSearcher;
  type class (line 685) | typedef class WebProxy WebProxy;
  type WebProxy (line 687) | typedef struct WebProxy WebProxy;
  type class (line 697) | typedef class SystemInformation
  type SystemInformation (line 699) | typedef struct SystemInformation SystemInformation;
  type class (line 709) | typedef class WindowsUpdateAgentInfo
  type WindowsUpdateAgentInfo (line 711) | typedef struct WindowsUpdateAgentInfo WindowsUpdateAgentInfo;
  type class (line 721) | typedef class AutomaticUpdates
  type AutomaticUpdates (line 723) | typedef struct AutomaticUpdates AutomaticUpdates;
  type class (line 733) | typedef class UpdateCollection
  type UpdateCollection (line 735) | typedef struct UpdateCollection UpdateCollection;
  type class (line 745) | typedef class UpdateDownloader
  type UpdateDownloader (line 747) | typedef struct UpdateDownloader UpdateDownloader;
  type class (line 757) | typedef class UpdateInstaller
  type UpdateInstaller (line 759) | typedef struct UpdateInstaller UpdateInstaller;
  type class (line 769) | typedef class UpdateSession
  type UpdateSession (line 771) | typedef struct UpdateSession UpdateSession;
  type class (line 781) | typedef class UpdateServiceManager
  type UpdateServiceManager (line 783) | typedef struct UpdateServiceManager UpdateServiceManager;
  type class (line 793) | typedef class InstallationAgent
  type InstallationAgent (line 795) | typedef struct InstallationAgent InstallationAgent;
  type AutomaticUpdatesNotificationLevel (line 1091) | typedef /* [v1_enum][helpstring][public] */
  type AutomaticUpdatesScheduledInstallationDay (line 1100) | typedef /* [v1_enum][helpstring][public] */
  type DownloadPhase (line 1112) | typedef /* [v1_enum][helpstring][public] */
  type DownloadPriority (line 1119) | typedef /* [v1_enum][helpstring][public] */
  type AutoSelectionMode (line 1126) | typedef /* [v1_enum][helpstring][public] */
  type AutoDownloadMode (line 1134) | typedef /* [v1_enum][helpstring][public] */
  type InstallationImpact (line 1141) | typedef /* [v1_enum][helpstring][public] */
  type InstallationRebootBehavior (line 1148) | typedef /* [v1_enum][helpstring][public] */
  type OperationResultCode (line 1155) | typedef /* [v1_enum][helpstring][public] */
  type ServerSelection (line 1165) | typedef /* [v1_enum][helpstring][public] */
  type UpdateType (line 1173) | typedef /* [v1_enum][helpstring][public] */
  type UpdateOperation (line 1179) | typedef /* [v1_enum][helpstring][public] */
  type DeploymentAction (line 1185) | typedef /* [v1_enum][helpstring][public] */
  type UpdateExceptionContext (line 1193) | typedef /* [v1_enum][helpstring][public] */
  type AutomaticUpdatesUserType (line 1200) | typedef /* [v1_enum][helpstring][public] */
  type AutomaticUpdatesPermissionType (line 1206) | typedef /* [v1_enum][helpstring][public] */
  type UpdateServiceRegistrationState (line 1215) | typedef /* [v1_enum][helpstring][public] */
  type SearchScope (line 1222) | typedef /* [v1_enum][helpstring][public] */
  type IUpdateLockdownVtbl (line 1265) | typedef struct IUpdateLockdownVtbl
  function interface (line 1288) | interface IUpdateLockdown
  type IStringCollectionVtbl (line 1374) | typedef struct IStringCollectionVtbl
  function interface (line 1465) | interface IStringCollection
  type IWebProxyVtbl (line 1602) | typedef struct IWebProxyVtbl
  function interface (line 1708) | interface IWebProxy
  type ISystemInformationVtbl (line 1819) | typedef struct ISystemInformationVtbl
  function interface (line 1875) | interface ISystemInformation
  type IWindowsUpdateAgentInfoVtbl (line 1948) | typedef struct IWindowsUpdateAgentInfoVtbl
  function interface (line 2001) | interface IWindowsUpdateAgentInfo
  type IAutomaticUpdatesResultsVtbl (line 2073) | typedef struct IAutomaticUpdatesResultsVtbl
  function interface (line 2129) | interface IAutomaticUpdatesResults
  type IAutomaticUpdatesSettingsVtbl (line 2226) | typedef struct IAutomaticUpdatesSettingsVtbl
  function interface (line 2312) | interface IAutomaticUpdatesSettings
  type IAutomaticUpdatesSettings2Vtbl (line 2416) | typedef struct IAutomaticUpdatesSettings2Vtbl
  function interface (line 2516) | interface IAutomaticUpdatesSettings2
  type IAutomaticUpdatesSettings3Vtbl (line 2631) | typedef struct IAutomaticUpdatesSettings3Vtbl
  function interface (line 2747) | interface IAutomaticUpdatesSettings3
  type IAutomaticUpdatesVtbl (line 2879) | typedef struct IAutomaticUpdatesVtbl
  function interface (line 2950) | interface IAutomaticUpdates
  type IAutomaticUpdates2Vtbl (line 3037) | typedef struct IAutomaticUpdates2Vtbl
  function interface (line 3112) | interface IAutomaticUpdates2
  type IUpdateIdentityVtbl (line 3206) | typedef struct IUpdateIdentityVtbl
  function interface (line 3262) | interface IUpdateIdentity
  type IImageInformationVtbl (line 3343) | typedef struct IImageInformationVtbl
  function interface (line 3407) | interface IImageInformation
  type ICategoryVtbl (line 3509) | typedef struct ICategoryVtbl
  function interface (line 3593) | interface ICategory
  type ICategoryCollectionVtbl (line 3693) | typedef struct ICategoryCollectionVtbl
  function interface (line 3754) | interface ICategoryCollection
  type IInstallationBehaviorVtbl (line 3838) | typedef struct IInstallationBehaviorVtbl
  function interface (line 3902) | interface IInstallationBehavior
  type IUpdateDownloadContentVtbl (line 3980) | typedef struct IUpdateDownloadContentVtbl
  function interface (line 4032) | interface IUpdateDownloadContent
  type IUpdateDownloadContent2Vtbl (line 4101) | typedef struct IUpdateDownloadContent2Vtbl
  function interface (line 4157) | interface IUpdateDownloadContent2
  type IUpdateDownloadContentCollectionVtbl (line 4237) | typedef struct IUpdateDownloadContentCollectionVtbl
  function interface (line 4298) | interface IUpdateDownloadContentCollection
  type IUpdateVtbl (line 4505) | typedef struct IUpdateVtbl
  function interface (line 4733) | interface IUpdate
  type IWindowsDriverUpdateVtbl (line 4955) | typedef struct IWindowsDriverUpdateVtbl
  function interface (line 5215) | interface IWindowsDriverUpdate
  type IUpdate2Vtbl (line 5450) | typedef struct IUpdate2Vtbl
  function interface (line 5694) | interface IUpdate2
  type IUpdate3Vtbl (line 5908) | typedef struct IUpdate3Vtbl
  function interface (line 6156) | interface IUpdate3
  type IUpdate4Vtbl (line 6374) | typedef struct IUpdate4Vtbl
  function interface (line 6626) | interface IUpdate4
  type IUpdate5Vtbl (line 6851) | typedef struct IUpdate5Vtbl
  function interface (line 7111) | interface IUpdate5
  type IWindowsDriverUpdate2Vtbl (line 7349) | typedef struct IWindowsDriverUpdate2Vtbl
  function interface (line 7625) | interface IWindowsDriverUpdate2
  type IWindowsDriverUpdate3Vtbl (line 7864) | typedef struct IWindowsDriverUpdate3Vtbl
  function interface (line 8144) | interface IWindowsDriverUpdate3
  type IWindowsDriverUpdateEntryVtbl (line 8408) | typedef struct IWindowsDriverUpdateEntryVtbl
  function interface (line 8488) | interface IWindowsDriverUpdateEntry
  type IWindowsDriverUpdateEntryCollectionVtbl (line 8585) | typedef struct IWindowsDriverUpdateEntryCollectionVtbl
  function interface (line 8646) | interface IWindowsDriverUpdateEntryCollection
  type IWindowsDriverUpdate4Vtbl (line 8724) | typedef struct IWindowsDriverUpdate4Vtbl
  function interface (line 9012) | interface IWindowsDriverUpdate4
  type IWindowsDriverUpdate5Vtbl (line 9265) | typedef struct IWindowsDriverUpdate5Vtbl
  function interface (line 9561) | interface IWindowsDriverUpdate5
  type IUpdateCollectionVtbl (line 9848) | typedef struct IUpdateCollectionVtbl
  function interface (line 9939) | interface IUpdateCollection
  type IUpdateExceptionVtbl (line 10041) | typedef struct IUpdateExceptionVtbl
  function interface (line 10101) | interface IUpdateException
  type IInvalidProductLicenseExceptionVtbl (line 10176) | typedef struct IInvalidProductLicenseExceptionVtbl
  function interface (line 10240) | interface IInvalidProductLicenseException
  type IUpdateExceptionCollectionVtbl (line 10326) | typedef struct IUpdateExceptionCollectionVtbl
  function interface (line 10387) | interface IUpdateExceptionCollection
  type ISearchResultVtbl (line 10471) | typedef struct ISearchResultVtbl
  function interface (line 10535) | interface ISearchResult
  type ISearchJobVtbl (line 10620) | typedef struct ISearchJobVtbl
  function interface (line 10682) | interface ISearchJob
  type ISearchCompletedCallbackArgsVtbl (line 10757) | typedef struct ISearchCompletedCallbackArgsVtbl
  function interface (line 10805) | interface ISearchCompletedCallbackArgs
  type ISearchCompletedCallbackVtbl (line 10872) | typedef struct ISearchCompletedCallbackVtbl
  function interface (line 10896) | interface ISearchCompletedCallback
  type IUpdateHistoryEntryVtbl (line 10991) | typedef struct IUpdateHistoryEntryVtbl
  function interface (line 11095) | interface IUpdateHistoryEntry
  type IUpdateHistoryEntry2Vtbl (line 11203) | typedef struct IUpdateHistoryEntry2Vtbl
  function interface (line 11311) | interface IUpdateHistoryEntry2
  type IUpdateHistoryEntryCollectionVtbl (line 11430) | typedef struct IUpdateHistoryEntryCollectionVtbl
  function interface (line 11491) | interface IUpdateHistoryEntryCollection
  type IUpdateSearcherVtbl (line 11625) | typedef struct IUpdateSearcherVtbl
  function interface (line 11753) | interface IUpdateSearcher
  type IUpdateSearcher2Vtbl (line 11876) | typedef struct IUpdateSearcher2Vtbl
  function interface (line 12012) | interface IUpdateSearcher2
  type IUpdateSearcher3Vtbl (line 12142) | typedef struct IUpdateSearcher3Vtbl
  function interface (line 12286) | interface IUpdateSearcher3
  type IUpdateDownloadResultVtbl (line 12423) | typedef struct IUpdateDownloadResultVtbl
  function interface (line 12479) | interface IUpdateDownloadResult
  type IDownloadResultVtbl (line 12558) | typedef struct IDownloadResultVtbl
  function interface (line 12619) | interface IDownloadResult
  type IDownloadProgressVtbl (line 12719) | typedef struct IDownloadProgressVtbl
  function interface (line 12804) | interface IDownloadProgress
  type IDownloadJobVtbl (line 12910) | typedef struct IDownloadJobVtbl
  function interface (line 12980) | interface IDownloadJob
  type IDownloadCompletedCallbackArgsVtbl (line 13061) | typedef struct IDownloadCompletedCallbackArgsVtbl
  function interface (line 13109) | interface IDownloadCompletedCallbackArgs
  type IDownloadCompletedCallbackVtbl (line 13176) | typedef struct IDownloadCompletedCallbackVtbl
  function interface (line 13200) | interface IDownloadCompletedCallback
  type IDownloadProgressChangedCallbackArgsVtbl (line 13256) | typedef struct IDownloadProgressChangedCallbackArgsVtbl
  function interface (line 13308) | interface IDownloadProgressChangedCallbackArgs
  type IDownloadProgressChangedCallbackVtbl (line 13378) | typedef struct IDownloadProgressChangedCallbackVtbl
  function interface (line 13402) | interface IDownloadProgressChangedCallback
  type IUpdateDownloaderVtbl (line 13492) | typedef struct IUpdateDownloaderVtbl
  function interface (line 13588) | interface IUpdateDownloader
  type IUpdateInstallationResultVtbl (line 13693) | typedef struct IUpdateInstallationResultVtbl
  function interface (line 13753) | interface IUpdateInstallationResult
  type IInstallationResultVtbl (line 13838) | typedef struct IInstallationResultVtbl
  function interface (line 13903) | interface IInstallationResult
  type IInstallationProgressVtbl (line 13991) | typedef struct IInstallationProgressVtbl
  function interface (line 14056) | interface IInstallationProgress
  type IInstallationJobVtbl (line 14147) | typedef struct IInstallationJobVtbl
  function interface (line 14217) | interface IInstallationJob
  type IInstallationCompletedCallbackArgsVtbl (line 14298) | typedef struct IInstallationCompletedCallbackArgsVtbl
  function interface (line 14346) | interface IInstallationCompletedCallbackArgs
  type IInstallationCompletedCallbackVtbl (line 14413) | typedef struct IInstallationCompletedCallbackVtbl
  function interface (line 14437) | interface IInstallationCompletedCallback
  type IInstallationProgressChangedCallbackArgsVtbl (line 14493) | typedef struct IInstallationProgressChangedCallbackArgsVtbl
  function interface (line 14545) | interface IInstallationProgressChangedCallbackArgs
  type IInstallationProgressChangedCallbackVtbl (line 14615) | typedef struct IInstallationProgressChangedCallbackVtbl
  function interface (line 14639) | interface IInstallationProgressChangedCallback
  type IUpdateInstallerVtbl (line 14764) | typedef struct IUpdateInstallerVtbl
  function interface (line 14905) | interface IUpdateInstaller
  type IUpdateInstaller2Vtbl (line 15037) | typedef struct IUpdateInstaller2Vtbl
  function interface (line 15186) | interface IUpdateInstaller2
  type IUpdateSessionVtbl (line 15343) | typedef struct IUpdateSessionVtbl
  function interface (line 15423) | interface IUpdateSession
  type IUpdateSession2Vtbl (line 15516) | typedef struct IUpdateSession2Vtbl
  function interface (line 15604) | interface IUpdateSession2
  type IUpdateSession3Vtbl (line 15707) | typedef struct IUpdateSession3Vtbl
  function interface (line 15806) | interface IUpdateSession3
  type IUpdateServiceVtbl (line 15946) | typedef struct IUpdateServiceVtbl
  function interface (line 16046) | interface IUpdateService
  type IUpdateService2Vtbl (line 16151) | typedef struct IUpdateService2Vtbl
  function interface (line 16255) | interface IUpdateService2
  type IUpdateServiceCollectionVtbl (line 16371) | typedef struct IUpdateServiceCollectionVtbl
  function interface (line 16432) | interface IUpdateServiceCollection
  type IUpdateServiceRegistrationVtbl (line 16516) | typedef struct IUpdateServiceRegistrationVtbl
  function interface (line 16580) | interface IUpdateServiceRegistration
  type IUpdateServiceManagerVtbl (line 16682) | typedef struct IUpdateServiceManagerVtbl
  function interface (line 16764) | interface IUpdateServiceManager
  type IUpdateServiceManager2Vtbl (line 16864) | typedef struct IUpdateServiceManager2Vtbl
  function interface (line 16966) | interface IUpdateServiceManager2
  type IInstallationAgentVtbl (line 17068) | typedef struct IInstallationAgentVtbl
  function interface (line 17122) | interface IInstallationAgent
  type UpdateLockdownOption (line 17176) | typedef /* [v1_enum][helpstring][public] */
  type AddServiceFlag (line 17181) | typedef /* [v1_enum][helpstring][public] */
  type UpdateServiceOption (line 17188) | typedef /* [v1_enum][helpstring][public] */

FILE: launcher/InitRunOnce.c
  type DWORD (line 12) | typedef DWORD (__fastcall *_ThemeWaitForServiceReady)(DWORD timeout);
  type DWORD (line 13) | typedef DWORD (__fastcall *_ThemeWatchForStart)(void);
  function StartThemes (line 23) | static void StartThemes(void) {
  function BOOL (line 53) | static BOOL RunCmd(LPPROCESS_INFORMATION processInfo) {
  function LRESULT (line 74) | static LRESULT CALLBACK RunOnceWndProc(HWND hwnd, UINT message, WPARAM w...
  function ResetSetupKey (line 99) | static void ResetSetupKey(void) {
  function BOOL (line 126) | static BOOL IsSystemUser(void) {
  function CreateRunOnceWindow (line 167) | static void CreateRunOnceWindow(void) {
  function FixUserWallpaper (line 264) | static void FixUserWallpaper(void) {
  function RunOnce (line 282) | void RunOnce(BOOL postInstall) {

FILE: launcher/LaunchLog.c
  function LaunchLog (line 12) | void LaunchLog(int argc, LPWSTR *argv, int nCmdShow) {

FILE: launcher/LaunchUpdateSite.c
  function LPWSTR (line 22) | static LPWSTR GetUpdateSiteURL(void) {
  function HRESULT (line 43) | HRESULT HandleIENotInstalled(void) {
  function LaunchUpdateSite (line 81) | void LaunchUpdateSite(int argc, LPWSTR *argv, int nCmdShow) {

FILE: launcher/MsgBox.c
  function MsgBox (line 14) | int MsgBox(HWND hwnd, LPCTSTR instruction, LPCTSTR body, UINT type) {

FILE: launcher/Options.c
  function LaunchOptions (line 6) | void LaunchOptions(int nCmdShow) {

FILE: launcher/RegisterServer.c
  function HRESULT (line 13) | static HRESULT RegisterDllInternal(LPWSTR path, BOOL state) {
  function HRESULT (line 36) | static HRESULT RegisterDllExternal(LPWSTR path, BOOL state) {
  function HRESULT (line 59) | HRESULT RegisterServer(HWND hwnd, BOOL state, BOOL forLaunch) {

FILE: launcher/SelfElevate.c
  function HRESULT (line 6) | HRESULT SelfElevate(LPWSTR args, LPDWORD code) {

FILE: launcher/main.c
  type Action (line 20) | typedef enum Action {
  function wWinMain (line 41) | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR ...

FILE: nsisplugin/CloseIEWindows.c
  function PLUGIN_METHOD (line 9) | PLUGIN_METHOD(CloseIEWindows) {

FILE: nsisplugin/DialogInit.c
  type MARGINS (line 32) | typedef HRESULT (WINAPI *_DwmExtendFrameIntoClientArea)(HWND hWnd, const...
  type eAttribute (line 36) | typedef HRESULT (WINAPI *_SetWindowThemeAttribute)(HWND hwnd, enum WINDO...
  type const (line 40) | typedef HRESULT (WINAPI *_DrawThemeBackground)(HTHEME hTheme, HDC hdc, i...
  type Theme (line 54) | typedef enum Theme {
  function Theme (line 73) | static Theme GetTheme(void) {
  function ConfigureWindow (line 90) | static void ConfigureWindow(void) {
  function LRESULT (line 139) | static LRESULT CALLBACK BannerWndProc(HWND hwnd, UINT uMsg, WPARAM wPara...
  function LRESULT (line 230) | static LRESULT CALLBACK BottomWndProc(HWND hwnd, UINT uMsg, WPARAM wPara...
  function LRESULT (line 257) | static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,...
  function LRESULT (line 321) | static LRESULT CALLBACK BackgroundWndProc(HWND hwnd, UINT uMsg, WPARAM w...
  function UINT_PTR (line 385) | static UINT_PTR NSISPluginCallback(enum NSPIM event) {
  function PLUGIN_METHOD (line 390) | PLUGIN_METHOD(DialogInit) {

FILE: nsisplugin/EnableMicrosoftUpdate.c
  function PLUGIN_METHOD (line 8) | PLUGIN_METHOD(EnableMicrosoftUpdate) {

FILE: nsisplugin/Exec.c
  function FORCEINLINE (line 30) | FORCEINLINE DWORD NoDepr_GetVersion(void) { __pragma(warning(push))__pra...
  function PLUGIN_METHOD (line 48) | PLUGIN_METHOD(Exec) {
  function PLUGIN_METHOD (line 53) | PLUGIN_METHOD(ExecToLog) {
  function PLUGIN_METHOD (line 58) | PLUGIN_METHOD(ExecToStack) {
  function BOOL (line 63) | static BOOL IsLeadSurrogateUTF16(unsigned short c) { return c >= 0xd800 ...
  function BOOL (line 64) | static BOOL IsTrailSurrogateUTF16(unsigned short c) { return c >= 0xdc00...
  function PWSTR (line 66) | static PWSTR MyCharNext(PCWSTR p)
  function TruncateStringUTF16LE (line 77) | static void TruncateStringUTF16LE(LPWSTR Buffer, SIZE_T Length, LPCWSTR ...
  function TruncateStringMB (line 100) | static void TruncateStringMB(UINT Codepage, LPSTR Buffer, SIZE_T Length,...
  function BOOL (line 110) | static BOOL IsWOW64(void) {
  function LogMessage (line 148) | static void LogMessage(TCHAR *pStr, BOOL bOEM) {
  function ExecScript (line 167) | void ExecScript(int mode) {
  function TCHAR (line 504) | static TCHAR *my_strstr(TCHAR *a, TCHAR *b)
  function my_atoi (line 522) | static unsigned int my_atoi(TCHAR *s) {
  function AsExeWinMain (line 557) | int WINAPI AsExeWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LP...

FILE: nsisplugin/IsActivated.c
  type SLID (line 10) | typedef HRESULT (WINAPI *_SLGetLicensingStatusInformation)(HSLC, const S...
  function PLUGIN_METHOD (line 20) | PLUGIN_METHOD(IsActivated) {

FILE: nsisplugin/IsAdmin.c
  function PLUGIN_METHOD (line 5) | PLUGIN_METHOD(IsAdmin) {

FILE: nsisplugin/IsMultiCPU.c
  function PLUGIN_METHOD (line 5) | PLUGIN_METHOD(IsMultiCPU) {

FILE: nsisplugin/IsServerCore.c
  function PLUGIN_METHOD (line 7) | PLUGIN_METHOD(IsServerCore) {

FILE: nsisplugin/MessageForHresult.c
  function PLUGIN_METHOD (line 5) | PLUGIN_METHOD(MessageForHresult) {

FILE: nsisplugin/NeedsRootsUpdate.c
  function PLUGIN_METHOD (line 8) | PLUGIN_METHOD(NeedsRootsUpdate) {
  function PLUGIN_METHOD (line 40) | PLUGIN_METHOD(SetRootsUpdateTime) {

FILE: nsisplugin/RebootPage.c
  function INT_PTR (line 22) | static INT_PTR CALLBACK RebootDialogProc(HWND hwnd, UINT uMsg, WPARAM wP...
  function LRESULT (line 55) | static LRESULT CALLBACK RebootMainWndProc(HWND hwnd, UINT uMsg, WPARAM w...
  function PLUGIN_METHOD (line 75) | PLUGIN_METHOD(RebootPageCreate) {
  function PLUGIN_METHOD (line 156) | PLUGIN_METHOD(RebootPageShow) {

FILE: nsisplugin/TaskbarProgress.c
  function LRESULT (line 19) | LRESULT CALLBACK ProgressBarWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,...
  function LRESULT (line 55) | static LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam,...
  function UINT_PTR (line 85) | static UINT_PTR NSISPluginCallback(enum NSPIM event) {
  function PLUGIN_METHOD (line 90) | PLUGIN_METHOD(InitTaskbarProgress) {

FILE: nsisplugin/UpdateRoots.c
  function PLUGIN_METHOD (line 6) | PLUGIN_METHOD(UpdateRoots) {

FILE: nsisplugin/VerifyFileHash.c
  function BOOL (line 5) | static BOOL hexToBinary(const char *hex, uint8_t *binary, int binaryLeng...
  function BOOL (line 38) | static BOOL calculateFileSha256(const LPWSTR path, uint8_t hash[SIZE_OF_...
  function PLUGIN_METHOD (line 58) | PLUGIN_METHOD(VerifyFileHash) {

FILE: nsisplugin/WriteLog.c
  function LRESULT (line 9) | static LRESULT CALLBACK LogListViewProc(HWND hwnd, UINT msg, WPARAM wPar...
  function PLUGIN_METHOD (line 20) | PLUGIN_METHOD(InitLog) {
  function PLUGIN_METHOD (line 36) | PLUGIN_METHOD(WriteLog) {

FILE: nsisplugin/main.c
  function WINAPI (line 10) | WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) {

FILE: nsisplugin/sha256.c
  function right_rot (line 19) | static inline uint32_t right_rot(uint32_t value, unsigned int count)
  function consume_chunk (line 34) | static inline void consume_chunk(uint32_t *h, const uint8_t *p)
  function sha_256_init (line 118) | void sha_256_init(struct Sha_256 *sha_256, uint8_t hash[SIZE_OF_SHA_256_...
  function sha_256_write (line 138) | void sha_256_write(struct Sha_256 *sha_256, const void *data, size_t len)
  type Sha_256 (line 175) | struct Sha_256
  function calc_sha_256 (line 223) | void calc_sha_256(uint8_t hash[SIZE_OF_SHA_256_HASH], const void *input,...

FILE: nsisplugin/sha256.h
  type Sha_256 (line 33) | struct Sha_256 {
  type Sha_256 (line 69) | struct Sha_256
  type Sha_256 (line 86) | struct Sha_256
  type Sha_256 (line 102) | struct Sha_256

FILE: setup/resource.c
  function DllMain (line 1) | void DllMain() {}

FILE: shared/Exec.c
  function HRESULT (line 4) | HRESULT Exec(LPCWSTR verb, LPCWSTR file, LPCWSTR params, LPCWSTR working...
  function HRESULT (line 15) | HRESULT ExecEx(LPSHELLEXECUTEINFO execInfo, BOOL wait, LPDWORD exitCode) {

FILE: shared/HResult.c
  function EXTERN_C (line 10) | EXTERN_C LPWSTR GetMessageForHresult(HRESULT hr) {

FILE: shared/LegacyUpdate.c
  function EXTERN_C (line 7) | EXTERN_C HRESULT GetInstallPath(LPWSTR *path) {

FILE: shared/LoadImage.c
  function HGLOBAL (line 17) | static HGLOBAL GetRawResource(HINSTANCE hInstance, LPCWSTR name, LPCWSTR...
  function IStream (line 55) | static IStream *GetResourceStream(HINSTANCE hInstance, LPCWSTR name, LPC...
  function IWICBitmapSource (line 71) | static IWICBitmapSource *GetWICBitmap(IStream *imageStream, REFCLSID rcl...
  function HBITMAP (line 101) | static HBITMAP GetHBitmapForWICBitmap(IWICBitmapSource *bitmap) {
  function HBITMAP (line 135) | HBITMAP LoadPNGResource(HINSTANCE hInstance, LPCWSTR resourceName, LPCWS...
  function HBITMAP (line 165) | HBITMAP LoadJPEGFile(LPCWSTR filePath) {
  function BOOL (line 206) | BOOL ScaleAndWriteToBMP(HBITMAP hBitmap, DWORD width, DWORD height, LPCW...

FILE: shared/Log.c
  function LogInternal (line 35) | void LogInternal(LPCWSTR text) {
  function WriteLogBanner (line 55) | static void WriteLogBanner() {
  function HRESULT (line 108) | HRESULT OpenLog() {
  function CloseLog (line 152) | void CloseLog(void) {

FILE: shared/ProductInfo.c
  type DWORD (line 3) | typedef BOOL (WINAPI *_GetProductInfo)(DWORD, DWORD, DWORD, DWORD, PDWORD);
  function BOOL (line 8) | BOOL GetVistaProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion,...

FILE: shared/Registry.c
  function HRESULT (line 9) | HRESULT GetRegistryString(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueNam...
  function HRESULT (line 61) | HRESULT GetRegistryDword(HKEY key, LPCWSTR subkeyPath, LPCWSTR valueName...
  function HRESULT (line 80) | HRESULT SetRegistryEntries(RegistryEntry entries[]) {

FILE: shared/Registry.h
  type RegistryEntry (line 37) | typedef struct {

FILE: shared/Startup.h
  function HardenDllSearchPaths (line 8) | static inline void HardenDllSearchPaths(void) {
  function Startup (line 46) | static inline void Startup(void) {

FILE: shared/User.h
  function BOOL (line 5) | static inline BOOL IsUserAdmin(void) {
  function BOOL (line 22) | static inline BOOL IsElevated(void) {
  function DWORD (line 40) | static inline DWORD GetTokenIntegrity(void) {

FILE: shared/VersionInfo.h
  function ALWAYS_INLINE (line 47) | static ALWAYS_INLINE OSVERSIONINFOEX *GetVersionInfo(void) {
  function ALWAYS_INLINE (line 56) | static ALWAYS_INLINE WORD GetWinVer(void) {
  function ALWAYS_INLINE (line 60) | static ALWAYS_INLINE WORD GetWinBuild(void) {
  function ALWAYS_INLINE (line 117) | static ALWAYS_INLINE HRESULT GetOwnFileName(LPWSTR *filename) {

FILE: shared/ViewLog.c
  function HRESULT (line 3) | HRESULT ViewLog(LogAction log, int nCmdShow, BOOL showErrors) {

FILE: shared/ViewLog.h
  type LogAction (line 11) | typedef enum LogAction {

FILE: shared/WMI.c
  function HRESULT (line 21) | HRESULT QueryWMIProperty(LPCWSTR query, LPCWSTR property, LPVARIANT valu...

FILE: shared/Wow64.c
  function LoadWow64Symbols (line 15) | static void LoadWow64Symbols(void) {
  function OurGetNativeSystemInfo (line 26) | void OurGetNativeSystemInfo(LPSYSTEM_INFO lpSystemInfo) {
  function BOOL (line 37) | BOOL DisableWow64FsRedirection(PVOID *OldValue) {
  function BOOL (line 47) | BOOL RevertWow64FsRedirection(PVOID OldValue) {
Condensed preview — 179 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,533K chars).
[
  {
    "path": ".editorconfig",
    "chars": 168,
    "preview": "# http://editorconfig.org\nroot = true\n\n[*]\nindent_style = tab\ntab_width = 2\nend_of_line = lf\ncharset = utf-8\ntrim_traili"
  },
  {
    "path": ".gitattributes",
    "chars": 65,
    "preview": "*         text=auto eol=lf\n*.sln     eol=crlf\n*.vcxproj eol=crlf\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 101,
    "preview": "github: kirb\nko_fi: adamdemasi\npatreon: adamdemasi\ncustom: [\"https://paypal.me/HashbangProductions\"]\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/01-bug_report.yml",
    "chars": 5284,
    "preview": "name: \"Bug Report\"\ndescription: \"Report something that isn’t working as expected\"\nlabels: [\"Bug\", \"Needs triage\"]\nbody:\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/02-update_issue.yml",
    "chars": 6192,
    "preview": "name: \"Update Issue\"\ndescription: \"Report a problem with an update\"\nlabels: [\"Needs triage\"]\nbody:\n  - type: markdown\n  "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/03-download_center_issue.yml",
    "chars": 1601,
    "preview": "name: \"Download Center Issue\"\ndescription: \"Report a problem with the Microsoft Download Center Archive\"\nlabels: [\"Compo"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/04-feature_suggestion.yml",
    "chars": 1464,
    "preview": "name: \"Feature Suggestion\"\ndescription: \"Suggest a feature to be added to Legacy Update\"\nlabels: [\"Enhancement\", \"Needs "
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 541,
    "preview": "blank_issues_enabled: false\ncontact_links:\n  - name: Legacy Update Help\n    url: https://legacyupdate.net/help/\n    abou"
  },
  {
    "path": ".github/workflows/build-nt4.yml",
    "chars": 2417,
    "preview": "name: Build Legacy Update NT\n\non:\n  push:\n    branches: []\n  pull_request:\n    branches: []\n  workflow_dispatch:\n\njobs:\n"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 2143,
    "preview": "name: Build Legacy Update\n\non:\n  push:\n    branches: []\n  pull_request:\n    branches: []\n  workflow_dispatch:\n\njobs:\n  b"
  },
  {
    "path": ".gitignore",
    "chars": 1904,
    "preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
  },
  {
    "path": ".idea/.idea.LegacyUpdate/.idea/.gitignore",
    "chars": 281,
    "preview": "# Default ignored files\n/shelf/\n/workspace.xml\n# Rider ignored files\n/.idea.LegacyUpdate.iml\n/modules.xml\n/contentModel."
  },
  {
    "path": ".idea/.idea.LegacyUpdate/.idea/discord.xml",
    "chars": 216,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"DiscordProjectSettings\">\n    <option nam"
  },
  {
    "path": ".idea/.idea.LegacyUpdate/.idea/indexLayout.xml",
    "chars": 240,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"UserContentModel\">\n    <attachedFolders>"
  },
  {
    "path": ".idea/.idea.LegacyUpdate/.idea/vcs.xml",
    "chars": 167,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping dire"
  },
  {
    "path": ".vscode/c_cpp_properties.json",
    "chars": 1118,
    "preview": "{\n    \"configurations\": [\n        {\n            \"name\": \"MinGW\",\n            \"includePath\": [\n                \"${workspa"
  },
  {
    "path": ".vscode/settings.json",
    "chars": 66,
    "preview": "{\n\t\"files.associations\": {\n\t\t\"*.rc\": \"cpp\",\n\t\t\"*.idl\": \"cpp\"\n\t}\n}\n"
  },
  {
    "path": "LICENSE.md",
    "chars": 11358,
    "preview": "\n                                 Apache License\n                           Version 2.0, January 2004\n                  "
  },
  {
    "path": "LegacyUpdate/ClassFactory.cpp",
    "chars": 1564,
    "preview": "#include \"ClassFactory.h\"\n#include \"LegacyUpdate_i.h\"\n#include \"LegacyUpdateCtrl.h\"\n#include \"ElevationHelper.h\"\n#includ"
  },
  {
    "path": "LegacyUpdate/ClassFactory.h",
    "chars": 774,
    "preview": "#pragma once\n\n#include \"com.h\"\n\nSTDMETHODIMP CreateClassFactory(IUnknown *pUnkOuter, REFIID riid, void **ppv);\n\nclass DE"
  },
  {
    "path": "LegacyUpdate/Compat.cpp",
    "chars": 3380,
    "preview": "#include \"Compat.h\"\n#include <windows.h>\n#include <shellscalingapi.h>\n#include \"resource.h\"\n#include \"ProductInfo.h\"\n\nty"
  },
  {
    "path": "LegacyUpdate/Compat.h",
    "chars": 125,
    "preview": "#pragma once\n\nvoid BecomeDPIAware();\nvoid IsolationAwareStart(ULONG_PTR *cookie);\nvoid IsolationAwareEnd(ULONG_PTR *cook"
  },
  {
    "path": "LegacyUpdate/ElevationHelper.cpp",
    "chars": 6061,
    "preview": "// ElevationHelper.cpp : Implementation of CElevationHelper\n\n#include \"ElevationHelper.h\"\n#include \"Compat.h\"\n#include \""
  },
  {
    "path": "LegacyUpdate/ElevationHelper.h",
    "chars": 1012,
    "preview": "#pragma once\n\n// ElevationHelper.h : Declaration of the CElevationHelper class.\n\n#include \"resource.h\"\n#include \"com.h\"\n"
  },
  {
    "path": "LegacyUpdate/IUpdateInstaller4.h",
    "chars": 27004,
    "preview": "#pragma once\n#include <wuapi.h>\n\n// Copied from wuapi.h in Windows SDK 10.0.19041.0\n\n#ifndef __IUpdateInstaller3_FWD_DEF"
  },
  {
    "path": "LegacyUpdate/LaunchUpdateSite.cpp",
    "chars": 656,
    "preview": "#include \"Exec.h\"\n#include \"HResult.h\"\n#include \"Utils.h\"\n#include <comdef.h>\n\n// Function signature required by Rundll3"
  },
  {
    "path": "LegacyUpdate/LegacyUpdate.def",
    "chars": 280,
    "preview": "; LegacyUpdate.def : Declares the module parameters.\n\nEXPORTS\n\t; Registration\n\tDllCanUnloadNow      PRIVATE\n\tDllGetClass"
  },
  {
    "path": "LegacyUpdate/LegacyUpdate.idl",
    "chars": 3604,
    "preview": "// LegacyUpdate.idl : IDL source for LegacyUpdate\n//\n\n// This file will be processed by the MIDL tool to\n// produce the "
  },
  {
    "path": "LegacyUpdate/LegacyUpdate.rc",
    "chars": 1675,
    "preview": "#include \"resource.h\"\n#include <windows.h>\n#include \"Version.h\"\n\n///////////////////////////////////////////////////////"
  },
  {
    "path": "LegacyUpdate/LegacyUpdate.vcxproj",
    "chars": 6377,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
  },
  {
    "path": "LegacyUpdate/LegacyUpdate.vcxproj.filters",
    "chars": 837,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "LegacyUpdate/LegacyUpdateCtrl.cpp",
    "chars": 16133,
    "preview": "// LegacyUpdateCtrl.cpp : Implementation of the CLegacyUpdateCtrl ActiveX Control class.\n\n#include \"LegacyUpdateCtrl.h\"\n"
  },
  {
    "path": "LegacyUpdate/LegacyUpdateCtrl.h",
    "chars": 2459,
    "preview": "#pragma once\n\n// LegacyUpdateCtrl.h : Declaration of the CLegacyUpdateCtrl ActiveX Control class.\n\n// CLegacyUpdateCtrl "
  },
  {
    "path": "LegacyUpdate/Makefile",
    "chars": 1036,
    "preview": "FILES    = \\\n\t$(wildcard *.cpp) \\\n\tdlldatax.c \\\n\t../shared/Exec.c \\\n\t../shared/HResult.c \\\n\t../shared/LegacyUpdate.c \\\n\t"
  },
  {
    "path": "LegacyUpdate/NGen.cpp",
    "chars": 1569,
    "preview": "#include \"NGen.h\"\n#include \"Exec.h\"\n#include \"VersionInfo.h\"\n#include \"Wow64.h\"\n#include <shlwapi.h>\n\nSTDMETHODIMP Pause"
  },
  {
    "path": "LegacyUpdate/NGen.h",
    "chars": 61,
    "preview": "#pragma once\n\nSTDMETHODIMP PauseResumeNGenQueue(BOOL state);\n"
  },
  {
    "path": "LegacyUpdate/ProductName.cpp",
    "chars": 11483,
    "preview": "#include <comdef.h>\n#include <shlwapi.h>\n#include \"Registry.h\"\n#include \"VersionInfo.h\"\n#include \"WMI.h\"\n#include \"Wow64"
  },
  {
    "path": "LegacyUpdate/ProductName.h",
    "chars": 63,
    "preview": "#pragma once\n\nHRESULT GetOSProductName(LPVARIANT productName);\n"
  },
  {
    "path": "LegacyUpdate/ProgressBarControl.cpp",
    "chars": 12022,
    "preview": "// ProgressBarControl.cpp : Implementation of CProgressBarControl\n\n#include \"ProgressBarControl.h\"\n#include <commctrl.h>"
  },
  {
    "path": "LegacyUpdate/ProgressBarControl.h",
    "chars": 3692,
    "preview": "#pragma once\n\n// ProgressBarControl.h : Declaration of the CProgressBarControl class.\n\n#include \"resource.h\"\n#include \"c"
  },
  {
    "path": "LegacyUpdate/ProgressBarControl.html",
    "chars": 1356,
    "preview": "<!DOCTYPE html>\n<html>\n<head>\n\t<title>ATL test page for object ProgressBarControl</title>\n\t<meta http-equiv=\"X-UA-Compat"
  },
  {
    "path": "LegacyUpdate/Utils.cpp",
    "chars": 2948,
    "preview": "#include \"Utils.h\"\n#include <shlwapi.h>\n#include <winreg.h>\n#include \"Exec.h\"\n#include \"LegacyUpdate.h\"\n#include \"ViewLo"
  },
  {
    "path": "LegacyUpdate/Utils.h",
    "chars": 82,
    "preview": "#pragma once\n\nHRESULT StartLauncher(LPCWSTR params, BOOL wait);\nHRESULT Reboot();\n"
  },
  {
    "path": "LegacyUpdate/dlldatax.c",
    "chars": 284,
    "preview": "// wrapper for dlldata.c\n\n#include <windows.h>\n#include <ole2.h>\n\n#define REGISTER_PROXY_DLL\n#define USE_STUBLESS_PROXY\n"
  },
  {
    "path": "LegacyUpdate/dlldatax.h",
    "chars": 316,
    "preview": "#pragma once\n\nEXTERN_C BOOL WINAPI PrxDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved);\nEXTERN_C STDAPI P"
  },
  {
    "path": "LegacyUpdate/dllmain.cpp",
    "chars": 6043,
    "preview": "// dllmain.cpp : Implementation of DLL Exports.\n\n#include \"LegacyUpdate_i.h\"\n#include \"dllmain.h\"\n#include \"dlldatax.h\"\n"
  },
  {
    "path": "LegacyUpdate/dllmain.h",
    "chars": 116,
    "preview": "#pragma once\n\n// dllmain.h : Declaration of module class.\n\nextern HINSTANCE g_hInstance;\nextern LONG g_serverLocks;\n"
  },
  {
    "path": "LegacyUpdate/resource.h",
    "chars": 85,
    "preview": "#define IDS_LEGACYUPDATE                1\n\n#define ID_TYPELIB                      1\n"
  },
  {
    "path": "LegacyUpdate/stdafx.h",
    "chars": 395,
    "preview": "#pragma once\n\n// stdafx.h : include file for standard system include files,\n// or project specific include files that ar"
  },
  {
    "path": "LegacyUpdate/wuapi.idl",
    "chars": 759,
    "preview": "import \"oaidl.idl\";\n\n// Just types we need from wuapi.idl\n\n[\n\thelpstring(\"IUpdateInstaller Interface\"),\n\tobject,\n\toleaut"
  },
  {
    "path": "LegacyUpdate/wuerror.mc",
    "chars": 108020,
    "preview": ";// Reverse engineered from wuerror.h from Windows SDK 10.0.26100.0\n\n;/*************************************************"
  },
  {
    "path": "LegacyUpdate/wuguid.cpp",
    "chars": 1257,
    "preview": "#include <windows.h>\n#include <initguid.h>\n#include <com.h>\n\nDEFINE_GUID(CLSID_UpdateInstaller,   0xd2e0fe7f, 0xd23e, 0x"
  },
  {
    "path": "LegacyUpdate.sln",
    "chars": 1461,
    "preview": "\r\nMicrosoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio Version 17\r\nVisualStudioVersion = 17.14."
  },
  {
    "path": "Makefile",
    "chars": 542,
    "preview": "export CI ?= 0\nexport SIGN ?= 0\nexport DEBUG ?= 1\n\nall: setup\n\nactivex:\n\t+$(MAKE) -C LegacyUpdate\n\nlauncher:\n\t+$(MAKE) -"
  },
  {
    "path": "README.md",
    "chars": 11144,
    "preview": "# [<img src=\"https://legacyupdate.net/socialbanner.png\" alt=\"Legacy Update\">](http://legacyupdate.net/)\n\n[![wakatime](ht"
  },
  {
    "path": "build/fix-nsis.sh",
    "chars": 939,
    "preview": "#!/bin/bash\n# Fixes NSIS binaries so they run on Pentium/486. Debian's build of NSIS is compiled with MinGW,\n# but they "
  },
  {
    "path": "build/get-nt4-patches.sh",
    "chars": 310,
    "preview": "#!/bin/bash\n# Get dependencies for NT4 build\n\nset -e\n\ncd \"$(dirname \"$0\")\"/..\n\nfor i in usb; do\n\techo \"Downloading $i..."
  },
  {
    "path": "build/getvc.cmd",
    "chars": 903,
    "preview": "@REM @echo off\nsetlocal enabledelayedexpansion\n\nset ProgramFiles32=%ProgramFiles%\nif \"%ProgramFiles(x86)%\" neq \"\" set Pr"
  },
  {
    "path": "build/shared.mk",
    "chars": 4196,
    "preview": "_COMMA = ,\n\nCLANG  ?= 0\nARCH   ?= 32\n\nifeq ($(ARCH),64)\nTAG     = x86_64\nelse\nTAG     = i686\nendif\n\nPREFIX  = $(TAG)-w64"
  },
  {
    "path": "build/sign.cmd",
    "chars": 350,
    "preview": "@echo off\nsetlocal enabledelayedexpansion\n\n:: Find Visual Studio installation\ncall %~dp0getvc.cmd x64\n\n:: Sign\nsigntool "
  },
  {
    "path": "build/sign.sh",
    "chars": 204,
    "preview": "#!/bin/bash\nargs=(\"$(wslpath -w \"$(dirname \"$0\")/sign.cmd\")\")\nfor arg in \"$@\"; do\n\tcase \"$arg\" in\n\t\t*/*) args+=(\"$(wslpa"
  },
  {
    "path": "include/com/ComClass.h",
    "chars": 541,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n\ntemplate<typename TImpl, typename TInterf"
  },
  {
    "path": "include/com/ComPtr.h",
    "chars": 2849,
    "preview": "#pragma once\n\n#ifdef __cplusplus\n\ntemplate<class TInterface>\nclass CComPtr {\npublic:\n\tTInterface *pointer;\n\n\tvoid *opera"
  },
  {
    "path": "include/com/IDispatchImpl.h",
    "chars": 2294,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <cguid.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComPtr.h\"\n\nte"
  },
  {
    "path": "include/com/IOleInPlaceActiveObjectImpl.h",
    "chars": 1027,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\ntemplate<typename T"
  },
  {
    "path": "include/com/IOleInPlaceObjectImpl.h",
    "chars": 1181,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\ntemplate<typename T"
  },
  {
    "path": "include/com/IOleObjectImpl.h",
    "chars": 3219,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\ntemplate<typename T"
  },
  {
    "path": "include/com/IQuickActivateImpl.h",
    "chars": 1518,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\ntemplate<typename T"
  },
  {
    "path": "include/com/IUnknownImpl.h",
    "chars": 847,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\nclass IUnknownImpl "
  },
  {
    "path": "include/com/IViewObjectExImpl.h",
    "chars": 3876,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n#include \"ComClass.h\"\n\ntemplate<typename T"
  },
  {
    "path": "include/com/helpers.h",
    "chars": 368,
    "preview": "#pragma once\n\n#include <combaseapi.h>\n#include <oleauto.h>\n#include <ocidl.h>\n\n#define DEFINE_UUIDOF(cls, uuid) \\\n\ttempl"
  },
  {
    "path": "include/com.h",
    "chars": 337,
    "preview": "#pragma once\n\n#include <com/helpers.h>\n#include <com/ComPtr.h>\n#include <com/ComClass.h>\n#include <com/IDispatchImpl.h>\n"
  },
  {
    "path": "include/licdll.h",
    "chars": 57017,
    "preview": "/*** Autogenerated by WIDL 8.5 from licdll.idl - Do not edit ***/\n\n#ifdef _WIN32\n#ifndef __REQUIRED_RPCNDR_H_VERSION__\n#"
  },
  {
    "path": "include/licdll.idl",
    "chars": 7178,
    "preview": "\nimport \"oaidl.idl\";\n\n// Generated .IDL file (by the OLE/COM Object Viewer)\n//\n// typelib filename: licdll.dll\n\n[\n  uuid"
  },
  {
    "path": "include/nsis/api.h",
    "chars": 3245,
    "preview": "/*\n * apih\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2023 Nullsoft and Contributors\n * \n * Licensed "
  },
  {
    "path": "include/nsis/nsis_tchar.h",
    "chars": 4825,
    "preview": "/*\n * nsis_tchar.h\n * \n * This file is a part of NSIS.\n * \n * Copyright (C) 1999-2023 Nullsoft and Contributors\n * \n * T"
  },
  {
    "path": "include/nsis/pluginapi.c",
    "chars": 6894,
    "preview": "#include <windows.h>\n#include \"pluginapi.h\"\n\n#ifndef COUNTOF\n#define COUNTOF(a) (sizeof(a)/sizeof(a[0]))\n#endif\n\n// mini"
  },
  {
    "path": "include/nsis/pluginapi.h",
    "chars": 3048,
    "preview": "#ifndef ___NSIS_PLUGIN__H___\n#define ___NSIS_PLUGIN__H___\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"api.h\"\n#inc"
  },
  {
    "path": "include/slpublic.h",
    "chars": 670,
    "preview": "#pragma once\n\n#include <windows.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef GUID SLID;\ntypedef PVOID HSLC;\n\nDEFI"
  },
  {
    "path": "include/wuapi.h",
    "chars": 670699,
    "preview": "\n\n/* this ALWAYS GENERATED file contains the definitions for the interfaces */\n\n\n /* File created by MIDL compiler versi"
  },
  {
    "path": "include/wuerror.h",
    "chars": 65439,
    "preview": "/***************************************************************************\n*                                          "
  },
  {
    "path": "launcher/CplTasks.xml",
    "chars": 823,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<applications xmlns=\"http://schemas.microsoft.com/windows/cpltasks/v1\" xmlns:sh=\""
  },
  {
    "path": "launcher/InitRunOnce.c",
    "chars": 12317,
    "preview": "#include <windows.h>\n#include <commctrl.h>\n#include \"HResult.h\"\n#include \"LoadImage.h\"\n#include \"MsgBox.h\"\n#include \"Reg"
  },
  {
    "path": "launcher/LaunchLog.c",
    "chars": 863,
    "preview": "#include \"MsgBox.h\"\n#include \"ViewLog.h\"\n\n// Matches LogAction enum in ViewLog.h\nstatic const LPCWSTR logActions[][4] = "
  },
  {
    "path": "launcher/LaunchUpdateSite.c",
    "chars": 8406,
    "preview": "#include \"stdafx.h\"\n#include \"main.h\"\n#include \"resource.h\"\n#include <exdisp.h>\n#include \"Exec.h\"\n#include \"HResult.h\"\n#"
  },
  {
    "path": "launcher/Makefile",
    "chars": 828,
    "preview": "FILES    = \\\n\t$(wildcard *.c) \\\n\t../shared/Exec.c \\\n\t../shared/HResult.c \\\n\t../shared/LegacyUpdate.c \\\n\t../shared/LoadIm"
  },
  {
    "path": "launcher/MsgBox.c",
    "chars": 2380,
    "preview": "#include \"stdafx.h\"\n#include \"main.h\"\n#include \"resource.h\"\n\n#undef _WIN32_WINNT\n#define _WIN32_WINNT _WIN32_WINNT_VISTA"
  },
  {
    "path": "launcher/MsgBox.h",
    "chars": 105,
    "preview": "#pragma once\n\n#include <windows.h>\n\nint MsgBox(HWND hwnd, LPCTSTR instruction, LPCTSTR body, UINT type);\n"
  },
  {
    "path": "launcher/Options.c",
    "chars": 1336,
    "preview": "#include <windows.h>\n#include \"Exec.h\"\n#include \"VersionInfo.h\"\n#include \"Wow64.h\"\n\nvoid LaunchOptions(int nCmdShow) {\n#"
  },
  {
    "path": "launcher/RegisterServer.c",
    "chars": 3977,
    "preview": "#include <windows.h>\n#include \"Exec.h\"\n#include \"HResult.h\"\n#include \"LegacyUpdate.h\"\n#include \"MsgBox.h\"\n#include \"Regi"
  },
  {
    "path": "launcher/RegisterServer.h",
    "chars": 99,
    "preview": "#pragma once\n\n#include <windows.h>\n\nHRESULT RegisterServer(HWND hwnd, BOOL state, BOOL forLaunch);\n"
  },
  {
    "path": "launcher/SelfElevate.c",
    "chars": 338,
    "preview": "#include \"SelfElevate.h\"\n#include <windows.h>\n#include \"Exec.h\"\n#include \"VersionInfo.h\"\n\nHRESULT SelfElevate(LPWSTR arg"
  },
  {
    "path": "launcher/SelfElevate.h",
    "chars": 84,
    "preview": "#pragma once\n\n#include <windows.h>\n\nHRESULT SelfElevate(LPWSTR args, LPDWORD code);\n"
  },
  {
    "path": "launcher/main.c",
    "chars": 3065,
    "preview": "#include \"stdafx.h\"\n#include \"main.h\"\n#include \"resource.h\"\n#include <windows.h>\n#include <combaseapi.h>\n#include <commc"
  },
  {
    "path": "launcher/main.h",
    "chars": 32,
    "preview": "EXTERN_C HINSTANCE g_hInstance;\n"
  },
  {
    "path": "launcher/manifest.xml",
    "chars": 1435,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n\t<depen"
  },
  {
    "path": "launcher/resource.h",
    "chars": 637,
    "preview": "#define IDI_APPICON                     100\n\n#define IDR_CPLTASKS                    202\n\n#define IDS_LEGACYUPDATEOCX   "
  },
  {
    "path": "launcher/resource.rc",
    "chars": 3533,
    "preview": "#include \"resource.h\"\n#include <windows.h>\n#include \"Version.h\"\n\n///////////////////////////////////////////////////////"
  },
  {
    "path": "launcher/stdafx.h",
    "chars": 342,
    "preview": "#pragma once\n\n#ifndef STRICT\n#define STRICT\n#endif\n\n#define WINVER       _WIN32_WINNT_WIN2K\n#define _WIN32_WINNT _WIN32_"
  },
  {
    "path": "nsisplugin/CloseIEWindows.c",
    "chars": 3620,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include <exdisp.h>\n#include <tlhelp32.h>\n\nconst LPWSTR LegacyUpdateSit"
  },
  {
    "path": "nsisplugin/DialogInit.c",
    "chars": 14292,
    "preview": "#include \"stdafx.h\"\n\n#undef _WIN32_WINNT\n#define _WIN32_WINNT _WIN32_WINNT_VISTA\n\n#include <windows.h>\n#include <nsis/pl"
  },
  {
    "path": "nsisplugin/EnableMicrosoftUpdate.c",
    "chars": 1276,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include <wuapi.h>\n#include \"main.h\"\n\nstatic const LPWSTR MicrosoftUpda"
  },
  {
    "path": "nsisplugin/Exec.c",
    "chars": 19884,
    "preview": "/*\nCopyright (C) 2002 Robert Rainwater <rrainwater@yahoo.com>\nCopyright (C) 2002-2023 Nullsoft and Contributors\n\nThis so"
  },
  {
    "path": "nsisplugin/IsActivated.c",
    "chars": 3334,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"main.h\"\n#include \"VersionInfo.h\"\n#include \"Wow64.h\"\n#include "
  },
  {
    "path": "nsisplugin/IsAdmin.c",
    "chars": 137,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"User.h\"\n\nPLUGIN_METHOD(IsAdmin) {\n\tPLUGIN_INIT();\n\n\tpushint(I"
  },
  {
    "path": "nsisplugin/IsMultiCPU.c",
    "chars": 230,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"User.h\"\n\nPLUGIN_METHOD(IsMultiCPU) {\n\tPLUGIN_INIT();\n\n\tSYSTEM"
  },
  {
    "path": "nsisplugin/IsServerCore.c",
    "chars": 1669,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"ProductInfo.h\"\n#include \"Registry.h\"\n#include \"VersionInfo.h\""
  },
  {
    "path": "nsisplugin/Makefile",
    "chars": 666,
    "preview": "FILES    = \\\n\t$(wildcard *.c) \\\n\t../shared/HResult.c \\\n\t../shared/LegacyUpdate.c \\\n\t../shared/LoadImage.c \\\n\t../shared/L"
  },
  {
    "path": "nsisplugin/MessageForHresult.c",
    "chars": 308,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"../shared/HResult.h\"\n\nPLUGIN_METHOD(MessageForHresult) {\n\tPLU"
  },
  {
    "path": "nsisplugin/NeedsRootsUpdate.c",
    "chars": 1582,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"Registry.h\"\n#include \"VersionInfo.h\"\n\n#define ROOTS_UPDATE_TH"
  },
  {
    "path": "nsisplugin/RebootPage.c",
    "chars": 5262,
    "preview": "#include <windows.h>\n#include <commctrl.h>\n#include <nsis/pluginapi.h>\n#include \"main.h\"\n#include \"resource.h\"\n#include "
  },
  {
    "path": "nsisplugin/TaskbarProgress.c",
    "chars": 3801,
    "preview": "// Based on https://nsis.sourceforge.io/TaskbarProgress_plug-in - zlib licensed\n// Cleaned up and refactored into C by L"
  },
  {
    "path": "nsisplugin/UpdateRoots.c",
    "chars": 1820,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include <wincrypt.h>\n#include \"HResult.h\"\n\nPLUGIN_METHOD(UpdateRoots) "
  },
  {
    "path": "nsisplugin/VerifyFileHash.c",
    "chars": 2262,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"sha256.h\"\n\nstatic BOOL hexToBinary(const char *hex, uint8_t *"
  },
  {
    "path": "nsisplugin/WriteLog.c",
    "chars": 1055,
    "preview": "#include \"stdafx.h\"\n#include <nsis/pluginapi.h>\n#include <commctrl.h>\n#include \"Log.h\"\n\nstatic HWND g_hwndLogList = 0;\ns"
  },
  {
    "path": "nsisplugin/main.c",
    "chars": 470,
    "preview": "#include <windows.h>\n#include <nsis/pluginapi.h>\n#include \"Startup.h\"\n#include \"Log.h\"\n\nHINSTANCE g_hInstance;\nHWND g_hw"
  },
  {
    "path": "nsisplugin/main.h",
    "chars": 82,
    "preview": "#include <windows.h>\n\nEXTERN_C HINSTANCE g_hInstance;\nEXTERN_C HWND g_hwndParent;\n"
  },
  {
    "path": "nsisplugin/resource.h",
    "chars": 207,
    "preview": "#define IDC_CHILDRECT       1018\n\n// Reboot\n#define IDD_REBOOT          120\n#define IDI_ICON2           103\n#define IDC_"
  },
  {
    "path": "nsisplugin/resource.rc",
    "chars": 2097,
    "preview": "#include \"resource.h\"\n#include <windows.h>\n#include \"Version.h\"\n\n#define INNER_WIDTH         317\n#define INNER_HEIGHT   "
  },
  {
    "path": "nsisplugin/sha256.c",
    "chars": 7639,
    "preview": "// From https://github.com/amosnier/sha-2\n// Licensed under 0BSD https://github.com/amosnier/sha-2/blob/565f650/LICENSE."
  },
  {
    "path": "nsisplugin/sha256.h",
    "chars": 4436,
    "preview": "// From https://github.com/amosnier/sha-2\n// Licensed under 0BSD https://github.com/amosnier/sha-2/blob/565f650/LICENSE."
  },
  {
    "path": "nsisplugin/stdafx.h",
    "chars": 766,
    "preview": "#pragma once\n\n#ifndef STRICT\n#define STRICT\n#endif\n\n#define WINVER       _WIN32_WINNT_NT4\n#define _WIN32_WINNT _WIN32_WI"
  },
  {
    "path": "setup/ActiveX.inf",
    "chars": 114,
    "preview": "[Version]\nSignature=\"$CHICAGO$\"\nAdvancedINF=2.0\n\n[Setup Hooks]\nsetup=setup\n\n[setup]\nrun=\"%EXTRACT_DIR%\\setup.exe\"\n"
  },
  {
    "path": "setup/ActiveXPage.nsh",
    "chars": 2304,
    "preview": "Var Dialog\nVar Dialog.Y\n\nFunction ActiveXPage\n\t; Skip in runonce\n\t${If} ${IsRunOnce}\n\t${OrIf} ${IsPostInstall}\n\t\tAbort\n\t"
  },
  {
    "path": "setup/AeroWizard.nsh",
    "chars": 2678,
    "preview": "!macro SetFont font parent control\n\tGetDlgItem $0 ${parent} ${control}\n\tSendMessage $0 ${WM_SETFONT} ${font} 0\n!macroend"
  },
  {
    "path": "setup/Common.nsh",
    "chars": 8484,
    "preview": "!addplugindir /x86-unicode x86-unicode\n\nSetPluginUnload alwaysoff\n\n!if ${DEBUG} == 0\n\t!packhdr        upx.tmp 'upx --lzm"
  },
  {
    "path": "setup/Constants.nsh",
    "chars": 4634,
    "preview": "; Product\n!define NAME               \"Legacy Update\"\n!define DOMAIN             \"legacyupdate.net\"\n\n; NSIS target\n!ifdef"
  },
  {
    "path": "setup/Download2KXP.nsh",
    "chars": 1206,
    "preview": "!insertmacro NeedsSPHandler \"W2KSP4\"  \"Win2000\"   3\n!insertmacro NeedsSPHandler \"XPSP1a\"  \"WinXP2002\" 0\n!insertmacro Nee"
  },
  {
    "path": "setup/DownloadIE.nsh",
    "chars": 1162,
    "preview": "!insertmacro NeedsFileVersionHandler \"IE6\" \"$WINDIR\\system32\\mshtml.dll\" \"6.0.2600.0\"\n\n!macro DownloadIE ver title\n\t${If"
  },
  {
    "path": "setup/DownloadNT4.nsh",
    "chars": 2383,
    "preview": "!macro TODO thing\n\tFunction Install${thing}\n\t\tDetailPrint \"TODO: ${thing}\"\n\tFunctionEnd\n!macroend\n\n!include \"NT4USB.nsh\""
  },
  {
    "path": "setup/DownloadVista78.nsh",
    "chars": 5729,
    "preview": "Function NeedsPackage\n\tPop $0\n\tClearErrors\n\tFindFirst $R0 $R1 \"$WINDIR\\servicing\\Packages\\$0~31bf3856ad364e35~*\"\n\tFindCl"
  },
  {
    "path": "setup/DownloadWUA.nsh",
    "chars": 1869,
    "preview": "Function DetermineWUAVersion\n\t; WUA refuses to install on 2000 Datacenter Server. Maybe we can hack around this in futur"
  },
  {
    "path": "setup/Makefile",
    "chars": 1037,
    "preview": "DEBUG ?= 1\nSIGN ?= 0\nCI ?= 0\n\nMAKENSIS = makensis\nNSISFLAGS = -DDEBUG=$(DEBUG) -DSIGN=$(SIGN) -DCI=$(CI)\n\nFILES   = reso"
  },
  {
    "path": "setup/NT4USB.nsh",
    "chars": 2796,
    "preview": "; TODO: Check whether machine will support the USB stack, via LegacyUpdateNSIS::IsMultiCPU\n\nFunction InstallNT4USB\n\tCall"
  },
  {
    "path": "setup/PatchInstall.nsh",
    "chars": 10646,
    "preview": "Function GetArch\n\tVar /GLOBAL Arch\n\t${If} $Arch == \"\"\n\t\t${If} ${IsNativeIA32}\n\t\t\tStrCpy $Arch \"x86\"\n\t\t${ElseIf} ${IsNati"
  },
  {
    "path": "setup/Patches.ini",
    "chars": 44999,
    "preview": "[Language]\n0401=ARA\n0403=CAT\n0404=CHT\n0804=CHS\n0405=CSY\n0406=DAN\n0407=DEU\n0408=ELL\n0409=ENU\n0c0a=ESN\n0425=ETI\n040b=FIN\n0"
  },
  {
    "path": "setup/PatchesNT4.ini",
    "chars": 2244,
    "preview": "[Language]\n0401=ARA\n0403=CAT\n0404=CHT\n0804=CHS\n0405=CSY\n0406=DAN\n0407=DEU\n0408=ELL\n0409=ENU\n0c0a=ESN\n0425=ETI\n040b=FIN\n0"
  },
  {
    "path": "setup/RebootPage.nsh",
    "chars": 764,
    "preview": "Function RebootPage\n\t; Only show if reboot needed\n\t${IfNot} ${RebootFlag}\n\t\tAbort\n\t${EndIf}\n\n\t; Not needed in runonce\n\t$"
  },
  {
    "path": "setup/RunOnce.nsh",
    "chars": 7627,
    "preview": "Function IsAuditMode\n\t; 2k/XP\n\tReadRegDword $0 HKLM \"${REGPATH_SETUP}\" \"AuditInProgress\"\n\t${If} $0 == 1\n\t\tPush 1\n\t${Else"
  },
  {
    "path": "setup/Strings.nsh",
    "chars": 20396,
    "preview": "!insertmacro MUI_LANGUAGE \"English\"\n\n; Dialog\nMiscButtonText \"Back\" \"Next\" \"Cancel\" \"Close\"\n\n; Log\nLangString ^ExecShell"
  },
  {
    "path": "setup/UpdateRoots.nsh",
    "chars": 4155,
    "preview": "!macro -SetSecureProtocolsBitmask root path key\n\tReadRegDword $0 ${root} \"${path}\" \"${key}\"\n\t${VerbosePrint} \"${root}\\${"
  },
  {
    "path": "setup/Win32.nsh",
    "chars": 2502,
    "preview": "; advapi32\n!define GetUserName              'advapi32::GetUserName(t, *i) i'\n\n; cbscore\n!define CBS_EXECUTE_STATE_NONE  "
  },
  {
    "path": "setup/WinVer.nsh",
    "chars": 7587,
    "preview": "; NSIS WinVer.nsh rewritten to work more like what I expect.\n\n!include LogicLib.nsh\n!include Util.nsh\n\n; Defines\n\n!defin"
  },
  {
    "path": "setup/codebase/lucontrl.ddf",
    "chars": 584,
    "preview": ".Set CabinetNameTemplate=lucontrl.cab\n.Set CompressionType=MSZIP\n.Set CompressionLevel=7\n.Set InfFileName=lucontrl_layou"
  },
  {
    "path": "setup/codebase/setup.inf",
    "chars": 123,
    "preview": "[Version]\nSignature=\"$CHICAGO$\"\nAdvancedINF=2.0\n\n[Setup Hooks]\nsetup=setup\n\n[setup]\nrun=\"%EXTRACT_DIR%\\setup.exe\" /activ"
  },
  {
    "path": "setup/codebase/test.html",
    "chars": 123,
    "preview": "<object classid=\"CLSID:AD28E0DF-5F5A-40B5-9432-85EFD97D1F9F\" codebase=\"/lucontrl.cab#version=1,9,0,0\" viewastext></objec"
  },
  {
    "path": "setup/patches/.gitignore",
    "chars": 60,
    "preview": "# Only commit redists\n**/*\n!.gitignore\n!redist\n!redist/**/*\n"
  },
  {
    "path": "setup/resource.c",
    "chars": 18,
    "preview": "void DllMain() {}\n"
  },
  {
    "path": "setup/resource.h",
    "chars": 1207,
    "preview": "// Root dialog\n#define IDD_INST            105\n#define IDC_BACK            3\n#define IDC_CHILDRECT       1018\n#define ID"
  },
  {
    "path": "setup/resource.rc",
    "chars": 5876,
    "preview": "#include \"resource.h\"\n#include <windows.h>\n#include <richedit.h>\n\n#define OUTER_WIDTH         363\n#define OUTER_HEIGHT  "
  },
  {
    "path": "setup/setup-nt4.nsi",
    "chars": 7785,
    "preview": "!include Constants.nsh\n\nName         \"${NAME}\"\nCaption      \"${NAME}\"\nBrandingText \"${NAME} ${VERSION} - ${DOMAIN}\"\nOutF"
  },
  {
    "path": "setup/setup.nsi",
    "chars": 32454,
    "preview": "!include Constants.nsh\n\nName         \"${NAME}\"\nCaption      \"${NAME}\"\nBrandingText \"${NAME} ${VERSION} - ${DOMAIN}\"\nOutF"
  },
  {
    "path": "setup/stdafx.h",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "shared/Exec.c",
    "chars": 1143,
    "preview": "#include \"stdafx.h\"\n#include \"Exec.h\"\n\nHRESULT Exec(LPCWSTR verb, LPCWSTR file, LPCWSTR params, LPCWSTR workingDir, int "
  },
  {
    "path": "shared/Exec.h",
    "chars": 267,
    "preview": "#pragma once\n\n#include <windows.h>\n#include <shellapi.h>\n\nEXTERN_C HRESULT Exec(LPCWSTR verb, LPCWSTR file, LPCWSTR para"
  },
  {
    "path": "shared/HResult.c",
    "chars": 1584,
    "preview": "#include \"stdafx.h\"\n#include <windows.h>\n#include \"HResult.h\"\n#include \"LegacyUpdate.h\"\n#include \"VersionInfo.h\"\n\nstatic"
  },
  {
    "path": "shared/HResult.h",
    "chars": 86,
    "preview": "#pragma once\n\n#include <windows.h>\n\nEXTERN_C LPWSTR GetMessageForHresult(HRESULT hr);\n"
  },
  {
    "path": "shared/LegacyUpdate.c",
    "chars": 908,
    "preview": "#include \"stdafx.h\"\n#include <windows.h>\n#include \"Registry.h\"\n\nstatic LPWSTR _installPath;\n\nEXTERN_C HRESULT GetInstall"
  },
  {
    "path": "shared/LegacyUpdate.h",
    "chars": 83,
    "preview": "#pragma once\n\n#include <windows.h>\n\nEXTERN_C HRESULT GetInstallPath(LPWSTR *path);\n"
  },
  {
    "path": "shared/LoadImage.c",
    "chars": 9051,
    "preview": "#include <windows.h>\n#include <wincodec.h>\n#include <gdiplus.h>\n\n// Adapted from https://faithlife.codes/blog/2008/09/di"
  },
  {
    "path": "shared/LoadImage.h",
    "chars": 255,
    "preview": "#pragma once\n\n#include <windows.h>\n\nHBITMAP LoadPNGResource(HINSTANCE hInstance, LPCWSTR resourceName, LPCWSTR resourceT"
  },
  {
    "path": "shared/Log.c",
    "chars": 4300,
    "preview": "#include \"stdafx.h\"\n#include \"Log.h\"\n#include \"Version.h\"\n#include \"VersionInfo.h\"\n#include \"User.h\"\n#include \"Wow64.h\"\n"
  },
  {
    "path": "shared/Log.h",
    "chars": 378,
    "preview": "#pragma once\n\n#include <windows.h>\n\n// Same as NSIS_MAX_STRLEN\n#define LOG_LINE_MAXLEN 4096\n\nEXTERN_C HRESULT OpenLog();"
  },
  {
    "path": "shared/ProductInfo.c",
    "chars": 710,
    "preview": "#include <windows.h>\n\ntypedef BOOL (WINAPI *_GetProductInfo)(DWORD, DWORD, DWORD, DWORD, PDWORD);\n\nstatic BOOL productIn"
  },
  {
    "path": "shared/ProductInfo.h",
    "chars": 189,
    "preview": "#pragma once\n\n#include <windows.h>\n\nBOOL GetVistaProductInfo(DWORD dwOSMajorVersion, DWORD dwOSMinorVersion, DWORD dwSpM"
  },
  {
    "path": "shared/Registry.c",
    "chars": 4367,
    "preview": "#include \"stdafx.h\"\n#include \"Registry.h\"\n#include \"VersionInfo.h\"\n#include <shlwapi.h>\n\nLPVOID DELETE_KEY   = (LPVOID)I"
  },
  {
    "path": "shared/Registry.h",
    "chars": 1986,
    "preview": "#pragma once\n\n#include <windows.h>\n\n#define REGPATH_SETUP              L\"System\\\\Setup\"\n\n#define REGPATH_CPL_DESKTOP    "
  },
  {
    "path": "shared/Startup.h",
    "chars": 1344,
    "preview": "#pragma once\n\n#include <windows.h>\n\ntypedef void (WINAPI *_SetDefaultDllDirectories)(DWORD DirectoryFlags);\ntypedef BOOL"
  },
  {
    "path": "shared/Trace.h",
    "chars": 690,
    "preview": "#pragma once\n\n#include \"Log.h\"\n\n#ifdef _DEBUG\n\t// Yeah, sue me lol\n\t#define TRACE(...) { \\\n\t\tLPWSTR __traceMsg = (LPWSTR"
  },
  {
    "path": "shared/User.h",
    "chars": 1509,
    "preview": "#pragma once\n\n#include <windows.h>\n\nstatic inline BOOL IsUserAdmin(void) {\n\tSID_IDENTIFIER_AUTHORITY authority = SECURIT"
  },
  {
    "path": "shared/Version.h",
    "chars": 76,
    "preview": "#pragma once\n\n#define VERSION        1,13,0,0\n#define VERSION_STRING \"1.13\"\n"
  },
  {
    "path": "shared/VersionInfo.h",
    "chars": 3682,
    "preview": "#pragma once\n\n#include <windows.h>\n#include \"stdafx.h\"\n\n// Windows 11 Copper (22H2). \"WIN10\" typo is from the original s"
  },
  {
    "path": "shared/ViewLog.c",
    "chars": 2725,
    "preview": "#include \"ViewLog.h\"\n\nHRESULT ViewLog(LogAction log, int nCmdShow, BOOL showErrors) {\n\tif (log < 0 || log > LogActionWin"
  },
  {
    "path": "shared/ViewLog.h",
    "chars": 347,
    "preview": "#pragma once\n\n#include \"stdafx.h\"\n#include <windows.h>\n#include <knownfolders.h>\n#include <shlobj.h>\n#include \"Exec.h\"\n#"
  },
  {
    "path": "shared/WMI.c",
    "chars": 2506,
    "preview": "#include \"stdafx.h\"\n#include \"WMI.h\"\n#include <wbemcli.h>\n\n#ifdef CINTERFACE\n\t#define our_CLSID_WbemLocator &CLSID_WbemL"
  },
  {
    "path": "shared/WMI.h",
    "chars": 140,
    "preview": "#pragma once\n\n#include <windows.h>\n#include <oaidl.h>\n\nEXTERN_C HRESULT QueryWMIProperty(LPCWSTR query, LPCWSTR property"
  },
  {
    "path": "shared/Wow64.c",
    "chars": 1559,
    "preview": "#include \"stdafx.h\"\n#include \"Wow64.h\"\n\n#if !_WIN64\n\ntypedef void (WINAPI *_GetNativeSystemInfo)(LPSYSTEM_INFO lpSystemI"
  },
  {
    "path": "shared/Wow64.h",
    "chars": 425,
    "preview": "#pragma once\n\n#include <windows.h>\n\n#if _WIN64\n\t#define OurGetNativeSystemInfo(lpSystemInfo) GetNativeSystemInfo(lpSyste"
  },
  {
    "path": "shared/stdafx.h",
    "chars": 64,
    "preview": "#define ALWAYS_INLINE inline __attribute__((__always_inline__))\n"
  }
]

About this extraction

This page contains the full source code of the kirb/LegacyUpdate GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 179 files (1.4 MB), approximately 419.4k tokens, and a symbol index with 719 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!