Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 104 of file locale.c.
Referenced by NtSetDefaultUILanguage().
{ OBJECT_ATTRIBUTES ObjectAttributes; UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"Control Panel\\Desktop"); UNICODE_STRING ValueName; WCHAR ValueBuffer[8]; ULONG ValueLength; HANDLE UserHandle; HANDLE KeyHandle; NTSTATUS Status; PAGED_CODE(); /* Setup the key name */ RtlInitUnicodeString(&ValueName, MuiName); /* Open the use key */ Status = RtlOpenCurrentUser(KEY_WRITE, &UserHandle); if (!NT_SUCCESS(Status)) return Status; /* Initialize the attributes */ InitializeObjectAttributes(&ObjectAttributes, &KeyName, OBJ_CASE_INSENSITIVE | OBJ_KERNEL_HANDLE, UserHandle, NULL); /* Open the key */ Status = ZwOpenKey(&KeyHandle, KEY_SET_VALUE, &ObjectAttributes); if (NT_SUCCESS(Status)) { /* Setup the value name */ ValueLength = swprintf(ValueBuffer, L"%04lX", (ULONG)LanguageId); /* Set the length for the call and set the value */ ValueLength = (ValueLength + 1) * sizeof(WCHAR); Status = ZwSetValueKey(KeyHandle, &ValueName, 0, REG_SZ, ValueBuffer, ValueLength); /* Close the handle for this key */ ZwClose(KeyHandle); } /* Close the user key and return status */ ZwClose(UserHandle); return Status; }