summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-07 23:52:32 -0500
committermidipix <writeonce@midipix.org>2016-11-08 08:34:23 -0500
commit4fdb5bb93bb0375a4a1b1c5cfba90315f1afe9d4 (patch)
tree600219101c72f627b27f5670feb94a866adcc299
parent0e78645878fb98861eeec67e72c383e12d7ea35c (diff)
downloadntapi-4fdb5bb93bb0375a4a1b1c5cfba90315f1afe9d4.tar.bz2
ntapi-4fdb5bb93bb0375a4a1b1c5cfba90315f1afe9d4.tar.xz
__ntapi_tt_open_physical_parent_directory(): support device root directory.
-rw-r--r--src/fs/ntapi_tt_open_physical_parent_directory.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/fs/ntapi_tt_open_physical_parent_directory.c b/src/fs/ntapi_tt_open_physical_parent_directory.c
index a9975a7..e80a21a 100644
--- a/src/fs/ntapi_tt_open_physical_parent_directory.c
+++ b/src/fs/ntapi_tt_open_physical_parent_directory.c
@@ -39,9 +39,11 @@ int32_t __stdcall __ntapi_tt_open_physical_parent_directory(
return NT_STATUS_BAD_FILE_TYPE;
wch = path->buffer + (path->strlen / sizeof(uint16_t));
- while ((--wch >= path->buffer) && (*wch != '\\'));
- if (wch == path->buffer )
+ for (; (wch > path->buffer) && (wch[-1] != '\\'); wch--)
+ (void)0;
+
+ if (wch == path->buffer)
return NT_STATUS_MORE_PROCESSING_REQUIRED;
path->strlen = sizeof(uint16_t) * (uint16_t)(wch-path->buffer);