summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-30 04:42:45 +0000
committermidipix <writeonce@midipix.org>2017-01-29 23:57:20 -0500
commit85b39215b7264022460d3895e755e337485807b8 (patch)
tree25240b6f31b614fe22e3eb5d99faf105544f4ece /src
parent8bdef095fae423cd9264ea94da914f3d8c13d5a3 (diff)
downloadntapi-85b39215b7264022460d3895e755e337485807b8.tar.bz2
ntapi-85b39215b7264022460d3895e755e337485807b8.tar.xz
{i}stat{fs} interfaces(): hold the operating system's hand as needed.
Diffstat (limited to 'src')
-rw-r--r--src/fs/ntapi_tt_istat.c4
-rw-r--r--src/fs/ntapi_tt_stat.c4
-rw-r--r--src/fs/ntapi_tt_statfs.c4
3 files changed, 12 insertions, 0 deletions
diff --git a/src/fs/ntapi_tt_istat.c b/src/fs/ntapi_tt_istat.c
index f17c8b1..67545a0 100644
--- a/src/fs/ntapi_tt_istat.c
+++ b/src/fs/ntapi_tt_istat.c
@@ -39,6 +39,10 @@ int32_t __stdcall __ntapi_tt_istat(
istat->hfile = hfile;
istat->dev_name_maxlen = (uint16_t)infolen - sizeof(*istat);
+ /* sigh */
+ if (buffer_size >= 65536)
+ buffer_size = 65535;
+
/* file index number */
if (!(flags & NT_ISTAT_DEV_NAME_ONLY))
if ((status = __ntapi->zw_query_information_file(
diff --git a/src/fs/ntapi_tt_stat.c b/src/fs/ntapi_tt_stat.c
index 762535f..4d40fba 100644
--- a/src/fs/ntapi_tt_stat.c
+++ b/src/fs/ntapi_tt_stat.c
@@ -39,6 +39,10 @@ int32_t __stdcall __ntapi_tt_stat(
stat->hfile = hfile;
stat->dev_name_maxlen = (uint16_t)infolen - sizeof(*stat);
+ /* sigh */
+ if (buffer_size >= 65536)
+ buffer_size = 65535;
+
/* system-unique device name */
if ((status = __ntapi->zw_query_information_file(
hfile,
diff --git a/src/fs/ntapi_tt_statfs.c b/src/fs/ntapi_tt_statfs.c
index d131758..5d5de60 100644
--- a/src/fs/ntapi_tt_statfs.c
+++ b/src/fs/ntapi_tt_statfs.c
@@ -44,6 +44,10 @@ int32_t __stdcall __ntapi_tt_statfs(
statfs->hfile = hfile;
statfs->dev_name_maxlen = (uint16_t)infolen - sizeof(*statfs);
+ /* sigh */
+ if (buffer_size >= 65536)
+ buffer_size = 65535;
+
/* maximum component length, file system type */
if ((status = __ntapi->zw_query_volume_information_file(
hfile,