6#ifndef _NTSTRSAFE_H_INCLUDED_
7#define _NTSTRSAFE_H_INCLUDED_
15#pragma warning(disable:28719)
18#define NTSTRSAFEAPI static __inline NTSTATUS NTAPI
19#define NTSTRSAFEVAPI static __inline NTSTATUS __cdecl
20#define NTSTRSAFE_INLINE_API static __inline NTSTATUS NTAPI
22#ifndef NTSTRSAFE_MAX_CCH
23#define NTSTRSAFE_MAX_CCH 2147483647
26#ifndef NTSTRSAFE_UNICODE_STRING_MAX_CCH
27#define NTSTRSAFE_UNICODE_STRING_MAX_CCH 32767
30#ifndef _STRSAFE_H_INCLUDED_
31#define STRSAFE_IGNORE_NULLS 0x00000100
32#define STRSAFE_FILL_BEHIND_NULL 0x00000200
33#define STRSAFE_FILL_ON_FAILURE 0x00000400
34#define STRSAFE_NULL_ON_FAILURE 0x00000800
35#define STRSAFE_NO_TRUNCATION 0x00001000
36#define STRSAFE_IGNORE_NULL_UNICODE_STRINGS 0x00010000
37#define STRSAFE_UNICODE_STRING_DEST_NULL_TERMINATED 0x00020000
39#define STRSAFE_VALID_FLAGS (0x000000FF | STRSAFE_IGNORE_NULLS | STRSAFE_FILL_BEHIND_NULL | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION)
40#define STRSAFE_UNICODE_STRING_VALID_FLAGS (STRSAFE_VALID_FLAGS | STRSAFE_IGNORE_NULL_UNICODE_STRINGS | STRSAFE_UNICODE_STRING_DEST_NULL_TERMINATED)
42#define STRSAFE_FILL_BYTE(x) ((STRSAFE_DWORD)(((x) & 0x000000FF) | STRSAFE_FILL_BEHIND_NULL))
43#define STRSAFE_FAILURE_BYTE(x) ((STRSAFE_DWORD)(((x) & 0x000000FF) | STRSAFE_FILL_ON_FAILURE))
45#define STRSAFE_GET_FILL_PATTERN(dwFlags) ((int)((dwFlags) & 0x000000FF))
48#define STRSAFE_FILL_BEHIND STRSAFE_FILL_BEHIND_NULL
49#define STRSAFE_ZERO_LENGTH_ON_FAILURE STRSAFE_NULL_ON_FAILURE
161 size_t cchDest = cbDest /
sizeof(
char);
179 size_t cchDest = cbDest /
sizeof(
wchar_t);
238 size_t cbDest = cchDest *
sizeof(
wchar_t);
279 size_t cchDest = cbDest /
sizeof(
char);
280 size_t cchRemaining = 0;
294 *pcbRemaining = (cchRemaining *
sizeof(
char)) + (cbDest %
sizeof(
char));
309 size_t cchDest = cbDest /
sizeof(
wchar_t);
310 size_t cchRemaining = 0;
324 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
334 _In_ size_t cchToCopy);
341 _In_ size_t cchToCopy);
349 _In_ size_t cchToCopy)
367 _In_ size_t cchToCopy)
385 _In_ size_t cbToCopy);
392 _In_ size_t cbToCopy);
399 _In_ size_t cbToCopy)
401 size_t cchDest = cbDest /
sizeof(
char);
402 size_t cchToCopy = cbToCopy /
sizeof(
char);
420 _In_ size_t cbToCopy)
422 size_t cchDest = cbDest /
sizeof(
wchar_t);
423 size_t cchToCopy = cbToCopy /
sizeof(
wchar_t);
441 _In_ size_t cchToCopy,
451 _In_ size_t cchToCopy,
461 _In_ size_t cchToCopy,
482 _In_ size_t cchToCopy,
503 _In_ size_t cbToCopy,
513 _In_ size_t cbToCopy,
523 _In_ size_t cbToCopy,
529 size_t cchRemaining = 0;
533 if ((pszDest !=
NULL) && (cbDest > 0))
541 *pcbRemaining = cchRemaining;
551 _In_ size_t cbToCopy,
557 size_t cchDest = cbDest /
sizeof(
wchar_t);
558 size_t cchToCopy = cbToCopy /
sizeof(
wchar_t);
559 size_t cchRemaining = 0;
563 if ((pszDest !=
NULL) && (cbDest > 0))
571 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
641 size_t cchDest = cbDest /
sizeof(
wchar_t);
691 size_t cbDest = cchDest *
sizeof(
wchar_t);
727 size_t cchRemaining = 0;
735 *pcbRemaining = (cchRemaining *
sizeof(
char)) + (cbDest %
sizeof(
char));
750 size_t cchDest = cbDest /
sizeof(
wchar_t);
751 size_t cchRemaining = 0;
759 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
769 _In_ size_t cchToAppend);
776 _In_ size_t cchToAppend);
783 _In_ size_t cchToAppend)
796 _In_ size_t cchToAppend)
809 _In_ size_t cbToAppend);
816 _In_ size_t cbToAppend);
823 _In_ size_t cbToAppend)
836 _In_ size_t cbToAppend)
838 size_t cchDest = cbDest /
sizeof(
wchar_t);
839 size_t cchToAppend = cbToAppend /
sizeof(
wchar_t);
852 _In_ size_t cchToAppend,
862 _In_ size_t cchToAppend,
872 _In_ size_t cchToAppend,
888 _In_ size_t cchToAppend,
904 _In_ size_t cbToAppend,
914 _In_ size_t cbToAppend,
924 _In_ size_t cbToAppend,
930 size_t cchRemaining = 0;
938 *pcbRemaining = (cchRemaining *
sizeof(
char)) + (cbDest %
sizeof(
char));
948 _In_ size_t cbToAppend,
954 size_t cchDest = cbDest /
sizeof(
wchar_t);
955 size_t cchToAppend = cbToAppend /
sizeof(
wchar_t);
956 size_t cchRemaining = 0;
964 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
1004 _In_ size_t cchDest,
1058 size_t cchDest = cbDest /
sizeof(
wchar_t);
1073 _In_ size_t cchDest,
1080 _In_ size_t cchDest,
1087 _In_ size_t cchDest,
1112 _In_ size_t cchDest,
1181 size_t cchDest = cbDest /
sizeof(
wchar_t);
1200 _In_ size_t cchDest,
1210 _In_ size_t cchDest,
1220 _In_ size_t cchDest,
1248 _In_ size_t cchDest,
1256 size_t cbDest = cchDest *
sizeof(
wchar_t);
1305 size_t cchRemaining = 0;
1307 cchDest = cbDest /
sizeof(
char);
1327 *pcbRemaining = (cchRemaining *
sizeof(
char)) + (cbDest %
sizeof(
char));
1346 size_t cchRemaining = 0;
1347 cchDest = cbDest /
sizeof(
wchar_t);
1368 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
1377 _In_ size_t cchDest,
1387 _In_ size_t cchDest,
1397 _In_ size_t cchDest,
1416 cbDest = cchDest *
sizeof(
char);
1426 _In_ size_t cchDest,
1445 cbDest = cchDest *
sizeof(
wchar_t);
1484 size_t cchRemaining = 0;
1485 cchDest = cbDest /
sizeof(
char);
1496 *pcbRemaining = (cchRemaining *
sizeof(
char)) + (cbDest %
sizeof(
char));
1515 size_t cchRemaining = 0;
1516 cchDest = cbDest /
sizeof(
wchar_t);
1527 *pcbRemaining = (cchRemaining *
sizeof(
wchar_t)) + (cbDest %
sizeof(
wchar_t));
1616 size_t cchLength = 0;
1628 *pcbLength = cchLength *
sizeof(
char);
1648 size_t cchLength = 0;
1660 *pcbLength = cchLength *
sizeof(
wchar_t);
1684 while (cchDest && (*pszSrc !=
'\0'))
1686 *pszDest++ = *pszSrc++;
1715 while (cchDest && (*pszSrc !=
L'\0'))
1717 *pszDest++ = *pszSrc++;
1739 size_t *pcchRemaining,
1744 size_t cchRemaining = 0;
1756 if ((cchDest != 0) || (cbDest != 0))
1768 pszDestEnd = pszDest;
1771 if (*pszSrc !=
'\0')
1781 pszDestEnd = pszDest;
1782 cchRemaining = cchDest;
1784 while (cchRemaining && (*pszSrc !=
'\0'))
1786 *pszDestEnd++ = *pszSrc++;
1790 if (cchRemaining > 0)
1818 pszDestEnd = pszDest;
1819 cchRemaining = cchDest;
1821 else if (cchDest > 0)
1823 pszDestEnd = pszDest + cchDest - 1;
1831 pszDestEnd = pszDest;
1832 cchRemaining = cchDest;
1841 *ppszDestEnd = pszDestEnd;
1844 *pcchRemaining = cchRemaining;
1856 size_t *pcchRemaining,
1861 size_t cchRemaining = 0;
1873 if ((cchDest != 0) || (cbDest != 0))
1885 pszDestEnd = pszDest;
1888 if (*pszSrc !=
L'\0')
1898 pszDestEnd = pszDest;
1899 cchRemaining = cchDest;
1901 while (cchRemaining && (*pszSrc !=
L'\0'))
1903 *pszDestEnd++ = *pszSrc++;
1907 if (cchRemaining > 0)
1921 *pszDestEnd =
L'\0';
1936 pszDestEnd = pszDest;
1937 cchRemaining = cchDest;
1939 else if (cchDest > 0)
1941 pszDestEnd = pszDest + cchDest - 1;
1943 *pszDestEnd =
L'\0';
1949 pszDestEnd = pszDest;
1950 cchRemaining = cchDest;
1951 *pszDestEnd =
L'\0';
1959 *ppszDestEnd = pszDestEnd;
1962 *pcchRemaining = cchRemaining;
1982 while (cchDest && cchSrc && (*pszSrc !=
'\0'))
1984 *pszDest++ = *pszSrc++;
2015 while (cchDest && cchToCopy && (*pszSrc !=
L'\0'))
2017 *pszDest++ = *pszSrc++;
2041 size_t *pcchRemaining,
2046 size_t cchRemaining = 0;
2062 if ((cchDest != 0) || (cbDest != 0))
2074 pszDestEnd = pszDest;
2077 if ((cchToCopy != 0) && (*pszSrc !=
'\0'))
2087 pszDestEnd = pszDest;
2088 cchRemaining = cchDest;
2090 while (cchRemaining && cchToCopy && (*pszSrc !=
'\0'))
2092 *pszDestEnd++ = *pszSrc++;
2097 if (cchRemaining > 0)
2125 pszDestEnd = pszDest;
2126 cchRemaining = cchDest;
2128 else if (cchDest > 0)
2130 pszDestEnd = pszDest + cchDest - 1;
2140 pszDestEnd = pszDest;
2141 cchRemaining = cchDest;
2151 *ppszDestEnd = pszDestEnd;
2154 *pcchRemaining = cchRemaining;
2167 size_t *pcchRemaining,
2172 size_t cchRemaining = 0;
2188 if ((cchDest != 0) || (cbDest != 0))
2200 pszDestEnd = pszDest;
2203 if ((cchToCopy != 0) && (*pszSrc !=
L'\0'))
2213 pszDestEnd = pszDest;
2214 cchRemaining = cchDest;
2216 while (cchRemaining && cchToCopy && (*pszSrc !=
L'\0'))
2218 *pszDestEnd++ = *pszSrc++;
2223 if (cchRemaining > 0)
2237 *pszDestEnd =
L'\0';
2251 pszDestEnd = pszDest;
2252 cchRemaining = cchDest;
2254 else if (cchDest > 0)
2256 pszDestEnd = pszDest + cchDest - 1;
2258 *pszDestEnd =
L'\0';
2265 pszDestEnd = pszDest;
2266 cchRemaining = cchDest;
2267 *pszDestEnd =
L'\0';
2276 *ppszDestEnd = pszDestEnd;
2279 *pcchRemaining = cchRemaining;
2290 size_t cchDestLength;
2303 size_t cchDestLength;
2317 size_t *pcchRemaining,
2322 size_t cchRemaining = 0;
2330 size_t cchDestLength;
2335 if ((cchDest == 0) && (cbDest == 0))
2345 pszDestEnd = pszDest + cchDestLength;
2346 cchRemaining = cchDest - cchDestLength;
2358 pszDestEnd = pszDest + cchDestLength;
2359 cchRemaining = cchDest - cchDestLength;
2367 if (*pszSrc !=
'\0')
2391 pszDestEnd = pszDest;
2392 cchRemaining = cchDest;
2394 else if (cchDest > 0)
2396 pszDestEnd = pszDest + cchDest - 1;
2404 pszDestEnd = pszDest;
2405 cchRemaining = cchDest;
2414 *ppszDestEnd = pszDestEnd;
2417 *pcchRemaining = cchRemaining;
2429 size_t *pcchRemaining,
2434 size_t cchRemaining = 0;
2442 size_t cchDestLength;
2447 if ((cchDest == 0) && (cbDest == 0))
2457 pszDestEnd = pszDest + cchDestLength;
2458 cchRemaining = cchDest - cchDestLength;
2470 pszDestEnd = pszDest + cchDestLength;
2471 cchRemaining = cchDest - cchDestLength;
2479 if (*pszSrc !=
L'\0')
2503 pszDestEnd = pszDest;
2504 cchRemaining = cchDest;
2506 else if (cchDest > 0)
2508 pszDestEnd = pszDest + cchDest - 1;
2510 *pszDestEnd =
L'\0';
2516 pszDestEnd = pszDest;
2517 cchRemaining = cchDest;
2518 *pszDestEnd =
L'\0';
2526 *ppszDestEnd = pszDestEnd;
2528 *pcchRemaining = cchRemaining;
2540 size_t cchDestLength;
2554 size_t cchDestLength;
2569 size_t *pcchRemaining,
2574 size_t cchRemaining = 0;
2575 size_t cchDestLength = 0;
2591 if ((cchDest == 0) && (cbDest == 0))
2601 pszDestEnd = pszDest + cchDestLength;
2602 cchRemaining = cchDest - cchDestLength;
2614 pszDestEnd = pszDest + cchDestLength;
2615 cchRemaining = cchDest - cchDestLength;
2623 if ((cchToAppend != 0) && (*pszSrc !=
'\0'))
2647 pszDestEnd = pszDest;
2648 cchRemaining = cchDest;
2650 else if (cchDest > 0)
2652 pszDestEnd = pszDest + cchDest - 1;
2660 pszDestEnd = pszDest;
2661 cchRemaining = cchDest;
2670 *ppszDestEnd = pszDestEnd;
2673 *pcchRemaining = cchRemaining;
2686 size_t *pcchRemaining,
2691 size_t cchRemaining = 0;
2692 size_t cchDestLength = 0;
2708 if ((cchDest == 0) && (cbDest == 0))
2718 pszDestEnd = pszDest + cchDestLength;
2719 cchRemaining = cchDest - cchDestLength;
2731 pszDestEnd = pszDest + cchDestLength;
2732 cchRemaining = cchDest - cchDestLength;
2740 if ((cchToAppend != 0) && (*pszSrc !=
L'\0'))
2765 pszDestEnd = pszDest;
2766 cchRemaining = cchDest;
2768 else if (cchDest > 0)
2770 pszDestEnd = pszDest + cchDest - 1;
2772 *pszDestEnd =
L'\0';
2778 pszDestEnd = pszDest;
2779 cchRemaining = cchDest;
2780 *pszDestEnd =
L'\0';
2788 *ppszDestEnd = pszDestEnd;
2791 *pcchRemaining = cchRemaining;
2811 size_t cchMax = cchDest - 1;
2814 if ((iRet < 0) || (((
size_t)iRet) >
cchMax))
2820 else if (((
size_t)iRet) ==
cchMax)
2834 size_t* pcchDestNewLen,
2838 int iRet =
_vsnwprintf(pszDest, cchDest, pszFormat, argList);
2840 if ((iRet < 0) || (((
size_t)iRet) > cchDest))
2843 *pcchDestNewLen = cchDest;
2847 *pcchDestNewLen = iRet;
2857 size_t* pcchDestNewLen,
2861 size_t cchMax = cchDest - 1;
2864 if ((iRet < 0) || (((
size_t)iRet) >
cchMax))
2870 else if (((
size_t)iRet) ==
cchMax)
2877 *pcchDestNewLen = (iRet == -1) ? cchDest : iRet;
2899 size_t *pcchRemaining,
2906 size_t cchRemaining = 0;
2918 if ((cchDest != 0) || (cbDest != 0))
2929 pszDestEnd = pszDest;
2932 if (*pszFormat !=
'\0')
2946 if ((iRet < 0) || (((
size_t)iRet) >
cchMax))
2948 pszDestEnd = pszDest +
cchMax;
2953 else if (((
size_t)iRet) ==
cchMax)
2955 pszDestEnd = pszDest +
cchMax;
2959 else if (((
size_t)iRet) <
cchMax)
2961 pszDestEnd = pszDest + iRet;
2962 cchRemaining = cchDest - iRet;
2982 pszDestEnd = pszDest;
2983 cchRemaining = cchDest;
2985 else if (cchDest > 0)
2987 pszDestEnd = pszDest + cchDest - 1;
2997 pszDestEnd = pszDest;
2998 cchRemaining = cchDest;
3008 *ppszDestEnd = pszDestEnd;
3011 *pcchRemaining = cchRemaining;
3022 size_t *pcchRemaining,
3025 size_t* pcchDestNewLen,
3030 size_t cchRemaining = 0;
3042 if ((cchDest != 0) || (cbDest != 0))
3054 pszDestEnd = pszDest;
3056 if (*pszFormat !=
L'\0')
3066 size_t cchDestNewLen = 0;
3069 pszDestEnd = pszDest + cchDestNewLen;
3070 cchRemaining = cchDest - cchDestNewLen;
3078 *pcchDestNewLen = cchDestNewLen;
3092 pszDestEnd = pszDest;
3093 cchRemaining = cchDest;
3095 else if (cchDest > 0)
3097 pszDestEnd = pszDest + cchDest - 1;
3099 *pszDestEnd =
L'\0';
3107 pszDestEnd = pszDest;
3108 cchRemaining = cchDest;
3109 *pszDestEnd =
L'\0';
3118 *ppszDestEnd = pszDestEnd;
3121 *pcchRemaining = cchRemaining;
3132 size_t *pcchRemaining,
3147 size_t cchMaxPrev =
cchMax;
3149 while (
cchMax && (*psz !=
'\0'))
3161 *pcchLength = cchMaxPrev -
cchMax;
3176 size_t cchMaxPrev =
cchMax;
3178 while (
cchMax && (*psz !=
L'\0'))
3190 *pcchLength = cchMaxPrev -
cchMax;
3247 size_t cchFinalLength;
3287 size_t cchFinalLength;
3288 size_t cchRemaining;
3296 &RemainingString->Buffer,
3309 if (RemainingString)
3311 RemainingString->Length = 0;
3312 RemainingString->MaximumLength = (
USHORT)cchRemaining *
sizeof(
WCHAR);
3319#define RtlStringCopyWorkerA RtlStringCopyWorkerA_instead_use_StringCchCopyA_or_StringCchCopyExA;
3320#define RtlStringCopyWorkerW RtlStringCopyWorkerW_instead_use_StringCchCopyW_or_StringCchCopyExW;
3321#define RtlStringCopyExWorkerA RtlStringCopyExWorkerA_instead_use_StringCchCopyA_or_StringCchCopyExA;
3322#define RtlStringCopyExWorkerW RtlStringCopyExWorkerW_instead_use_StringCchCopyW_or_StringCchCopyExW;
3323#define RtlStringCatWorkerA RtlStringCatWorkerA_instead_use_StringCchCatA_or_StringCchCatExA;
3324#define RtlStringCatWorkerW RtlStringCatWorkerW_instead_use_StringCchCatW_or_StringCchCatExW;
3325#define RtlStringCatExWorkerA RtlStringCatExWorkerA_instead_use_StringCchCatA_or_StringCchCatExA;
3326#define RtlStringCatExWorkerW RtlStringCatExWorkerW_instead_use_StringCchCatW_or_StringCchCatExW;
3327#define RtlStringCatNWorkerA RtlStringCatNWorkerA_instead_use_StringCchCatNA_or_StrincCbCatNA;
3328#define RtlStringCatNWorkerW RtlStringCatNWorkerW_instead_use_StringCchCatNW_or_StringCbCatNW;
3329#define RtlStringCatNExWorkerA RtlStringCatNExWorkerA_instead_use_StringCchCatNExA_or_StringCbCatNExA;
3330#define RtlStringCatNExWorkerW RtlStringCatNExWorkerW_instead_use_StringCchCatNExW_or_StringCbCatNExW;
3331#define RtlStringVPrintfWorkerA RtlStringVPrintfWorkerA_instead_use_StringCchVPrintfA_or_StringCchVPrintfExA;
3332#define RtlStringVPrintfWorkerW RtlStringVPrintfWorkerW_instead_use_StringCchVPrintfW_or_StringCchVPrintfExW;
3333#define RtlStringVPrintfExWorkerA RtlStringVPrintfExWorkerA_instead_use_StringCchVPrintfA_or_StringCchVPrintfExA;
3334#define RtlStringVPrintfExWorkerW RtlStringVPrintfExWorkerW_instead_use_StringCchVPrintfW_or_StringCchVPrintfExW;
3335#define RtlStringLengthWorkerA RtlStringLengthWorkerA_instead_use_StringCchLengthA_or_StringCbLengthA;
3336#define RtlStringLengthWorkerW RtlStringLengthWorkerW_instead_use_StringCchLengthW_or_StringCbLengthW;
#define NT_SUCCESS(StatCode)
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
#define _Outptr_opt_result_buffer_(size)
#define _In_reads_or_z_(size)
#define _In_reads_bytes_(size)
#define _Out_writes_bytes_(size)
#define _Inout_updates_(size)
#define _Outptr_opt_result_bytebuffer_(size)
#define _Deref_out_range_(lb, ub)
#define _Out_writes_(size)
#define _Null_terminated_
#define _Must_inspect_result_
#define _Inout_updates_bytes_(size)
#define _In_range_(lb, ub)
#define _Printf_format_string_
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
_Out_ _Inout_ POEM_STRING DestinationString
NTSTRSAFEAPI RtlStringCbCopyW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
#define RtlStringCopyWorkerA
const char * STRSAFE_LPCSTR
NTSTRSAFEAPI RtlStringCchCatNA(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, _In_ size_t cchToAppend)
#define RtlStringCatWorkerA
NTSTRSAFEAPI RtlStringCchCatA(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEAPI RtlStringCchCopyNW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cchToCopy)
NTSTRSAFEAPI RtlStringCchCopyNExW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cchToCopy, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
#define RtlStringVPrintfExWorkerW
#define STRSAFE_NULL_ON_FAILURE
#define RtlStringVPrintfWorkerW
NTSTRSAFEAPI RtlStringCchCopyNA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, _In_ size_t cchToCopy)
NTSTRSAFEAPI RtlStringCbCatA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEAPI RtlStringCchCatNExA(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToAppend) STRSAFE_LPCSTR pszSrc, _In_ size_t cchToAppend, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
#define STRSAFE_UNICODE_STRING_VALID_FLAGS
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
NTSTRSAFEAPI RtlStringCchCatNW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, _In_ size_t cchToAppend)
NTSTRSAFEAPI RtlStringCopyNWorkerW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy)
#define STRSAFE_VALID_FLAGS
#define STRSAFE_FILL_ON_FAILURE
_Must_inspect_result_ NTSTRSAFEAPI RtlStringCchLengthA(_In_reads_or_z_(cchMax) STRSAFE_LPCSTR psz, _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength)
NTSTRSAFEAPI RtlStringCbCatW(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
_Null_terminated_ const char * NTSTRSAFE_PCSTR
NTSTRSAFEAPI RtlStringCchCopyA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEVAPI RtlStringCchPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
NTSTRSAFEAPI RtlStringCbCatNExA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, _In_ size_t cbToAppend, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCbCopyNExA(_Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, _In_ size_t cbToCopy, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchCatExW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchVPrintfExW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, _In_ va_list argList)
#define RtlStringCatNWorkerW
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
_Must_inspect_result_ NTSTRSAFEAPI RtlStringCbLengthW(_In_reads_or_z_(cbMax/sizeof(wchar_t)) STRSAFE_LPCWSTR psz, _In_ _In_range_(1, NTSTRSAFE_MAX_CCH *sizeof(wchar_t)) size_t cbMax, _Out_opt_ _Deref_out_range_(<, cbMax - 1) size_t *pcbLength)
NTSTRSAFEAPI RtlStringCopyNWorkerA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc, size_t cchToCopy)
NTSTRSAFEAPI RtlUnicodeStringValidateEx(_In_opt_ PCUNICODE_STRING SourceString, _In_ STRSAFE_DWORD dwFlags)
#define STRSAFE_FILL_BEHIND
NTSTRSAFEAPI RtlStringCbCatExA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchCatW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
#define RtlStringCopyWorkerW
#define RtlStringLengthWorkerA
#define RtlStringCatExWorkerA
NTSTRSAFEVAPI RtlStringCbPrintfExA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
#define RtlStringCopyExWorkerA
NTSTRSAFEAPI RtlStringCbVPrintfExA(_Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
NTSTRSAFEAPI RtlStringCbCopyExW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
#define STRSAFE_GET_FILL_PATTERN(dwFlags)
NTSTRSAFEAPI RtlStringCopyNExWorkerW(STRSAFE_LPWSTR pszDest, size_t cchDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc, size_t cchToCopy, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlpStringVPrintfExWorkerW(STRSAFE_LPWSTR pszDest, size_t cchDest, size_t cbDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat, size_t *pcchDestNewLen, va_list argList)
NTSTRSAFEVAPI RtlStringCbPrintfExW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEVAPI RtlStringCchPrintfExA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
_Null_terminated_ char * NTSTRSAFE_PSTR
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
NTSTRSAFEVAPI RtlUnicodeStringPrintf(_In_ PUNICODE_STRING DestinationString, _In_ NTSTRSAFE_PCWSTR pszFormat,...)
#define RtlStringCatExWorkerW
NTSTRSAFEAPI RtlUnicodeStringValidate(PCUNICODE_STRING SourceString)
NTSTRSAFEAPI RtlStringCchCopyExA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchVPrintfA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
NTSTRSAFEAPI RtlpUnicodeStringValidate(_In_opt_ PCUNICODE_STRING SourceString, _In_ STRSAFE_DWORD dwFlags)
_Null_terminated_ wchar_t * NTSTRSAFE_PWSTR
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
#define RtlStringVPrintfWorkerA
NTSTRSAFEAPI RtlStringCchCopyNExA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToCopy) STRSAFE_LPCSTR pszSrc, _In_ size_t cchToCopy, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchVPrintfExA(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
NTSTRSAFEAPI RtlStringCchCopyExW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
#define RtlStringCatWorkerW
NTSTRSAFEAPI RtlStringCbVPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, _In_ va_list argList)
NTSTRSAFEVAPI RtlUnicodeStringPrintfEx(_In_opt_ PUNICODE_STRING DestinationString, _In_opt_ PUNICODE_STRING RemainingString, _In_ STRSAFE_DWORD dwFlags, _In_ NTSTRSAFE_PCWSTR pszFormat,...)
_Null_terminated_ const wchar_t * NTSTRSAFE_PCWSTR
NTSTRSAFEAPI RtlStringCbCatExW(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
#define RtlStringCopyExWorkerW
NTSTRSAFEAPI RtlStringCbCopyNExW(_Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToCopy, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEAPI RtlStringCchCatNExW(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_reads_or_z_(cchToAppend) STRSAFE_LPCWSTR pszSrc, _In_ size_t cchToAppend, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
#define NTSTRSAFE_MAX_CCH
NTSTRSAFEAPI RtlStringCbCopyNA(_Out_writes_bytes_(cbDest) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCSTR pszSrc, _In_ size_t cbToCopy)
#define STRSAFE_IGNORE_NULLS
#define RtlStringVPrintfExWorkerA
#define STRSAFE_NO_TRUNCATION
NTSTRSAFEAPI RtlStringCchCatExA(_Inout_updates_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags)
_Must_inspect_result_ NTSTRSAFEAPI RtlStringCchLengthW(_In_reads_or_z_(cchMax) STRSAFE_LPCWSTR psz, _In_ _In_range_(1, NTSTRSAFE_MAX_CCH) size_t cchMax, _Out_opt_ _Deref_out_range_(<, cchMax) _Deref_out_range_(<=, _String_length_(psz)) size_t *pcchLength)
#define RtlStringCatNExWorkerW
NTSTRSAFEAPI RtlStringCbCopyExA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc, _Outptr_opt_result_bytebuffer_(*pcbRemaining) STRSAFE_LPSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
#define STRSAFE_FILL_BEHIND_NULL
NTSTRSAFEAPI RtlStringCbCatNW(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToAppend)
NTSTRSAFEAPI RtlpArrayVPrintfWorkerW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, size_t *pcchDestNewLen, va_list argList)
NTSTRSAFEAPI RtlStringCbVPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat, _In_ va_list argList)
NTSTRSAFEAPI RtlStringCbCatNA(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToAppend) STRSAFE_LPCSTR pszSrc, _In_ size_t cbToAppend)
#define RtlStringLengthWorkerW
NTSTRSAFEAPI RtlStringCbCopyNW(_Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToCopy) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToCopy)
const wchar_t * STRSAFE_LPCWSTR
NTSTRSAFEAPI RtlStringCbCatNExW(_Inout_updates_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_reads_bytes_(cbToAppend) STRSAFE_LPCWSTR pszSrc, _In_ size_t cbToAppend, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags)
NTSTRSAFEVAPI RtlStringCchPrintfExW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _Outptr_opt_result_buffer_(*pcchRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcchRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
#define RtlStringCatNExWorkerA
NTSTRSAFEAPI RtlStringCbCopyA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCSTR pszSrc)
NTSTRSAFEAPI RtlStringCbVPrintfExW(_Out_writes_bytes_(cbDest) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, _In_ va_list argList)
NTSTRSAFEAPI RtlStringCchVPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat, _In_ va_list argList)
#define RtlStringCatNWorkerA
NTSTRSAFEAPI RtlpStringVPrintfWorkerW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat, size_t *pcchDestNewLen, va_list argList)
NTSTRSAFEAPI RtlStringCopyNExWorkerA(STRSAFE_LPSTR pszDest, size_t cchDest, size_t cbDest, STRSAFE_LPCSTR pszSrc, size_t cchToCopy, STRSAFE_LPSTR *ppszDestEnd, size_t *pcchRemaining, STRSAFE_DWORD dwFlags)
#define NTSTRSAFE_UNICODE_STRING_MAX_CCH
_Must_inspect_result_ NTSTRSAFEAPI RtlStringCbLengthA(_In_reads_or_z_(cbMax) STRSAFE_LPCSTR psz, _In_ _In_range_(1, NTSTRSAFE_MAX_CCH *sizeof(char)) size_t cbMax, _Out_opt_ _Deref_out_range_(<, cbMax) size_t *pcbLength)
#define STATUS_BUFFER_OVERFLOW
unsigned short MaximumLength
#define STATUS_INVALID_PARAMETER
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags