Debian Codegraph @

rpython/rlib/src/winhelpers.h

raw symbols SCIP
1 #ifndef Py_WINREPARSE_H
2 #define Py_WINREPARSE_H
3
4 #include <src/precommondefs.h>
5 #ifdef _WIN64
6 #include <windows.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 /* The following structure was copied from
13 http://msdn.microsoft.com/en-us/library/ff552012.aspx as the required
14 include km\ntifs.h isn't present in the Windows SDK (at least as included
15 with Visual Studio Express). Use unique names to avoid conflicting with
16 the structure as defined by Min GW. */
17 typedef struct {
18 ULONG ReparseTag;
19 USHORT ReparseDataLength;
20 USHORT Reserved;
21 union {
22 struct {
23 USHORT SubstituteNameOffset;
24 USHORT SubstituteNameLength;
25 USHORT PrintNameOffset;
26 USHORT PrintNameLength;
27 ULONG Flags;
28 WCHAR PathBuffer[1];
29 } SymbolicLinkReparseBuffer;
30
31 struct {
32 USHORT SubstituteNameOffset;
33 USHORT SubstituteNameLength;
34 USHORT PrintNameOffset;
35 USHORT PrintNameLength;
36 WCHAR PathBuffer[1];
37 } MountPointReparseBuffer;
38
39 struct {
40 UCHAR DataBuffer[1];
41 } GenericReparseBuffer;
42 };
43 } _Py_REPARSE_DATA_BUFFER, *_Py_PREPARSE_DATA_BUFFER;
44
45 #define _Py_REPARSE_DATA_BUFFER_HEADER_SIZE \
46 FIELD_OFFSET(_Py_REPARSE_DATA_BUFFER, GenericReparseBuffer)
47 #define _Py_MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
48
49 // Defined in WinBase.h in 'recent' versions of Windows 10 SDK
50 #ifndef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
51 #define SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE 0x2
52 #endif
53
54 RPY_EXPORTED int
55 os_readlink_impl(wchar_t *path_wide, void *target_buffer, wchar_t **result);
56
57 RPY_EXPORTED int
58 os_symlink_impl(wchar_t *src, wchar_t *dst, int target_is_directory);
59
60 RPY_EXPORTED int
61 os_unlink_impl(wchar_t *src);
62
63 RPY_EXPORTED int
64 os_createdirectory_impl(wchar_t *path, int mode);
65
66 #ifdef __cplusplus
67 }
68 #endif
69
70 #endif /* MS_WINDOWS */
71
72 #endif /* !Py_WINREPARSE_H */