Note that if you make multiple calls to MsiGetProperty the value in pchValueBuf gets changed each time. And even if you are expecting the same length string each time, the value gets set to one less than the actual buffer size! Very shoddy design... IMHO.