Implementing wtmpnam in msvcrt

Juan Lang juan.lang at gmail.com
Sat Nov 29 10:00:00 CST 2008


Hi Tim,

> +  p = s + MSVCRT_swprintf(s, "\\s%s.", tmpstr);  // "implicit declaration"
> error, function is defined in wcs (but no wcs.h); but how to convert format
> string to MSVCRT_wchar_t?

Declare the format string as a const buffer, e.g.:
static const MSVCRT_wchar_t tmpFmt[] = { '\\','s','%','s','.',0 };

> +    mbstowcs(wtmpstr,tmpstr,strlen(tmpstr));  // need a MSVCRT_wchar
> version
MultiByteToWideChar should be enough.

> +    wcscpy(p, wtmpstr);    // need a MSVCRT_wchar version
Just use strcpyW, as other files in msvcrt do.

> +@ cdecl wtmpnam(ptr) MSVCRT_wtmpnam  // needs an underscore?
The name in the .spec file must match the name in the .c file, that's all.
--Juan



More information about the wine-devel mailing list