cpp-windows-review

Identifies memory, threading, and Win32 API misuse in C++ Windows code.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Shah-Aayush/pr-reviewer --skill cpp-windows-review
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cpp-windows-review
Source: https://github.com/Shah-Aayush/pr-reviewer/tree/main/shared-skills/cpp-windows
Command: npx skills add https://github.com/Shah-Aayush/pr-reviewer --skill cpp-windows-review

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill identifies potential issues in C++ code targeting Windows, ensuring memory safety, threading, Win32 API misuse, COM lifetimes, ETW, named pipe security, and MSVC-specific pitfalls.

Core Features & Use Cases

  • Memory Safety: Flags issues with smart-pointer ownership, HANDLE lifetimes, use-after-move, and string lifetime crossing API boundaries.
  • Threading: Checks for mutex held across blocking I/O, lock ordering, shared state without synchronization, and thread lifecycle management.
  • Win32 API: Verifies return-value checks, Named pipe DACLs, impersonation token leaks, and GetLastError usage.
  • COM: Ensures HRESULT checks, AddRef/Release pairing, CoInitialize/CoUninitialize symmetry, and proper provider registration and GUID matching.
  • ETW: Validates provider registration unregistration, GUID mismatches, and event size limits.
  • Service Lifecycle: Checks for service stop hangs and start ordering.
  • MSVC-specific: Identifies issues with __cpuid, pointer truncation on ARM64, and warnings-as-errors interactions.
  • Use Case: When you want to ensure that your C++ code targeting Windows is free from common pitfalls and adheres to best practices.

Quick Start

Run the cpp-windows-review skill on your Windows C++ codebase.

Frequently Asked Questions about cpp-windows-review

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check my C++ Windows code for memory safety and threading issues?

To check C++ Windows code for memory safety and threading issues, you need a review process that identifies smart-pointer ownership errors, HANDLE lifetimes, use-after-move, and mutexes held across blocking I/O. This analysis requires examining source code for shared state without synchronization.

What common Win32 API misuse pitfalls should I look for in C++ code reviews?

Common Win32 API misuse pitfalls in C++ code reviews include unchecked return values, missing Named pipe DACLs, impersonation token leaks, and improper GetLastError usage. Identifying these issues ensures your Windows applications maintain security and reliability.

How do I validate COM lifetimes and HRESULT checks in my Windows C++ application?

To validate COM lifetimes and HRESULT checks in Windows C++ applications, verify that every HRESULT return value is checked, AddRef and Release calls are properly paired, and CoInitialize and CoUninitialize are symmetric. Proper provider registration and GUID matching must also be validated.

Does this code review process cover MSVC-specific issues like ARM64 pointer truncation?

Yes, this code review process covers MSVC-specific issues including ARM64 pointer truncation, __cpuid intrinsic usage, and warnings-as-errors interactions. Identifying these MSVC-specific pitfalls prevents architecture-specific failures in your C++ Windows builds.

What is the best way to detect ETW provider registration leaks in Windows C++ code?

The best way to detect ETW provider registration leaks is to validate that provider registration and unregistration are properly paired, check for GUID mismatches, and enforce event size limits. This prevents tracing infrastructure failures in C++ Windows applications.

Can I use this review to find service lifecycle hangs and start ordering problems?

Yes, you can use this review to find service lifecycle hangs and start ordering problems in C++ Windows code. It checks for blocking conditions during service stops and validates start sequencing to ensure reliable Windows service operation.