Fixed compilation & removed useless code

This commit is contained in:
Gliniak 2020-09-20 20:00:47 +02:00
parent e130f666b4
commit 0d71596200
3 changed files with 6 additions and 10 deletions

View File

@ -93,11 +93,6 @@ dword_result_t NtCreateFile(lpdword_t handle_out, dword_t desired_access,
return X_STATUS_OBJECT_NAME_INVALID;
}
if (target_path.back() == '\\' &&
create_options & CreateOptions::FILE_NON_DIRECTORY_FILE) {
return X_STATUS_FILE_IS_A_DIRECTORY;
}
if (object_attrs->root_directory != 0xFFFFFFFD && // ObDosDevices
object_attrs->root_directory != 0) {
auto root_file = kernel_state()->object_table()->LookupObject<XFile>(

View File

@ -101,7 +101,7 @@ dword_result_t NtAllocateVirtualMemory(lpdword_t base_addr_ptr,
if (*base_addr_ptr != 0) {
// ignore specified page size when base address is specified.
auto heap = kernel_memory()->LookupHeap(*base_addr_ptr);
if (heap->page_size == 0x1000 && !*region_size_ptr) {
if (heap->page_size() == 0x1000 && !*region_size_ptr) {
return X_STATUS_INVALID_PARAMETER;
}
@ -200,7 +200,7 @@ dword_result_t NtProtectVirtualMemory(lpdword_t base_addr_ptr,
}
auto heap = kernel_memory()->LookupHeap(*base_addr_ptr);
if (heap->page_size == 0x1000 && !*region_size_ptr) {
if (heap->page_size() == 0x1000 && !*region_size_ptr) {
return X_STATUS_INVALID_PARAMETER;
}
@ -254,7 +254,7 @@ dword_result_t NtFreeVirtualMemory(lpdword_t base_addr_ptr,
}
auto heap = kernel_state()->memory()->LookupHeap(base_addr_value);
if (heap->page_size == 0x1000 && !*region_size_ptr) {
if (heap->page_size() == 0x1000 && !*region_size_ptr) {
return X_STATUS_INVALID_PARAMETER;
}

View File

@ -173,8 +173,9 @@ bool VirtualFileSystem::DeletePath(const std::string_view path) {
X_STATUS VirtualFileSystem::OpenFile(Entry* root_entry,
const std::string_view path,
FileDisposition creation_disposition,
uint32_t desired_access, uint32_t create_options,
File** out_file, FileAction* out_action) {
uint32_t desired_access,
uint32_t create_options, File** out_file,
FileAction* out_action) {
// TODO(gibbed): should 'is_directory' remain as a bool or should it be
// flipped to a generic FileAttributeFlags?