Ruby: win32/file.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

file.h
Go to the documentation of this file.
1#ifndef RUBY_WIN32_FILE_H
2#define RUBY_WIN32_FILE_H
3
4#define MAX_REPARSE_PATH_LEN 4092
5
6enum {
7 MINIMUM_REPARSE_BUFFER_PATH_LEN = 4
8};
9/* License: Ruby's */
10 typedef struct {
11 ULONG ReparseTag;
12 USHORT ReparseDataLength;
13 USHORT Reserved;
14 union {
15 struct {
16 USHORT SubstituteNameOffset;
17 USHORT SubstituteNameLength;
18 USHORT PrintNameOffset;
19 USHORT PrintNameLength;
20 ULONG Flags;
21 WCHAR PathBuffer[4];
22 } SymbolicLinkReparseBuffer;
23 struct {
24 USHORT SubstituteNameOffset;
25 USHORT SubstituteNameLength;
26 USHORT PrintNameOffset;
27 USHORT PrintNameLength;
28 WCHAR PathBuffer[4];
29 } MountPointReparseBuffer;
30 };
31} rb_w32_reparse_buffer_t;
32
33#define rb_w32_reparse_buffer_size(n) \
34 (sizeof(rb_w32_reparse_buffer_t) + \
35 sizeof(WCHAR)*((n)-MINIMUM_REPARSE_BUFFER_PATH_LEN))
36
37int rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp,
38 size_t bufsize, WCHAR **result, DWORD *len);
39
40int lchown(const char *path, int owner, int group);
41int rb_w32_ulchown(const char *path, int owner, int group);
42int fchmod(int fd, int mode);
43#define HAVE_FCHMOD 0
44
45UINT rb_w32_filecp(void);
46WCHAR *rb_w32_home_dir(void);
47
48#endif /* RUBY_WIN32_FILE_H */
len
uint8_t len
Definition: escape.c:17
rp
#define rp(obj)
Definition: internal.h:95
mode
const char int mode
Definition: ioapi.h:137
rb_w32_reparse_buffer_t
Definition: file.h:10
rb_w32_reparse_buffer_t::SubstituteNameLength
USHORT SubstituteNameLength
Definition: file.h:17
rb_w32_reparse_buffer_t::PrintNameLength
USHORT PrintNameLength
Definition: file.h:19
rb_w32_reparse_buffer_t::ReparseDataLength
USHORT ReparseDataLength
Definition: file.h:12
rb_w32_reparse_buffer_t::PrintNameOffset
USHORT PrintNameOffset
Definition: file.h:18
rb_w32_reparse_buffer_t::Reserved
USHORT Reserved
Definition: file.h:13
rb_w32_reparse_buffer_t::SubstituteNameOffset
USHORT SubstituteNameOffset
Definition: file.h:16
rb_w32_reparse_buffer_t::ReparseTag
ULONG ReparseTag
Definition: file.h:11
rb_w32_reparse_buffer_t::Flags
ULONG Flags
Definition: file.h:20
rb_w32_filecp
UINT rb_w32_filecp(void)
rb_w32_home_dir
WCHAR * rb_w32_home_dir(void)
Definition: win32.c:547
fchmod
int fchmod(int fd, int mode)
Definition: win32.c:7713
lchown
int lchown(const char *path, int owner, int group)
Definition: win32.c:4832
rb_w32_ulchown
int rb_w32_ulchown(const char *path, int owner, int group)
Definition: win32.c:4838
MINIMUM_REPARSE_BUFFER_PATH_LEN
@ MINIMUM_REPARSE_BUFFER_PATH_LEN
Definition: file.h:7
rb_w32_read_reparse_point
int rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp, size_t bufsize, WCHAR **result, DWORD *len)
Definition: win32.c:5068
DWORD
IUnknown DWORD
Definition: win32ole.c:33