本文整理汇总了C++中ipc::RequestBuilder::PushMoveObjects方法的典型用法代码示例。如果您正苦于以下问题:C++ RequestBuilder::PushMoveObjects方法的具体用法?C++ RequestBuilder::PushMoveObjects怎么用?C++ RequestBuilder::PushMoveObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ipc::RequestBuilder
的用法示例。
在下文中一共展示了RequestBuilder::PushMoveObjects方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OpenFile
void FS_USER::OpenFile(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0802, 7, 2);
rp.Skip(1, false); // Transaction.
ArchiveHandle archive_handle = rp.Pop<u64>();
auto filename_type = rp.PopEnum<FileSys::LowPathType>();
u32 filename_size = rp.Pop<u32>();
FileSys::Mode mode{rp.Pop<u32>()};
u32 attributes = rp.Pop<u32>(); // TODO(Link Mauve): do something with those attributes.
std::vector<u8> filename = rp.PopStaticBuffer();
ASSERT(filename.size() == filename_size);
FileSys::Path file_path(filename_type, filename);
LOG_DEBUG(Service_FS, "path={}, mode={} attrs={}", file_path.DebugStr(), mode.hex, attributes);
ResultVal<std::shared_ptr<File>> file_res =
archives.OpenFileFromArchive(archive_handle, file_path, mode);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
rb.Push(file_res.Code());
if (file_res.Succeeded()) {
std::shared_ptr<File> file = *file_res;
rb.PushMoveObjects(file->Connect());
} else {
rb.PushMoveObjects<Kernel::Object>(nullptr);
LOG_ERROR(Service_FS, "failed to get a handle for file {}", file_path.DebugStr());
}
}
示例2: OpenSubFile
void File::OpenSubFile(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x0801, 4, 0);
s64 offset = rp.PopRaw<s64>();
s64 size = rp.PopRaw<s64>();
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
const FileSessionSlot* original_file = GetSessionData(ctx.Session());
if (original_file->subfile) {
// OpenSubFile can not be called on a file which is already as subfile
rb.Push(FileSys::ERROR_UNSUPPORTED_OPEN_FLAGS);
return;
}
if (offset < 0 || size < 0) {
rb.Push(FileSys::ERR_WRITE_BEYOND_END);
return;
}
std::size_t end = offset + size;
// TODO(Subv): Check for overflow and return ERR_WRITE_BEYOND_END
if (end > original_file->size) {
rb.Push(FileSys::ERR_WRITE_BEYOND_END);
return;
}
using Kernel::ClientSession;
using Kernel::ServerSession;
using Kernel::SharedPtr;
auto sessions = system.Kernel().CreateSessionPair(GetName());
auto server = std::get<SharedPtr<ServerSession>>(sessions);
ClientConnected(server);
FileSessionSlot* slot = GetSessionData(server);
slot->priority = original_file->priority;
slot->offset = offset;
slot->size = size;
slot->subfile = true;
rb.Push(RESULT_SUCCESS);
rb.PushMoveObjects(std::get<SharedPtr<ClientSession>>(sessions));
}
示例3: OpenLinkFile
void File::OpenLinkFile(Kernel::HLERequestContext& ctx) {
LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile {}", GetName());
using Kernel::ClientSession;
using Kernel::ServerSession;
using Kernel::SharedPtr;
IPC::RequestParser rp(ctx, 0x080C, 0, 0);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 2);
auto sessions = system.Kernel().CreateSessionPair(GetName());
auto server = std::get<SharedPtr<ServerSession>>(sessions);
ClientConnected(server);
FileSessionSlot* slot = GetSessionData(server);
const FileSessionSlot* original_file = GetSessionData(ctx.Session());
slot->priority = original_file->priority;
slot->offset = 0;
slot->size = backend->GetSize();
slot->subfile = false;
rb.Push(RESULT_SUCCESS);
rb.PushMoveObjects(std::get<SharedPtr<ClientSession>>(sessions));
}
示例4: GetHandles
void IR_RST::GetHandles(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp(ctx, 0x01, 0, 0);
IPC::RequestBuilder rb = rp.MakeBuilder(1, 3);
rb.Push(RESULT_SUCCESS);
rb.PushMoveObjects(shared_memory, update_event);
}