mirror of
https://github.com/decompals/wibo.git
synced 2025-12-16 16:37:12 +00:00
Split kernel32 into separate files (part 1)
This commit is contained in:
50
dll/kernel32/wow64apiset.cpp
Normal file
50
dll/kernel32/wow64apiset.cpp
Normal file
@@ -0,0 +1,50 @@
|
||||
#include "common.h"
|
||||
#include "errors.h"
|
||||
#include "handles.h"
|
||||
#include "kernel32.h"
|
||||
|
||||
namespace kernel32 {
|
||||
|
||||
BOOL WIN_FUNC Wow64DisableWow64FsRedirection(PVOID *OldValue) {
|
||||
DEBUG_LOG("STUB: Wow64DisableWow64FsRedirection(%p)\n", OldValue);
|
||||
if (OldValue) {
|
||||
*OldValue = nullptr;
|
||||
}
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WIN_FUNC Wow64RevertWow64FsRedirection(PVOID OldValue) {
|
||||
DEBUG_LOG("STUB: Wow64RevertWow64FsRedirection(%p)\n", OldValue);
|
||||
(void)OldValue;
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WIN_FUNC IsWow64Process(HANDLE hProcess, PBOOL Wow64Process) {
|
||||
DEBUG_LOG("IsWow64Process(%p, %p)\n", hProcess, Wow64Process);
|
||||
if (!Wow64Process) {
|
||||
wibo::lastError = ERROR_INVALID_PARAMETER;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
const auto rawHandle = reinterpret_cast<uintptr_t>(hProcess);
|
||||
bool isPseudoHandle = rawHandle == static_cast<uintptr_t>(-1);
|
||||
if (!isPseudoHandle) {
|
||||
if (!hProcess) {
|
||||
wibo::lastError = ERROR_INVALID_HANDLE;
|
||||
return FALSE;
|
||||
}
|
||||
auto data = handles::dataFromHandle(hProcess, false);
|
||||
if (data.type != handles::TYPE_PROCESS || data.ptr == nullptr) {
|
||||
wibo::lastError = ERROR_INVALID_HANDLE;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
*Wow64Process = FALSE;
|
||||
wibo::lastError = ERROR_SUCCESS;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} // namespace kernel32
|
||||
Reference in New Issue
Block a user