> It's good. I have found a solution on msdn. I have to
> duplicate the socket handler ;
>
> DuplicateHandle(GetCurrentProcess(),(HANDLE)ctrl,
> GetCurrentProcess(),(HANDLE*)&ctrl_dup,
> 0, TRUE, /* inherit socket */
> DUPLICATE_SAME_ACCESS);
>
> Then put ctrl_dup on cmd_line args for
> CreateProcess();
>
> This value is retrieved easily parsing new process
> args. The retrieved handle could correctly be used as
> a socket with BIO_new_socket() and so on.
>
> I hope this could help somebody oneday.

        It is an API violation to duplicate a socket via 'DuplicateHandle'. That
only duplicates the handle and could cause major problems by failing to
duplicate other structures associated with the socket but not the handle.
You should change your code immediately to use *socket* duplication
functions like 'WSADuplicateSocket'. Your code *will* break code that relies
upon such socket data structures.

        DS

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to