In Installer.cs, around line 137 is currently:
#region EnumProducts
public static string EnumProducts(int index)
{
string product;
TR(MsiEnumProducts(index, out product));
return product;
}
[DllImport(Installer.MSI_DLL, CharSet =
CharSet.Auto)]
private static extern UInt32 MsiEnumProducts(int
index,
out string product);
#endregion
The "product" argument, unfortunately, is a pointer to a
string buffer that is supposed to be at least 39
characters long (GUID is 38 characters, plus one for a
null). I don't think the library checks for stack overrund. :-
)
If you replace the above code with the below code,
EnumProducts will work correctly:
#region EnumProducts
public static string EnumProducts(int index)
{
StringBuilder buffer =
new StringBuilder(39);
TR(MsiEnumProducts(index, buffer));
return buffer.ToString();
}
[DllImport(Installer.MSI_DLL, CharSet =
CharSet.Auto)]
private static extern UInt32 MsiEnumProducts(int
index,
StringBuilder product);
#endregion
Logged In: NO
The same is true for EnumRelatedProducts
note also the DLL entrypoint is missing an s
#region EnumRelatedProducts
public static string EnumRelatedProducts(string
upgradeCode, int index)
{
StringBuilder buffer = new StringBuilder(39);
TR(MsiEnumRelatedProducts(upgradeCode, 0,
index, buffer));
return buffer.ToString();
}
[DllImport(Installer.MSI_DLL, CharSet =
CharSet.Auto)]
private static extern UInt32 MsiEnumRelatedProducts
(string upgradeCode,
int reserved, int index, StringBuilder
product);
#endregion