summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 02:33:31 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2007-06-01 02:33:31 +0000
commit39eb7b35c396cfda69c9286343e1a1819d48edbc (patch)
tree01cec6059ea5445d33e63f1b74e084fde214be8a
parent11e122bcab483b9969bd7bff2ceef6bde4f41f92 (diff)
downloadlibapr-39eb7b35c396cfda69c9286343e1a1819d48edbc.tar.gz
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 Backport: 543363 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x@543364 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/arch/win32/apr_arch_inherit.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/arch/win32/apr_arch_inherit.h b/include/arch/win32/apr_arch_inherit.h
index 97c7d05d0..d70d5972c 100644
--- a/include/arch/win32/apr_arch_inherit.h
+++ b/include/arch/win32/apr_arch_inherit.h
@@ -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 @@ APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
} \
return APR_SUCCESS; \
}
+#endif
#endif /* ! INHERIT_H */