Re: shell32: Unicode'ify ISFHelper interface
Saturday, March 4, 2006, 10:35:54 AM, Michael Jung wrote:
ChangeLog: Unicode'ify shell32 internal ISFHelper interface and it's implementors.
dlls/shell32/shellfolder.h | 4 ++- dlls/shell32/shfldr_fs.c | 55 +++++++++++++++++++++--------------------- dlls/shell32/shfldr_unixfs.c | 32 ++++++++++++++---------- dlls/shell32/shv_bg_cmenu.c | 6 ++--- 4 files changed, 51 insertions(+), 46 deletions(-)
Few questions:
- if (uLen < strlen (szNewFolder) + 4) + if (uLen < lstrlenW (wszNewFolder) + 4) Probably should use sizeof(wszNewFolder)/sizeof(WCHAR) + 4. A bit awkward but compiled into single number. And it looks like that's what you used in shfldr_unixfs.c <g>.
- _ILSimpleGetText (pidl, szText, MAX_PATH); - if (0 == strcasecmp (szText, lpName)) { - sprintf (lpName, "%s %d", szNewFolder, i++); + _ILSimpleGetTextW (pidl, wszText, MAX_PATH); + if (0 == lstrcmpiW (wszText, pwszName)) { + sprintfW (pwszName, wszFormat, wszNewFolder, i++); To be safe probably should use snprintfW instead.
+ if (This->sPathTarget) + lstrcpyW(wszNewDir, This->sPathTarget); Kind of the same thing.
Here
+++ b/dlls/shell32/shfldr_fs.c + if (uLen < lstrlenW (wszNewFolder) + 4) and here +++ b/dlls/shell32/shfldr_unixfs.c + if (uLen < sizeof(wszNewFolder)/sizeof(WCHAR)+3) Why 4 in one place and 3 in the other?
Vitaliy Margolen
Hey Vitaliy, thanks for the comments. I've sent an updated version. On Saturday 04 March 2006 20:26, Vitaliy Margolen wrote:
Here
+++ b/dlls/shell32/shfldr_fs.c + if (uLen < lstrlenW (wszNewFolder) + 4) and here +++ b/dlls/shell32/shfldr_unixfs.c + if (uLen < sizeof(wszNewFolder)/sizeof(WCHAR)+3) Why 4 in one place and 3 in the other?
That's because the sizeof expression counts the terminating zero, while strlen does'nt. Bye, -- Michael Jung mjung(a)iss.tu-darmstadt.de
participants (2)
-
Michael Jung -
Vitaliy Margolen