PnpQueryDeviceText

__int64 __fastcall PnpQueryDeviceText(_DEVICE_OBJECT *DeviceObject, int a2, __int64 a3, _QWORD *a4){
  NTSTATUS v7; 
  void *v8; 
  int v9; 
  WCHAR *NormalizedText; 
  _IO_STACK_LOCATION TopStackLocation; 
  UINT64 Information; 

  Information = 0i64;
  NormalizedText = 0i64;
  *a4 = 0i64;
  memset(&TopStackLocation, 0i64, sizeof(TopStackLocation));
  TopStackLocation.Parameters.Options = PsDefaultSystemLocaleId;
  *(_WORD *)&TopStackLocation.MajorFunction = 3099;
  LODWORD(TopStackLocation.Parameters.SecurityContext) = a2;
  v7 = IopSynchronousCall(DeviceObject, &TopStackLocation, 3221225659i64, 0i64, &Information);
  v8 = (void *)Information;
  v9 = v7;
  if( !Information )
    v9 = -1073741637;
  if( v9 >= 0 )
  {
    *a4 = Information;
    if( PiNormalizeDeviceText((WCHAR *)v8, &NormalizedText) >= 0 )
    {
      if( NormalizedText )
      {
        *a4 = NormalizedText;
        ExFreePoolWithTag(v8, 0);
      }
    }
  }
  return(unsigned int)v9;
}

Referenced by:

PiProcessNewDeviceNode