Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dthaler opened this issue Aug 10, 2023 · 0 comments
Open

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

dthaler opened this issue Aug 10, 2023 · 0 comments

Comments

@dthaler
Copy link
Contributor

dthaler commented Aug 10, 2023

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.

@dthaler dthaler added documentation Improvements or additions to documentation and removed documentation Improvements or additions to documentation labels Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant