First the disclaimer: I am not an experienced WINE developer, or even
a frequent coder; call me a motivated power user.
I use WINE to run one application, Lotus Notes 4.6.7, and I must say
that the job that the WINE team has done is absolutely remarkable. Well
done!
Attaching files to Notes has always been somewhat problematic. Until
recently it required the use of native DLLs, but WINE 20001002 seemed to
remove this dependency. WINE 20001026, on the other hand, seemed to
break it entirely. The symptom is that after the user selects a file,
"foo", for attachment an error dialog pops up, stating that
"foo<garbage characters>" does not exist.
Some further experimentation revealed that 20001002 didn't really work
either. A user can successfully attach a file immediately after
starting Notes, but if the user first detaches a file the "garbage"
problem appears. Interestingly, the "garbage" characters in this case
are sometimes part of of the Notes user ID of the sender of the note
from which the file was detached previously. (Got that?) This led me
to suspect that either:
- a buffer is not being properly cleared (by Notes or WINE), or
- the file name string is not being properly terminated (by Notes
or WINE).
After much perusal of dlls/commdlg/filedlg95.c, I was able to locate the
point at which FILEDLG95_OnOpen returns the filename in fodInfos->
ofnInfos->lpstrFile. I created a quick hack (patch attached) which adds
an additional '\0' to the end of the string. Much to my surprise, it
seems to actually work.
I have no idea what the correct behavior of FILEDLG95_OnOpen should be.
If it is supposed to return a doubly terminated string (a la FILEDLG95_
FILENAME_GetFileNames), then I guess I've found a bug. If the double-
termination simply works around a Notes bug (or an unknown bug somewhere
else in WINE), then the issues are stickier.
I hope this helps!
--
========================================================================
Ian Pilcher [EMAIL PROTECTED]
========================================================================
--- dlls/commdlg/filedlg95.c-20001002 Mon Sep 25 18:30:58 2000
+++ dlls/commdlg/filedlg95.c Wed Nov 1 17:12:16 2000
@@ -1407,12 +1407,13 @@
}
/* Check that size size of the file does not exceed buffer size */
- if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile)
+ if(strlen(lpstrPathAndFile) < fodInfos->ofnInfos->nMaxFile - 1)
{
LPSTR lpszTemp;
/* fill destination buffer */
strcpy(fodInfos->ofnInfos->lpstrFile, lpstrPathAndFile);
+ fodInfos->ofnInfos->lpstrFile[strlen(fodInfos->ofnInfos->lpstrFile) + 1] =
+'\0';
/* set filename offset */
lpszTemp = COMDLG32_PathFindFileNameA(lpstrPathAndFile);