/* * @implemented */ NTSTATUS NTAPI NtQueryInstallUILanguage(OUT LANGID* LanguageId) { NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); /* Enter SEH for probing */ _SEH2_TRY { /* Check if we came from user mode */ if (KeGetPreviousMode() != KernelMode) { /* Probe the Language ID */ ProbeForWriteLangid(LanguageId); } /* Return it */ *LanguageId = PsInstallUILanguageId; } _SEH2_EXCEPT(ExSystemExceptionFilter()) { /* Get exception code */ Status = _SEH2_GetExceptionCode(); } _SEH2_END; /* Return status */ return Status; }
/* * @implemented */ NTSTATUS NTAPI NtQueryDefaultUILanguage(OUT LANGID* LanguageId) { NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); /* Enter SEH for probing */ _SEH2_TRY { /* Check if we came from user mode */ if (KeGetPreviousMode() != KernelMode) { /* Probe the Language ID */ ProbeForWriteLangid(LanguageId); } /* Call the executive helper routine */ Status = ExpGetCurrentUserUILanguage(L"MultiUILanguageId", LanguageId); if (NT_SUCCESS(Status)) { /* Success, return the language */ *LanguageId = PsInstallUILanguageId; } } _SEH2_EXCEPT(ExSystemExceptionFilter()) { /* Get exception code */ Status = _SEH2_GetExceptionCode(); } _SEH2_END; /* Return status */ return Status; }
NTSTATUS NTAPI NtQueryDefaultLocale(IN BOOLEAN UserProfile, OUT PLCID DefaultLocaleId) { NTSTATUS Status = STATUS_SUCCESS; PAGED_CODE(); /* Enter SEH for probing */ _SEH2_TRY { /* Check if we came from user mode */ if (KeGetPreviousMode() != KernelMode) { /* Probe the language ID */ ProbeForWriteLangid(DefaultLocaleId); } /* Check if we have a user profile */ if (UserProfile) { /* Return session wide thread locale */ *DefaultLocaleId = MmGetSessionLocaleId(); } else { /* Return system locale */ *DefaultLocaleId = PsDefaultSystemLocaleId; } } _SEH2_EXCEPT(ExSystemExceptionFilter()) { /* Get exception code */ Status = _SEH2_GetExceptionCode(); } _SEH2_END; /* Return status */ return Status; }