summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-24 18:33:47 +0000
committermidipix <writeonce@midipix.org>2016-12-25 01:31:01 -0500
commit1d3e991a03ff78741f801f88a7bd4ec541bdc99e (patch)
tree04f3a9448dae4b859742c9ec464db825c8bbf58f
parent31ee70d0195fc172077ef4bd8201465b8434c4d3 (diff)
downloadntapi-1d3e991a03ff78741f801f88a7bd4ec541bdc99e.tar.bz2
ntapi-1d3e991a03ff78741f801f88a7bd4ec541bdc99e.tar.xz
{i}stat{fs} interfaces: add .obj_name_strlen, remove .record_name_strlen.
-rw-r--r--include/ntapi/nt_istat.h4
-rw-r--r--include/ntapi/nt_stat.h5
-rw-r--r--include/ntapi/nt_statfs.h3
-rw-r--r--src/fs/ntapi_tt_istat.c7
-rw-r--r--src/fs/ntapi_tt_stat.c4
-rw-r--r--src/fs/ntapi_tt_statfs.c13
6 files changed, 20 insertions, 16 deletions
diff --git a/include/ntapi/nt_istat.h b/include/ntapi/nt_istat.h
index d8ac78c..49e0f24 100644
--- a/include/ntapi/nt_istat.h
+++ b/include/ntapi/nt_istat.h
@@ -18,9 +18,11 @@ typedef struct _nt_istat {
nt_fii fii;
nt_ftagi ftagi;
uint32_t flags;
- uint32_t dev_name_hash;
+ uint16_t obj_name_strlen;
+ uint16_t obj_name_maxlen;
uint16_t dev_name_strlen;
uint16_t dev_name_maxlen;
+ uint32_t dev_name_hash;
wchar16_t dev_name[];
} nt_istat;
diff --git a/include/ntapi/nt_stat.h b/include/ntapi/nt_stat.h
index ba88168..755ea2a 100644
--- a/include/ntapi/nt_stat.h
+++ b/include/ntapi/nt_stat.h
@@ -25,10 +25,11 @@ typedef struct _nt_stat {
void * hfile;
uint32_t flags;
uint32_t file_name_length;
- uint32_t file_name_hash;
- uint32_t dev_name_hash;
+ uint16_t obj_name_strlen;
+ uint16_t obj_name_maxlen;
uint16_t dev_name_strlen;
uint16_t dev_name_maxlen;
+ uint32_t dev_name_hash;
wchar16_t dev_name[];
} nt_stat;
diff --git a/include/ntapi/nt_statfs.h b/include/ntapi/nt_statfs.h
index 7370313..659bffe 100644
--- a/include/ntapi/nt_statfs.h
+++ b/include/ntapi/nt_statfs.h
@@ -46,7 +46,8 @@ typedef struct _nt_statfs {
nt_guid nt_volume_guid;
void * hfile;
uint32_t flags;
- uint16_t record_name_strlen;
+ uint16_t obj_name_strlen;
+ uint16_t obj_name_maxlen;
uint16_t dev_name_strlen;
uint16_t dev_name_maxlen;
uint32_t dev_name_hash;
diff --git a/src/fs/ntapi_tt_istat.c b/src/fs/ntapi_tt_istat.c
index 99e0a1d..f54f8ea 100644
--- a/src/fs/ntapi_tt_istat.c
+++ b/src/fs/ntapi_tt_istat.c
@@ -131,11 +131,12 @@ int32_t __stdcall __ntapi_tt_istat(
for (; *wch!='\\'; )
wch++;
+ istat->obj_name_strlen = sdev->strlen;
+ istat->obj_name_maxlen = istat->dev_name_maxlen;
istat->dev_name_strlen = (uint16_t)((wch - sdev->buffer) * sizeof(uint16_t));
istat->dev_name_hash = __ntapi->tt_buffer_crc32(
- hash,
- wch_mark,
- (uintptr_t)wch - (uintptr_t)wch_mark);
+ hash,wch_mark,
+ sizeof(wchar16_t)*(wch-wch_mark));
if (!(flags & NT_ISTAT_DEV_NAME_COPY))
return NT_STATUS_SUCCESS;
diff --git a/src/fs/ntapi_tt_stat.c b/src/fs/ntapi_tt_stat.c
index b94b08f..b7ad52d 100644
--- a/src/fs/ntapi_tt_stat.c
+++ b/src/fs/ntapi_tt_stat.c
@@ -81,8 +81,6 @@ int32_t __stdcall __ntapi_tt_stat(
/* record the file name length, but do not hash */
fai = (nt_fai *)buffer;
stat->file_name_length = fai->name_info.file_name_length;
- stat->file_name_hash = 0;
-
/* file system size information */
if ((status = __ntapi->zw_query_volume_information_file(
@@ -139,6 +137,8 @@ int32_t __stdcall __ntapi_tt_stat(
for (; *wch!='\\'; )
wch++;
+ stat->obj_name_strlen = sdev->strlen;
+ stat->obj_name_maxlen = stat->dev_name_maxlen;
stat->dev_name_strlen = (uint16_t)((wch - sdev->buffer) * sizeof(uint16_t));
stat->dev_name_hash = __ntapi->tt_buffer_crc32(
hash,wch_mark,
diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
index f38509e..450d2bc 100644
--- a/src/fs/ntapi_tt_statfs.c
+++ b/src/fs/ntapi_tt_statfs.c
@@ -179,13 +179,12 @@ int32_t __stdcall __ntapi_tt_statfs(
for (; *wch!='\\'; )
wch++;
- statfs->dev_name_strlen = (uint16_t)((wch - sdev->buffer) * sizeof(uint16_t));
- statfs->record_name_strlen = sdev->strlen - statfs->dev_name_strlen;
-
- statfs->dev_name_hash = __ntapi->tt_buffer_crc32(
- hash,
- wch_mark,
- sizeof(wchar16_t) * (wch - wch_mark));
+ statfs->obj_name_strlen = sdev->strlen;
+ statfs->obj_name_maxlen = statfs->dev_name_maxlen;
+ statfs->dev_name_strlen = (uint16_t)((wch - sdev->buffer) * sizeof(uint16_t));
+ statfs->dev_name_hash = __ntapi->tt_buffer_crc32(
+ hash,wch_mark,
+ sizeof(wchar16_t)*(wch-wch_mark));
/* device name */
if (!(flags & NT_STATFS_DEV_NAME_COPY))