ntdll: Properly check the NtQueryDirectoryFile return status.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-04-29 23:14:23 +09:00
parent c90845cf93
commit 9fef5dc839
1 changed files with 5 additions and 6 deletions

View File

@ -2694,9 +2694,8 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai )
ai->version.major, ai->version.minor, lang ); ai->version.major, ai->version.minor, lang );
RtlInitUnicodeString( &lookup_us, lookup ); RtlInitUnicodeString( &lookup_us, lookup );
NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), if (!NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ); FileBothDirectoryInformation, FALSE, &lookup_us, TRUE ))
if (io.u.Status == STATUS_SUCCESS)
{ {
ULONG min_build = ai->version.build, min_revision = ai->version.revision; ULONG min_build = ai->version.build, min_revision = ai->version.revision;
FILE_BOTH_DIR_INFORMATION *dir_info; 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) if (data_pos >= data_len)
{ {
NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer), if (NtQueryDirectoryFile( dir, 0, NULL, NULL, &io, buffer, sizeof(buffer),
FileBothDirectoryInformation, FALSE, &lookup_us, FALSE ); FileBothDirectoryInformation, FALSE, &lookup_us, FALSE ))
if (io.u.Status != STATUS_SUCCESS) break; break;
data_len = io.Information; data_len = io.Information;
data_pos = 0; data_pos = 0;
} }