diff --git a/reactos/subsys/system/winefile/winefile.c b/reactos/subsys/system/winefile/winefile.c index 7012cd3a13e..0fa7f9ef39d 100644 --- a/reactos/subsys/system/winefile/winefile.c +++ b/reactos/subsys/system/winefile/winefile.c @@ -18,10 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include - -#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 diff --git a/reactos/subsys/system/winefile/winefile.h b/reactos/subsys/system/winefile/winefile.h index 94a0984b086..cdc847f6c14 100644 --- a/reactos/subsys/system/winefile/winefile.h +++ b/reactos/subsys/system/winefile/winefile.h @@ -28,19 +28,23 @@ #define NOIMAGE #define NOTAPE -#ifdef UNICODE -#define _UNICODE -#include -#endif -#include - +#define NONAMELESSUNION #include #include #include #include + #include #include #include +#include +#include + +#ifdef UNICODE +#define _UNICODE +#include +#endif +#include #ifdef _MSC_VER #include /* for alloca() */ @@ -52,7 +56,7 @@ #include #include #include -#endif +#endif /* _NO_EXTENSIONS */ #ifndef FILE_ATTRIBUTE_NOT_CONTENT_INDEXED #define FILE_ATTRIBUTE_ENCRYPTED 0x00000040