Message 81093 - Python tracker (original) (raw)
As for checking CRT handles: it seems that __pioinfo is exported from msvcr90.dll. So we could check whether osfile has the FOPEN flag set, and we could check whether fh >= 0. Unfortunately, there seems to be no way to check for _nhandle. However, that might not be necessary: IIUC, we just need to check whether M=fh>>IOINFO_L2E is smaller than IOINFO_ARRAYS and __pioinfo[M] is not null.