RtlStringCbCopyW

NTSTATUS __stdcall RtlStringCbCopyW(PWCHAR pszDest, UINT64 cbDest, PWCHAR pszSrc){
  UINT64 v3; 
  NTSTATUS v4; 
  UINT64 v5; 
  signed __int64 v6; 
  WCHAR v7; 
  PWCHAR v8; 
  v3 = cbDest >> 1;
  v4 = 0;
  if( v3 - 1 > 0x7FFFFFFE )
    v4 = -1073741811;
  if( v4 < 0 )
  {
    if( v3 )
      *pszDest = 0;
  }
  else
  {
    if( v3 )
    {
      v5 = 2147483646 - v3;
      v6 = (char *)pszSrc - (char *)pszDest;
      do
      {
        if( !(v5 + v3) )
          break;
        v7 = *(PWCHAR)((char *)pszDest + v6);
        if( !v7 )
          break;
        *pszDest++ = v7;
        --v3;
      }
      while( v3 );
    }
    v8 = pszDest - 1;
    if( v3 )
      v8 = pszDest;
    v4 = v3 == 0 ? 0x80000005 : 0;
    *v8 = 0;
  }
  return v4;
}

Referenced by:

DbgkSendSystemDllMessages
EtwTimLogRedirectionTrustPolicy
ExpressionConvertToString
MfgInitSystem
PfSnParametersRead
PiDcHandleCustomDeviceEvent
PiDcResetChildDeviceContainerCallback
PiSwCompleteCreate
PiSwFindSwDevice
PiSwIrpInterfaceRegister
PiSwIrpStartCreateWorker
PipMakeGloballyUniqueId
PnpAllocatePWSTR
PopIdleWakeFinalizeWakeSource
PopPowerInformationInternal
RtlpAllowsLowBoxAccess
RtlpGetNameFromLangInfoNode
SeSetLearningModeObjectInformation
ViMakeVerifierSettings
WmipAddMofResource
WmipEnumerateMofResources
WmipGenerateBinaryMofNotification
WmipIncludeStaticNames
WmipInsertStaticNames