Dhruva Krishnamurthy wrote:
I am trying to build XEmacs 21.5.7 on NT 4 SP5 using MSVC++6.0.
I had mailed earlier about the error I get in accessing
"GetLongPathNameW".
...
3. For NT, there is a suggested work around (which I guess Andy
knows).
If not, please refer the URL:
http://www.geocities.com/SiliconValley/2060/articles/longpaths.html
GetLongPathNameW is unused in XEmacs. I don't have NT 4.0 around to test,
but this simple patch should fix the problem.
There is a function mswindows-long-file-name that looks like it already uses
a similar algorithm to your suggested workaround.
Unfortunately I can't commit this myself, since I'm currently getting:
...
cvs commit: Examining tests/mule
cvs commit: Examining tests/tooltalk
' from cvs serverng: unrecognized response `ok
from the CVS server.
src/ChangeLog addition:
2002-07-04 Jonathan Harris <jonathan(a)xemacs.org>
* intl-auto-encap-win32.c:
* intl-auto-encap-win32.h:
* intl-encap-win32.c:
Remove GetLongPathNameW - API not available on Win95/NT4
xemacs-21.5 source patch:
Diff command: cvs -q diff -u
Files affected: src/intl-encap-win32.c src/intl-auto-encap-win32.h
src/intl-auto-encap-win32.c
Index: src/intl-auto-encap-win32.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-auto-encap-win32.c,v
retrieving revision 1.6
diff -u -u -r1.6 intl-auto-encap-win32.c
--- src/intl-auto-encap-win32.c 2002/05/06 14:15:41 1.6
+++ src/intl-auto-encap-win32.c 2002/07/04 19:33:24
@@ -2578,14 +2578,7 @@
return GetShortPathNameA ((LPCSTR) lpszLongPath, (LPSTR) lpszShortPath, cchBuffer);
}
-DWORD
-qxeGetLongPathName (const Extbyte * lpszShortPath, Extbyte * lpszLongPath, DWORD
cchBuffer)
-{
- if (XEUNICODE_P)
- return GetLongPathNameW ((LPCWSTR) lpszShortPath, (LPWSTR) lpszLongPath, cchBuffer);
- else
- return GetLongPathNameA ((LPCSTR) lpszShortPath, (LPSTR) lpszLongPath, cchBuffer);
-}
+/* Error if GetLongPathName used: Win98/2K+ only */
/* Skipping GetEnvironmentStrings because misnamed ANSI version of the function */
Index: src/intl-auto-encap-win32.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-auto-encap-win32.h,v
retrieving revision 1.6
diff -u -u -r1.6 intl-auto-encap-win32.h
--- src/intl-auto-encap-win32.h 2002/05/06 14:15:43 1.6
+++ src/intl-auto-encap-win32.h 2002/07/04 19:33:24
@@ -1829,11 +1829,8 @@
#endif
DWORD qxeGetShortPathName (const Extbyte * lpszLongPath, Extbyte * lpszShortPath, DWORD
cchBuffer);
-#ifdef ERROR_WHEN_NONINTERCEPTED_FUNS_USED
#undef GetLongPathName
-#define GetLongPathName error use qxeGetLongPathName or
GetLongPathNameA/GetLongPathNameW
-#endif
-DWORD qxeGetLongPathName (const Extbyte * lpszShortPath, Extbyte * lpszLongPath, DWORD
cchBuffer);
+#define GetLongPathName error Win98/2K+ only
/* Skipping GetEnvironmentStrings because misnamed ANSI version of the function */
Index: src/intl-encap-win32.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/intl-encap-win32.c,v
retrieving revision 1.7
diff -u -u -r1.7 intl-encap-win32.c
--- src/intl-encap-win32.c 2002/06/20 21:18:36 1.7
+++ src/intl-encap-win32.c 2002/07/04 19:33:25
@@ -216,7 +216,7 @@
yes GetBinaryType
yes GetShortPathName
-yes GetLongPathName
+no GetLongPathName Win98/2K+ only
skip GetEnvironmentStrings misnamed ANSI version of the function
yes FreeEnvironmentStrings
yes FormatMessage