Thread: Unicode
View Single Post
Old 17th November 2009, 14:22   #337
Senior Member
Join Date: Aug 2007
Location: Paris, France
Posts: 304
Originally posted by jimpark
@Wizou: the problem with that check is that if the user calls CreateFile() with 'w' in the Unicode version of NSIS, that's not wrong either. CreateFile should still resolve to CreateFileW.
I don't agree with you. This is wrong.
If the user explicitely wants to call the Unicode version using 'w' as parameter type, he has to specify CreateFileW as the function name.

* the user wants to call explicitely CreateFileA => he uses function name CreateFileA and parameter type 'm'
* the user wants to call explicitely CreateFileW => he uses function name CreateFileW and parameter type 'w'
* the user wants to call CreateFile whatever suits best according to NSIS variant => he uses function name CreateFile and parameter type 't'
* outside the presence of parameter type t, we can't suppose the existence of a A/W suffix, and it seems to me it would be wrong to try to add one (it would risk to reach another API which is unrelated)

Last edited by Wizou; 17th November 2009 at 15:17.
Wizou is offline   Reply With Quote