Ingo Blank <
[hidden email]> wrote in message
news:3aee7d53$0$9334$
[hidden email]...
> Hi,
>
> I'm implementing an interface to a stream library written in C.
> This lib relies on the CRTLib <file descriptor> as returned by
> open or dup.
>
> Is it by any chance possible to obtain this "C"ish fd from a Win32 HANDLE
> (CreateFile) ?
>
This is a little outside of the area I normal work in Dolphin, but I wonder
if these methods might be of use (you may have already seen these, but I
thought it was worth mentioning):
in the CRTLibrary class
connectDescriptor: fdInteger toWinStdHandle: stdHandleInteger mode:
modeString
"Private - Connect the CRT FILE with the descriptor/index, fdInteger, to the
standard Win32 OS file
handle identified by the constant, stdHandleInteger. Answer the handle of
the CRT file stream.
This is necessary to correctly associate CRT stdin/stdout streams with the
correct OS file handles after
allocating a console in a GUI app. See MSDN article Q105305."
or
_open_osfhandle: osfhandle flags: flags
or
_dup: anInteger
"Duplicate a file handle
int_dup( int handle );"