- Notifications
You must be signed in to change notification settings - Fork 7.8k
/
Copy pathtsrm_win32.h
106 lines (90 loc) · 3.01 KB
/
tsrm_win32.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
+----------------------------------------------------------------------+
| Copyright (c) The PHP Group |
+----------------------------------------------------------------------+
| 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 |
| available through the world-wide-web at the following url: |
| https://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Authors: Daniel Beulshausen <daniel@php4win.de> |
+----------------------------------------------------------------------+
*/
#ifndefTSRM_WIN32_H
#defineTSRM_WIN32_H
#include"TSRM.h"
#include<windows.h>
#include<sys/utime.h>
#include"win32/ipc.h"
structipc_perm {
key_tkey;
unsigned shortuid;
unsigned shortgid;
unsigned shortcuid;
unsigned shortcgid;
unsigned shortmode;
unsigned shortseq;
};
structshmid_ds {
structipc_permshm_perm;
size_tshm_segsz;
time_tshm_atime;
time_tshm_dtime;
time_tshm_ctime;
unsigned shortshm_cpid;
unsigned shortshm_lpid;
shortshm_nattch;
};
typedefstruct {
FILE*stream;
HANDLEprochnd;
} process_pair;
typedefstruct {
void*addr;
HANDLEsegment;
structshmid_ds*descriptor;
} shm_pair;
typedefstruct {
process_pair*process;
shm_pair*shm;
intprocess_size;
intshm_size;
char*comspec;
HANDLEimpersonation_token;
PSIDimpersonation_token_sid;
} tsrm_win32_globals;
#ifdefZTS
# defineTWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v)
TSRMLS_CACHE_EXTERN()
#else
# defineTWG(v) (win32_globals.v)
#endif
#defineIPC_PRIVATE 0
#defineIPC_CREAT 00001000
#defineIPC_EXCL 00002000
#defineIPC_NOWAIT 00004000
#defineIPC_RMID 0
#defineIPC_SET 1
#defineIPC_STAT 2
#defineIPC_INFO 3
#defineSHM_R PAGE_READONLY
#defineSHM_W PAGE_READWRITE
#defineSHM_RDONLY FILE_MAP_READ
#defineSHM_RND FILE_MAP_WRITE
#defineSHM_REMAP FILE_MAP_COPY
constchar*tsrm_win32_get_path_sid_key(constchar*pathname, size_tpathname_len, size_t*key_len);
TSRM_APIvoidtsrm_win32_startup(void);
TSRM_APIvoidtsrm_win32_shutdown(void);
TSRM_APIFILE*popen_ex(constchar*command, constchar*type, constchar*cwd, constchar*env);
TSRM_APIFILE*popen(constchar*command, constchar*type);
TSRM_APIintpclose(FILE*stream);
TSRM_APIinttsrm_win32_access(constchar*pathname, intmode);
TSRM_APIintwin32_utime(constchar*filename, structutimbuf*buf);
TSRM_APIintshmget(key_tkey, size_tsize, intflags);
TSRM_APIvoid*shmat(intkey, constvoid*shmaddr, intflags);
TSRM_APIintshmdt(constvoid*shmaddr);
TSRM_APIintshmctl(intkey, intcmd, structshmid_ds*buf);
#endif