How make FILE* from HANDLE in WinApi?

前端 未结 3 2082
别跟我提以往
别跟我提以往 2020-12-01 09:31

Is there easy way to create FILE* from WinApi HANDLE which points to one end of pipe? Something like we do in unix: fdopen(fd,);

3条回答
  •  攒了一身酷
    2020-12-01 10:18

    You can do this but you have to do it in two steps. First, call _open_osfhandle() to get a C run-time file descriptor from a Win32 HANDLE value, then call _fdopen() to get a FILE* object from the file descriptor.

提交回复
热议问题