summaryrefslogtreecommitdiff
path: root/shmem
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-07-31 06:20:15 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-07-31 06:20:15 +0000
commit6322bb0031c113db08be671d36bf080e6b41fdd3 (patch)
treee1276eb919a822477b0cb44f39e6d9506ef5b0b8 /shmem
parentca9658642225d0ee84b6758a76df6c0062688bdd (diff)
downloadlibapr-6322bb0031c113db08be671d36bf080e6b41fdd3.tar.gz
More handle leakage. We need to be explicit when we create a duplicate
handle for a child or all our children's children end up with the polution. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63747 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'shmem')
-rw-r--r--shmem/win32/shm.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/shmem/win32/shm.c b/shmem/win32/shm.c
index 48f45a5fd..8de8b7eb3 100644
--- a/shmem/win32/shm.c
+++ b/shmem/win32/shm.c
@@ -95,7 +95,6 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
apr_pool_t *pool)
{
static apr_size_t memblock = 0;
- SECURITY_ATTRIBUTES sec, *psec;
HANDLE hMap, hFile;
apr_status_t rv;
apr_size_t size;
@@ -117,15 +116,9 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
size = memblock * (1 + (reqsize - 1) / memblock);
if (!file) {
- /* Do Anonymous, which will be an inherited handle */
+ /* Do Anonymous, which must be passed as a duplicated handle */
#ifndef _WIN32_WCE
hFile = INVALID_HANDLE_VALUE;
- sec.nLength = sizeof(SECURITY_ATTRIBUTES);
- sec.lpSecurityDescriptor = NULL;
- sec.bInheritHandle = TRUE;
- psec = &sec;
-#else
- psec = NULL;
#endif
mapkey = NULL;
}
@@ -144,19 +137,18 @@ APR_DECLARE(apr_status_t) apr_shm_create(apr_shm_t **m,
}
rv = apr_file_trunc(f, size);
mapkey = res_name_from_filename(file, 1, pool);
- psec = NULL;
}
#if APR_HAS_UNICODE_FS
IF_WIN_OS_IS_UNICODE
{
- hMap = CreateFileMappingW(hFile, psec, PAGE_READWRITE, 0, size, mapkey);
+ hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 0, size, mapkey);
}
#endif
#if APR_HAS_ANSI_FS
ELSE_WIN_OS_IS_ANSI
{
- hMap = CreateFileMappingA(hFile, psec, PAGE_READWRITE, 0, size, mapkey);
+ hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, 0, size, mapkey);
}
#endif
err = apr_get_os_error();