mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
win32.c: volume_prefix_len
* win32/win32.c (rb_w32_read_reparse_point): name the prefix length to be dropped. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53706 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
19162d268b
commit
94cfa2893c
1 changed files with 3 additions and 3 deletions
|
@ -4843,13 +4843,13 @@ rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp,
|
||||||
}
|
}
|
||||||
else { /* IO_REPARSE_TAG_MOUNT_POINT */
|
else { /* IO_REPARSE_TAG_MOUNT_POINT */
|
||||||
static const WCHAR *volume = L"Volume{";
|
static const WCHAR *volume = L"Volume{";
|
||||||
/* +4/-4 means to drop "\??\" */
|
enum {volume_prefix_len = rb_strlen_lit("\\??\\")};
|
||||||
name = ((char *)rp->MountPointReparseBuffer.PathBuffer +
|
name = ((char *)rp->MountPointReparseBuffer.PathBuffer +
|
||||||
rp->MountPointReparseBuffer.SubstituteNameOffset +
|
rp->MountPointReparseBuffer.SubstituteNameOffset +
|
||||||
4 * sizeof(WCHAR));
|
volume_prefix_len * sizeof(WCHAR));
|
||||||
ret = rp->MountPointReparseBuffer.SubstituteNameLength;
|
ret = rp->MountPointReparseBuffer.SubstituteNameLength;
|
||||||
*len = ret / sizeof(WCHAR);
|
*len = ret / sizeof(WCHAR);
|
||||||
ret -= 4 * sizeof(WCHAR);
|
ret -= volume_prefix_len * sizeof(WCHAR);
|
||||||
if (ret > sizeof(volume) - 1 * sizeof(WCHAR) &&
|
if (ret > sizeof(volume) - 1 * sizeof(WCHAR) &&
|
||||||
memcmp(name, volume, sizeof(volume) - 1 * sizeof(WCHAR)) == 0)
|
memcmp(name, volume, sizeof(volume) - 1 * sizeof(WCHAR)) == 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Reference in a new issue