IopAllocateUnicodeString

NTSTATUS __stdcall IopAllocateUnicodeString(_UNICODE_STRING *String, UINT16 Length){
  unsigned __int16 *p_MaximumLength; 
  int v4; 
  VOID **PoolWithTag; 

  p_MaximumLength = &String->MaximumLength;
  String->Length = 0;
  v4 = RtlUShortAdd(Length, 2u, &String->MaximumLength);
  if( v4 >= 0 )
  {
    PoolWithTag = ExAllocatePoolWithTag(1ui64, *p_MaximumLength, 1970499664i64);
    String->Buffer = (wchar_t *)PoolWithTag;
    if( !PoolWithTag )
    {
      *p_MaximumLength = 0;
      return -1073741670;
    }
  }
  return v4;
}

Referenced by:

IoRequestDeviceRemovalForReset
IopBuildGlobalSymbolicLinkString
PiBuildAndOpenDeviceDirectoryPath
PiCreateDriverRedirectedStateKey
PiDeferSetInterfaceState
PiGetDriverMutableStateDirectory
PiOpenDriverRedirectedStateKey
PipProcessDevNodeTree
PnpConcatenateUnicodeStrings