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
38static const unsigned char UTF8Mask[6] = {0x7f, 0x1f, 0x0f, 0x07, 0x03, 0x01};
42 {0, 0x80, 0x800, 0x10000, 0x200000, 0x2000000, 0xFFFFFFFF};
97 DPRINT1(
"Failed to create basic NLS SD (Status 0x%08x)\n",
Status);
111 DPRINT1(
"Failed to create Admins SID (Status 0x%08x)\n",
Status);
122 DPRINT1(
"Failed to get DACL from descriptor (Status 0x%08x)\n",
Status);
134 DPRINT1(
"Failed to add allowed access ACE for Admins SID (Status 0x%08x)\n",
Status);
175 DPRINT1(
"Failed to create NLS directory security (Status 0x%08x)\n",
Status);
265 CurrentEntry = CurrentEntry->
Flink)
296 CHAR SectionName[40];
298 PBYTE SectionMapping;
324 sizeof(CodePage) /
sizeof(
WCHAR)))
337 sizeof(CodePage) /
sizeof(
WCHAR)))
346 if (CodePageEntry !=
NULL)
348 return CodePageEntry;
362 "\\Nls\\NlsSectionCP",
364 sizeof(SectionName)))
387 DPRINT1(
"CreateNlsSecurityDescriptor FAILED! (Status 0x%08x)\n",
Status);
454 if (SectionMapping ==
NULL)
462 if (CodePageEntry ==
NULL)
479 return CodePageEntry;
500 LPCSTR MbsEnd, MbsPtrSave;
501 UCHAR Char, TrailLength;
504 BOOL CharIsValid, StringIsValid =
TRUE;
505 const WCHAR InvalidChar = 0xFFFD;
514 if (WideCharCount == 0)
526 if ((Char & 0xC0) == 0x80)
529 StringIsValid =
FALSE;
534 if (TrailLength == 0)
536 StringIsValid =
FALSE;
542 WideChar = Char &
UTF8Mask[TrailLength];
548 CharIsValid = StringIsValid =
FALSE;
565 StringIsValid =
FALSE;
574 return WideCharCount;
584 *WideCharString++ = Char;
588 if ((Char & 0xC0) == 0x80)
590 *WideCharString++ = InvalidChar;
592 StringIsValid =
FALSE;
597 if (TrailLength == 0)
599 *WideCharString++ = InvalidChar;
600 StringIsValid =
FALSE;
606 WideChar = Char &
UTF8Mask[TrailLength];
612 CharIsValid = StringIsValid =
FALSE;
622 *WideCharString++ = WideChar;
626 *WideCharString++ = InvalidChar;
628 StringIsValid =
FALSE;
634 *WideCharString = InvalidChar;
682 if (CodePageEntry ==
NULL)
713 while (TempString < MbsEnd)
720 if (((TempString + 1) == MbsEnd) || (*(TempString + 1) == 0))
739 WideChar = MultiByteTable[(
UCHAR)*TempString];
744 (WideChar >= 0xE000 && WideChar <= 0xF8FF))
756 if (WideCharCount == 0)
771 return WideCharCount;
782 *WideCharString++ = MultiByteTable[Char];
811 TempString++, TempLength--)
813 WideChar = MultiByteTable[(
UCHAR)*TempString];
818 (WideChar >= 0xE000 && WideChar <= 0xF8FF))
827 if (WideCharCount == 0)
828 return MultiByteCount;
831 for (TempLength = (WideCharCount < MultiByteCount) ? WideCharCount : MultiByteCount;
839 if (WideCharCount < MultiByteCount)
841 MultiByteCount = WideCharCount;
845 return MultiByteCount;
877 if (WideCharCount == 0)
879 return MultiByteCount;
882 WideCharMaxLen = WideCharCount > MultiByteCount ? MultiByteCount : WideCharCount;
889 WideCharString[
Count] = Char;
893 WideCharString[
Count] = Char + 0xf000;
896 if (MultiByteCount > WideCharMaxLen)
902 return WideCharMaxLen;
932 if (MultiByteCount == 0)
934 return WideCharCount;
937 MaxLen = MultiByteCount > WideCharCount ? WideCharCount : MultiByteCount;
940 Char = WideCharString[
Count];
947 if ((Char >= 0xf020) && (Char < 0xf100))
959 if (WideCharCount > MaxLen)
996 if (MultiByteCount == 0)
998 for (TempLength = 0; WideCharCount;
999 WideCharCount--, WideCharString++)
1002 if (*WideCharString >= 0x80)
1005 if (*WideCharString >= 0x800)
1008 if (*WideCharString >= 0xd800 && *WideCharString < 0xdc00 &&
1009 WideCharCount >= 1 &&
1010 WideCharString[1] >= 0xdc00 && WideCharString[1] <= 0xe000)
1022 for (TempLength = MultiByteCount; WideCharCount; WideCharCount--, WideCharString++)
1024 Char = *WideCharString;
1052 if (Char >= 0xd800 && Char < 0xdc00 &&
1053 WideCharCount >= 1 &&
1054 WideCharString[1] >= 0xdc00 && WideCharString[1] < 0xe000)
1065 Char = (Char - 0xd800) << 10;
1066 Char |= *WideCharString - 0xdc00;
1069 ASSERT(Char <= 0x10ffff);
1093 return MultiByteCount - TempLength;
1178 if (CodePageEntry ==
NULL)
1191 if (
Flags || DefaultChar || UsedDefaultChar)
1193 BOOL TempUsedDefaultChar;
1198 if (!UsedDefaultChar)
1199 UsedDefaultChar = &TempUsedDefaultChar;
1201 *UsedDefaultChar =
FALSE;
1205 DefChar = DefaultChar[1] ? ((DefaultChar[0] << 8) | DefaultChar[1]) : DefaultChar[0];
1210 if (!MultiByteCount)
1212 for (TempLength = 0; WideCharCount; WideCharCount--, WideCharString++, TempLength++)
1219 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1228 *UsedDefaultChar =
TRUE;
1240 for (TempLength = MultiByteCount;
1241 WideCharCount && TempLength;
1242 TempLength--, WideCharString++, WideCharCount--)
1249 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1258 *UsedDefaultChar =
TRUE;
1265 if (TempLength == 1)
1282 return MultiByteCount - TempLength;
1286 if (!MultiByteCount)
1288 for (TempLength = 0; WideCharCount; WideCharCount--, WideCharString++, TempLength++)
1299 for (TempLength = MultiByteCount;
1300 WideCharCount && TempLength;
1301 TempLength--, WideCharString++, WideCharCount--)
1309 if (TempLength == 1)
1326 return MultiByteCount - TempLength;
1333 if (
Flags || DefaultChar || UsedDefaultChar)
1335 BOOL TempUsedDefaultChar;
1340 if (!UsedDefaultChar)
1341 UsedDefaultChar = &TempUsedDefaultChar;
1343 *UsedDefaultChar =
FALSE;
1346 if (!MultiByteCount)
1349 for (TempLength = 0; WideCharCount; TempLength++, WideCharString++, WideCharCount--)
1354 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1357 if (!*UsedDefaultChar)
1369 DefChar = *DefaultChar;
1374 for (TempLength = MultiByteCount;
1375 WideCharCount && TempLength;
1381 DPRINT(
"WC_COMPOSITECHECK flag UNIMPLEMENTED\n");
1389 *UsedDefaultChar =
TRUE;
1400 return MultiByteCount - TempLength;
1404 if (!MultiByteCount)
1405 return WideCharCount;
1408 if (MultiByteCount < WideCharCount)
1411 WideCharCount = MultiByteCount;
1418 nReturn = WideCharCount;
1422 for (TempLength = WideCharCount; --TempLength >= 0; WideCharString++,
MultiByteString++)
1448 if (
Byte >= TableInfo->
LeadByte[
i] && Byte <= TableInfo->LeadByte[
i+1])
1534 WCHAR ValueNameBuffer[11];
1547 ValueName.MaximumLength =
sizeof(ValueNameBuffer);
1554 L"CurrentControlSet\\Control\\Nls\\CodePage");
1574 Kvpi, KvpiSize, &KvpiSize);
1610 if (CodePage == 0)
return FALSE;
1635 static const signed char base64_decoding_table[] =
1637 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1638 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
1639 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63,
1640 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1,
1641 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
1642 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1,
1643 -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
1644 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1
1650 DWORD byte_pair = 0;
1653 while (
src < source_end)
1658 if (
src >= source_end)
1675 signed char sextet = *
src;
1692 sextet = base64_decoding_table[sextet];
1702 byte_pair = (byte_pair << 6) | sextet;
1718 while (
src < source_end);
1776 MultiByteCount == 0 || WideCharCount < 0 ||
1777 (WideCharCount && (WideCharString ==
NULL ||
1785 if (MultiByteCount < 0)
1806 WideCharString, WideCharCount);
1826 static const BOOL directly_encodable_table[] =
1828 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0,
1829 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1830 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1,
1831 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1,
1832 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1833 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0,
1834 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1835 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
1838 return codepoint <= 0x7A ? directly_encodable_table[codepoint] :
FALSE;
1858 static const char base64_encoding_table[] =
1859 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
1864 while (
src < source_end)
1892 DWORD byte_pair = 0;
1902 byte_pair = (byte_pair << 16) | *
src;
1926 byte_pair <<= (6 -
offset);
2003 for (
i = 0;
i < (
uID & 0x0F);
i++)
2033 DPRINT1(
"Resource not found: uID = %lu\n",
uID);
2055 if (CodePageEntry ==
NULL)
2069 DPRINT1(
"Invalid CP!: %lx\n", CodePage);
2134 if (CodePageEntry ==
NULL)
2136 DPRINT1(
"Could not get CodePage Entry! CodePageEntry = NULL\n");
2232 if (WideCharString ==
NULL ||
2233 WideCharCount == 0 ||
2243 if (WideCharCount < 0)
2245 WideCharCount =
lstrlenW(WideCharString) + 1;
2251 if (DefaultChar !=
NULL || UsedDefaultChar !=
NULL)
2266 if (DefaultChar !=
NULL || UsedDefaultChar !=
NULL)
2280 if ((DefaultChar!=
NULL) || (UsedDefaultChar!=
NULL))
2348 if (CodePageEntry !=
NULL)
2412 DPRINT1(
"Security descriptor size too small\n");
2420 0, 0, 0, 0, 0, 0, 0,
2424 DPRINT1(
"Failed to create World SID (Status 0x%08x)\n",
Status);
2433 DPRINT1(
"Failed to create security descriptor (Status 0x%08x)\n",
Status);
2453 DPRINT1(
"Failed to add allowed access ACE for World SID (Status 0x%08x)\n",
Status);
2461 DPRINT1(
"Failed to set DACL into descriptor (Status 0x%08x)\n",
Status);
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)
NTSTATUS NTAPI NtOpenSection(OUT PHANDLE SectionHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
static SID_IDENTIFIER_AUTHORITY NtAuthority
#define NLS_SIZEOF_ACE_AND_SIDS(n)
#define NLS_SECTION_SECURITY_DESCRIPTOR_SIZE
_In_ PFCB _In_ PCD_NAME DirName
_In_ CDROM_SCAN_FOR_SPECIAL_INFO _In_ PCDROM_SCAN_FOR_SPECIAL_HANDLER Function
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define ERROR_INSUFFICIENT_BUFFER
#define NT_SUCCESS(StatCode)
#define ERROR_INVALID_PARAMETER
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define WideCharToMultiByte
#define MultiByteToWideChar
UINT WINAPI GetSystemDirectoryW(OUT LPWSTR lpBuffer, IN UINT uSize)
LPVOID WINAPI LockResource(HGLOBAL handle)
HRSRC WINAPI FindResourceExW(HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD lang)
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
LCID WINAPI GetThreadLocale(void)
UINT WINAPI GetOEMCP(void)
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
LCID WINAPI ConvertDefaultLocale(LCID lcid)
static INT WINAPI IntWideCharToMultiByteCP(UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar)
BOOL WINAPI GetNLSVersion(IN NLS_FUNCTION Function, IN LCID Locale, IN OUT LPNLSVERSIONINFO lpVersionInformation)
static BOOL IntIsValidSBCSMapping(PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, UCHAR ch)
static const char UTF8Length[128]
static BOOL utf7_can_directly_encode(WCHAR codepoint)
BOOL WINAPI GetCPInfo(UINT CodePage, LPCPINFO CodePageInfo)
VOID FASTCALL NlsUninit(VOID)
BOOL WINAPI IsNLSDefinedString(IN NLS_FUNCTION Function, IN DWORD dwFlags, IN LPNLSVERSIONINFO lpVersionInformation, IN LPCWSTR lpString, IN INT cchStr)
VOID WINAPI NlsConvertIntegerToString(ULONG Value, ULONG Base, ULONG strsize, LPWSTR str, ULONG strsize2)
static INT WideCharToUtf7(const WCHAR *src, int srclen, char *dst, int dstlen)
BOOL WINAPI IsDBCSLeadByteEx(UINT CodePage, BYTE TestByte)
static BOOL utf7_write_c(char *dst, int dstlen, int *index, char character)
BOOL WINAPI ValidateLCType(int a1, unsigned int a2, int a3, int a4)
PCODEPAGE_ENTRY FASTCALL IntGetCodePageEntry(UINT CodePage)
UINT GetLocalisedText(IN UINT uID, IN LPWSTR lpszDest, IN UINT cchDest, IN LANGID lang)
BOOL WINAPI IsValidCodePage(UINT CodePage)
PCODEPAGE_ENTRY FASTCALL IntGetLoadedCodePageEntry(UINT CodePage)
BOOL WINAPI GetNLSVersionEx(IN NLS_FUNCTION function, IN LPCWSTR lpLocaleName, IN OUT LPNLSVERSIONINFOEX lpVersionInformation)
static CODEPAGE_ENTRY AnsiCodePage
ULONG WINAPI NlsGetCacheUpdateCount(VOID)
static const unsigned long UTF8LBound[]
UINT WINAPI SetCPGlobal(UINT CodePage)
static BOOL utf7_write_w(WCHAR *dst, int dstlen, int *index, WCHAR character)
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. Typically used by BASESRV to give Everyone (World...
BOOL WINAPI IsValidUILanguage(LANGID langid)
BOOL FASTCALL NlsInit(VOID)
static INT WINAPI IntWideCharToMultiByteUTF8(UINT CodePage, DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount, LPCSTR DefaultChar, LPBOOL UsedDefaultChar)
static RTL_CRITICAL_SECTION CodePageListLock
VOID WINAPI GetLinguistLangSize(LPVOID lpUnknown)
BOOL WINAPI ValidateLocale(IN ULONG LocaleId)
static INT Utf7ToWideChar(const char *src, int srclen, WCHAR *dst, int dstlen)
static NTSTATUS CreateNlsDirectorySecurity(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ SIZE_T DescriptorSize)
Creates a security descriptor for the NLS object directory.
static BOOL IntIsValidDBCSMapping(PCPTABLEINFO CodePageTable, DWORD Flags, WCHAR wch, USHORT ch)
BOOL WINAPI GetCPFileNameFromRegistry(UINT CodePage, LPWSTR FileName, ULONG FileNameSize)
static INT WINAPI IntMultiByteToWideCharUTF8(DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
BOOL WINAPI NlsResetProcessLocale(VOID)
static CODEPAGE_ENTRY OemCodePage
static LIST_ENTRY CodePageListHead
static BOOL WINAPI IntIsLeadByte(PCPTABLEINFO TableInfo, BYTE Byte)
BOOL WINAPI GetCPInfoExA(UINT CodePage, DWORD dwFlags, LPCPINFOEXA lpCPInfoEx)
BOOL WINAPI GetCPInfoExW(UINT CodePage, DWORD dwFlags, LPCPINFOEXW lpCPInfoEx)
VOID WINAPI GetDefaultSortkeySize(LPVOID lpUnknown)
static INT WINAPI IntWideCharToMultiByteSYMBOL(DWORD Flags, LPCWSTR WideCharString, INT WideCharCount, LPSTR MultiByteString, INT MultiByteCount)
static INT WINAPI IntMultiByteToWideCharCP(UINT CodePage, DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
static const unsigned char UTF8Mask[6]
static INT WINAPI IntMultiByteToWideCharSYMBOL(DWORD Flags, LPCSTR MultiByteString, INT MultiByteCount, LPWSTR WideCharString, INT WideCharCount)
_ACRTIMP size_t __cdecl strlen(const char *)
static SID_IDENTIFIER_AUTHORITY WorldAuthority
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
IN PDCB IN POEM_STRING IN PUNICODE_STRING UnicodeName
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE FileHandle
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
#define MB_ERR_INVALID_CHARS
#define WC_NO_BEST_FIT_CHARS
#define OBJ_CASE_INSENSITIVE
NTSYSAPI void WINAPI RtlInitCodePageTable(USHORT *, CPTABLEINFO *)
NTSYSAPI NTSTATUS WINAPI RtlAddAccessAllowedAce(PACL, DWORD, DWORD, PSID)
NTSYSAPI NTSTATUS WINAPI RtlSetDaclSecurityDescriptor(PSECURITY_DESCRIPTOR, BOOLEAN, PACL, BOOLEAN)
LPSTR WINAPI lstrcpyA(LPSTR lpString1, LPCSTR lpString2)
LPSTR WINAPI lstrcatA(LPSTR lpString1, LPCSTR lpString2)
int WINAPI lstrlenA(LPCSTR lpString)
#define memcpy(s1, s2, n)
#define MAXIMUM_LEADBYTES
static const struct update_accum a1
static const struct update_accum a2
static const struct update_accum a3
static const struct update_accum a4
static DWORD LPDWORD LPCSTR DWORD srclen
#define InitializeObjectAttributes(p, n, a, r, s)
struct _SECURITY_DESCRIPTOR SECURITY_DESCRIPTOR
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
_In_ ACCESS_MASK AccessMask
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL Dacl
NTSYSAPI NTSTATUS NTAPI RtlDeleteCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlCreateAcl(PACL Acl, ULONG AclSize, ULONG AclRevision)
_Out_ PCPTABLEINFO CodePageTable
NTSYSAPI NTSTATUS NTAPI RtlEnterCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlCreateSecurityDescriptor(_Out_ PSECURITY_DESCRIPTOR SecurityDescriptor, _In_ ULONG Revision)
NTSYSAPI NTSTATUS NTAPI RtlLeaveCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI NTSTATUS NTAPI RtlInitializeCriticalSection(_In_ PRTL_CRITICAL_SECTION CriticalSection)
NTSYSAPI PVOID NTAPI RtlFreeSid(_In_ _Post_invalid_ PSID Sid)
NTSYSAPI NTSTATUS NTAPI RtlIntegerToChar(_In_ ULONG Value, _In_ ULONG Base, _In_ ULONG Length, _Out_ PCHAR String)
NTSYSAPI NTSTATUS NTAPI RtlGetDaclSecurityDescriptor(_In_ PSECURITY_DESCRIPTOR SecurityDescriptor, _Out_ PBOOLEAN DaclPresent, _Out_ PACL *Dacl, _Out_ PBOOLEAN DaclDefaulted)
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG DaclSize
_In_ BOOLEAN _In_opt_ PACL _In_opt_ BOOLEAN DaclDefaulted
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
#define DIRECTORY_CREATE_OBJECT
@ KeyValuePartialInformation
#define DIRECTORY_TRAVERSE
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
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)
struct _KEY_VALUE_PARTIAL_INFORMATION KEY_VALUE_PARTIAL_INFORMATION
NTSYSAPI NTSTATUS NTAPI RtlIntegerToUnicodeString(ULONG Value, ULONG Base, PUNICODE_STRING String)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
#define DIRECTORY_ALL_ACCESS
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define FILE_GENERIC_READ
#define LOCALE_SYSTEM_DEFAULT
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)
NTSTATUS NTAPI NtCreateDirectoryObject(OUT PHANDLE DirectoryHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
#define LANGIDFROMLCID(l)
#define SUBLANG_ENGLISH_US
#define STATUS_BUFFER_TOO_SMALL
base of all file and directory entries
CPTABLEINFO CodePageTable
UCHAR LeadByte[MAXIMUM_LEADBYTES]
USHORT MaximumCharacterSize
USHORT TransUniDefaultChar
struct _LIST_ENTRY * Flink
BYTE LeadByte[MAX_LEADBYTES]
BYTE DefaultChar[MAX_DEFAULTCHAR]
CHAR CodePageName[MAX_PATH]
WCHAR CodePageName[MAX_PATH]
_In_ SIZE_T DescriptorSize
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_OBJECT_PATH_NOT_FOUND
#define STATUS_UNSUCCESSFUL
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_OBJECT_NAME_NOT_FOUND
static const WCHAR lang[]
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
#define ERROR_NO_UNICODE_TRANSLATION
#define ERROR_INVALID_FLAGS
_In_ DWORD _In_ int _In_ int _In_opt_ LPNLSVERSIONINFO lpVersionInformation
#define LOCALE_IDEFAULTANSICODEPAGE
#define LOCALE_IDEFAULTMACCODEPAGE
#define MAKEINTRESOURCEW(i)
_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
_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
_Must_inspect_result_ _In_ ULONG Flags
*BytesInMultiByteString PCHAR MultiByteString
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_WORLD_SID_AUTHORITY
#define SECURITY_WORLD_RID
#define SECURITY_NT_AUTHORITY
#define SECURITY_DESCRIPTOR_REVISION
#define DOMAIN_ALIAS_RID_ADMINS