You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I could only successfully creating STD handles as pipe when running on mintty with Cygwin 3. However, even with this setup the GetFileInformationByHandleEx function succeeded properly. The most plausible answer for the API call to return invalid function error is the underlying driver doesn't handle the IRP sent to it or it simply fail for some other reason which cause the invalid function error to be returned. Assuming this is correct, the possible scenarios could be where custom drivers would be used which involves containers, some sort of virtualization, network drives or specialized hardware. It seems the Gradle errors is flaky which makes it harder to narrow the issue further.
A better alternative could be to use NtQueryObject API instead. I can't confirmed yet if the API goes through the driver. The feeling is it's a Kernel call that return information from the object store.
The text was updated successfully, but these errors were encountered:
This answer seems to be quite comprehensive on the difference of both NtQueryObject and GetFileInformationByHandleEx. I also quickly went through the Object Manager explanation in the Windows Internal book and it seems like my feeling was correct. The header of the object should contains the name and should be owned by the Kernel so no IRP to the underlying driver hence no ERROR_INVALID_FUNCTION should be returned.
This Gradle issue expose an interesting system configuration which cause
GetFileInformationByHandleEx
to fail withERROR_INVALID_FUNCTION
under a scenario where the STD handles are pipes on, what appears to be, very specific driver usage. Unfortunately, the reproduction case is still unknown but I will document what have been found.I could only successfully creating STD handles as pipe when running on mintty with Cygwin 3. However, even with this setup the
GetFileInformationByHandleEx
function succeeded properly. The most plausible answer for the API call to return invalid function error is the underlying driver doesn't handle the IRP sent to it or it simply fail for some other reason which cause the invalid function error to be returned. Assuming this is correct, the possible scenarios could be where custom drivers would be used which involves containers, some sort of virtualization, network drives or specialized hardware. It seems the Gradle errors is flaky which makes it harder to narrow the issue further.A better alternative could be to use
NtQueryObject
API instead. I can't confirmed yet if the API goes through the driver. The feeling is it's a Kernel call that return information from the object store.The text was updated successfully, but these errors were encountered: