Linking to _wtol function

thomas.mertes at thomas.mertes at
Mon Aug 4 05:46:37 CDT 2003

"Robert Shearman" <> wrote:

> I'd like to get people's opinions on how I should link to the _wtol
> from a Wine DLL. Should I:
> a) Link to NTDLL and use the function there
> b) Link to MSVCRT and use the function there
> c) Create a new function in unicode.h
> d) Copy the function into my DLL

a) and b) are equivalent. In dlls/msvcrt/msvcrt.spec _wtol is
just a link to ntdll._wtol.
I suggest you use a) since NTDLL is always present (in NT systems).
If your program/dll should also run in DOS based systems you should use b).
Btw. The wine implementation of the _wtol function is okay, so c) is not
necessary. And code duplication d) is also not a good idea.

> In that case should I reimplement _wtol in NTDLL function using strtolW?
> rest of the functions in wcstring.c call their libunicode versions, but
> one doesn't.

This is wrong the only function in wcstring.c calling strtolW is _wcstol.

As you can see in the changelog several months ago I implemented the
_ultoa, _ltoa, _itoa, _ui64toa, _i64toa,
_atoi64, _ultow, _ltow, _itow, _ui64tow, _i64tow, _wtol, _wtoi,

There are also test functions for this functions in the dlls/ntdll/tests
All this functions work correct and are documented.
There is no reason to rewrite them for fun unless you find a bug.

If you want to write little library functions, It is not necessary to
something already working. Search for library functions in msvcrt. There
are tons of unimplemented functions.

Greetings Thomas Mertes

COMPUTERBILD 15/03: Premium-e-mail-Dienste im Test
1. GMX TopMail - Platz 1 und Testsieger!
2. GMX ProMail - Platz 2 und Preis-Qualitätssieger!
3. Arcor - 4. - 5. T-Online - 6. - 7. daybyday - 8. e-Post

More information about the wine-devel mailing list