RtlUnicodeStringValidateSrcWorker - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTSTRSAFE_H_INCLUDED_
#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS

_Post_satisfies_(*pcchSrcLength*sizeof(wchar_t) == SourceString->MaximumLength)
    NTSTRSAFEWORKERDDI
    RtlUnicodeStringValidateSrcWorker(
            _In_ PCUNICODE_STRING SourceString,
            _Outptr_result_buffer_(*pcchSrcLength) wchar_t** ppszSrc,
            _Out_ size_t* pcchSrcLength,
            _In_ const size_t cchMax,
            _In_ DWORD dwFlags);

#endif
#endif

View code on GitHub
#ifndef _NTSTRSAFE_H_INCLUDED_
// Below here are the worker functions that actually do the work
#if defined(NTSTRSAFE_LIB_IMPL) || !defined(NTSTRSAFE_LIB)
#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS

_Post_satisfies_(*pcchSrcLength*sizeof(wchar_t) == SourceString->MaximumLength)
    NTSTRSAFEWORKERDDI
    RtlUnicodeStringValidateSrcWorker(
            _In_ PCUNICODE_STRING SourceString,
            _Outptr_result_buffer_(*pcchSrcLength) wchar_t** ppszSrc,
            _Out_ size_t* pcchSrcLength,
            _In_ const size_t cchMax,
            _In_ DWORD dwFlags)
{
    NTSTATUS status;

    *ppszSrc = NULL;
    *pcchSrcLength = 0;

    status = RtlUnicodeStringValidateWorker(SourceString, cchMax, dwFlags);

    if (NT_SUCCESS(status))
    {
        if (SourceString)
        {
            *ppszSrc = SourceString->Buffer;
            *pcchSrcLength = SourceString->Length / sizeof(wchar_t);
        }

        if ((*ppszSrc == NULL) && (dwFlags & STRSAFE_IGNORE_NULLS))
        {
            *ppszSrc = (wchar_t*)L"";
        }
    }

    return status;
}

#endif
#endif
#endif

View code on GitHub
#ifndef _NTSTRSAFE_H_INCLUDED_
// Do not call these functions, they are worker functions for internal use within this file
#ifdef DEPRECATE_SUPPORTED
// ...
#else

#define RtlUnicodeStringValidateSrcWorker   RtlUnicodeStringValidateSrcWorker_do_not_call_this_function

#endif
#endif

View code on GitHub

No description available.