From 9fef5dc839051ebda5bd93acfc8d5107a9a49de8 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 29 Apr 2016 23:14:23 +0900 Subject: [PATCH] ntdll: Properly check the NtQueryDirectoryFile return status. Signed-off-by: Alexandre Julliard --- dlls/ntdll/actctx.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index 4aa1a72ea7e..d26a5c430f1 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -2694,9 +2694,8 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) ai->version.major, ai->version.minor, lang ); RtlInitUnicodeString( &lookup_us, lookup ); - NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), - FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ); - if (io.u.Status == STATUS_SUCCESS) + if (!NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileBothDirectoryInformation, FALSE, &lookup_us, TRUE )) { ULONG min_build = ai->version.build, min_revision = ai->version.revision; FILE_BOTH_DIR_INFORMATION *dir_info; @@ -2709,9 +2708,9 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) { if (data_pos >= data_len) { - NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), - FileBothDirectoryInformation, FALSE, &lookup_us, FALSE ); - if (io.u.Status != STATUS_SUCCESS) break; + if (NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), + FileBothDirectoryInformation, FALSE, &lookup_us, FALSE )) + break; data_len = io.Information; data_pos = 0; }