Commit d3b89c2
committed
mingw: try to create symlinks without elevated permissions
As of Windows 10 Build 14972 in Developer Mode, a new flag is supported
by `CreateSymbolicLink()` to create symbolic links even when running
outside of an elevated session (which was previously required).
This new flag is called `SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE`
and has the numeric value 0x02.
Previous Windows 10 versions will not understand that flag and return
an `ERROR_INVALID_PARAMETER`, therefore we have to be careful to try
passing that flag only when the build number indicates that it is
supported.
For more information about the new flag, see this blog post:
https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10/
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>1 parent 7b6dbc7 commit d3b89c2
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
334 | 336 | | |
335 | 337 | | |
336 | 338 | | |
| |||
381 | 383 | | |
382 | 384 | | |
383 | 385 | | |
384 | | - | |
| 386 | + | |
| 387 | + | |
385 | 388 | | |
386 | 389 | | |
387 | 390 | | |
| |||
2846 | 2849 | | |
2847 | 2850 | | |
2848 | 2851 | | |
2849 | | - | |
| 2852 | + | |
2850 | 2853 | | |
2851 | 2854 | | |
2852 | 2855 | | |
| |||
3523 | 3526 | | |
3524 | 3527 | | |
3525 | 3528 | | |
| 3529 | + | |
| 3530 | + | |
| 3531 | + | |
| 3532 | + | |
| 3533 | + | |
| 3534 | + | |
| 3535 | + | |
| 3536 | + | |
| 3537 | + | |
| 3538 | + | |
| 3539 | + | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
3526 | 3547 | | |
3527 | 3548 | | |
3528 | 3549 | | |
| |||
3558 | 3579 | | |
3559 | 3580 | | |
3560 | 3581 | | |
| 3582 | + | |
3561 | 3583 | | |
3562 | 3584 | | |
3563 | 3585 | | |
| |||
0 commit comments