/usr/src/redhat/BUILD/httpd-2.2.3/srclib/apr/include/arch/win32/apr_arch_inherit.h

00001 /* Copyright 2000-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef INHERIT_H
00018 #define INHERIT_H
00019 
00020 #include "apr_inherit.h"
00021 
00022 #define APR_INHERIT (1 << 24)    /* Must not conflict with other bits */
00023 
00024 #define APR_IMPLEMENT_INHERIT_SET(name, flag, pool, cleanup)        \
00025 APR_DECLARE(apr_status_t) apr_##name##_inherit_set(apr_##name##_t *the##name) \
00026 {                                                                   \
00027     IF_WIN_OS_IS_UNICODE                                            \
00028     {                                                               \
00029         if (!SetHandleInformation(the##name->filehand,              \
00030                                   HANDLE_FLAG_INHERIT,              \
00031                                   HANDLE_FLAG_INHERIT))             \
00032             return apr_get_os_error();                              \
00033     }                                                               \
00034     ELSE_WIN_OS_IS_ANSI                                             \
00035     {                                                               \
00036         HANDLE temp, hproc = GetCurrentProcess();                   \
00037         if (!DuplicateHandle(hproc, the##name->filehand,            \
00038                              hproc, &temp, 0, TRUE,                 \
00039                              DUPLICATE_SAME_ACCESS))                \
00040             return apr_get_os_error();                              \
00041         CloseHandle(the##name->filehand);                           \
00042         the##name->filehand = temp;                                 \
00043     }                                                               \
00044     return APR_SUCCESS;                                             \
00045 }
00046 
00047 #define APR_IMPLEMENT_INHERIT_UNSET(name, flag, pool, cleanup)      \
00048 APR_DECLARE(apr_status_t) apr_##name##_inherit_unset(apr_##name##_t *the##name)\
00049 {                                                                   \
00050     IF_WIN_OS_IS_UNICODE                                            \
00051     {                                                               \
00052         if (!SetHandleInformation(the##name->filehand,              \
00053                                   HANDLE_FLAG_INHERIT, 0))          \
00054             return apr_get_os_error();                              \
00055     }                                                               \
00056     ELSE_WIN_OS_IS_ANSI                                             \
00057     {                                                               \
00058         HANDLE temp, hproc = GetCurrentProcess();                   \
00059         if (!DuplicateHandle(hproc, the##name->filehand,            \
00060                              hproc, &temp, 0, FALSE,                \
00061                              DUPLICATE_SAME_ACCESS))                \
00062             return apr_get_os_error();                              \
00063         CloseHandle(the##name->filehand);                           \
00064         the##name->filehand = temp;                                 \
00065     }                                                               \
00066     return APR_SUCCESS;                                             \
00067 }
00068 
00069 #endif  /* ! INHERIT_H */

Apacheに対してSun Jul 19 22:05:24 2009に生成されました。  doxygen 1.4.7