RtlUnicodeStringValidateDestWorker - 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_(*pcchDest*sizeof(wchar_t) == DestinationString->MaximumLength)
    NTSTRSAFEWORKERDDI
    RtlUnicodeStringValidateDestWorker(
            _In_ PCUNICODE_STRING DestinationString,
            _Outptr_result_buffer_(*pcchDest) wchar_t** ppszDest,
            _Out_ size_t* pcchDest,
            _Out_opt_ size_t* pcchDestLength,
            _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_(*pcchDest*sizeof(wchar_t) == DestinationString->MaximumLength)
    NTSTRSAFEWORKERDDI
    RtlUnicodeStringValidateDestWorker(
            _In_ PCUNICODE_STRING DestinationString,
            _Outptr_result_buffer_(*pcchDest) wchar_t** ppszDest,
            _Out_ size_t* pcchDest,
            _Out_opt_ size_t* pcchDestLength,
            _In_ const size_t cchMax,
            _In_ DWORD dwFlags)
{
    NTSTATUS status;

    *ppszDest = NULL;
    *pcchDest = 0;

    if (pcchDestLength)
    {
        *pcchDestLength = 0;
    }

    status = RtlUnicodeStringValidateWorker(DestinationString, cchMax, dwFlags);

    if (NT_SUCCESS(status) && DestinationString)
    {
        *ppszDest = DestinationString->Buffer;
        *pcchDest = DestinationString->MaximumLength / sizeof(wchar_t);

        if (pcchDestLength)
        {
            *pcchDestLength = DestinationString->Length / sizeof(wchar_t);
        }
    }

    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 RtlUnicodeStringValidateDestWorker  RtlUnicodeStringValidateDestWorker_do_not_call_this_function

#endif
#endif

View code on GitHub

No description available.