microsoft / microsoft/usersim

Including ntddk.h in user mode generates lots of compiler warnings

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
105
Forks
34
Avg merge
3d 39m
Merged PRs (30d)
5

Description

Update the README with how to deal with the following:

C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24384): warning C28301: No annotations for first declaration of 'POOL_FLAGS'. See c:\program files (x86)\windows kits\10\include\10.0.22621.0\km\wdm.h(17293). 
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24547): warning C28160: Error annotation: Must succeed pool allocations are forbidden. Allocation failures cause a system crash.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24538): warning C6387: 'return' could be '0'.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24615): warning C28160: Error annotation: Must succeed pool allocations are forbidden. Allocation failures cause a system crash.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24606): warning C6387: 'return' could be '0'.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24646): warning C6387: 'return' could be '0'.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24684): warning C28160: Error annotation: Must succeed pool allocations are forbidden. Allocation failures cause a system crash.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(24674): warning C6387: 'return' could be '0'.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(28457): warning C28252: Inconsistent annotation for 'MmGetSystemRoutineAddress': return/function has 'SAL_maxIRQL(0)' on the prior instance. See c:\program files (x86)\windows kits\10\include\10.0.22621.0\km\wdm.h(13307). 
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\wdm.h(28457): warning C28253: Inconsistent annotation for 'MmGetSystemRoutineAddress': return/function has 'SAL_maxIRQL(1)' on this instance. See c:\program files (x86)\windows kits\10\include\10.0.22621.0\km\wdm.h(13307). 
c:\program files (x86)\windows kits\10\include\10.0.22621.0\km\ntddk.h(22357): warning C28230: The type of '_Param_(1)' has no member 'RecordLength'.
c:\program files (x86)\windows kits\10\include\10.0.22621.0\km\ntddk.h(22357): warning C28285: For function 'WheaErrorRecordBuilderAddPacket' '_Param_(1)' syntax error in 'SAL_writableTo(byteCount(__formal(0,Record)->RecordLength))' near 'RecordLength))'.
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\ntstrsafe.h(6765): warning C28196: The requirement that '_Param_(1)->MaximumLength>0?_Param_(1)->Length>0?_Param_(1)->Buffer==_Param_(2)&&(_Param_(1)->Buffer==0||_Param_(1)->Buffer!=0):1:1' is not satisfied. (The expression does not evaluate to true.)
C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\km\ntstrsafe.h(6823): warning C28196: The requirement that '_Param_(1)->MaximumLength>0?_Param_(1)->Length>0?_Param_(1)->Buffer==_Param_(2)&&(_Param_(1)->Buffer==0||_Param_(1)->Buffer!=0):1:1' is not satisfied. (The expression does not evaluate to true.)

Probably need to create an ntddk.h wrapper to disable these while processing ntddk.h and its dependencies.

Contributor guide

Open the contributing guide

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

Start with the README and the reported Windows SDK ntddk.h, wdm.h, and ntstrsafe.h warnings. Determine how user-mode inclusion should suppress or avoid these warnings, including whether an ntddk.h wrapper is needed, then document the verified approach in the README.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation, operating-systems
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.