|
|
| version 1.1.1.3, 2013/07/22 01:32:14 | version 1.1.1.5, 2014/06/15 20:04:03 |
|---|---|
| Line 2 | Line 2 |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | PHP Version 5 | | | PHP Version 5 | |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | Copyright (c) 1997-2013 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
| +----------------------------------------------------------------------+ | +----------------------------------------------------------------------+ |
| | This source file is subject to version 3.01 of the PHP license, | | | This source file is subject to version 3.01 of the PHP license, | |
| | that is bundled with this package in the file LICENSE, and is | | | that is bundled with this package in the file LICENSE, and is | |
| Line 625 TSRM_API int shmget(int key, int size, int flags) | Line 625 TSRM_API int shmget(int key, int size, int flags) |
| shm->info = info_handle; | shm->info = info_handle; |
| shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); | shm->descriptor = MapViewOfFileEx(shm->info, FILE_MAP_ALL_ACCESS, 0, 0, 0, NULL); |
| if (created) { | if (NULL != shm->descriptor && created) { |
| shm->descriptor->shm_perm.key = key; | shm->descriptor->shm_perm.key = key; |
| shm->descriptor->shm_segsz = size; | shm->descriptor->shm_segsz = size; |
| shm->descriptor->shm_ctime = time(NULL); | shm->descriptor->shm_ctime = time(NULL); |
| Line 639 TSRM_API int shmget(int key, int size, int flags) | Line 639 TSRM_API int shmget(int key, int size, int flags) |
| shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; | shm->descriptor->shm_perm.mode = shm->descriptor->shm_perm.seq = 0; |
| } | } |
| if (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz ) { | if (NULL != shm->descriptor && (shm->descriptor->shm_perm.key != key || size > shm->descriptor->shm_segsz)) { |
| CloseHandle(shm->segment); | if (NULL != shm->segment) { |
| CloseHandle(shm->segment); | |
| } | |
| UnmapViewOfFile(shm->descriptor); | UnmapViewOfFile(shm->descriptor); |
| CloseHandle(shm->info); | CloseHandle(shm->info); |
| return -1; | return -1; |