Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c39ab11
Upgrade to Visual Studio 2026 (v145 toolset)
stephenegriffin Feb 6, 2026
397ed25
ensure config
stephenegriffin Feb 6, 2026
7a8ec30
install sdk
stephenegriffin Feb 6, 2026
f8efc98
update codeql
stephenegriffin Feb 6, 2026
2405bc0
add arm builds
stephenegriffin Feb 6, 2026
f90d65c
Merge branch 'main' into u/sgriffin/vc2026
stephenegriffin Feb 9, 2026
8e457ff
update ci for arm
stephenegriffin Feb 9, 2026
8c7b20d
Remove Prefast configurations from mapistub
stephenegriffin Feb 17, 2026
bba20d7
replace broken clang action
stephenegriffin Feb 17, 2026
14f70be
update clang action
stephenegriffin Feb 17, 2026
0f6a5a4
Update .github/workflows/codeql.yml
stephenegriffin Feb 17, 2026
a0109fb
Update .github/workflows/codeql.yml
stephenegriffin Feb 17, 2026
4186348
Update mapistub.sln
stephenegriffin Feb 17, 2026
eda8175
Update .github/workflows/github-ci.yml
stephenegriffin Feb 17, 2026
3c74dae
fix sdk installer
stephenegriffin Feb 17, 2026
096a611
better handling of sdk dependency
stephenegriffin Feb 18, 2026
8862bc8
alternate attempt at sdk
stephenegriffin Feb 18, 2026
8746341
better hash
stephenegriffin Feb 18, 2026
d7186a2
clean up project
stephenegriffin Feb 18, 2026
b41fde2
add arm builds
stephenegriffin Feb 18, 2026
a5125bb
fix args
stephenegriffin Feb 18, 2026
9700f1f
merge with main
stephenegriffin Feb 24, 2026
2b40870
Update .github/workflows/github-ci.yml
stephenegriffin Feb 27, 2026
5154baa
mapistub: harden msbuild scripts, fix CodeQL SDK failure handling, an…
stephenegriffin Feb 27, 2026
de2788f
mapistub: dedupe SDK install in workflows and harden CI build/clean s…
stephenegriffin Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/clang.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,22 @@ jobs:
egress-policy: audit

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0
with:
clang-format-version: '17'
exclude-regex: 'include/*'
fallback-style: 'Microsoft'

- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-17

