mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-01-19 04:58:27 +00:00
8a8c1f274b
* Implement `sceKernelFtruncate` and `sceKernelUnlink`. * Remove unused variable. * Implement `sceKernelReserveVirtualRange`, misc fixes * Fix `sceKernelReserveVirtualRange`. * Add TODO on reserve * Replace comment with assert. * Add missing copyright header * Add `UNREACHABLE` for `IOFile::Unlink`. * Move NT API initialization out of the header * Fix bug where files were always mapped as read only. * `clang-format`
21 lines
642 B
C++
21 lines
642 B
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include "ntapi.h"
|
|
|
|
NtDelayExecution_t NtDelayExecution = nullptr;
|
|
NtSetInformationFile_t NtSetInformationFile = nullptr;
|
|
|
|
namespace Common::NtApi {
|
|
|
|
void Initialize() {
|
|
HMODULE nt_handle = GetModuleHandleA("ntdll.dll");
|
|
|
|
// http://stackoverflow.com/a/31411628/4725495
|
|
NtDelayExecution = (NtDelayExecution_t)GetProcAddress(nt_handle, "NtDelayExecution");
|
|
NtSetInformationFile =
|
|
(NtSetInformationFile_t)GetProcAddress(nt_handle, "NtSetInformationFile");
|
|
}
|
|
|
|
} // namespace Common::NtApi
|