microsoft / microsoft/wil

[Kernel] Some wil/resource.h features require Windows 10

Open
#216 0 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

When I compile my driver with wil/resource.h, I get error messages:

  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6490,15): error C2039: 'ExReleasePushLockExclusive': is not a member of '`global namespace'' [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6490,41): error C3861: 'ExReleasePushLockExclusive': identifier not found [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6497,15): error C2039: 'ExReleasePushLockShared': is not a member of '`global namespace'' [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6497,38): error C3861: 'ExReleasePushLockShared': identifier not found [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6514,11): error C2039: 'ExAcquirePushLockExclusive': is not a member of '`global namespace'' [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\vcpkg_installed\x64-windows-static\include\wil\resource.h(6514,37): error C3861: 'ExAcquirePushLockExclusive': identifier not found [F:\Projects\IRM\src\IRM\IRM.vcxproj]
  ...\IRM\vcpkg_installed\x64-windows-static\include\wil\resource.h(6524,11): error C2039: 'ExAcquirePushLockShared': is not a member of '`global namespace'' [F:\Projects\IRM\src\IRM\IRM.vcxproj]

My driver is compiled with the following (relevant) options: /D _WIN32_WINNT=0x0601 /D WINVER=0x0601 /D WINNT=1 /D NTDDI_VERSION=0x06010000 which means that I target Windows 7 and those APIs (ExReleasePushLockExclusive, ExReleasePushLockShared) are Windows 10 only.

It is my impression that these code portions should have been guarded to prevent these APIs' use when targeting Windows 7.

Thank you for WIL!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect wil/resource.h around lines 6490-6524, focusing on the ExAcquirePushLock* and ExReleasePushLock* calls. Reproduce the build with the Windows 7 target definitions from the report, then verify those APIs are not used for that target and the driver compiles successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.