From 39eb7b35c396cfda69c9286343e1a1819d48edbc Mon Sep 17 00:00:00 2001 From: wrowe Date: Fri, 1 Jun 2007 02:33:31 +0000 Subject: 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 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 --- include/arch/win32/apr_arch_inherit.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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 */ -- cgit v1.2.1