diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-06-01 02:33:39 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2007-06-01 02:33:39 +0000 |
commit | bd4d1849cf57dd93b9d1f1eb75a4c77fd8856277 (patch) | |
tree | 086149ab3b1e3918f1e71bfb78db7d0113749ba2 | |
parent | b2494f067148007c1bf4352aa39a2ffc2912be50 (diff) | |
download | libapr-bd4d1849cf57dd93b9d1f1eb75a4c77fd8856277.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/0.9.x@543365 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | include/arch/win32/apr_arch_inherit.h | 28 |
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 40068929a..be47f870f 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) \ { \ @@ -75,5 +102,6 @@ APR_DECLARE(void) apr_##name##_unset_inherit(apr_##name##_t *the##name) \ { \ apr_##name##_inherit_unset(the##name); \ } +#endif #endif /* ! INHERIT_H */ |