Uday Kiran

Uday Kiran

  • NA
  • 5
  • 2.4k

Get catalog file information

Aug 20 2015 2:04 AM
I need to check whether a driver catalog file is created for x86 or x64.
So, I loaded the libraries of inf2cat.exe.
I am able to create a catalog file with it.
But I am not able to get any info about the existing catalog file.
I tried below but it is creating empty collection for CatalogAttributeInfo.
[CODE]bool iscat = Microsoft.Whos.Shared.IO.Catalogs.CatalogInfo.IsCatalog(@"C:\Users\Admin\Desktop\akshasp.cat");
Console.WriteLine("Is catalog file: "+iscat);
CatalogFileInfo catalogfile = new CatalogFileInfo(@"C:\Users\Admin\Desktop\akshasp.cat");
FileInfo fi = catalogfile.FileInfo;
CatalogInfo ci = CatalogInfo.Create(@"C:\Users\Admin\Desktop\akshasp.cat");
Collection<CatalogAttributeInfo> fac = ci.Attributes;//catalogfile.Attributes;
System.Console.WriteLine("Writing Attribute Values with count." + fac.Count);
foreach (CatalogAttributeInfo c in fac)
{
System.Console.WriteLine("Writing Attribute Values.");
if (c != null)
System.Console.WriteLine("Id + Type + Value " + c.GetType() + c.Id + c.Type + c.Value);
else
System.Console.WriteLine("List element has null value.");
}
[/CODE]