I am storing a password as a LSA secret using LsaStorePrivateData using a hardcoded key string. I am able to get the password using LsaRetrievePrivateData. The point is I have a feature in my app that can be optionally password protected. So if the user removes the password protection I want to delete the password from the LSA database. The next time when I query the LSA database with the same key string I will get an error and I know it is not password protected. I can store another secret to check whether it is password protected but it is a kludge.
P.S. My app has admin privileges. It is a COM server launched under Administrator identity