ok,problem solved with (HANDLE)_get_osfhandle(file.handle() );
api is on io.h