summaryrefslogtreecommitdiffhomepage
path: root/src/fs/ntapi_tt_istat.c
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-22 11:58:01 +0200
committermidipix <writeonce@midipix.org>2016-12-22 14:08:40 -0500
commit030926d2c8da32a09fefd9c5e9ea4478cd0d4780 (patch)
tree6aed6d03c81a50693315100e794a3c3504bf6831 /src/fs/ntapi_tt_istat.c
parent7f8d50abe18471c5a79951ad13b63d1bc125c47e (diff)
downloadntapi-030926d2c8da32a09fefd9c5e9ea4478cd0d4780.tar.bz2
ntapi-030926d2c8da32a09fefd9c5e9ea4478cd0d4780.tar.xz
__ntapi_tt_statfs(), __ntapi_tt_istat(): added initial \Device\Mup support.
Diffstat (limited to 'src/fs/ntapi_tt_istat.c')
-rw-r--r--src/fs/ntapi_tt_istat.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/fs/ntapi_tt_istat.c b/src/fs/ntapi_tt_istat.c
index bdfa09f..a42c8dd 100644
--- a/src/fs/ntapi_tt_istat.c
+++ b/src/fs/ntapi_tt_istat.c
@@ -28,13 +28,16 @@ int32_t __stdcall __ntapi_tt_istat(
nt_unicode_string * sdev;
wchar16_t * wch;
wchar16_t * wch_mark;
+ uint32_t hash;
/* validaton */
if (!hfile && !path)
return NT_STATUS_INVALID_HANDLE;
/* hfile */
- if (!hfile) {
+ if (hfile) {
+ istat->flags_out = 0;
+ } else {
/* oa */
oa.len = sizeof(nt_oa);
oa.root_dir = hroot;
@@ -104,15 +107,25 @@ int32_t __stdcall __ntapi_tt_istat(
|| (wch[7] != '\\'))
return NT_STATUS_INVALID_HANDLE;
- wch_mark = &wch[8];
- wch = wch_mark;
+ if ((sdev->strlen >= __DEVICE_MUP_PREFIX_LEN)
+ && (wch[8]=='M')
+ && (wch[9]=='u')
+ && (wch[10]=='p')
+ && (wch[11]=='\\')) {
+ istat->flags_out |= NT_STATFS_MUP_DEVICE;
+ wch_mark = &wch[12];
+ hash = __DEVICE_MUP_PREFIX_HASH;
+ } else {
+ wch_mark = &wch[8];
+ hash = __DEVICE_PATH_PREFIX_HASH;
+ }
- while (*wch != '\\')
- wch++;
+ for (wch=wch_mark; *wch!='\\'; wch++)
+ (void)0;
istat->dev_name_strlen = (uint16_t)((wch - sdev->buffer) * sizeof(uint16_t));
istat->dev_name_hash = __ntapi->tt_buffer_crc32(
- __DEVICE_PATH_PREFIX_HASH,
+ hash,
wch_mark,
(uintptr_t)wch - (uintptr_t)wch_mark);