apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r543363 - /apr/apr/trunk/include/arch/win32/apr_arch_inherit.h
Date Fri, 01 Jun 2007 02:32:35 GMT
Author: wrowe
Date: Thu May 31 19:32:34 2007
New Revision: 543363

URL: http://svn.apache.org/viewvc?view=rev&rev=543363
Log:
include/arch/win32/apr_arch_inherit.h defines macros that are used to implement
apr_mutex_inherit_set and unset and several other similar methods.  The current
header file will call SetHandleInformation in a block for Unicode supporting
versions of Windows and has a fallback for Win 9x.  The patch defines the macros
as just the Win9x compatible implementation for WinCE and leaves the other
definition for all other Windows variants.

PR: 39886
Submitted by: Curt Arnold <carnold apache.org>
Reviewed by: Davi Arnaut

Modified:
    apr/apr/trunk/include/arch/win32/apr_arch_inherit.h

Modified: apr/apr/trunk/include/arch/win32/apr_arch_inherit.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_arch_inherit.h?view=diff&rev=543363&r1=543362&r2=543363
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_arch_inherit.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_arch_inherit.h Thu May 31 19:32:34 2007
@@ -21,6 +21,33 @@
 
 #define APR_INHERIT (1 << 24)    /* Must not conflict with other bits */
 
+#if defined(_WIN32_WCE)
+#define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
+APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
+{                                                                   \
+        HANDLE temp, hproc = GetCurrentProcess();                   \
+        if (!DuplicateHandle(hproc, the##name->filehand,            \
+                             hproc, &temp, 0, TRUE,                 \
+                             DUPLICATE_SAME_ACCESS))                \
+            return apr_get_os_error();                              \
+        CloseHandle(the##name->filehand);                           \
+        the##name->filehand = temp;                                 \
+    return APR_SUCCESS;                                             \
+}
+
+#define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
+APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
+{                                                                   \
+        HANDLE temp, hproc = GetCurrentProcess();                   \
+        if (!DuplicateHandle(hproc, the##name->filehand,            \
+                             hproc, &temp, 0, FALSE,                \
+                             DUPLICATE_SAME_ACCESS))                \
+            return apr_get_os_error();                              \
+        CloseHandle(the##name->filehand);                           \
+        the##name->filehand = temp;                                 \
+    return APR_SUCCESS;                                             \
+}
+#else
 #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
 APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
 {                                                                   \
@@ -65,5 +92,6 @@
     }                                                               \
     return APR_SUCCESS;                                             \
 }
+#endif
 
 #endif	/* ! INHERIT_H */



Mime
View raw message