When starting gpg-agent on Windows you get hundredts (probably 256 ;-) )
warnings in DebugView about "Invalid Parameter passed to C runtime function"
I was curious about this and tracked it down to:
The Line: if (!(fstat (fd, &statbuf) == -1 && errno == EBADF))
Produces this and It's called in a loop for 256 FD's. Each time a warning is
produced. According to MSDN:
"A return value of –1 indicates an error. If the file descriptor is invalid or
buffer is NULL, the invalid parameter handler is invoked, as described in
The invalid parameter handler is afaik what produces this warning.
I don't know a way how to check if an fd is valid without triggering the invalid
parameter handler. get_osfilehandle also triggers the invalid parameter handler :-/
So no fix here from me but I wanted to note down where the message comes from.