Re: msi: source one off error correction
Aric Stewart wrote:
rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEstringW, 0, 0, (LPBYTE)buffer,&size); ptr = strchrW(buffer,';'); + ptr ++; ptr = strchrW(ptr,';'); if (!ptr) rc = ERROR_UNKNOWN_PROPERTY;
This will crash immediately if there's anything other than a string with ;; in it in the registry. Mike
True, there shouldn't be because that string is of format <char>;<int>;<path> but i will work out some better error checking to handle garbage strings more gracefully. -aric Mike McCormack wrote:
Aric Stewart wrote:
rc = RegQueryValueExW(sourcekey, INSTALLPROPERTY_LASTUSEDSOURCEstringW, 0, 0, (LPBYTE)buffer,&size); ptr = strchrW(buffer,';'); + ptr ++; ptr = strchrW(ptr,';'); if (!ptr) rc = ERROR_UNKNOWN_PROPERTY;
This will crash immediately if there's anything other than a string with ;; in it in the registry.
Mike
participants (2)
-
Aric Stewart -
Mike McCormack