You are wrong. NtQueryDefaultLocale returns _default_ locale, not current thread's locale. Same with NtSetDefaultLocale. This value is stored in registry! And it is the same for all threads in the system. Current locale may differ for different threads. One thread may have US locale activated and another may have RU locale at the same time, while default locale may be set to DE, no matter.
Default thread's locale != current thread's locale.
so do not change my implement of NtUserGetKeyboardLayoutName it is correct test in Windows and in ReactOS.
Your implementation of NtUserGetKeyboardLayoutName is a HACK. My code is correct.
magnus@itkonsult-olsen.com пишет:
Thomas : ZwQueryDefaultLocale is located in ntoskrnl and it is call on NtQueryDefaultLocale check by my self
let us take a look at NtUserGetKeyboardLayoutName
- it return a keyboard name the keyboard name is the current active Keyboard LCID
to optain it we can use ZwQueryDefaultLocale (check reactos code in ntoskrnl how it works) so let us use ZwQueryDefaultLocale to optain the current activate keyboard with follow call ZwQueryDefaultLocale(FALSE, &LocaleId);
what happen then let us take a look at ZwQueryDefaultLocale if (UserProfile) *DefaultLocaleId = PsDefaultThreadLocaleId; else *DefaultLocaleId = PsDefaultSystemLocaleId;
return DefaultLocaleId;
etiher we get current threed local or local system keyboard LCID with this call depns on it is current user or not. depns what we whant.
so it is a correct impement to use it.
now we can check other thing as well please check how it works in ntoskrnl in ex/local.c then we can talk how it works.
Ros-dev mailing list Ros-dev@reactos.org http://www.reactos.org/mailman/listinfo/ros-dev