summaryrefslogtreecommitdiff
path: root/src/core/hle/applets/swkbd.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/hle/applets/swkbd.cpp')
-rw-r--r--src/core/hle/applets/swkbd.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp
index 3ad950692..d87bf3d57 100644
--- a/src/core/hle/applets/swkbd.cpp
+++ b/src/core/hle/applets/swkbd.cpp
@@ -35,9 +35,9 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
35 // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory. 35 // The LibAppJustStarted message contains a buffer with the size of the framebuffer shared memory.
36 // Create the SharedMemory that will hold the framebuffer data 36 // Create the SharedMemory that will hold the framebuffer data
37 Service::APT::CaptureBufferInfo capture_info; 37 Service::APT::CaptureBufferInfo capture_info;
38 ASSERT(sizeof(capture_info) == parameter.buffer_size); 38 ASSERT(sizeof(capture_info) == parameter.buffer.size());
39 39
40 memcpy(&capture_info, parameter.data, sizeof(capture_info)); 40 memcpy(&capture_info, parameter.buffer.data(), sizeof(capture_info));
41 41
42 using Kernel::MemoryPermission; 42 using Kernel::MemoryPermission;
43 // Allocate a heap block of the required size for this applet. 43 // Allocate a heap block of the required size for this applet.
@@ -50,8 +50,7 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
50 // Send the response message with the newly created SharedMemory 50 // Send the response message with the newly created SharedMemory
51 Service::APT::MessageParameter result; 51 Service::APT::MessageParameter result;
52 result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished); 52 result.signal = static_cast<u32>(Service::APT::SignalType::LibAppFinished);
53 result.data = nullptr; 53 result.buffer.clear();
54 result.buffer_size = 0;
55 result.destination_id = static_cast<u32>(Service::APT::AppletId::Application); 54 result.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
56 result.sender_id = static_cast<u32>(id); 55 result.sender_id = static_cast<u32>(id);
57 result.object = framebuffer_memory; 56 result.object = framebuffer_memory;
@@ -61,9 +60,9 @@ ResultCode SoftwareKeyboard::ReceiveParameter(Service::APT::MessageParameter con
61} 60}
62 61
63ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) { 62ResultCode SoftwareKeyboard::StartImpl(Service::APT::AppletStartupParameter const& parameter) {
64 ASSERT_MSG(parameter.buffer_size == sizeof(config), "The size of the parameter (SoftwareKeyboardConfig) is wrong"); 63 ASSERT_MSG(parameter.buffer.size() == sizeof(config), "The size of the parameter (SoftwareKeyboardConfig) is wrong");
65 64
66 memcpy(&config, parameter.data, parameter.buffer_size); 65 memcpy(&config, parameter.buffer.data(), parameter.buffer.size());
67 text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object); 66 text_memory = boost::static_pointer_cast<Kernel::SharedMemory, Kernel::Object>(parameter.object);
68 67
69 // TODO(Subv): Verify if this is the correct behavior 68 // TODO(Subv): Verify if this is the correct behavior
@@ -107,8 +106,8 @@ void SoftwareKeyboard::DrawScreenKeyboard() {
107void SoftwareKeyboard::Finalize() { 106void SoftwareKeyboard::Finalize() {
108 // Let the application know that we're closing 107 // Let the application know that we're closing
109 Service::APT::MessageParameter message; 108 Service::APT::MessageParameter message;
110 message.buffer_size = sizeof(SoftwareKeyboardConfig); 109 message.buffer.resize(sizeof(SoftwareKeyboardConfig));
111 message.data = reinterpret_cast<u8*>(&config); 110 std::memcpy(message.buffer.data(), &config, message.buffer.size());
112 message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed); 111 message.signal = static_cast<u32>(Service::APT::SignalType::LibAppClosed);
113 message.destination_id = static_cast<u32>(Service::APT::AppletId::Application); 112 message.destination_id = static_cast<u32>(Service::APT::AppletId::Application);
114 message.sender_id = static_cast<u32>(id); 113 message.sender_id = static_cast<u32>(id);