summaryrefslogtreecommitdiff
path: root/TSRM/tsrm_win32.c
Commit message (Collapse)AuthorAgeFilesLines
* Constify char * arguments of APIstwosee2020-06-081-1/+1
| | | | Closes GH-5676.
* Fix MSVC level 1 (severe) warningsChristoph M. Becker2020-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | We fix (hopefully) all instances of: * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273> * <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312> `zend_llist_add_element()` and `zend_llist_prepend_element()` now explicitly expect a *const* pointer. We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress C4090; this should prevent accidential removal of the cast by clarifying the intention, and makes it easier to remove the casts if the issue[1] will be resolved sometime. [1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
* utime is always available on WindowsGeorge Peter Banyard2020-05-131-2/+0
| | | | | | Therefore drop useless preprocessor if check Closes GH-5563
* Merge branch 'PHP-7.4'Christoph M. Becker2020-05-051-7/+9
|\ | | | | | | | | * PHP-7.4: Fix #79566: Private SHM is not private on Windows
| * Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-05-051-7/+9
| |\ | | | | | | | | | | | | * PHP-7.3: Fix #79566: Private SHM is not private on Windows
| | * Fix #79566: Private SHM is not private on WindowsChristoph M. Becker2020-05-051-7/+9
| | | | | | | | | | | | | | | | | | | | | We map the POSIX semantics of `IPC_PRIVATE` by creating unnamed file mapping objects on Windows. While that is not particularly useful for ext/shmop, which is the only bundled extension which uses `shmget()`, it may be useful for external extensions.
* | | Make quoting of cmd execution functions consistentChristoph M. Becker2020-02-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the `$command` passed to `proc_open()` had to be wrapped in double-quotes manually, that was implicitly done for all other program execution functions. This could easily introduce bugs and even security issues when switching from one to another program execution function. Furthermore we ensure that the additional quotes are always unwrapped regardless of what is passed as `$command` by passing the `/s` flag to cmd.exe. As it was, `shell_exec('path with spaces/program.exe')` did execute program.exe, but adding an argument (`shell_exec('path with spaces/program.exe -h)`) failed to execute program.exe, because cmd.exe stripped the additional quotes. While these changes obviously can cause BC breaks, we feel that in the long run the benefits of having consistent behavior for all program execution functions outweighs the drawbacks of potentially breaking some code now.
* | | Merge branch 'PHP-7.4'Christoph M. Becker2020-01-031-1/+7
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #78538: shmop memory leak
| * | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2020-01-031-1/+7
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix #78538: shmop memory leak
| | * Fix #78538: shmop memory leakChristoph M. Becker2020-01-031-1/+7
| | | | | | | | | | | | | | | If the descriptor's refcount drops to zero, we have to unmap the respective file view, to avoid leaking memory.
| | * Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-08-061-1/+1
| | |\ | | | | | | | | | | | | | | | | * PHP-7.2: Fix #78282: atime and mtime mismatch
| | | * Fix #78282: atime and mtime mismatchChristoph M. Becker2019-08-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for bug #78241 assumed that `time_t` would always be 64bit, but actually is 32bit for x86. We therefore enforce 64bit arithmetic to avoid wrapping. (cherry picked from commit bf242d58e77d50d4d8fdaaaca7ede686ec4467c0)
* | | | Remove mention of PHP major version in Copyright headersGabriel Caruso2019-09-251-2/+0
|/ / / | | | | | | | | | Closes GH-4732.
* | | Fix #78282: atime and mtime mismatchChristoph M. Becker2019-07-131-1/+1
| | | | | | | | | | | | | | | | | | The fix for bug #78241 assumed that `time_t` would always be 64bit, but actually is 32bit for x86. We therefore enforce 64bit arithmetic to avoid wrapping.
* | | Merge branch 'PHP-7.3' into PHP-7.4Christoph M. Becker2019-07-031-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.3: Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
| * | Merge branch 'PHP-7.2' into PHP-7.3Christoph M. Becker2019-07-031-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.2: Fix #78241: touch() does not handle dates after 2038 in PHP 64-bit
| | * Fix #78241: touch() does not handle dates after 2038 in PHP 64-bitChristoph M. Becker2019-07-031-1/+1
| | | | | | | | | | | | | | | | | | `time_t` defaults to `_time64` (which is 64bit signed) even on x86, but `Int32x32To64()` truncates it to signed 32bit. We replace the macro with the "manual" calculation.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
* | | Remove unused variableGabriel Caruso2019-05-291-1/+0
| | |
* | | Stricter validation for popen mode argument on WindowsNikita Popov2019-02-221-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Context: The ext/standard/tests/file/popen_pclose_error-win32.phpt test often fails under parallel testing, because the "is not recognized as an internal or external command" message doesn't actually have a guaranteed position in the output. While looking into this, I noticed that this test on Windows tests something very different (invalid comand) than on Linux (invalid mode). Here I'm adjusting the Windows popen implementation so it immediately fails on a `rw` mode, just like it does on Linux.
* | | Remove local variablesPeter Kokot2019-02-031-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the so called local variables defined per file basis for certain editors to properly show tab width, and similar settings. These are mainly used by Vim and Emacs editors yet with recent changes the once working definitions don't work anymore in Vim without custom plugins or additional configuration. Neither are these settings synced across the PHP code base. A simpler and better approach is EditorConfig and fixing code using some code style fixing tools in the future instead. This patch also removes the so called modelines for Vim. Modelines allow Vim editor specifically to set some editor configuration such as syntax highlighting, indentation style and tab width to be set in the first line or the last 5 lines per file basis. Since the php test files have syntax highlighting already set in most editors properly and EditorConfig takes care of the indentation settings, this patch removes these as well for the Vim 6.0 and newer versions. With the removal of local variables for certain editors such as Emacs and Vim, the footer is also probably not needed anymore when creating extensions using ext_skel.php script. Additionally, Vim modelines for setting php syntax and some editor settings has been removed from some *.phpt files. All these are mostly not relevant for phpt files neither work properly in the middle of the file.
* | | Remove yearly range from copyright noticeZeev Suraski2019-01-301-1/+1
|/ /
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Modernize realpath and integrate quick variant into virtual_file_exAnatol Belski2017-12-151-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The slower I/O as a traditional bottleneck on Windows which is the target of this patch. The recursive path resolution, while being an allround solution, is expensive when it comes to the common case. Files with proper ACLs set can be resolved in one go by usage of specific API. Those are available since Vista, so actually can be called old. Those simpler api is used for the cases where no CWD_EXPAND is requested. For the cases where ACLs are improper, the existing solution based on FindFirstFile still does good job also partially providing quirks. Cases involing reparse tags and other non local filesystems are also partially server by new APIs. The approach uses both APIs - the quick one for the common case still integrating realpath cache, and the existing one as a fallback. The tests show the I/O load drop on the realpath resolution part due to less system calls for the sub part resolution of paths. In most case it is justified, as the sub parts were otherwise cached or unused as well. The realpath() implementation in ioutil is also closer to the POSIX.
* | Move temporary allocation to the stackAnatol Belski2017-12-091-10/+2
| |
* | Improve ioutil access impl and refactor tsrm_win32_accessAnatol Belski2017-12-081-150/+135
|/
* vim folds and mode lines yetAnatol Belski2017-07-041-36/+47
|
* use char* as we don't compile with UNICODE anywayAnatol Belski2017-04-281-1/+1
|
* Avoid unnecessary string copyAnatol Belski2017-04-271-7/+1
| | | | which is the case when there's no impersonation.
* get rid of two strlen callsAnatol Belski2017-04-271-5/+8
|
* Merge branch 'PHP-7.1'Anatol Belski2017-04-151-3/+2
|\ | | | | | | | | * PHP-7.1: fix error handling
| * Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2017-04-151-3/+2
| |\ | | | | | | | | | | | | * PHP-7.0: fix error handling
| | * fix error handlingAnatol Belski2017-04-151-3/+2
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| * | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
| | |
* | | Path handling related refactoringsAnatol Belski2016-12-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Primarily related to the path handling datatypes, to avoid unnecessary casts, where possible. Also some rework to avoid code dup. Probably more places are to go, even not path related, primarily to have less casts and unsigned integers where possible. That way, we've not only less warnings and casts, but are also safer with regard to the integer overflows. OFC it's not a panacea, but still significantly reduces the vulnerability potential.
* | | Merge branch 'PHP-7.1'Anatol Belski2016-08-291-0/+6
|\ \ \ | |/ / | | | | | | | | | * PHP-7.1: fix HANDLE leak
| * | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2016-08-291-0/+6
| |\ \ | | |/ | | | | | | | | | * PHP-7.0: fix HANDLE leak
| | * Merge branch 'PHP-5.6' into PHP-7.0Anatol Belski2016-08-291-0/+6
| | |\ | | | | | | | | | | | | | | | | * PHP-5.6: fix HANDLE leak
| | | * fix HANDLE leakAnatol Belski2016-08-291-0/+6
| | | |
| | | * backport relevant part from bug #72858 patch in 7.0Anatol Belski2016-08-251-2/+12
| | | |
| | | * Happy new year (Update copyright to 2016)Lior Kaplan2016-01-011-1/+1
| | | |
| | | * bump yearXinchen Hui2015-01-151-1/+1
| | | |
* | | | sync shm* implementation signatures with POSIXAnatol Belski2016-08-231-7/+10
| | | |
* | | | Merge branch 'PHP-7.1'Anatol Belski2016-08-181-4/+4
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.1: avoid other efforts if memory mapping fails
| * | | Merge branch 'PHP-7.0' into PHP-7.1Anatol Belski2016-08-181-4/+4
| |\ \ \ | | |/ / | | | | | | | | | | | | * PHP-7.0: avoid other efforts if memory mapping fails
| | * | avoid other efforts if memory mapping failsAnatol Belski2016-08-181-4/+4
| | | |
* | | | Merge branch 'PHP-7.1'Anatol Belski2016-08-181-4/+1
|\ \ \ \ | |/ / / | | | | | | | | | | | | * PHP-7.1: map ell the err code