#include <rtl.h>
#include <debug.h>
Go to the source code of this file.
|
static int __cdecl | LcidSortEntryCompare (const void *a, const void *b) |
|
NTSTATUS NTAPI | RtlpInitializeLocaleTable (VOID) |
|
static _Must_inspect_result_ ULONG | FindIndexByLcid (_In_ LCID Lcid) |
|
static _Must_inspect_result_ INT | CompareLocaleNames (_In_ PCSTR AsciiLocaleName, _In_ PCUNICODE_STRING UnicodeLocaleName) |
|
static _Must_inspect_result_ ULONG | FindIndexByLocaleName (_In_ PCUNICODE_STRING LocaleName) |
|
static _Must_inspect_result_ BOOLEAN | CopyAsciizToUnicodeString (_Inout_ PUNICODE_STRING UnicodeString, _In_ PCSTR AsciiString) |
|
static BOOLEAN | IsNeutralLocale (_In_ LCID Lcid) |
|
NTSTATUS NTAPI | RtlLcidToLocaleName (_In_ LCID Lcid, _Inout_ PUNICODE_STRING LocaleName, _In_ ULONG Flags, _In_ BOOLEAN AllocateDestinationString) |
|
static _Must_inspect_result_ NTSTATUS | RtlpLocaleNameToLcidInternal (_In_ PCUNICODE_STRING LocaleName, _Out_ PLCID Lcid, _In_ ULONG Flags) |
|
NTSTATUS NTAPI | RtlLocaleNameToLcid (_In_ PCWSTR LocaleName, _Out_ PLCID Lcid, _In_ ULONG Flags) |
|
| _Success_ (return !=FALSE) |
|
BOOLEAN NTAPI | RtlIsValidLocaleName (_In_ LPCWSTR LocaleName, _In_ ULONG Flags) |
|
NTSTATUS NTAPI | RtlConvertLCIDToString (_In_ LCID LcidValue, _In_ ULONG Base, _In_ ULONG Padding, _Out_writes_(Size) PWSTR pResultBuf, _In_ ULONG Size) |
|
◆ LCID_ALT_NAME
#define LCID_ALT_NAME 0x00100000 |
◆ LOWERCASE_CHAR
#define LOWERCASE_CHAR |
( |
|
Char | ) |
(((Char) >= 'A' && (Char) <= 'Z') ? ((Char) + ('a' - 'A')) : (Char)) |
◆ MAX_BASIC_LCID
◆ MAX_PRIMARY_LANGUAGE
#define MAX_PRIMARY_LANGUAGE 0x3FF |
◆ NDEBUG
◆ LOCALE_ENTRY
◆ PSORT_ENTRY
◆ SORT_ENTRY
◆ _Success_()
Definition at line 886 of file locale.c.
892{
894
895
898 {
899 DPRINT1(
"RtlLcidToLocaleName failed with status 0x%lx\n",
Status);
901 }
902
904}
#define NT_SUCCESS(StatCode)
NTSTATUS NTAPI RtlLcidToLocaleName(_In_ LCID Lcid, _Inout_ PUNICODE_STRING LocaleName, _In_ ULONG Flags, _In_ BOOLEAN AllocateDestinationString)
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
_In_ CONST DEVPROPKEY _In_ LCID Lcid
◆ CompareLocaleNames()
Definition at line 613 of file locale.c.
616{
618
619
620 for (
i = 0;
i < UnicodeLocaleName->Length /
sizeof(
WCHAR);
i++)
621 {
622
625
626
627 if (Char1 == Char2)
628 {
629 continue;
630 }
631
632
633 if (AsciiLocaleName[
i] ==
'\0')
634 {
635
636 return -1;
637 }
638
639
640 return (
INT)Char1 - (
INT)Char2;
641 }
642
643
644
645 if (AsciiLocaleName[
i] ==
'\0')
646 {
647 return 0;
648 }
649
650
651 return 1;
652}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
#define LOWERCASE_CHAR(Char)
Referenced by FindIndexByLocaleName().
◆ CopyAsciizToUnicodeString()
Definition at line 692 of file locale.c.
695{
697
698
700 {
702 }
703
704
706 {
708 }
709
710
713
715}
ACPI_SIZE strlen(const char *String)
Referenced by RtlLcidToLocaleName().
◆ FindIndexByLcid()
Definition at line 571 of file locale.c.
573{
579
581 {
583
584
587
588
590 if (CurrentLcid <
Lcid)
591 {
593 }
594 else if (CurrentLcid >
Lcid)
595 {
597 }
598 else
599 {
601 }
602 }
603
605}
static USHORT RtlpLocaleIndexTable[_ARRAYSIZE(RtlpLocaleTable)]
static const LOCALE_ENTRY RtlpLocaleTable[]
Referenced by RtlLcidToLocaleName().
◆ FindIndexByLocaleName()
Definition at line 657 of file locale.c.
659{
663 PCSTR CurrentLocaleName;
665
667 {
669
672 if (CompareResult < 0)
673 {
675 }
676 else if (CompareResult > 0)
677 {
679 }
680 else
681 {
682 return Middle;
683 }
684 }
685
687}
static _In_ LPCWSTR LocaleName
static _Must_inspect_result_ INT CompareLocaleNames(_In_ PCSTR AsciiLocaleName, _In_ PCUNICODE_STRING UnicodeLocaleName)
Referenced by RtlpLocaleNameToLcidInternal().
◆ IsNeutralLocale()
◆ LcidSortEntryCompare()
Definition at line 515 of file locale.c.
516{
519 return SortEntryA->
Lcid - SortEntryB->
Lcid;
520}
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
struct _SORT_ENTRY * PSORT_ENTRY
Referenced by RtlpInitializeLocaleTable().
◆ RtlConvertLCIDToString()
Definition at line 945 of file locale.c.
951{
954}
#define STATUS_NOT_IMPLEMENTED
◆ RtlIsValidLocaleName()
◆ RtlLcidToLocaleName()
Definition at line 735 of file locale.c.
740{
742
743
745 {
746 DPRINT1(
"RtlLcidToLocaleName: Invalid flags: 0x%lx\n",
Flags);
748 }
749
750
752 {
753 DPRINT1(
"RtlLcidToLocaleName: Invalid buffer\n");
755 }
756
757
759 {
760 DPRINT1(
"RtlLcidToLocaleName: Invalid LCID: 0x%lx\n",
Lcid);
762 }
763
764
765 if ((
Flags & RTL_LOCALE_ALLOW_NEUTRAL_NAMES) == 0)
766 {
767
769 {
770 DPRINT(
"RtlLcidToLocaleName: Neutral LCID: 0x%lx\n",
Lcid);
772 }
773 }
774
775
777 {
780 break;
781
785 break;
786
789 }
790
791
794 {
795 DPRINT(
"RtlLcidToLocaleName: LCID 0x%lx not found\n",
Lcid);
797 }
798
799
801 {
802 DPRINT(
"RtlLcidToLocaleName: Buffer too small\n");
804 }
805
807}
#define LOCALE_USER_DEFAULT
#define LOCALE_CUSTOM_DEFAULT
#define LOCALE_SYSTEM_DEFAULT
#define LOCALE_CUSTOM_UI_DEFAULT
#define NLS_VALID_LOCALE_MASK
#define STATUS_INVALID_PARAMETER_2
#define STATUS_INVALID_PARAMETER_1
#define STATUS_INVALID_PARAMETER_3
LCID RtlpSystemDefaultLcid
static _Must_inspect_result_ ULONG FindIndexByLcid(_In_ LCID Lcid)
static BOOLEAN IsNeutralLocale(_In_ LCID Lcid)
static _Must_inspect_result_ BOOLEAN CopyAsciizToUnicodeString(_Inout_ PUNICODE_STRING UnicodeString, _In_ PCSTR AsciiString)
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_UNSUCCESSFUL
_Must_inspect_result_ _In_ ULONG Flags
Referenced by _Success_().
◆ RtlLocaleNameToLcid()
Definition at line 872 of file locale.c.
876{
878
879
881
882
884}
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
static _Must_inspect_result_ NTSTATUS RtlpLocaleNameToLcidInternal(_In_ PCUNICODE_STRING LocaleName, _Out_ PLCID Lcid, _In_ ULONG Flags)
◆ RtlpInitializeLocaleTable()
Definition at line 529 of file locale.c.
530{
533
536
539 if (SortTable ==
NULL)
540 {
542 }
543
544
546 {
549 }
550
551
554 sizeof(SortTable[0]),
556
557
559 {
561 }
562
564
566}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
NTSTATUS NTAPI NtQueryDefaultLocale(IN BOOLEAN UserProfile, OUT PLCID DefaultLocaleId)
static int __cdecl LcidSortEntryCompare(const void *a, const void *b)
#define STATUS_INSUFFICIENT_RESOURCES
Referenced by LdrpInitializeProcess().
◆ RtlpLocaleNameToLcidInternal()
Definition at line 812 of file locale.c.
816{
819
820
822 {
823 DPRINT1(
"RtlpLocaleNameToLcidInternal: Invalid buffer\n");
825 }
826
827
829 {
830 DPRINT1(
"RtlpLocaleNameToLcidInternal: Lcid is NULL\n");
832 }
833
834
836 {
837 DPRINT1(
"RtlpLocaleNameToLcidInternal: Invalid flags: 0x%lx\n",
Flags);
839 }
840
841
844 {
845 DPRINT(
"RtlpLocaleNameToLcidInternal: Locale name not found\n");
847 }
848
849
851
852
853 if ((
Flags & RTL_LOCALE_ALLOW_NEUTRAL_NAMES) == 0)
854 {
855
857 {
858 DPRINT(
"RtlpLocaleNameToLcidInternal: Neutral LCID: 0x%lx\n", FoundLcid);
860 }
861 }
862
863
865
867}
static _Must_inspect_result_ ULONG FindIndexByLocaleName(_In_ PCUNICODE_STRING LocaleName)
Referenced by RtlLocaleNameToLcid().
◆ RtlpLocaleIndexTable
◆ RtlpLocaleTable
◆ RtlpSystemDefaultLcid
LCID RtlpSystemDefaultLcid |
◆ RtlpUserDefaultLcid