Revert "Removed debug code"

This reverts commit d6ff261fcc.
This commit is contained in:
Adubbz 2019-08-06 21:32:28 +10:00
parent 5e0f4130c4
commit dac951f72b
14 changed files with 562 additions and 0 deletions

View file

@ -18,9 +18,12 @@
#include "ncm_path_utils.hpp"
#include "ncm_readonlycontentstorage.hpp"
#include "debug.hpp"
namespace sts::ncm {
Result ReadOnlyContentStorageInterface::Initialize(const char* root_path, MakeContentPathFunc content_path_func) {
R_DEBUG_START
if (this->disabled) {
return ResultNcmInvalidContentStorage;
}
@ -34,37 +37,53 @@ namespace sts::ncm {
strncpy(this->root_path, root_path, FS_MAX_PATH-2);
this->make_content_path_func = *content_path_func;
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GeneratePlaceHolderId(Out<PlaceHolderId> out) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::CreatePlaceHolder(PlaceHolderId placeholder_id, ContentId content_id, u64 size) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::DeletePlaceHolder(PlaceHolderId placeholder_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::HasPlaceHolder(Out<bool> out, PlaceHolderId placeholder_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::WritePlaceHolder(PlaceHolderId placeholder_id, u64 offset, InBuffer<u8> data) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::Register(PlaceHolderId placeholder_id, ContentId content_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::Delete(ContentId content_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::Has(Out<bool> out, ContentId content_id) {
R_DEBUG_START
if (this->disabled) {
return ResultNcmInvalidContentStorage;
}
@ -82,9 +101,11 @@ namespace sts::ncm {
out.SetValue(has);
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetPath(OutPointerWithServerSize<lr::Path, 0x1> out, ContentId content_id) {
R_DEBUG_START
if (this->disabled) {
return ResultNcmInvalidContentStorage;
}
@ -104,29 +125,41 @@ namespace sts::ncm {
*out.pointer = common_path;
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetPlaceHolderPath(OutPointerWithServerSize<lr::Path, 0x1> out, PlaceHolderId placeholder_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::CleanupAllPlaceHolder() {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::ListPlaceHolder(Out<u32> out_count, OutBuffer<PlaceHolderId> out_buf) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetContentCount(Out<u32> out_count) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::ListContentId(Out<u32> out_count, OutBuffer<ContentId> out_buf, u32 start_offset) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetSizeFromContentId(Out<u64> out_size, ContentId content_id) {
R_DEBUG_START
if (this->disabled) {
return ResultNcmInvalidContentStorage;
}
@ -148,22 +181,30 @@ namespace sts::ncm {
out_size.SetValue(st.st_size);
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::DisableForcibly() {
R_DEBUG_START
this->disabled = true;
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::RevertToPlaceHolder(PlaceHolderId placeholder_id, ContentId old_content_id, ContentId new_content_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::SetPlaceHolderSize(PlaceHolderId placeholder_id, u64 size) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::ReadContentIdFile(OutBuffer<u8> buf, ContentId content_id, u64 offset) {
R_DEBUG_START
/* Offset is too large */
if (offset >> 0x3f != 0) {
return ResultNcmInvalidOffset;
@ -199,13 +240,17 @@ namespace sts::ncm {
}
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetRightsIdFromPlaceHolderId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetRightsIdFromContentId(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, ContentId content_id) {
R_DEBUG_START
if (this->disabled) {
return ResultNcmInvalidContentStorage;
}
@ -231,36 +276,51 @@ namespace sts::ncm {
out_key_generation.SetValue(static_cast<u64>(key_generation));
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::WriteContentForDebug(ContentId content_id, u64 offset, InBuffer<u8> data) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetFreeSpaceSize(Out<u64> out_size) {
R_DEBUG_START
out_size.SetValue(0);
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetTotalSpaceSize(Out<u64> out_size) {
R_DEBUG_START
out_size.SetValue(0);
return ResultSuccess;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::FlushPlaceHolder() {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetSizeFromPlaceHolderId(Out<u64> out, PlaceHolderId placeholder_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::RepairInvalidFileAttribute() {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
Result ReadOnlyContentStorageInterface::GetRightsIdFromPlaceHolderIdWithCache(Out<FsRightsId> out_rights_id, Out<u64> out_key_generation, PlaceHolderId placeholder_id, ContentId cache_content_id) {
R_DEBUG_START
return ResultNcmInvalidContentStorageOperation;
R_DEBUG_END
}
}