Friday, March 5, 2010

Beware of SHFileOperation

Take care in case you ever going to use SHFileOperation function.
Fields pFrom and pTo of SHFILEOPSTRUCT must be double-null terminated!
Even if you are passing only one file name.
 
P.s. Our tech.support guys informed me about funny thing: last version of one of our products distributed to clients was removing boot.ini, ntldr, and other files at C:\ during uninstall. Yes, due to missing second null. Evil :)

No comments:

Post a Comment