How do I get the file HANDLE from the fopen FILE structure?
The fopen function returns a pointer to a FILE structure, which should be considered an opaque value, without dealing with its content or meaning. On Windows, the C runtime is a wrapper of the Windows API, and the fopen function relies on the CreateFile function. The CreateFile function returns a HANDLE , which is used by other Windows API. Now, I need to use Windows API deep inside of a library that uses fopen and FILE* . So: is there a way to get the HANDLE from the FILE structure? As this is compiler specific, I mean on the MSVC runtime library. I understand that this would be an ugly, non