t_wunlink p_wunlink = NULL;
t_wmkdir p_wmkdir = NULL;
t_wopen p_wopen = NULL;
+
+t_cgetws p_cgetws = NULL;
+t_cwprintf p_cwprintf = NULL;
+
t_GetFileAttributesA p_GetFileAttributesA = NULL;
t_GetFileAttributesW p_GetFileAttributesW = NULL;
/* wopen */
p_wopen = (t_wopen)
GetProcAddress(hLib, "_wopen");
-
+
+ /* cgetws */
+ p_cgetws = (t_cgetws)
+ GetProcAddress (hLib, "_cgetws");
+ /* cwprintf */
+ p_cwprintf = (t_cwprintf)
+ GetProcAddress (hLib, "_cwprintf");
+
FreeLibrary(hLib);
}
typedef int (__cdecl * t_wmkdir) (const wchar_t *);
typedef int (__cdecl * t_wopen) (const wchar_t *, int, ...);
+typedef wchar_t* (__cdecl *t_cgetws) (wchar_t *);
+typedef int (__cdecl *t_cwprintf) (const wchar_t *, ...);
+
extern t_wunlink p_wunlink;
extern t_wmkdir p_wmkdir;
extern t_wopen p_wopen;
+
+extern t_cgetws p_cgetws;
+extern t_cwprintf p_cwprintf;
/* In KERNEL32.DLL */
typedef BOOL (WINAPI * t_GetFileAttributesExA)(LPCSTR, GET_FILEEX_INFO_LEVELS,
LPVOID);
extern t_GetCurrentDirectoryA p_GetCurrentDirectoryA;
extern t_GetCurrentDirectoryW p_GetCurrentDirectoryW;
+#ifdef WIN32_VSS
+class VSSClient;
+extern VSSClient g_VSSClient;
+#endif
+
void InitWinAPIWrapper();
#endif
this works under nt and 98 (95 and me not tested)
*/
- if (p_MultiByteToWideChar && (stream == stdout)) {
+ if (p_MultiByteToWideChar && (stream == stdout) && p_cwprintf) {
WCHAR szBuf[MAX_PATH_UNICODE];
UTF8_2_wchar(szBuf, string, MAX_PATH_UNICODE);
- return _cwprintf (szBuf);
+ return p_cwprintf (szBuf);
}
return fputs(string, stream);
from the win32 console */
/* nt and unicode conversion */
- if ((g_platform_id == VER_PLATFORM_WIN32_NT) && p_WideCharToMultiByte) {
+ if ((g_platform_id == VER_PLATFORM_WIN32_NT) && p_WideCharToMultiByte && p_cgetws) {
WCHAR szBuf[260];
szBuf[0] = min (255, len); /* max len, must be smaller than buffer */
- if (!_cgetws (szBuf))
+ if (!p_cgetws (szBuf))
return NULL;
if (wchar_2_UTF8(buffer, &szBuf[2], len))