Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25303 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62192 invoked by uid 1010); 10 Aug 2006 21:45:27 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 62168 invoked from network); 10 Aug 2006 21:45:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Aug 2006 21:45:27 -0000 X-PHP-List-Original-Sender: edink@emini.dk X-Host-Fingerprint: 192.38.9.232 gw2.emini.dk Linux 2.4/2.6 Received: from ([192.38.9.232:9115] helo=gw2.emini.dk) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 34/F8-04634-044ABD44 for ; Thu, 10 Aug 2006 17:25:22 -0400 Received: by gw2.emini.dk (Postfix, from userid 504) id 75CAFBFB11; Thu, 10 Aug 2006 23:25:18 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on gw2.emini.dk X-Spam-Detected: no X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Level: Received: from [10.0.0.11] (gw1.emini.dk [212.242.124.121]) by gw2.emini.dk (Postfix) with ESMTP id 26A36BFB09; Thu, 10 Aug 2006 23:25:17 +0200 (CEST) Message-ID: <44DBA43C.7040200@emini.dk> Date: Thu, 10 Aug 2006 23:25:16 +0200 Organization: Emini A/S User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Rob Richards Cc: "internals@lists.php.net" References: <44DB9EEA.7030309@ctindustries.net> In-Reply-To: <44DB9EEA.7030309@ctindustries.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] libxml2/threading/win 2003 From: edink@emini.dk (Edin Kadribasic) Hi Rob, Since we're adding a DllMain function, shouldn't it be located in main/main.c. We might need to hook up other thread initialization stuff in there in the future. Edin Rob Richards wrote: > In order to resolve reported crashing on win 2003, I have had to change > the static libxml builds to use the flag LIBXML_STATIC_FOR_DLL. > > This now requires a DllMain to be added within any dll that is building > libxml2 in statically. > PHP 4.x - domxml (use php_domxml.c.diff.txt patch) > PHP 5.x/HEAD added within libxml.c (apply libxml.c.diff.txt to PHP 5 and > HEAD - was made against HEAD) > > This changes the threading a bit to work in the same manner as if > libxml2 were built and linked to as a shared lib. > > Along with these changes new libxml libraries are needed. > debug builds: > http://ctindustries.net/libxml/libxml2-2.6.26.threads.zip > http://ctindustries.net/libxml/libxslt-1.1.17.debug.php.zip > > release builds: > http://ctindustries.net/libxml/libxml2-2.6.26.threads.zip > http://ctindustries.net/libxml/libxslt-1.1.17.php.zip > > So far I have been testing these against 5.2 builds and ran a few tests > with domxml in PHP 4.4 to make sure all was good. I would appreciate it > if anyone running win builds make these changes to their local builds > and let me know if anyone runs into any problems (there really shouldnt > be any, but in any case..). Would like some additional outside testing > before committing this stuff. > > Rob > > > > > > ------------------------------------------------------------------------ > > Index: libxml.c > =================================================================== > RCS file: /repository/php-src/ext/libxml/libxml.c,v > retrieving revision 1.51 > diff -u -r1.51 libxml.c > --- libxml.c 6 Aug 2006 17:41:39 -0000 1.51 > +++ libxml.c 10 Aug 2006 20:25:31 -0000 > @@ -1043,6 +1043,13 @@ > } > /* }}} */ > > +#ifdef PHP_WIN32 > +PHP_LIBXML_API BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) > +{ > + return xmlDllMain(hinstDLL, fdwReason, lpvReserved); > +} > +#endif > + > #endif > > /* > > > ------------------------------------------------------------------------ > > Index: php_domxml.c > =================================================================== > RCS file: /repository/php-src/ext/domxml/Attic/php_domxml.c,v > retrieving revision 1.218.2.50.2.2 > diff -u -r1.218.2.50.2.2 php_domxml.c > --- php_domxml.c 18 Mar 2006 10:46:27 -0000 1.218.2.50.2.2 > +++ php_domxml.c 8 Aug 2006 11:47:17 -0000 > @@ -5520,6 +5520,13 @@ > /* }}} */ > #endif /* HAVE_DOMXSLT */ > > +#ifdef PHP_WIN32 > +__declspec(dllexport) BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) > +{ > + return xmlDllMain(hinstDLL, fdwReason, lpvReserved); > +} > +#endif > + > #endif /* HAVE_DOMXML */ > > /* > >