httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: [PATCH] let ap_open() work on Win9x
Date Mon, 20 Mar 2000 14:20:40 GMT
Let me clarify - the global flag is internal to modules linked into
aprlib.dll - because we cannot maintain the binary compatibility of data
linkages from build to build, it needs to be exported as a function, if at
all.  But since _EVERY_ messy NT/95 detail is addressed in aprlib, this
isn't a problem (we trust).

> -----Original Message-----
> From: William A. Rowe, Jr. [mailto:wrowe@lnd.com]
> Sent: Sunday, March 19, 2000 9:02 PM
> To: new-httpd@apache.org; trawickj@bellsouth.net
> Subject: RE: [PATCH] let ap_open() work on Win9x
>
>
> I believe Ryan or Bill pointed out we need a global flag on
> this.  No excuse
> to add the function call overhead for a boolean flag.  It
> ought to be set on
> startup through the win32 flavor of process initialization.
>
> Bill
>
> > -----Original Message-----
> > From: Jeff Trawick [mailto:trawickj@bellsouth.net]
> > Sent: Sunday, March 19, 2000 8:11 PM
> > To: new-httpd@apache.org
> > Subject: [PATCH] let ap_open() work on Win9x
> >
> >
> > FILE_SHARE_DELETE is NT/Win2K only...
> >
> > follow-on issues...
> >
> > . define ap_get_oslevel() in a header file
> >   (lib/apr/include/apr_general.h?)
> >
> > . perhaps change ap_get_oslevel() so you can ask does this have NT
> >   functionality or not?  Win32's GetVersionEx() lets us ask
> the right
> >   question without getting into the details of which release; we
> >   don't want to end up with various code that has to be changed when
> >   Microsoft updates Win2K or Win98
> >
> > Index: lib/apr/file_io/win32/open.c
> > ===================================================================
> > RCS file: /cvs/apache/apache-2.0/src/lib/apr/file_io/win32/open.c,v
> > retrieving revision 1.22
> > diff -u -r1.22 open.c
> > --- open.c	2000/03/15 16:53:30	1.22
> > +++ open.c	2000/03/20 02:03:18
> > @@ -81,6 +81,8 @@
> >      DWORD oflags = 0;
> >      DWORD createflags = 0;
> >      DWORD attributes = 0;
> > +	DWORD sharemode = FILE_SHARE_READ | FILE_SHARE_WRITE;
> > +    ap_oslevel_e level;
> >
> >      (*dafile) = (struct file_t *)ap_palloc(cont,
> > sizeof(struct file_t));
> >
> > @@ -106,7 +108,11 @@
> >
> >      (*dafile)->demonfname =
> > canonical_filename((*dafile)->cntxt, fname);
> >      (*dafile)->lowerdemonfname = strlwr((*dafile)->demonfname);
> > -
> > +
> > +	if (ap_get_oslevel(cont, &level) == APR_SUCCESS &&
> > level == APR_WIN_NT) {
> > +		sharemode |= FILE_SHARE_DELETE;
> > +	}
> > +
> >      if (flag & APR_CREATE) {
> >          if (flag & APR_EXCL) {
> >              /* only create new if file does not already exist */
> > @@ -147,7 +153,7 @@
> >          attributes |= FILE_FLAG_DELETE_ON_CLOSE;
> >      }
> >
> > -    (*dafile)->filehand = CreateFile(fname, oflags,
> > FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
> > +    (*dafile)->filehand = CreateFile(fname, oflags, sharemode,
> >                                       NULL, createflags,
> > attributes, 0);
> >
> >      if ((*dafile)->filehand == INVALID_HANDLE_VALUE) {
> >
> > --
> > Jeff Trawick | trawick@ibm.net | PGP public key at web site:
> >      http://www.geocities.com/SiliconValley/Park/9289/
> >           Born in Roswell... married an alien...
> >
>


Mime
View raw message