IopAllocateUnicodeString

NTSTATUS __stdcall IopAllocateUnicodeString(UNICODE_STRING *String, UINT16 a2){
  unsigned __int16 *p_MaximumLength; 
  int v4; 
  wchar_t *PoolWithTag; 
  p_MaximumLength = &String->MaximumLength;
  String->Length = 0;
  v4 = RtlUShortAdd(a2, 2u, &String->MaximumLength);
  if( v4 >= 0 )
  {
    PoolWithTag = (wchar_t *)ExAllocatePoolWithTag(PagedPool, *p_MaximumLength, 0x75737050ui64);
    String->Buffer = PoolWithTag;
    if( !PoolWithTag )
    {
      *p_MaximumLength = 0;
      return -1073741670;
    }
  }
  return v4;
}

Referenced by:

IoRequestDeviceRemovalForReset
IopBuildGlobalSymbolicLinkString
PiBuildAndOpenDeviceDirectoryPath
PiCreateDriverRedirectedStateKey
PiDeferSetInterfaceState
PiGetDriverMutableStateDirectory
PiOpenDriverRedirectedStateKey
PipProcessDevNodeTree
PnpConcatenateUnicodeStrings