tsrm_win32.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: Daniel Beulshausen <daniel@php4win.de> |
  16. +----------------------------------------------------------------------+
  17. */
  18. #ifndef TSRM_WIN32_H
  19. #define TSRM_WIN32_H
  20. #include "TSRM.h"
  21. #include <windows.h>
  22. #if HAVE_UTIME
  23. # include <sys/utime.h>
  24. #endif
  25. #include "win32/ipc.h"
  26. struct ipc_perm {
  27. key_t key;
  28. unsigned short uid;
  29. unsigned short gid;
  30. unsigned short cuid;
  31. unsigned short cgid;
  32. unsigned short mode;
  33. unsigned short seq;
  34. };
  35. struct shmid_ds {
  36. struct ipc_perm shm_perm;
  37. size_t shm_segsz;
  38. time_t shm_atime;
  39. time_t shm_dtime;
  40. time_t shm_ctime;
  41. unsigned short shm_cpid;
  42. unsigned short shm_lpid;
  43. short shm_nattch;
  44. };
  45. typedef struct {
  46. FILE *stream;
  47. HANDLE prochnd;
  48. } process_pair;
  49. typedef struct {
  50. void *addr;
  51. HANDLE info;
  52. HANDLE segment;
  53. struct shmid_ds *descriptor;
  54. } shm_pair;
  55. typedef struct {
  56. process_pair *process;
  57. shm_pair *shm;
  58. int process_size;
  59. int shm_size;
  60. char *comspec;
  61. HANDLE impersonation_token;
  62. PSID impersonation_token_sid;
  63. } tsrm_win32_globals;
  64. #ifdef ZTS
  65. # define TWG(v) TSRMG_STATIC(win32_globals_id, tsrm_win32_globals *, v)
  66. TSRMLS_CACHE_EXTERN()
  67. #else
  68. # define TWG(v) (win32_globals.v)
  69. #endif
  70. #define IPC_PRIVATE 0
  71. #define IPC_CREAT 00001000
  72. #define IPC_EXCL 00002000
  73. #define IPC_NOWAIT 00004000
  74. #define IPC_RMID 0
  75. #define IPC_SET 1
  76. #define IPC_STAT 2
  77. #define IPC_INFO 3
  78. #define SHM_R PAGE_READONLY
  79. #define SHM_W PAGE_READWRITE
  80. #define SHM_RDONLY FILE_MAP_READ
  81. #define SHM_RND FILE_MAP_WRITE
  82. #define SHM_REMAP FILE_MAP_COPY
  83. char * tsrm_win32_get_path_sid_key(const char *pathname, size_t pathname_len, size_t *key_len);
  84. TSRM_API void tsrm_win32_startup(void);
  85. TSRM_API void tsrm_win32_shutdown(void);
  86. TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd, char *env);
  87. TSRM_API FILE *popen(const char *command, const char *type);
  88. TSRM_API int pclose(FILE *stream);
  89. TSRM_API int tsrm_win32_access(const char *pathname, int mode);
  90. TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
  91. TSRM_API int shmget(key_t key, size_t size, int flags);
  92. TSRM_API void *shmat(int key, const void *shmaddr, int flags);
  93. TSRM_API int shmdt(const void *shmaddr);
  94. TSRM_API int shmctl(int key, int cmd, struct shmid_ds *buf);
  95. #endif
  96. /*
  97. * Local variables:
  98. * tab-width: 4
  99. * c-basic-offset: 4
  100. * End:
  101. * vim600: sw=4 ts=4 fdm=marker
  102. * vim<600: sw=4 ts=4
  103. */