Fixing casts. This is why I need tests.
This commit is contained in:
parent
8770e6e6cf
commit
c8b544ffd4
|
@ -198,7 +198,7 @@ dword_result_t NtReadFile(dword_t file_handle, dword_t event_handle,
|
||||||
size_t bytes_read = 0;
|
size_t bytes_read = 0;
|
||||||
result = file->Read(
|
result = file->Read(
|
||||||
buffer, buffer_length,
|
buffer, buffer_length,
|
||||||
byte_offset_ptr ? static_cast<uint32_t>(*byte_offset_ptr) : -1,
|
byte_offset_ptr ? static_cast<uint64_t>(*byte_offset_ptr) : -1,
|
||||||
&bytes_read, apc_context);
|
&bytes_read, apc_context);
|
||||||
if (io_status_block) {
|
if (io_status_block) {
|
||||||
io_status_block->status = result;
|
io_status_block->status = result;
|
||||||
|
@ -289,7 +289,7 @@ dword_result_t NtWriteFile(dword_t file_handle, dword_t event_handle,
|
||||||
size_t bytes_written = 0;
|
size_t bytes_written = 0;
|
||||||
result = file->Write(
|
result = file->Write(
|
||||||
buffer, buffer_length,
|
buffer, buffer_length,
|
||||||
byte_offset_ptr ? static_cast<uint32_t>(*byte_offset_ptr) : -1,
|
byte_offset_ptr ? static_cast<uint64_t>(*byte_offset_ptr) : -1,
|
||||||
&bytes_written, apc_context);
|
&bytes_written, apc_context);
|
||||||
if (XSUCCEEDED(result)) {
|
if (XSUCCEEDED(result)) {
|
||||||
info = (int32_t)bytes_written;
|
info = (int32_t)bytes_written;
|
||||||
|
|
|
@ -832,7 +832,7 @@ dword_result_t KeWaitForSingleObject(lpvoid_t object_ptr, dword_t wait_reason,
|
||||||
return X_STATUS_ABANDONED_WAIT_0;
|
return X_STATUS_ABANDONED_WAIT_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
|
||||||
X_STATUS result = object->Wait(wait_reason, processor_mode, alertable,
|
X_STATUS result = object->Wait(wait_reason, processor_mode, alertable,
|
||||||
timeout_ptr ? &timeout : nullptr);
|
timeout_ptr ? &timeout : nullptr);
|
||||||
|
|
||||||
|
@ -850,7 +850,7 @@ dword_result_t NtWaitForSingleObjectEx(dword_t object_handle, dword_t wait_mode,
|
||||||
auto object =
|
auto object =
|
||||||
kernel_state()->object_table()->LookupObject<XObject>(object_handle);
|
kernel_state()->object_table()->LookupObject<XObject>(object_handle);
|
||||||
if (object) {
|
if (object) {
|
||||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
|
||||||
result =
|
result =
|
||||||
object->Wait(3, wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
|
object->Wait(3, wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -885,7 +885,7 @@ dword_result_t KeWaitForMultipleObjects(dword_t count, lpdword_t objects_ptr,
|
||||||
objects.push_back(std::move(object_ref));
|
objects.push_back(std::move(object_ref));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
|
||||||
result = XObject::WaitMultiple(uint32_t(objects.size()),
|
result = XObject::WaitMultiple(uint32_t(objects.size()),
|
||||||
reinterpret_cast<XObject**>(objects.data()),
|
reinterpret_cast<XObject**>(objects.data()),
|
||||||
wait_type, wait_reason, processor_mode,
|
wait_type, wait_reason, processor_mode,
|
||||||
|
@ -915,7 +915,7 @@ dword_result_t NtWaitForMultipleObjectsEx(dword_t count, lpdword_t handles,
|
||||||
objects.push_back(std::move(object));
|
objects.push_back(std::move(object));
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t timeout = timeout_ptr ? uint64_t(*timeout_ptr) : 0;
|
uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
|
||||||
result = XObject::WaitMultiple(
|
result = XObject::WaitMultiple(
|
||||||
count, reinterpret_cast<XObject**>(objects.data()), wait_type, 6,
|
count, reinterpret_cast<XObject**>(objects.data()), wait_type, 6,
|
||||||
wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
|
wait_mode, alertable, timeout_ptr ? &timeout : nullptr);
|
||||||
|
@ -937,7 +937,7 @@ dword_result_t NtSignalAndWaitForSingleObjectEx(dword_t signal_handle,
|
||||||
auto wait_object =
|
auto wait_object =
|
||||||
kernel_state()->object_table()->LookupObject<XObject>(wait_handle);
|
kernel_state()->object_table()->LookupObject<XObject>(wait_handle);
|
||||||
if (signal_object && wait_object) {
|
if (signal_object && wait_object) {
|
||||||
uint64_t timeout = timeout_ptr ? static_cast<uint32_t>(*timeout_ptr) : 0u;
|
uint64_t timeout = timeout_ptr ? static_cast<uint64_t>(*timeout_ptr) : 0u;
|
||||||
result =
|
result =
|
||||||
XObject::SignalAndWait(signal_object.get(), wait_object.get(), 3, 1,
|
XObject::SignalAndWait(signal_object.get(), wait_object.get(), 3, 1,
|
||||||
alertable, timeout_ptr ? &timeout : nullptr);
|
alertable, timeout_ptr ? &timeout : nullptr);
|
||||||
|
|
Loading…
Reference in New Issue