Fixing NtQueryDirectoryFile.
This commit is contained in:
parent
74a710e8d4
commit
bc75b0ab87
|
@ -758,15 +758,14 @@ SHIM_CALL NtQueryDirectoryFile_shim(PPCContext* ppc_context,
|
||||||
|
|
||||||
auto file = kernel_state->object_table()->LookupObject<XFile>(file_handle);
|
auto file = kernel_state->object_table()->LookupObject<XFile>(file_handle);
|
||||||
if (file) {
|
if (file) {
|
||||||
X_FILE_DIRECTORY_INFORMATION* dir_info =
|
X_FILE_DIRECTORY_INFORMATION dir_info = {0};
|
||||||
(X_FILE_DIRECTORY_INFORMATION*)calloc(length, 1);
|
result = file->QueryDirectory(
|
||||||
result = file->QueryDirectory(dir_info, length, file_name.c_str(),
|
&dir_info, length, !file_name.empty() ? file_name.c_str() : nullptr,
|
||||||
restart_scan != 0);
|
restart_scan != 0);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
dir_info->Write(SHIM_MEM_BASE, file_info_ptr);
|
dir_info.Write(SHIM_MEM_BASE, file_info_ptr);
|
||||||
info = length;
|
info = length;
|
||||||
}
|
}
|
||||||
free(dir_info);
|
|
||||||
} else {
|
} else {
|
||||||
result = X_STATUS_NO_SUCH_FILE;
|
result = X_STATUS_NO_SUCH_FILE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue