TdiBuildSend (
Irp,
DeviceObject,
WorkThreadCtx->fileobject,
NULL, // Completion routine
NULL, // Completion context
Mdl, // Data
0, // Flags
nMsgLen // Send Length
) ;
This is a windows macro used in my driver, On compiling in vs2019, this is giving me warning treated as error, C4127 - Conditional expression is constant
The fourth parameter expects PVOID and we're passing the null and on the expansion of this macro
if ( CompRoutine != NULL) { \
IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\
} else { \
IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \
}
NULL!=NULL causing this
Also
in MSDN
" * CompRoutine [in]
Specifies the entry point of a client-supplied IoCompletion routine or NULL. The I/O manager calls this routine when the given IRP is completed, unless the client sets this parameter to NULL. "
To fix this, one workaround can be to surpress the warning,
is their any other solution