- name: Run clang-format style check
run: |
# Find all C/C++ files, excluding include directory
files=$(find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.c" \) \
! -path "./include/*" ! -path "./.git/*" | sort)

if [ -z "$files" ]; then
echo "No C/C++ files found"
exit 0
fi

# Check formatting (--dry-run -Werror exits non-zero if changes needed)
echo "$files" | xargs clang-format-17 --verbose --dry-run -Werror --style=file --fallback-style=Microsoft
14 changes: 10 additions & 4 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ permissions:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: windows-latest
# Use VS 2026 preview runner (GA May 4, 2026, then switch to windows-2025)
runs-on: windows-2025-vs2026
permissions:
packages: read
actions: read
Expand All @@ -39,9 +40,14 @@ jobs:
with:
submodules: 'recursive'

- name: Install Windows 11 SDK (10.0.22621.0)
shell: pwsh
run: |
& "${{ github.workspace }}\scripts\install-winsdk.ps1"

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
uses: github/codeql-action/init@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
Expand All @@ -53,11 +59,11 @@ jobs:
# queries: security-extended,security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
uses: github/codeql-action/autobuild@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2

- name: Perform CodeQL Analysis
id: analyze
uses: github/codeql-action/analyze@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
uses: github/codeql-action/analyze@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2
with:
category: "/language:${{matrix.language}}"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/devskim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
uses: microsoft/DevSkim-Action@4b5047945a44163b94642a1cecc0d93a3f428cc6 # v1.0.16

- name: Upload DevSkim scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
uses: github/codeql-action/upload-sarif@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2
with:
sarif_file: devskim-results.sarif

- name: Upload DevSkim scan results as an artifact
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
path: devskim-results.sarif
path: devskim-results.sarif
28 changes: 23 additions & 5 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@ permissions:

jobs:
build:
runs-on: windows-latest
# Use VS 2026 preview runner (GA May 4, 2026, then switch to windows-2025)
runs-on: windows-2025-vs2026
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
configuration: [ 'Release', 'Debug', 'Release_Unicode', 'Debug_Unicode' ]
platform: [ 'Win32', 'x64' ]
platform: [ 'Win32', 'x64', 'ARM64', 'ARM64EC' ]
exclude:
# ARM64/ARM64EC only need Unicode builds
- platform: ARM64
configuration: Release
- platform: ARM64
configuration: Debug
- platform: ARM64EC
configuration: Release
- platform: ARM64EC
configuration: Debug

steps:
- name: Harden Runner
Expand All @@ -32,11 +44,17 @@ jobs:
with:
submodules: 'recursive'

- name: Install Windows 11 SDK (10.0.22621.0)
shell: pwsh
run: |
& "${{ github.workspace }}\scripts\install-winsdk.ps1"

- name: "Build"
shell: pwsh
run: |
$path = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
& $path\MSBuild\Current\Bin\amd64\msbuild.exe /m /p:Configuration="${{matrix.configuration}}" /p:Platform="${{matrix.platform}}" mapistub.sln
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin\amd64\msbuild.exe"
Comment on lines +55 to +56
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build step uses vswhere.exe without -requires Microsoft.Component.MSBuild and doesn’t validate that the computed MSBuild path exists. Adding the -requires filter (and a simple Test-Path check with a clear error) would make CI failures more diagnosable if the runner image changes.

Suggested change
$vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath
$msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin\amd64\msbuild.exe"
$vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
if (-not (Test-Path $vswherePath)) {
Write-Error "vswhere.exe not found at expected path: $vswherePath"
exit 1
}
$vsPath = & $vswherePath -latest -requires Microsoft.Component.MSBuild -property installationPath
$msbuildPath = Join-Path $vsPath "MSBuild\Current\Bin\amd64\msbuild.exe"
if (-not (Test-Path $msbuildPath)) {
Write-Error "MSBuild not found at expected path: $msbuildPath (Visual Studio installation path: $vsPath)"
exit 1
}

Copilot uses AI. Check for mistakes.
& $msbuildPath /m /p:Configuration="${{matrix.configuration}}" /p:Platform="${{matrix.platform}}" mapistub.sln

publish-test-results:
name: "Publish Tests Results"
Expand All @@ -63,4 +81,4 @@ jobs:
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@c950f6fb443cb5af20a377fd0dfaa78838901040 # v2.23.0
with:
files: "artifacts/**/*.trx"
files: "artifacts/**/*.trx"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@89a39a4e59826350b863aa6b6252a07ad50cf83e # v3.29.5
uses: github/codeql-action/upload-sarif@b5ebac6f4c00c8ccddb7cdcd45fdb248329f808a # v3.32.2
with:
sarif_file: results.sarif
2 changes: 1 addition & 1 deletion .vsconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
"Microsoft.VisualStudio.Component.VC.Tools.ARM64EC",
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
"Microsoft.VisualStudio.Component.Windows11SDK.22621",
"Microsoft.VisualStudio.ComponentGroup.ArchitectureTools.Native",
"Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core",
"Microsoft.VisualStudio.Workload.CoreEditor",
Expand Down
38 changes: 38 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<!-- VS 2026 Toolset -->
<PlatformToolset>v145</PlatformToolset>

<!-- Windows 11 SDK (pinned for reproducible builds) -->
<WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>

<!-- Security Features (PropertyGroup level) -->
<!-- Note: Spectre mitigated libs may not be available for ARM64/ARM64EC -->
<SpectreMitigation Condition="'$(Platform)' != 'ARM64' AND '$(Platform)' != 'ARM64EC'">Spectre</SpectreMitigation>
<SpectreMitigation Condition="'$(Platform)' == 'ARM64' OR '$(Platform)' == 'ARM64EC'">false</SpectreMitigation>
<ControlFlowGuard>Guard</ControlFlowGuard>
<GuardEHContMetadata>true</GuardEHContMetadata>
</PropertyGroup>

<!-- Compiler Settings - Quality & Security Baseline -->
<!-- CET (Control-flow Enforcement Technology) enabled by default, disabled for ARM64/ARM64EC below -->
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<TreatWarningAsError>true</TreatWarningAsError>
<SDLCheck>true</SDLCheck>
<LanguageStandard>stdcpplatest</LanguageStandard>
</ClCompile>
<Link>
<CETCompat>true</CETCompat>
</Link>
</ItemDefinitionGroup>

<!-- Disable CET for ARM64/ARM64EC (not supported) -->
<ItemDefinitionGroup Condition="'$(Platform)' == 'ARM64' OR '$(Platform)' == 'ARM64EC'">
<Link>
<CETCompat>false</CETCompat>
</Link>
</ItemDefinitionGroup>
</Project>
41 changes: 28 additions & 13 deletions docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ The project includes all necessary MAPI headers in the `include` directory, so n

You now have a file, `MAPIStubLibrary.lib`, which you can link in to your project.

## Building with Node.js/node-gyp
## Building with Node.js scripts

Alternatively, you can build using Node.js and node-gyp (this creates a static library):
The npm scripts now use MSBuild by default (and keep node-gyp scripts under `gyp:*`):

Comment on lines +40 to 41
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section switches the default Node.js build path to MSBuild, but it doesn’t explicitly call out the new prerequisites (VS Build Tools/Visual Studio with MSBuild + the pinned Windows SDK version). Please update the Node.js build instructions here to mention the required VS/MSBuild + Windows SDK (10.0.22621.0) so users don’t hit opaque build failures.

Suggested change
The npm scripts now use MSBuild by default (and keep node-gyp scripts under `gyp:*`):
The npm scripts now use MSBuild by default (and keep node-gyp scripts under `gyp:*`).
**Prerequisites (in addition to Node.js):**
- Visual Studio 2019 or later **or** Visual Studio Build Tools with MSBuild and the C++ toolset installed (for example, the "Desktop development with C++" workload).
- Windows 10 SDK **10.0.22621.0** installed (the MSBuild-based scripts are pinned to this SDK version).

Copilot uses AI. Check for mistakes.
1. **Install Node.js**: Make sure you have [Node.js](https://nodejs.org/) installed.

Expand All @@ -47,30 +47,45 @@ Alternatively, you can build using Node.js and node-gyp (this creates a static l
npm install
```

3. **Build**:
3. **Build with MSBuild**:

**Default build (matches your Node.js architecture):**
**Default build:**

```bash
npm run build
```

**Architecture-specific builds:**
**Common build variants:**

```bash
npm run build:x64 # 64-bit library
npm run build:x86 # 32-bit library
npm run build:arm64 # ARM64 library
npm run build:all # Build all architectures
npm run build:debug:x64 # default script target
npm run build:release:x64
npm run build:debug:x86
npm run build:release:x86
npm run build:debug:arm64
npm run build:release:arm64
npm run build:debug:arm64ec
npm run build:release:arm64ec
npm run build:all # x64 + x86 all variants
```

**Clean build artifacts:**
**Clean build outputs:**

```bash
npm run clean
```

The outputs will be in architecture-specific directories:
4. **(Optional) Build with node-gyp (legacy):**

```bash
npm run gyp:build
npm run gyp:build:x64
npm run gyp:build:x86
npm run gyp:build:arm64
npm run gyp:clean
```

MSBuild outputs go to Visual Studio configuration/platform output directories. node-gyp outputs are in architecture-specific directories:

- `build/lib/x64/MAPIStubLibrary.lib` - 64-bit library
- `build/lib/ia32/MAPIStubLibrary.lib` - 32-bit library
Expand All @@ -85,9 +100,9 @@ After building with Visual Studio, you'll find:
- `MAPIStubLibrary.lib` - The static library for linking
- Debug symbols (if building in Debug configuration)

### Node.js Build
### Node.js (node-gyp) Build

After building with node-gyp, you'll find:
After building with node-gyp (`gyp:*` scripts), you'll find:

- `MAPIStubLibrary.lib` - The static library for linking in `build/Release/`

Expand Down
17 changes: 2 additions & 15 deletions mapistub.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.779
# Visual Studio Version 18
VisualStudioVersion = 18.0.0.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mapistub", "mapistub.vcxproj", "{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}"
EndProject
Expand All @@ -15,10 +14,6 @@ Global
Debug|Win32 = Debug|Win32
Debug|ARM64 = Debug|ARM64
Debug|ARM64EC = Debug|ARM64EC
Prefast|x64 = Prefast|x64
Prefast|Win32 = Prefast|Win32
Prefast|ARM64 = Prefast|ARM64
Prefast|ARM64EC = Prefast|ARM64EC
Release_Unicode|x64 = Release_Unicode|x64
Release_Unicode|Win32 = Release_Unicode|Win32
Release_Unicode|ARM64 = Release_Unicode|ARM64
Expand All @@ -45,14 +40,6 @@ Global
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Debug|ARM64.Build.0 = Debug|ARM64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Debug|ARM64EC.ActiveCfg = Debug|ARM64EC
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Debug|ARM64EC.Build.0 = Debug|ARM64EC
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|x64.ActiveCfg = Prefast|x64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|x64.Build.0 = Prefast|x64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|Win32.ActiveCfg = Prefast|Win32
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|Win32.Build.0 = Prefast|Win32
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|ARM64.ActiveCfg = Prefast|ARM64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|ARM64.Build.0 = Prefast|ARM64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|ARM64EC.ActiveCfg = Prefast|ARM64EC
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Prefast|ARM64EC.Build.0 = Prefast|ARM64EC
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Release_Unicode|x64.ActiveCfg = Release_Unicode|x64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Release_Unicode|x64.Build.0 = Release_Unicode|x64
{ACD4DD9F-0FB8-42C8-BC1C-25A5A29CB40C}.Release_Unicode|Win32.ActiveCfg = Release_Unicode|Win32
Expand Down
Loading
Loading