Ruby: win32/file.h Source File

Ruby 3.4.1p0 (2024-12-25 revision 48d4efcb85000e1ebae42004e963b5d0cedddcf2)

file.h
1#ifndef RUBY_WIN32_FILE_H
2#define RUBY_WIN32_FILE_H
3
4#ifndef IO_REPARSE_TAG_AF_UNIX
5# define IO_REPARSE_TAG_AF_UNIX 0x80000023
6#endif
7
8enum {
9 MINIMUM_REPARSE_BUFFER_PATH_LEN = 100
10};
11/* License: Ruby's */
12 typedef struct {
13 ULONG ReparseTag;
14 USHORT ReparseDataLength;
15 USHORT Reserved;
16 union {
17 struct {
18 USHORT SubstituteNameOffset;
19 USHORT SubstituteNameLength;
20 USHORT PrintNameOffset;
21 USHORT PrintNameLength;
22 ULONG Flags;
23 WCHAR PathBuffer[MINIMUM_REPARSE_BUFFER_PATH_LEN];
24 } SymbolicLinkReparseBuffer;
25 struct {
26 USHORT SubstituteNameOffset;
27 USHORT SubstituteNameLength;
28 USHORT PrintNameOffset;
29 USHORT PrintNameLength;
30 WCHAR PathBuffer[MINIMUM_REPARSE_BUFFER_PATH_LEN];
31 } MountPointReparseBuffer;
32 };
33} rb_w32_reparse_buffer_t;
34
35#define rb_w32_reparse_buffer_size(n) \
36 (sizeof(rb_w32_reparse_buffer_t) + \
37 sizeof(WCHAR)*((n)-MINIMUM_REPARSE_BUFFER_PATH_LEN))
38
39int rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp,
40 size_t bufsize, WCHAR **result, DWORD *len);
41
42int lchown(const char *path, int owner, int group);
43int rb_w32_ulchown(const char *path, int owner, int group);
44int fchmod(int fd, int mode);
45#define HAVE_FCHMOD 0
46
47UINT rb_w32_filecp(void);
48WCHAR *rb_w32_home_dir(void);
49
50rb_pid_t rb_w32_uspawn_process(int mode, const char *prog, char *const *argv,
51 int in_fd, int out_fd, int err_fd, DWORD flags);
52
53#endif /* RUBY_WIN32_FILE_H */
len
int len
Length of the buffer.
Definition io.h:8
rb_w32_reparse_buffer_t
Definition file.h:12