In MsiLocateComponent pcchBuf can be NULL so don't try to dereference