[XAM] Added XamMediaVerification stubs

- Create
- Close
- Verify
- FailedBlocks
- Inject

Thanks: Nicknine & Adrian
This commit is contained in:
Gliniak 2024-10-09 18:48:00 +02:00
parent 36453829df
commit 5a5fe97efb
3 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,72 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2024 Xenia Canary. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#include "xenia/kernel/util/shim_utils.h"
#include "xenia/kernel/xam/xam_private.h"
#include "xenia/kernel/xthread.h"
#include "xenia/xbox.h"
namespace xe {
namespace kernel {
namespace xam {
dword_result_t XamMediaVerificationCreate_entry(dword_t creation_flags) {
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamMediaVerificationCreate, kNone, kStub);
dword_result_t XamMediaVerificationClose_entry() { return X_ERROR_SUCCESS; }
DECLARE_XAM_EXPORT1(XamMediaVerificationClose, kNone, kStub);
dword_result_t XamMediaVerificationVerify_entry(
dword_t r3, pointer_t<XAM_OVERLAPPED> overlapped, lpvoid_t callback) {
if (callback) {
auto thread = XThread::GetCurrentThread();
thread->EnqueueApc(static_cast<uint32_t>(callback) & ~1u, 0, 0, 0);
}
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamMediaVerificationVerify, kNone, kStub);
struct X_SECURITY_FAILURE_INFORMATION {
xe::be<uint32_t> size;
xe::be<uint32_t> failed_reads;
xe::be<uint32_t> failed_hashes;
xe::be<uint32_t> blocks_checked;
xe::be<uint32_t> total_blocks;
xe::be<uint32_t> complete;
};
dword_result_t XamMediaVerificationFailedBlocks_entry(
pointer_t<X_SECURITY_FAILURE_INFORMATION> failure_information) {
if (failure_information) {
if (failure_information->size != sizeof(X_SECURITY_FAILURE_INFORMATION)) {
return X_ERROR_NOT_ENOUGH_MEMORY;
}
failure_information->failed_reads = 0;
failure_information->failed_hashes = 0;
failure_information->blocks_checked = 0;
failure_information->total_blocks = 0;
failure_information->complete = true;
}
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamMediaVerificationFailedBlocks, kNone, kStub);
dword_result_t XamMediaVerificationInject_entry(dword_t r3, dword_t r4) {
return X_ERROR_SUCCESS;
}
DECLARE_XAM_EXPORT1(XamMediaVerificationInject, kNone, kStub);
} // namespace xam
} // namespace kernel
} // namespace xe
DECLARE_XAM_EMPTY_REGISTER_EXPORTS(Media);

View file

@ -18,6 +18,7 @@ XE_MODULE_EXPORT_GROUP(xam, Enum)
XE_MODULE_EXPORT_GROUP(xam, Info)
XE_MODULE_EXPORT_GROUP(xam, Input)
XE_MODULE_EXPORT_GROUP(xam, Locale)
XE_MODULE_EXPORT_GROUP(xam, Media)
XE_MODULE_EXPORT_GROUP(xam, Msg)
XE_MODULE_EXPORT_GROUP(xam, Net)
XE_MODULE_EXPORT_GROUP(xam, Notify)

View file

@ -93,6 +93,7 @@ typedef uint32_t X_RESULT;
#define X_ERROR_PATH_NOT_FOUND X_RESULT_FROM_WIN32(0x00000003L)
#define X_ERROR_ACCESS_DENIED X_RESULT_FROM_WIN32(0x00000005L)
#define X_ERROR_INVALID_HANDLE X_RESULT_FROM_WIN32(0x00000006L)
#define X_ERROR_NOT_ENOUGH_MEMORY X_RESULT_FROM_WIN32(0x00000008L)
#define X_ERROR_NO_MORE_FILES X_RESULT_FROM_WIN32(0x00000012L)
#define X_ERROR_NOT_SUPPORTED X_RESULT_FROM_WIN32(0x00000032L)
#define X_ERROR_INVALID_PARAMETER X_RESULT_FROM_WIN32(0x00000057L)