Skip to content

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

@dthaler

Description

@dthaler

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions