[DllImport("kernel32.dll", CharSet = CharSet.Auto)]
static extern long PackageFullNameFromId(ref PACKAGE_ID packageId, ref UInt32 packageFullNameLength, StringBuilder packageFullName);
PACKAGE_ID packageId = new PACKAGE_ID();
packageId.name = "MyPackage";
packageId.publisher = "CN=PublisherName";
StringBuilder packageFullName = new StringBuilder(255);
UInt32 capacity = (UInt32)packageFullName.Capacity;
long errorCode = PackageFullNameFromId(ref packageId, ref capacity, packageFullName);