RtlStringCbPrintfW

INT64 __stdcall RtlStringCbPrintfW(WCHAR *pszDest, UINT64 cbDest, WCHAR *pszFormat){
  __int64 v3; 
  UINT64 v4; 
  int v6; 
  unsigned __int64 v7; 
  int v8; 
  __int64 Args; 
  Args = v3;
  v4 = cbDest >> 1;
  v6 = 0;
  if( v4 - 1 > 0x7FFFFFFE )
    v6 = -1073741811;
  if( v6 < 0 )
  {
    if( v4 )
      *pszDest = 0;
  }
  else
  {
    v7 = v4 - 1;
    v6 = 0;
    v8 = vsnwprintf(pszDest, v4 - 1, pszFormat, (va_list)&Args);
    if( v8 < 0 )
      goto LABEL_9;
    if( v8 == v7 )
    {
      pszDest[v7] = 0;
      return(unsigned int)v6;
    }
    if( v8 > v7 )
    {
LABEL_9:
      pszDest[v7] = 0;
      return(unsigned int)-2147483643;
    }
  }
  return(unsigned int)v6;
}

Referenced by:

AdtpBuildAccessReasonAuditStringInternal
AdtpBuildSecurityDescriptorUnicodeString
BiGetPhysicalDriveName
CmpCreatePerfKeys
CreateSystemRootLink
EtwpAddMicroarchitecturalPmcToPmcGroup
EtwpAddMicroarchitecturalPmcToRegistry
EtwpCreateNtFileName
EtwpEnableAutoLoggerProvider
EtwpEnumerateAutologgerPath
EtwpExpandFileName
EtwpFindMatchingPmcRegistryGroup
EtwpGenerateFileName
EtwpGetAutoLoggerEventNameFilter
EtwpGetAutoLoggerLevelKwFilter
EtwpGetAutoLoggerProviderFilter
EtwpGetSecurityDescriptorByGuid
EtwpLoadMicroarchitecturalPmcs
EtwpLoadMicroarchitecturalProfileGroup
EtwpRealtimeCreateLogfile
EtwpRemoveMicroarchitecturalPmcFromPmcGroup
ExProcessorCounterSetCallback
IoWMIDeviceObjectToInstanceName
IopGetLegacyVetoListDrivers
KiSynchCounterSetCallback
KiSynchNumaCounterSetCallback
LkmdTelCreateReport
MfgInitSystem
MiDriverLoadSucceeded
PfSnGetPrefetchInstructions
PfSnOpenVolumesForPrefetch
PfSnOperationProcess
PfpSourceGetPrefetchSupport
PiBuildDeviceNodeInstancePath
PiNormalizeDeviceText
PipMakeGloballyUniqueId
PipServiceInstanceToDeviceInstance
PnpUnloadAttachedDriver
PoFxRegisterDebugger
PopDiagTracePowerRequestCreate
PopDirectedDripsDiagCreateBlockerEntryBoolean
PopDirectedDripsDiagCreateBlockerEntryULong
PpmWmiRegisterInfo
RamdiskStart
SepReadAndPopulateCapes
SepSetSystemPaths
SiGetEfiSystemDevice
VhdInitialize
VhdiGetVolumeNumber
VhdiInitializeBootDisk
WmipIncludeStaticNames
WmipInsertStaticNames
WmipPrepareWnodeSI
WmipSecurityMethod