http://msdn.microsoft.com/en-us/library/bb288454.aspx encourages people to use the functions in strsafe.h. (They're inline by default, and optionally available as a static library.) Neither Wine nor mingw currently ship this header. There are a few copies floating around, though:
http://baseutils.googlecode.com/svn/trunk/str_strsafe.h http://github.com/janneke/gub/blob/76e5823756ea1eda37542808a82d784df4a20ee2/...
And then there's the massively more complete one from the mingw-w64 project:
http://mingw-w64.svn.sourceforge.net/viewvc/mingw-w64/trunk/mingw-w64-header...
Can we just use that one directly? - Dan