In gnupg/sm, there are places where we use FD and then es_fdopen_nc. To match the internal API, in server.c, we use translate_sys2libc_fd to get FD.
On Windows, it means that the HANDLE is translated to FD and then is composed into the estream. Strictly speaking, the resource for FD is leaked.
We can compose the estream by HANDLE, that's the way to go.