210{
220 WCHAR szKeyName[48] =
L".DEFAULT\\Keyboard Layout";
221 WCHAR szValueName[3 + 1];
222 WCHAR szSubstID[8 + 1];
223 WCHAR szLayoutID[8 + 1];
224
225
232
236 0,
241 {
244 }
245
247
248 KeyName.MaximumLength =
sizeof(szKeyName);
251 {
254 }
255
261
265 0,
270 {
273 }
274
281
285 0,
290 {
292 goto Quit;
293 }
294
295 uCount = 0;
296 for (uIndex = 0; (uIndex <= 19) && (MuiLayouts[uIndex].
LangID != 0); ++uIndex)
297 {
300
302
303 if ((
KLID)MuiLayouts[uIndex].
LangID == MuiLayouts[uIndex].LayoutID)
304 {
305
308 0,
313 {
314 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %u)\n",
Status, uIndex);
315 goto Quit;
316 }
317 }
318 else
319 {
320
322 (0xD0000000 | ((
USHORT)uCount << 4) | MuiLayouts[uIndex].
LangID));
325 0,
330 {
331 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %u)\n",
Status, uIndex);
332 goto Quit;
333 }
334
335
339 0,
344 {
345 DPRINT1(
"NtSetValueKey() failed (Status = %lx, uIndex = %u)\n",
Status, uIndex);
346 goto Quit;
347 }
348
349 ++uCount;
350 }
351 }
352
354
355Quit:
359}
HANDLE GetRootKeyByPredefKey(IN HANDLE KeyHandle, OUT PCWSTR *RootKeyMountPoint OPTIONAL)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
NTSTATUS RtlAppendUnicodeToString(IN PUNICODE_STRING Str1, IN PWSTR Str2)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
static BOOLEAN AddHotkeySettings(IN PCWSTR Hotkey, IN PCWSTR LangHotkey, IN PCWSTR LayoutHotkey)
#define InitializeObjectAttributes(p, n, a, r, s)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING _Out_ PNDIS_HANDLE SubKeyHandle
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define KEY_CREATE_SUB_KEY
#define REG_OPTION_NON_VOLATILE
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSTATUS NTAPI NtCreateKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, IN ULONG TitleIndex, IN PUNICODE_STRING Class OPTIONAL, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID