27 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
28 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
29 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
31 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
32 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
33 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
34 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 0
38 static const unsigned char UTF8Mask[6] = {0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01};
42 {0, 0x80, 0x800, 0x10000, 0x200000, 0x2000000, 0xFFFFFFFF};
97 DPRINT1(
"Failed to create NLS directory security (Status 0x%08x)\n",
Status);
185 CurrentEntry = CurrentEntry->
Flink)
215 CHAR SectionName[40];
218 PBYTE SectionMapping;
239 sizeof(CodePage) /
sizeof(
WCHAR)))
252 sizeof(CodePage) /
sizeof(
WCHAR)))
261 if (CodePageEntry !=
NULL)
263 return CodePageEntry;
277 "\\Nls\\NlsSectionCP",
279 sizeof(SectionName)))
361 if (SectionMapping ==
NULL)
369 if (CodePageEntry ==
NULL)
386 return CodePageEntry;
407 LPCSTR MbsEnd, MbsPtrSave;
408 UCHAR Char, TrailLength;
411 BOOL CharIsValid, StringIsValid =
TRUE;
412 const WCHAR InvalidChar = 0xFFFD;
421 if (WideCharCount == 0)
433 if ((Char & 0xC0) == 0x80)
436 StringIsValid =
FALSE;
441 if (TrailLength == 0)
443 StringIsValid =
FALSE;
449 WideChar = Char &
UTF8Mask[TrailLength];
455 CharIsValid = StringIsValid =
FALSE;
472 StringIsValid =
FALSE;
481 return WideCharCount;
491 *WideCharString++ = Char;
495 if ((Char & 0xC0) == 0x80)
497 *WideCharString++ = InvalidChar;
499 StringIsValid =
FALSE;
504 if (TrailLength == 0)
506 *WideCharString++ = InvalidChar;
507 StringIsValid =
FALSE;
513 WideChar = Char &
UTF8Mask[TrailLength];
519 CharIsValid = StringIsValid =
FALSE;
529 *WideCharString++ = WideChar;
533 *WideCharString++ = InvalidChar;
535 StringIsValid =
FALSE;
541 *WideCharString = InvalidChar;
589 if (CodePageEntry ==
NULL)
620 while (TempString < MbsEnd)
627 if (((TempString + 1) == MbsEnd) || (*(TempString + 1) == 0))
646 WideChar = MultiByteTable[(
UCHAR)*TempString];
651 (WideChar >= 0xE000 && WideChar <= 0xF8FF))
663 if (WideCharCount == 0)
678 return WideCharCount;
689 *WideCharString++ = MultiByteTable[Char];
718 TempString++, TempLength--)
720 WideChar = MultiByteTable[(
UCHAR)*TempString];
725 (WideChar >= 0xE000 && WideChar <= 0xF8FF))
734 if (WideCharCount == 0)
735 return MultiByteCount;
738 for (TempLength = (WideCharCount < MultiByteCount) ? WideCharCount : MultiByteCount;
746 if (WideCharCount < MultiByteCount)
748 MultiByteCount = WideCharCount;
752 return MultiByteCount;
784 if (WideCharCount == 0)
786 return MultiByteCount;
789 WideCharMaxLen = WideCharCount > MultiByteCount ? MultiByteCount : WideCharCount;
796 WideCharString[
Count] = Char;
800 WideCharString[
Count] = Char + 0xf000;
803 if (MultiByteCount > WideCharMaxLen)
809 return WideCharMaxLen;
839 if (MultiByteCount == 0)
841 return WideCharCount;
844 MaxLen = MultiByteCount > WideCharCount ? WideCharCount : MultiByteCount;
847 Char = WideCharString[
Count];
854 if ((Char >= 0xf020) && (Char < 0xf100))
866 if (WideCharCount > MaxLen)
903 if (MultiByteCount == 0)
905 for (TempLength = 0; WideCharCount;
906 WideCharCount--, WideCharString++)
909 if (*WideCharString >= 0x80)
912 if (*WideCharString >= 0x800)
915 if (*WideCharString >= 0xd800 && *WideCharString < 0xdc00 &&
916 WideCharCount >= 1 &&
917 WideCharString[1] >= 0xdc00 && WideCharString[1] <= 0xe000)
929 for (TempLength = MultiByteCount; WideCharCount; WideCharCount--, WideCharString++)
931 Char = *WideCharString;
959 if (Char >= 0xd800 && Char < 0xdc00 &&
960 WideCharCount >= 1 &&
961 WideCharString[1] >= 0xdc00 && WideCharString[1] < 0xe000)
972 Char = (Char - 0xd800) << 10;
973 Char |= *WideCharString - 0xdc00;
1000 return MultiByteCount - TempLength;
1085 if (CodePageEntry ==
NULL)
1098 if (
Flags || DefaultChar || UsedDefaultChar)
1100 BOOL TempUsedDefaultChar;
1105 if (!UsedDefaultChar)
1106 UsedDefaultChar = &TempUsedDefaultChar;
1108 *UsedDefaultChar =
FALSE;
1112 DefChar = DefaultChar[1] ? ((DefaultChar[0] << 8) | DefaultChar[1]) : DefaultChar[0];
1117 if (!MultiByteCount)
1119 for (TempLength = 0; WideCharCount; WideCharCount--, WideCharString++, TempLength++)
1126 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1135 *UsedDefaultChar =
TRUE;
1147 for (TempLength = MultiByteCount;
1148 WideCharCount && TempLength;
1149 TempLength--, WideCharString++, WideCharCount--)
1156 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1165 *UsedDefaultChar =
TRUE;
1172 if (TempLength == 1)
1189 return MultiByteCount - TempLength;
1193 if (!MultiByteCount)
1195 for (TempLength = 0; WideCharCount; WideCharCount--, WideCharString++, TempLength++)
1206 for (TempLength = MultiByteCount;
1207 WideCharCount && TempLength;
1208 TempLength--, WideCharString++, WideCharCount--)
1216 if (TempLength == 1)
1233 return MultiByteCount - TempLength;
1240 if (
Flags || DefaultChar || UsedDefaultChar)
1242 BOOL TempUsedDefaultChar;
1247 if (!UsedDefaultChar)
1248 UsedDefaultChar = &TempUsedDefaultChar;
1250 *UsedDefaultChar =
FALSE;
1253 if (!MultiByteCount)
1256 for (TempLength = 0; WideCharCount; TempLength++, WideCharString++, WideCharCount--)
1261 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1264 if (!*UsedDefaultChar)
1276 DefChar = *DefaultChar;
1281 for (TempLength = MultiByteCount;
1282 WideCharCount && TempLength;
1288 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1296 *UsedDefaultChar =
TRUE;
1307 return MultiByteCount - TempLength;
1311 if (!MultiByteCount)
1312 return WideCharCount;
1315 if (MultiByteCount < WideCharCount)
1318 WideCharCount = MultiByteCount;
1325 nReturn = WideCharCount;
1329 for (TempLength = WideCharCount; --TempLength >= 0; WideCharString++,
MultiByteString++)
1441 WCHAR ValueNameBuffer[11];
1454 ValueName.MaximumLength =
sizeof(ValueNameBuffer);
1461 L"CurrentControlSet\\Control\\Nls\\CodePage");
1481 Kvpi, KvpiSize, &KvpiSize);
1517 if (CodePage == 0)
return FALSE;
1542 static const signed char base64_decoding_table[] =
1544 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1545 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1546 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
1547 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
1548 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1549 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
1550 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1551 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
1557 DWORD byte_pair = 0;
1560 while (
src < source_end)
1565 if (
src >= source_end)
1582 signed char sextet = *
src;
1599 sextet = base64_decoding_table[sextet];
1609 byte_pair = (byte_pair << 6) | sextet;
1625 while (
src < source_end);
1683 MultiByteCount == 0 || WideCharCount < 0 ||
1684 (WideCharCount && (WideCharString ==
NULL ||
1692 if (MultiByteCount < 0)
1713 WideCharString, WideCharCount);
1733 static const BOOL directly_encodable_table[] =
1735 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
1736 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1737 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1,
1738 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
1739 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1740 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
1741 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1742 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1745 return codepoint <= 0x7A ? directly_encodable_table[codepoint] :
FALSE;
1765 static const char base64_encoding_table[] =
1766 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1771 while (
src < source_end)
1799 DWORD byte_pair = 0;
1809 byte_pair = (byte_pair << 16) | *
src;
1833 byte_pair <<= (6 -
offset);
1910 for (
i = 0;
i < (uID & 0x0F);
i++)
1917 if (*
p + 1 > cchDest)
1940 DPRINT1(
"Resource not found: uID = %lu\n", uID);
1962 if (CodePageEntry ==
NULL)
1975 DPRINT1(
"Invalid CP!: %lx\n", CodePage);
2015 lpCPInfoEx->CodePage =
CP_UTF7;
2016 lpCPInfoEx->UnicodeDefaultChar = 0x3f;
2018 lpCPInfoEx->CodePageName,
2026 lpCPInfoEx->CodePage =
CP_UTF8;
2027 lpCPInfoEx->UnicodeDefaultChar = 0x3f;
2029 lpCPInfoEx->CodePageName,
2039 if (CodePageEntry ==
NULL)
2041 DPRINT1(
"Could not get CodePage Entry! CodePageEntry = NULL\n");
2049 lpCPInfoEx->CodePageName,
2137 if (WideCharString ==
NULL ||
2138 WideCharCount == 0 ||
2148 if (WideCharCount < 0)
2150 WideCharCount =
lstrlenW(WideCharString) + 1;
2156 if (DefaultChar !=
NULL || UsedDefaultChar !=
NULL)
2171 if (DefaultChar !=
NULL || UsedDefaultChar !=
NULL)
2185 if ((DefaultChar!=
NULL) || (UsedDefaultChar!=
NULL))
2253 if (CodePageEntry !=
NULL)
2309 0, 0, 0, 0, 0, 0, 0,
2313 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to create world SID (Status 0x%08x)\n",
Status);
2326 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to create admins SID (Status 0x%08x)\n",
Status);
2339 DPRINT1(
"CreateNlsDirectorySecurity(): Could not allocate memory for DACL, not enough memory!\n");
2348 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to create the DACL (Status 0x%08x)\n",
Status);
2359 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to insert allowed access ACE to DACL for World SID (Status 0x%08x)\n",
Status);
2370 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to insert allowed access ACE to DACL for admins SID (Status 0x%08x)\n",
Status);
2379 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to initialize the security descriptor (Status 0x%08x)\n",
Status);
2390 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to insert DACL into the descriptor (Status 0x%08x)\n",
Status);
2400 DPRINT1(
"CreateNlsDirectorySecurity(): Unexpected status code, must be STATUS_BUFFER_TOO_SMALL (Status 0x%08x)\n",
Status);
2406 if (RelativeSd ==
NULL)
2408 DPRINT1(
"CreateNlsDirectorySecurity(): Could not allocate memory for relative SD, not enough memory!\n");
2419 DPRINT1(
"CreateNlsDirectorySecurity(): Failed to convert absolute SD to self-relative format (Status 0x%08x)\n",
Status);
2424 *NlsSecurityDescriptor = RelativeSd;
2432 if (AdminsSid !=
NULL)
2444 if (RelativeSd !=
NULL)
2500 0, 0, 0, 0, 0, 0, 0,
2504 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to create world SID (Status 0x%08x)\n",
Status);
2516 DPRINT1(
"CreateNlsSecurityDescriptor(): Could not allocate memory for DACL, not enough memory!\n");
2525 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to create the DACL (Status 0x%08x)\n",
Status);
2536 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to insert allowed access ACE to DACL for World SID (Status 0x%08x)\n",
Status);
2545 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to insert allowed access ACE to DACL for World SID (Status 0x%08x)\n",
Status);
2556 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to insert DACL into the descriptor (Status 0x%08x)\n",
Status);
2566 DPRINT1(
"CreateNlsSecurityDescriptor(): Unexpected status code, must be STATUS_BUFFER_TOO_SMALL (Status 0x%08x)\n",
Status);
2572 if (RelativeSd ==
NULL)
2574 DPRINT1(
"CreateNlsSecurityDescriptor(): Could not allocate memory for relative SD, not enough memory!\n");
2585 DPRINT1(
"CreateNlsSecurityDescriptor(): Failed to convert absolute SD to self-relative format (Status 0x%08x)\n",
Status);
2605 if (RelativeSd !=
NULL)
#define STATUS_OBJECT_NAME_COLLISION
#define ERROR_INVALID_PARAMETER
#define FILE_GENERIC_READ
static INT WINAPI IntMultiByteToWideCharUTF8(DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
BOOL WINAPI IsValidUILanguage(LANGID langid)
BOOL WINAPI GetCPInfo(UINT CodePage, LPCPINFO CodePageInfo)
#define LOCALE_IDEFAULTANSICODEPAGE
static CODEPAGE_ENTRY AnsiCodePage
static INT Utf7ToWideChar(const char *src, int srclen, WCHAR *dst, int dstlen)
static const struct update_accum a3
#define MB_ERR_INVALID_CHARS
#define STATUS_INSUFFICIENT_RESOURCES
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
static INT WideCharToUtf7(const WCHAR *src, int srclen, char *dst, int dstlen)
NTSTATUS NTAPI NtCreateSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN PLARGE_INTEGER MaximumSize OPTIONAL, IN ULONG SectionPageProtection OPTIONAL, IN ULONG AllocationAttributes, IN HANDLE FileHandle OPTIONAL)
#define OBJ_CASE_INSENSITIVE
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
ACPI_SIZE strlen(const char *String)
static INT WINAPI IntWideCharToMultiByteSYMBOL(DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount)
#define UNREFERENCED_PARAMETER(P)
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
static LIST_ENTRY CodePageListHead
static const char UTF8Length[128]
#define DIRECTORY_CREATE_OBJECT
WCHAR CodePageName[MAX_PATH]
BOOL WINAPI ValidateLocale(IN ULONG LocaleId)
BOOL WINAPI ValidateLCType(int a1, unsigned int a2, int a3, int a4)
VOID WINAPI GetLinguistLangSize(LPVOID lpUnknown)
BOOL WINAPI IsNLSDefinedString(IN NLS_FUNCTION Function, IN DWORD dwFlags, IN LPNLSVERSIONINFO lpVersionInformation, IN LPCWSTR lpString, IN INT cchStr)
static SID_IDENTIFIER_AUTHORITY WorldAuthority
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
IN PDCB IN POEM_STRING IN PUNICODE_STRING UnicodeName
#define LOCALE_IDEFAULTMACCODEPAGE
BOOL WINAPI GetNLSVersionEx(IN NLS_FUNCTION function, IN LPCWSTR lpLocaleName, IN OUT LPNLSVERSIONINFOEX lpVersionInformation)
static const unsigned long UTF8LBound[]
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define INVALID_HANDLE_VALUE
struct _ACCESS_ALLOWED_ACE ACCESS_ALLOWED_ACE
LPVOID WINAPI LockResource(HGLOBAL handle)
static const struct update_accum a4
INT WINAPI WideCharToMultiByte(UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar)
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
#define InsertTailList(ListHead, Entry)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToChar(_In_ ULONG Value, _In_ ULONG Base, _In_ ULONG Length, _Out_ PCHAR String)
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
PCODEPAGE_ENTRY FASTCALL IntGetLoadedCodePageEntry(UINT CodePage)
NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid(IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, IN ULONG SubAuthority1, IN ULONG SubAuthority2, IN ULONG SubAuthority3, IN ULONG SubAuthority4, IN ULONG SubAuthority5, IN ULONG SubAuthority6, IN ULONG SubAuthority7, OUT PSID *Sid)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
static INT WINAPI IntWideCharToMultiByteUTF8(UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar)
#define SUBLANG_ENGLISH_US
#define STATUS_BUFFER_TOO_SMALL
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define SECURITY_DESCRIPTOR_REVISION
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
static INT WINAPI IntMultiByteToWideCharSYMBOL(DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
BOOL WINAPI NlsResetProcessLocale(VOID)
BOOL WINAPI IsDBCSLeadByteEx(UINT CodePage, BYTE TestByte)
static BOOL utf7_write_c(char *dst, int dstlen, int *index, char character)
VOID WINAPI GetDefaultSortkeySize(LPVOID lpUnknown)
LCID WINAPI ConvertDefaultLocale(LCID lcid)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
NTSTATUS NTAPI NtOpenSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
static BOOL IntIsValidSBCSMapping(PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, UCHAR ch)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
NTSYSAPI ULONG NTAPI RtlLengthSid(IN PSID Sid)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
#define SECURITY_NT_AUTHORITY
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
ULONG WINAPI NlsGetCacheUpdateCount(VOID)
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define DIRECTORY_TRAVERSE
static const WCHAR lang[]
UCHAR LeadByte[MAXIMUM_LEADBYTES]
struct _LIST_ENTRY * Flink
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
VOID WINAPI NlsConvertIntegerToString(ULONG Value, ULONG Base, ULONG strsize, LPWSTR str, ULONG strsize2)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
NTSYSAPI NTSTATUS NTAPI NtQueryValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, IN PVOID KeyValueInformation, IN ULONG Length, IN PULONG ResultLength)
_Must_inspect_result_ _In_ ULONG Flags
static INT WINAPI IntMultiByteToWideCharCP(UINT CodePage, DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SECURITY_BUILTIN_DOMAIN_RID
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
#define NT_SUCCESS(StatCode)
USHORT TransUniDefaultChar
#define SECURITY_WORLD_SID_AUTHORITY
static const struct update_accum a2
BYTE LeadByte[MAX_LEADBYTES]
USHORT MaximumCharacterSize
static DWORD LPDWORD LPCSTR DWORD srclen
BOOL WINAPI GetNLSVersion(IN NLS_FUNCTION Function, IN LCID Locale, IN OUT LPNLSVERSIONINFO lpVersionInformation)
PCODEPAGE_ENTRY FASTCALL IntGetCodePageEntry(UINT CodePage)
#define LOCALE_SYSTEM_DEFAULT
_In_ ACCESS_MASK AccessMask
#define STATUS_OBJECT_PATH_NOT_FOUND
static BOOL WINAPI IntIsLeadByte(PCPTABLEINFO TableInfo, BYTE Byte)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define SECURITY_WORLD_RID
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
#define WC_NO_BEST_FIT_CHARS
#define STATUS_UNSUCCESSFUL
#define ERROR_NO_UNICODE_TRANSLATION
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
static CODEPAGE_ENTRY OemCodePage
static BOOL IntIsValidDBCSMapping(PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, USHORT ch)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
static INT WINAPI IntWideCharToMultiByteCP(UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar)
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
CHAR CodePageName[MAX_PATH]
static RTL_CRITICAL_SECTION CodePageListLock
static SID_IDENTIFIER_AUTHORITY NtAuthority
NTSTATUS CreateNlsDirectorySecurity(_Out_ PSECURITY_DESCRIPTOR *NlsSecurityDescriptor)
Creates a security descriptor for the NLS object directory name.
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define memcpy(s1, s2, n)
#define LANGIDFROMLCID(l)
#define MAXIMUM_LEADBYTES
VOID NTAPI RtlInitCodePageTable(IN PUSHORT TableBase, OUT PCPTABLEINFO CodePageTable)
BOOL WINAPI GetCPFileNameFromRegistry(UINT CodePage, LPWSTR FileName, ULONG FileNameSize)
INT WINAPI MultiByteToWideChar(UINT CodePage, DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
BOOL WINAPI GetNlsSectionName(UINT CodePage, UINT Base, ULONG Unknown, LPSTR BaseName, LPSTR Result, ULONG ResultSize)
NTSTATUS WINAPI CreateNlsSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR *SecurityDescriptor, _In_ SIZE_T DescriptorSize, _In_ ULONG AccessMask)
Creates a security descriptor for each NLS section name.
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
BOOL WINAPI IsValidCodePage(UINT CodePage)
int WINAPI lstrlenA(LPCSTR lpString)
#define STATUS_OBJECT_NAME_NOT_FOUND
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
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 WC_COMPOSITECHECK
BOOL WINAPI GetCPInfoExA(UINT CodePage, DWORD dwFlags, LPCPINFOEXA lpCPInfoEx)
BYTE DefaultChar[MAX_DEFAULTCHAR]
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
#define InitializeListHead(ListHead)
#define DIRECTORY_ALL_ACCESS
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
static const unsigned char UTF8Mask[6]
*BytesInMultiByteString PCHAR MultiByteString
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
BOOL WINAPI GetCPInfoExW(UINT CodePage, DWORD dwFlags, LPCPINFOEXW lpCPInfoEx)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
_In_ PFCB _In_ PCD_NAME DirName
_Out_ PCPTABLEINFO CodePageTable
#define InitializeObjectAttributes(p, n, a, r, s)
static BOOL utf7_write_w(WCHAR *dst, int dstlen, int *index, WCHAR character)
static BOOL utf7_can_directly_encode(WCHAR codepoint)
static const struct update_accum a1
#define MAKEINTRESOURCEW(i)
UINT GetLocalisedText(IN UINT uID, IN LPWSTR lpszDest, IN UINT cchDest, IN LANGID lang)
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
VOID FASTCALL NlsUninit(VOID)
BOOL FASTCALL NlsInit(VOID)
#define DOMAIN_ALIAS_RID_ADMINS
UINT WINAPI SetCPGlobal(UINT CodePage)
#define HeapFree(x, y, z)
#define ERROR_INVALID_FLAGS
base of all file and directory entries
CPTABLEINFO CodePageTable
LCID WINAPI GetThreadLocale(void)
#define ERROR_INSUFFICIENT_BUFFER
UINT WINAPI GetOEMCP(VOID)