ReactOS 0.4.15-dev-7693-gd0e2924
nls.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/rtl/nls.c
5 * PURPOSE: National Language Support (NLS) functions
6 * PROGRAMMERS: Emanuele Aliberti
7 */
8
9/* INCLUDES *****************************************************************/
10
11#include <rtl.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS *******************************************************************/
17
20
21USHORT NlsAnsiCodePage = 0; /* exported */
26PUSHORT NlsLeadByteInfo = NULL; /* exported */
27
34
37
38
39/* FUNCTIONS *****************************************************************/
40
41/*
42 * @unimplemented
43 */
47 IN ULONG UnicodeSize,
48 OUT PULONG ResultSize OPTIONAL,
49 IN PCHAR CustomString,
50 IN ULONG CustomSize)
51{
52 ULONG Size = 0;
53 ULONG i;
54
56
57 if (!CustomCP->DBCSCodePage)
58 {
59 /* single-byte code page */
60 if (CustomSize > (UnicodeSize / sizeof(WCHAR)))
61 Size = UnicodeSize / sizeof(WCHAR);
62 else
63 Size = CustomSize;
64
65 if (ResultSize)
66 *ResultSize = Size * sizeof(WCHAR);
67
68 for (i = 0; i < Size; i++)
69 {
70 *UnicodeString = CustomCP->MultiByteTable[(UCHAR)*CustomString];
72 CustomString++;
73 }
74 }
75 else
76 {
77 /* multi-byte code page */
78 /* FIXME */
80 }
81
82 return STATUS_SUCCESS;
83}
84
85/*
86 * @implemented
87 */
90{
92
94
95 if (Source < L'A')
96 return Source;
97
98 if (Source <= L'Z')
99 return Source + (L'a' - L'A');
100
101 if (Source < 0x80)
102 return Source;
103
104 Offset = ((USHORT)Source >> 8);
105 DPRINT("Offset: %hx\n", Offset);
106
108 DPRINT("Offset: %hx\n", Offset);
109
110 Offset += (((USHORT)Source & 0x00F0) >> 4);
111 DPRINT("Offset: %hx\n", Offset);
112
114 DPRINT("Offset: %hx\n", Offset);
115
116 Offset += ((USHORT)Source & 0x000F);
117 DPRINT("Offset: %hx\n", Offset);
118
120 DPRINT("Offset: %hx\n", Offset);
121
122 DPRINT("Result: %hx\n", Source + (SHORT)Offset);
123
124 return Source + (SHORT)Offset;
125}
126
127/*
128 * @implemented
129 */
132{
134
136}
137
138/*
139 * @implemented
140 */
144{
146
149}
150
151/*
152 * @implemented
153 */
157{
158 PNLS_FILE_HEADER NlsFileHeader;
159
161
162 DPRINT("RtlInitCodePageTable() called\n");
163
164 NlsFileHeader = (PNLS_FILE_HEADER)TableBase;
165
166 /* Copy header fields first */
167 CodePageTable->CodePage = NlsFileHeader->CodePage;
169 CodePageTable->DefaultChar = NlsFileHeader->DefaultChar;
173
175 &NlsFileHeader->LeadByte,
177
178 /* Offset to wide char table is after the header */
180 TableBase + NlsFileHeader->HeaderSize + 1 + TableBase[NlsFileHeader->HeaderSize];
181
182 /* Then multibyte table (256 wchars) follows */
183 CodePageTable->MultiByteTable = TableBase + NlsFileHeader->HeaderSize + 1;
184
185 /* Check the presence of glyph table (256 wchars) */
186 if (!CodePageTable->MultiByteTable[256])
188 else
190
191 /* Is this double-byte code page? */
193 {
196 }
197 else
198 {
201 }
202}
203
204/*
205 * @implemented
206 */
209 IN PUSHORT OemTableBase,
210 IN PUSHORT CaseTableBase,
211 OUT PNLSTABLEINFO NlsTable)
212{
214
215 DPRINT("RtlInitNlsTables()called\n");
216
217 if (AnsiTableBase && OemTableBase && CaseTableBase)
218 {
219 RtlInitCodePageTable(AnsiTableBase, &NlsTable->AnsiTableInfo);
220 RtlInitCodePageTable(OemTableBase, &NlsTable->OemTableInfo);
221
222 NlsTable->UpperCaseTable = (PUSHORT)CaseTableBase + 2;
223 NlsTable->LowerCaseTable = (PUSHORT)CaseTableBase + *((PUSHORT)CaseTableBase + 1) + 2;
224 }
225}
226
227/*
228 * @unimplemented
229 */
232 IN ULONG UnicodeSize,
233 OUT PULONG ResultSize,
234 IN PCSTR MbString,
235 IN ULONG MbSize)
236{
237 ULONG Size = 0;
238 ULONG i;
239
241
242 if (!NlsMbCodePageTag)
243 {
244 /* single-byte code page */
245 if (MbSize > (UnicodeSize / sizeof(WCHAR)))
246 Size = UnicodeSize / sizeof(WCHAR);
247 else
248 Size = MbSize;
249
250 if (ResultSize)
251 *ResultSize = Size * sizeof(WCHAR);
252
253 for (i = 0; i < Size; i++)
254 {
256 }
257 }
258 else
259 {
260 /* multi-byte code page */
261 /* FIXME */
262
263 UCHAR Char;
264 USHORT LeadByteInfo;
265 PCSTR MbEnd = MbString + MbSize;
266
267 for (i = 0; i < UnicodeSize / sizeof(WCHAR) && MbString < MbEnd; i++)
268 {
269 Char = *(PUCHAR)MbString++;
270
271 if (Char < 0x80)
272 {
273 *UnicodeString++ = Char;
274 continue;
275 }
276
277 LeadByteInfo = NlsLeadByteInfo[Char];
278
279 if (!LeadByteInfo)
280 {
282 continue;
283 }
284
285 if (MbString < MbEnd)
286 *UnicodeString++ = NlsLeadByteInfo[LeadByteInfo + *(PUCHAR)MbString++];
287 }
288
289 if (ResultSize)
290 *ResultSize = i * sizeof(WCHAR);
291 }
292
293 return STATUS_SUCCESS;
294}
295
296/*
297 * @unimplemented
298 */
300NTAPI
302 IN ULONG UnicodeSize,
303 OUT PULONG ResultSize,
304 IN PCSTR MbString,
305 IN ULONG MbSize,
307{
309
311 DPRINT1("RtlConsoleMultiByteToUnicodeN calling RtlMultiByteToUnicodeN\n");
312 *Unknown = 1;
314 UnicodeSize,
315 ResultSize,
316 MbString,
317 MbSize);
318}
319
320/*
321 * @implemented
322 */
324NTAPI
326 IN PCSTR MbString,
327 IN ULONG MbSize)
328{
329 ULONG Length = 0;
330
332
333 if (!NlsMbCodePageTag)
334 {
335 /* single-byte code page */
336 *UnicodeSize = MbSize * sizeof(WCHAR);
337 }
338 else
339 {
340 /* multi-byte code page */
341 /* FIXME */
342
343 while (MbSize--)
344 {
345 UCHAR Char = *(PUCHAR)MbString++;
346
347 if (Char >= 0x80 && NlsLeadByteInfo[Char])
348 {
349 if (MbSize)
350 {
351 /* Move on */
352 MbSize--;
353 MbString++;
354 }
355 }
356
357 /* Increase returned size */
358 Length++;
359 }
360
361 /* Return final size */
362 *UnicodeSize = Length * sizeof(WCHAR);
363 }
364
365 /* Success */
366 return STATUS_SUCCESS;
367}
368
369/*
370 * @unimplemented
371 */
374 IN ULONG UnicodeSize,
375 OUT PULONG ResultSize OPTIONAL,
377 IN ULONG OemSize)
378{
379 ULONG Size = 0;
380 ULONG i;
381
383
385 {
386 /* single-byte code page */
387 if (OemSize > (UnicodeSize / sizeof(WCHAR)))
388 Size = UnicodeSize / sizeof(WCHAR);
389 else
390 Size = OemSize;
391
392 if (ResultSize)
393 *ResultSize = Size * sizeof(WCHAR);
394
395 for (i = 0; i < Size; i++)
396 {
399 OemString++;
400 }
401 }
402 else
403 {
404 /* multi-byte code page */
405 /* FIXME */
406
407 UCHAR Char;
408 USHORT OemLeadByteInfo;
409 PCCH OemEnd = OemString + OemSize;
410
411 for (i = 0; i < UnicodeSize / sizeof(WCHAR) && OemString < OemEnd; i++)
412 {
413 Char = *(PUCHAR)OemString++;
414
415 if (Char < 0x80)
416 {
417 *UnicodeString++ = Char;
418 continue;
419 }
420
421 OemLeadByteInfo = NlsOemLeadByteInfo[Char];
422
423 if (!OemLeadByteInfo)
424 {
426 continue;
427 }
428
429 if (OemString < OemEnd)
430 *UnicodeString++ =
431 NlsOemLeadByteInfo[OemLeadByteInfo + *(PUCHAR)OemString++];
432 }
433
434 if (ResultSize)
435 *ResultSize = i * sizeof(WCHAR);
436 }
437
438 return STATUS_SUCCESS;
439}
440
441/*
442 * @implemented
443 */
446{
448
449 DPRINT("RtlResetRtlTranslations() called\n");
450
451 /* Set ANSI data */
452 NlsAnsiToUnicodeTable = (PUSHORT)NlsTable->AnsiTableInfo.MultiByteTable;
453 NlsUnicodeToAnsiTable = NlsTable->AnsiTableInfo.WideCharTable;
454 NlsUnicodeToMbAnsiTable = (PUSHORT)NlsTable->AnsiTableInfo.WideCharTable;
455 NlsMbCodePageTag = (NlsTable->AnsiTableInfo.DBCSCodePage != 0);
456 NlsLeadByteInfo = NlsTable->AnsiTableInfo.DBCSOffsets;
457 NlsAnsiCodePage = NlsTable->AnsiTableInfo.CodePage;
458 DPRINT("Ansi codepage %hu\n", NlsAnsiCodePage);
459
460 /* Set OEM data */
461 NlsOemToUnicodeTable = (PUSHORT)NlsTable->OemTableInfo.MultiByteTable;
462 NlsUnicodeToOemTable = NlsTable->OemTableInfo.WideCharTable;
463 NlsUnicodeToMbOemTable = (PUSHORT)NlsTable->OemTableInfo.WideCharTable;
464 NlsMbOemCodePageTag = (NlsTable->OemTableInfo.DBCSCodePage != 0);
465 NlsOemLeadByteInfo = NlsTable->OemTableInfo.DBCSOffsets;
466 NlsOemCodePage = NlsTable->OemTableInfo.CodePage;
467 DPRINT("Oem codepage %hu\n", NlsOemCodePage);
468
469 /* Set Unicode case map data */
470 NlsUnicodeUpcaseTable = NlsTable->UpperCaseTable;
471 NlsUnicodeLowercaseTable = NlsTable->LowerCaseTable;
472
473 /* set the default characters for RtlpDidUnicodeToOemWork */
474 NlsOemDefaultChar = NlsTable->OemTableInfo.DefaultChar;
475 NlsUnicodeDefaultChar = NlsTable->OemTableInfo.TransDefaultChar;
476}
477
478/*
479 * @unimplemented
480 */
483 OUT PCHAR CustomString,
484 IN ULONG CustomSize,
485 OUT PULONG ResultSize OPTIONAL,
487 IN ULONG UnicodeSize)
488{
489 ULONG Size = 0;
490 ULONG i;
491
493
494 if (!CustomCP->DBCSCodePage)
495 {
496 /* single-byte code page */
497 if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
498 Size = CustomSize;
499 else
500 Size = UnicodeSize / sizeof(WCHAR);
501
502 if (ResultSize)
503 *ResultSize = Size;
504
505 for (i = 0; i < Size; i++)
506 {
507 *CustomString = ((PCHAR)CustomCP->WideCharTable)[*UnicodeString];
508 CustomString++;
510 }
511 }
512 else
513 {
514 /* multi-byte code page */
515 /* FIXME */
516 ASSERT(FALSE);
517 }
518
519 return STATUS_SUCCESS;
520}
521
522/*
523 * @unimplemented
524 */
527 IN ULONG MbSize,
528 OUT PULONG ResultSize OPTIONAL,
530 IN ULONG UnicodeSize)
531{
532 ULONG Size = 0;
533 ULONG i;
534
536
537 if (!NlsMbCodePageTag)
538 {
539 /* single-byte code page */
540 Size = (UnicodeSize > (MbSize * sizeof(WCHAR)))
541 ? MbSize : (UnicodeSize / sizeof(WCHAR));
542
543 if (ResultSize)
544 *ResultSize = Size;
545
546 for (i = 0; i < Size; i++)
547 {
548 *MbString++ = NlsUnicodeToAnsiTable[*UnicodeString++];
549 }
550 }
551 else
552 {
553 /* multi-byte code page */
554 /* FIXME */
555
556 USHORT WideChar;
557 USHORT MbChar;
558
559 for (i = MbSize, Size = UnicodeSize / sizeof(WCHAR); i && Size; i--, Size--)
560 {
561 WideChar = *UnicodeString++;
562
563 if (WideChar < 0x80)
564 {
565 *MbString++ = LOBYTE(WideChar);
566 continue;
567 }
568
569 MbChar = NlsUnicodeToMbAnsiTable[WideChar];
570
571 if (!HIBYTE(MbChar))
572 {
573 *MbString++ = LOBYTE(MbChar);
574 continue;
575 }
576
577 if (i >= 2)
578 {
579 *MbString++ = HIBYTE(MbChar);
580 *MbString++ = LOBYTE(MbChar);
581 i--;
582 }
583 else break;
584 }
585
586 if (ResultSize)
587 *ResultSize = MbSize - i;
588 }
589
590 return STATUS_SUCCESS;
591}
592
593/*
594 * @implemented
595 */
597NTAPI
600 IN ULONG UnicodeSize)
601{
602 ULONG UnicodeLength = UnicodeSize / sizeof(WCHAR);
603 ULONG MbLength = 0;
604
606
607 if (!NlsMbCodePageTag)
608 {
609 /* single-byte code page */
610 *MbSize = UnicodeLength;
611 }
612 else
613 {
614 /* multi-byte code page */
615 /* FIXME */
616
617 while (UnicodeLength--)
618 {
619 USHORT WideChar = *UnicodeString++;
620
621 if (WideChar >= 0x80 && HIBYTE(NlsUnicodeToMbAnsiTable[WideChar]))
622 {
623 MbLength += sizeof(WCHAR);
624 }
625 else
626 {
627 MbLength++;
628 }
629 }
630
631 *MbSize = MbLength;
632 }
633
634 /* Success */
635 return STATUS_SUCCESS;
636}
637
638/*
639 * @implemented
640 */
642NTAPI
644 IN ULONG OemSize,
645 OUT PULONG ResultSize OPTIONAL,
647 IN ULONG UnicodeSize)
648{
649 ULONG Size = 0;
650
652
653 /* Bytes -> chars */
654 UnicodeSize /= sizeof(WCHAR);
655
657 {
658 while (OemSize && UnicodeSize)
659 {
661 Size++;
662 OemSize--;
663 UnicodeSize--;
664 }
665 }
666 else
667 {
668 while (OemSize && UnicodeSize)
669 {
671
672 if (HIBYTE(OemChar))
673 {
674 if (OemSize < 2)
675 break;
676 OemString[Size++] = HIBYTE(OemChar);
677 OemSize--;
678 }
679 OemString[Size++] = LOBYTE(OemChar);
680 OemSize--;
681 UnicodeSize--;
682 }
683 }
684
685 if (ResultSize)
686 *ResultSize = Size;
687
688 return UnicodeSize ? STATUS_BUFFER_OVERFLOW : STATUS_SUCCESS;
689}
690
691/*
692 * @implemented
693 */
696{
698
699 if (Source < 'a')
700 return Source;
701
702 if (Source <= 'z')
703 return (Source - ('a' - 'A'));
704
705 Offset = ((USHORT)Source >> 8) & 0xFF;
707
708 Offset += ((USHORT)Source >> 4) & 0xF;
710
711 Offset += ((USHORT)Source & 0xF);
713
714 return Source + (SHORT)Offset;
715}
716
717/*
718 * @implemented
719 */
722{
724
726}
727
728/*
729 * @implemented
730 */
733 OUT PCHAR CustomString,
734 IN ULONG CustomSize,
735 OUT PULONG ResultSize OPTIONAL,
737 IN ULONG UnicodeSize)
738{
739 WCHAR UpcaseChar;
740 ULONG Size = 0;
741 ULONG i;
742
744
745 if (!CustomCP->DBCSCodePage)
746 {
747 /* single-byte code page */
748 if (UnicodeSize > (CustomSize * sizeof(WCHAR)))
749 Size = CustomSize;
750 else
751 Size = UnicodeSize / sizeof(WCHAR);
752
753 if (ResultSize)
754 *ResultSize = Size;
755
756 for (i = 0; i < Size; i++)
757 {
759 *CustomString = ((PCHAR)CustomCP->WideCharTable)[UpcaseChar];
760 ++CustomString;
762 }
763 }
764 else
765 {
766 /* multi-byte code page */
767 /* FIXME */
768 ASSERT(FALSE);
769 }
770
771 return STATUS_SUCCESS;
772}
773
774/*
775 * @unimplemented
776 */
779 IN ULONG MbSize,
780 OUT PULONG ResultSize OPTIONAL,
782 IN ULONG UnicodeSize)
783{
784 WCHAR UpcaseChar;
785 ULONG Size = 0;
786 ULONG i;
787
789
790 if (!NlsMbCodePageTag)
791 {
792 /* single-byte code page */
793 if (UnicodeSize > (MbSize * sizeof(WCHAR)))
794 Size = MbSize;
795 else
796 Size = UnicodeSize / sizeof(WCHAR);
797
798 if (ResultSize)
799 *ResultSize = Size;
800
801 for (i = 0; i < Size; i++)
802 {
804 *MbString = NlsUnicodeToAnsiTable[UpcaseChar];
805 MbString++;
807 }
808 }
809 else
810 {
811 /* multi-byte code page */
812 /* FIXME */
813 ASSERT(FALSE);
814 }
815
816 return STATUS_SUCCESS;
817}
818
819/*
820 * @unimplemented
821 */
824 IN ULONG OemSize,
825 OUT PULONG ResultSize OPTIONAL,
827 IN ULONG UnicodeSize)
828{
829 WCHAR UpcaseChar;
830 ULONG Size = 0;
831 ULONG i;
832
834
836 {
837 /* single-byte code page */
838 if (UnicodeSize > (OemSize * sizeof(WCHAR)))
839 Size = OemSize;
840 else
841 Size = UnicodeSize / sizeof(WCHAR);
842
843 if (ResultSize)
844 *ResultSize = Size;
845
846 for (i = 0; i < Size; i++)
847 {
849 *OemString = NlsUnicodeToOemTable[UpcaseChar];
850 OemString++;
852 }
853 }
854 else
855 {
856 /* multi-byte code page */
857 /* FIXME */
858
859 USHORT WideChar;
860 USHORT OemChar;
861
862 for (i = OemSize, Size = UnicodeSize / sizeof(WCHAR); i && Size; i--, Size--)
863 {
865
866 if (WideChar < 0x80)
867 {
868 *OemString++ = LOBYTE(WideChar);
869 continue;
870 }
871
872 OemChar = NlsUnicodeToMbOemTable[WideChar];
873
874 if (!HIBYTE(OemChar))
875 {
876 *OemString++ = LOBYTE(OemChar);
877 continue;
878 }
879
880 if (i >= 2)
881 {
882 *OemString++ = HIBYTE(OemChar);
883 *OemString++ = LOBYTE(OemChar);
884 i--;
885 }
886 else break;
887 }
888
889 if (ResultSize)
890 *ResultSize = OemSize - i;
891 }
892
893 return STATUS_SUCCESS;
894}
895
896/*
897 * @unimplemented
898 */
901{
902 WCHAR Unicode;
904
906
907 /* Check for simple ANSI case */
908 if (Source <= 'z')
909 {
910 /* Check for simple downcase a-z case */
911 if (Source >= 'a')
912 {
913 /* Just XOR with the difference */
914 return Source ^ ('a' - 'A');
915 }
916 else
917 {
918 /* Otherwise return the same char, it's already upcase */
919 return Source;
920 }
921 }
922 else
923 {
924 if (!NlsMbCodePageTag)
925 {
926 /* single-byte code page */
927
928 /* ansi->unicode */
930
931 /* upcase conversion */
932 Unicode = RtlpUpcaseUnicodeChar (Unicode);
933
934 /* unicode -> ansi */
936 }
937 else
938 {
939 /* multi-byte code page */
940 /* FIXME */
942 }
943 }
944
945 return Destination;
946}
947
948/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define UNIMPLEMENTED
Definition: debug.h:115
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static CODEPAGE_ENTRY AnsiCodePage
Definition: nls.c:46
static CODEPAGE_ENTRY OemCodePage
Definition: nls.c:47
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
Definition: glfuncs.h:248
@ Unknown
Definition: i8042prt.h:114
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
#define PCHAR
Definition: match.c:90
#define ASSERT(a)
Definition: mode.c:44
#define MAXIMUM_LEADBYTES
Definition: precomp.h:16
struct _NLS_FILE_HEADER * PNLS_FILE_HEADER
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_Out_ PCPTABLEINFO CodePageTable
Definition: rtlfuncs.h:4316
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3004
CONST WCHAR * PCWCH
Definition: ntbasedef.h:411
CONST CHAR * PCCH
Definition: ntbasedef.h:392
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define L(x)
Definition: ntvdm.h:50
short SHORT
Definition: pedump.c:59
unsigned short USHORT
Definition: pedump.c:61
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
USHORT NlsOemDefaultChar
Definition: nls.c:35
VOID NTAPI RtlInitNlsTables(IN PUSHORT AnsiTableBase, IN PUSHORT OemTableBase, IN PUSHORT CaseTableBase, OUT PNLSTABLEINFO NlsTable)
Definition: nls.c:208
WCHAR NTAPI RtlpUpcaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:695
USHORT NlsOemCodePage
Definition: nls.c:28
PUSHORT NlsUnicodeToMbOemTable
Definition: nls.c:32
NTSTATUS NTAPI RtlMultiByteToUnicodeN(OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, OUT PULONG ResultSize, IN PCSTR MbString, IN ULONG MbSize)
Definition: nls.c:231
PCHAR NlsUnicodeToAnsiTable
Definition: nls.c:24
PUSHORT NlsOemLeadByteInfo
Definition: nls.c:33
USHORT NlsUnicodeDefaultChar
Definition: nls.c:36
VOID NTAPI RtlGetDefaultCodePage(OUT PUSHORT AnsiCodePage, OUT PUSHORT OemCodePage)
Definition: nls.c:142
BOOLEAN NlsMbOemCodePageTag
Definition: nls.c:29
PUSHORT NlsLeadByteInfo
Definition: nls.c:26
VOID NTAPI RtlInitCodePageTable(IN PUSHORT TableBase, OUT PCPTABLEINFO CodePageTable)
Definition: nls.c:155
VOID NTAPI RtlResetRtlTranslations(IN PNLSTABLEINFO NlsTable)
Definition: nls.c:445
WCHAR NTAPI RtlDowncaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:131
WCHAR NTAPI RtlpDowncaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:89
WCHAR NTAPI RtlUpcaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:721
PUSHORT NlsUnicodeLowercaseTable
Definition: nls.c:19
PUSHORT NlsOemToUnicodeTable
Definition: nls.c:30
NTSTATUS NTAPI RtlUnicodeToMultiByteSize(OUT PULONG MbSize, IN PCWCH UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:598
PUSHORT NlsAnsiToUnicodeTable
Definition: nls.c:23
NTSTATUS NTAPI RtlUnicodeToOemN(OUT PCHAR OemString, IN ULONG OemSize, OUT PULONG ResultSize OPTIONAL, IN PCWCH UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:643
NTSTATUS NTAPI RtlCustomCPToUnicodeN(IN PCPTABLEINFO CustomCP, OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, OUT PULONG ResultSize OPTIONAL, IN PCHAR CustomString, IN ULONG CustomSize)
Definition: nls.c:45
NTSTATUS NTAPI RtlUpcaseUnicodeToMultiByteN(OUT PCHAR MbString, IN ULONG MbSize, OUT PULONG ResultSize OPTIONAL, IN PCWCH UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:778
NTSTATUS NTAPI RtlConsoleMultiByteToUnicodeN(OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, OUT PULONG ResultSize, IN PCSTR MbString, IN ULONG MbSize, OUT PULONG Unknown)
Definition: nls.c:301
USHORT NlsAnsiCodePage
Definition: nls.c:21
NTSTATUS NTAPI RtlUpcaseUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP, OUT PCHAR CustomString, IN ULONG CustomSize, OUT PULONG ResultSize OPTIONAL, IN PWCHAR UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:732
PUSHORT NlsUnicodeToMbAnsiTable
Definition: nls.c:25
NTSTATUS NTAPI RtlOemToUnicodeN(OUT PWCHAR UnicodeString, IN ULONG UnicodeSize, OUT PULONG ResultSize OPTIONAL, IN PCCH OemString, IN ULONG OemSize)
Definition: nls.c:373
NTSTATUS NTAPI RtlUnicodeToMultiByteN(OUT PCHAR MbString, IN ULONG MbSize, OUT PULONG ResultSize OPTIONAL, IN PCWCH UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:526
PCHAR NlsUnicodeToOemTable
Definition: nls.c:31
NTSTATUS NTAPI RtlMultiByteToUnicodeSize(OUT PULONG UnicodeSize, IN PCSTR MbString, IN ULONG MbSize)
Definition: nls.c:325
NTSTATUS NTAPI RtlUnicodeToCustomCPN(IN PCPTABLEINFO CustomCP, OUT PCHAR CustomString, IN ULONG CustomSize, OUT PULONG ResultSize OPTIONAL, IN PWCHAR UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:482
BOOLEAN NlsMbCodePageTag
Definition: nls.c:22
CHAR NTAPI RtlUpperChar(IN CHAR Source)
Definition: nls.c:900
NTSTATUS NTAPI RtlUpcaseUnicodeToOemN(OUT PCHAR OemString, IN ULONG OemSize, OUT PULONG ResultSize OPTIONAL, IN PCWCH UnicodeString, IN ULONG UnicodeSize)
Definition: nls.c:823
PUSHORT NlsUnicodeUpcaseTable
Definition: nls.c:18
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define DPRINT
Definition: sndvol32.h:71
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
USHORT DefaultChar
Definition: precomp.h:34
PUSHORT DBCSRanges
Definition: precomp.h:42
USHORT DBCSCodePage
Definition: precomp.h:38
USHORT TransDefaultChar
Definition: precomp.h:36
PUSHORT MultiByteTable
Definition: precomp.h:40
UCHAR LeadByte[MAXIMUM_LEADBYTES]
Definition: precomp.h:39
USHORT CodePage
Definition: precomp.h:32
PUSHORT DBCSOffsets
Definition: precomp.h:43
USHORT UniDefaultChar
Definition: precomp.h:35
USHORT MaximumCharacterSize
Definition: precomp.h:33
PVOID WideCharTable
Definition: precomp.h:41
USHORT TransUniDefaultChar
Definition: precomp.h:37
USHORT MaximumCharacterSize
Definition: precomp.h:22
UCHAR LeadByte[MAXIMUM_LEADBYTES]
Definition: precomp.h:27
USHORT TransDefaultChar
Definition: precomp.h:25
USHORT HeaderSize
Definition: precomp.h:20
USHORT CodePage
Definition: precomp.h:21
USHORT TransUniDefaultChar
Definition: precomp.h:26
USHORT DefaultChar
Definition: precomp.h:23
USHORT UniDefaultChar
Definition: precomp.h:24
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
uint16_t * PUSHORT
Definition: typedefs.h:56
const char * PCSTR
Definition: typedefs.h:52
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define IN
Definition: typedefs.h:39
uint16_t * PWCHAR
Definition: typedefs.h:56
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
char * PCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
*BytesInOemString PCHAR OemString
Definition: rtlfuncs.h:1560
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175