From 4fdb5bb93bb0375a4a1b1c5cfba90315f1afe9d4 Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 7 Nov 2016 23:52:32 -0500 Subject: __ntapi_tt_open_physical_parent_directory(): support device root directory. --- src/fs/ntapi_tt_open_physical_parent_directory.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); -- cgit v1.2.3