in a WDF driver project I'm writing in Visual Studio 2013, I've got this function:
ZwWaitForSingleObject(hSemaphore, 0);
which gives the "too few arguments in function call" error, if I omit the last parameter, which is optional:
NTSTATUS ZwWaitForSingleObject(
_In_ HANDLE Handle,
_In_ BOOLEAN Alertable,
_In_opt_ PLARGE_INTEGER Timeout
);
The problem is, I have to omit it, I cannot just set it to NULL. Because, as MSDN says:
If a Timeout parameter is not specified, then the wait will not be satisfied until the object attains a state of Signaled. If an explicit Timeout value of zero is specified, then no wait will occur if the wait cannot be satisfied immediately.
So, the question is: have you got any idea on why Visual C++ forces me to type in the optional parameter on a system function call? How can it be avoided?