From ca9e0a70f509d2804f72feea2f87936d9826e6cf Mon Sep 17 00:00:00 2001 From: Davide Carella Date: Tue, 5 Jan 2021 09:39:33 +0100 Subject: [PATCH] Syscall: Changed 'setkeymap' to take also the Shift+AltGr map. --- Kernel/API/Syscall.h | 1 + Kernel/Syscalls/setkeymap.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h index 4d98eb19e9..ede2256168 100644 --- a/Kernel/API/Syscall.h +++ b/Kernel/API/Syscall.h @@ -336,6 +336,7 @@ struct SC_setkeymap_params { const u32* shift_map; const u32* alt_map; const u32* altgr_map; + const u32* shift_altgr_map; StringArgument map_name; }; diff --git a/Kernel/Syscalls/setkeymap.cpp b/Kernel/Syscalls/setkeymap.cpp index 8f9b441dd2..d761e3351b 100644 --- a/Kernel/Syscalls/setkeymap.cpp +++ b/Kernel/Syscalls/setkeymap.cpp @@ -50,6 +50,8 @@ int Process::sys$setkeymap(Userspace user_p return -EFAULT; if (!copy_from_user(character_map_data.altgr_map, params.altgr_map, CHAR_MAP_SIZE * sizeof(u32))) return -EFAULT; + if (!copy_from_user(character_map_data.shift_altgr_map, params.shift_altgr_map, CHAR_MAP_SIZE * sizeof(u32))) + return -EFAULT; auto map_name = get_syscall_path_argument(params.map_name); if (map_name.is_error()) {