Back to index

php5  5.3.10
tsrm_win32.h
Go to the documentation of this file.
00001 /*
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: Daniel Beulshausen <daniel@php4win.de>                      |
00016    +----------------------------------------------------------------------+
00017 */
00018 
00019 /* $Id: tsrm_win32.h 321634 2012-01-01 13:15:04Z felipe $ */
00020 
00021 #ifndef TSRM_WIN32_H
00022 #define TSRM_WIN32_H
00023 
00024 #include "TSRM.h"
00025 #include <windows.h>
00026 
00027 struct ipc_perm {
00028        int                  key;
00029        unsigned short       uid;
00030        unsigned short       gid;
00031        unsigned short       cuid;
00032        unsigned short       cgid;
00033        unsigned short       mode;
00034        unsigned short       seq;
00035 };
00036 
00037 struct shmid_ds {
00038        struct ipc_perm      shm_perm;
00039        int                         shm_segsz;
00040        time_t               shm_atime;
00041        time_t               shm_dtime;
00042        time_t               shm_ctime;
00043        unsigned short       shm_cpid;
00044        unsigned short       shm_lpid;
00045        short                shm_nattch;
00046 };
00047 
00048 typedef struct {
00049        FILE   *stream;
00050        HANDLE prochnd;
00051 } process_pair;
00052 
00053 typedef struct {
00054        void   *addr;
00055        HANDLE info;
00056        HANDLE segment;
00057        struct shmid_ds      *descriptor;
00058 } shm_pair;
00059 
00060 typedef struct {
00061        process_pair  *process;
00062        shm_pair             *shm;
00063        int                         process_size;
00064        int                         shm_size;
00065        char                 *comspec;
00066        HANDLE impersonation_token;
00067        PSID                 impersonation_token_sid;
00068 } tsrm_win32_globals;
00069 
00070 #ifdef ZTS
00071 # define TWG(v) TSRMG(win32_globals_id, tsrm_win32_globals *, v)
00072 #else
00073 # define TWG(v) (win32_globals.v)
00074 #endif
00075 
00076 #define IPC_PRIVATE  0
00077 #define IPC_CREAT    00001000
00078 #define IPC_EXCL     00002000
00079 #define IPC_NOWAIT   00004000
00080 
00081 #define IPC_RMID     0
00082 #define IPC_SET             1
00083 #define IPC_STAT     2
00084 #define IPC_INFO     3
00085 
00086 #define SHM_R        PAGE_READONLY
00087 #define SHM_W        PAGE_READWRITE
00088 
00089 #define       SHM_RDONLY    FILE_MAP_READ
00090 #define       SHM_RND              FILE_MAP_WRITE
00091 #define       SHM_REMAP     FILE_MAP_COPY
00092 
00093 char * tsrm_win32_get_path_sid_key(const char *pathname  TSRMLS_DC);
00094 
00095 TSRM_API void tsrm_win32_startup(void);
00096 TSRM_API void tsrm_win32_shutdown(void);
00097 
00098 TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env);
00099 TSRM_API FILE *popen(const char *command, const char *type);
00100 TSRM_API int pclose(FILE *stream);
00101 TSRM_API int tsrm_win32_access(const char *pathname, int mode);
00102 TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
00103 
00104 TSRM_API int shmget(int key, int size, int flags);
00105 TSRM_API void *shmat(int key, const void *shmaddr, int flags);
00106 TSRM_API int shmdt(const void *shmaddr);
00107 TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
00108 
00109 TSRM_API char *realpath(char *orig_path, char *buffer);
00110 #endif