httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: HANDLE from FILE on windows
Date Mon, 30 Dec 2002 18:57:19 GMT
First off... with Apache 2.0 all of these problems go away (we told you
there was a reason to upgrade :-)  The apr_os_file_get() fn will turn any
apr_file_t into a win32 handle, or a Unix fd, or whatnot on another platform.

IIRC, you are doing the 1.3 thing.  That reference is correct for turning
the fd into a HANDLE, but that isn't what you wanted.  The full syntax,
as demonstrated in apache-1.3/src/main/http_main.c(6719) is;

  FILE *file;
  HANDLE hFile;
  hFile = (HANDLE)_get_osfhandle(fileno(file));

Yes, the cast is needed because _get_osfhandle is defined to return a
long, iirc.  Best of luck.

Bill

At 12:33 PM 12/30/2002, David N. Welton wrote:

>I have a question - it's not directly related to apreq, but could
>potentially influence its API.
>
>In mod_dtcl, there is some Tcl code that, on windows, deals in
>HANDLE's, as (I guess - I'm a unix guy) that's the native windows
>thing.
>
>The problem is that apreq only gives us a FILE*, and we need a way to
>get a HANDLE from it.
>
>We found this on the microsoft site:
>
>http://support.microsoft.com/default.aspx?scid=kb;en-us;99173
>
>but it doesn't look all that great, as they suggest that actually
>using the results might not be a good idea.
>
>Any windows people out there with helpful suggestions?
>
>Thanks,
>-- 
>David N. Welton
>   Consulting: http://www.dedasys.com/
>     Personal: http://www.dedasys.com/davidw/
>Free Software: http://www.dedasys.com/freesoftware/
>   Apache Tcl: http://tcl.apache.org/



Mime
View raw message