call vswprintf@msvcrt in Wine's UNICODE version

svn path=/trunk/; revision=11233
This commit is contained in:
Martin Fuchs 2004-10-08 20:20:15 +00:00
parent 8d52d923ed
commit b0468e7ffa
2 changed files with 31 additions and 11 deletions

View file

@ -18,10 +18,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <locale.h>
#include <time.h>
#define NONAMELESSUNION
#include "winefile.h"
#include "resource.h"
@ -171,6 +167,26 @@ extern int call_stat(
unsigned long* plinks
);
/* call vswprintf() in msvcrt.dll */
int swprintf(wchar_t* buffer, const wchar_t* fmt, ...)
{
static int (__cdecl *vswprintf)(wchar_t*, const wchar_t*, va_list);
va_list ap;
int ret;
if (!vswprintf) {
HMODULE hmod = LoadLibraryA("msvcrt");
vswprintf = (int(__cdecl*)(wchar_t*,const wchar_t*,va_list)) GetProcAddress(hmod, "vswprintf");
}
va_start(ap, fmt);
ret = vswprintf(buffer, fmt, ap);
va_end(ap);
return 0;
}
#endif

View file

@ -28,20 +28,24 @@
#define NOIMAGE
#define NOTAPE
#define NONAMELESSUNION
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <locale.h>
#include <time.h>
#ifdef UNICODE
#define _UNICODE
#include <wchar.h>
#endif
#include <tchar.h>
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <commdlg.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#ifdef _MSC_VER
#include <malloc.h> /* for alloca() */
#endif
@ -52,7 +56,7 @@
#include <objbase.h>
#include <shellapi.h>
#include <shlobj.h>
#endif
#endif /* _NO_EXTENSIONS */
#ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
#define FILE_ATTRIBUTE_ENCRYPTED 0x00000040