mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* win32/win32.c (rb_w32_wreadlink): follow the official format of
REPARSE_DATA_BUFFER structure. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2f8134fd8d
commit
b38a8d287c
2 changed files with 28 additions and 12 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Mon Apr 20 23:46:53 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* win32/win32.c (rb_w32_wreadlink): follow the official format of
|
||||||
|
REPARSE_DATA_BUFFER structure.
|
||||||
|
|
||||||
Mon Apr 20 20:23:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
Mon Apr 20 20:23:04 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* common.mk ($(arch)-fake.rb): revert r50354 because bsdmake seems not
|
* common.mk ($(arch)-fake.rb): revert r50354 because bsdmake seems not
|
||||||
|
|
|
@ -4686,6 +4686,7 @@ rb_w32_wreadlink(const WCHAR *path, WCHAR *buf, size_t bufsize)
|
||||||
ULONG ReparseTag;
|
ULONG ReparseTag;
|
||||||
USHORT ReparseDataLength;
|
USHORT ReparseDataLength;
|
||||||
USHORT Reserved;
|
USHORT Reserved;
|
||||||
|
union {
|
||||||
struct {
|
struct {
|
||||||
USHORT SubstituteNameOffset;
|
USHORT SubstituteNameOffset;
|
||||||
USHORT SubstituteNameLength;
|
USHORT SubstituteNameLength;
|
||||||
|
@ -4694,6 +4695,14 @@ rb_w32_wreadlink(const WCHAR *path, WCHAR *buf, size_t bufsize)
|
||||||
ULONG Flags;
|
ULONG Flags;
|
||||||
WCHAR PathBuffer[MAXPATHLEN * 2];
|
WCHAR PathBuffer[MAXPATHLEN * 2];
|
||||||
} SymbolicLinkReparseBuffer;
|
} SymbolicLinkReparseBuffer;
|
||||||
|
struct {
|
||||||
|
USHORT SubstituteNameOffset;
|
||||||
|
USHORT SubstituteNameLength;
|
||||||
|
USHORT PrintNameOffset;
|
||||||
|
USHORT PrintNameLength;
|
||||||
|
WCHAR PathBuffer[MAXPATHLEN * 2];
|
||||||
|
} MountPointReparseBuffer;
|
||||||
|
};
|
||||||
} rp;
|
} rp;
|
||||||
HANDLE f;
|
HANDLE f;
|
||||||
DWORD ret;
|
DWORD ret;
|
||||||
|
@ -4738,10 +4747,12 @@ rb_w32_wreadlink(const WCHAR *path, WCHAR *buf, size_t bufsize)
|
||||||
ret = rp.SymbolicLinkReparseBuffer.PrintNameLength;
|
ret = rp.SymbolicLinkReparseBuffer.PrintNameLength;
|
||||||
}
|
}
|
||||||
else { /* IO_REPARSE_TAG_MOUNT_POINT */
|
else { /* IO_REPARSE_TAG_MOUNT_POINT */
|
||||||
/* +4/-4 mean to drop "?\" */
|
/* +4/-4 means to drop "\??\" */
|
||||||
name = ((char *)rp.SymbolicLinkReparseBuffer.PathBuffer +
|
name = ((char *)rp.MountPointReparseBuffer.PathBuffer +
|
||||||
rp.SymbolicLinkReparseBuffer.SubstituteNameOffset + 4);
|
rp.MountPointReparseBuffer.SubstituteNameOffset +
|
||||||
ret = rp.SymbolicLinkReparseBuffer.SubstituteNameLength - 4;
|
4 * sizeof(WCHAR));
|
||||||
|
ret = rp.MountPointReparseBuffer.SubstituteNameLength -
|
||||||
|
4 * sizeof(WCHAR);
|
||||||
}
|
}
|
||||||
((WCHAR *)name)[ret/sizeof(WCHAR)] = L'\0';
|
((WCHAR *)name)[ret/sizeof(WCHAR)] = L'\0';
|
||||||
translate_wchar(name, L'\\', L'/');
|
translate_wchar(name, L'\\', L'/');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue