"Robert Shearman" <R.J.Shearman_at_warwick.ac.uk> wrote:
I'd like to get people's opinions on how I should link to the _wtol
function
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?
The
rest of the functions in wcstring.c call their libunicode versions, but
this
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 functions _ultoa, _ltoa, _itoa, _ui64toa, _i64toa, _atoi64, _ultow, _ltow, _itow, _ui64tow, _i64tow, _wtol, _wtoi, _wtoi64.
There are also test functions for this functions in the dlls/ntdll/tests directory. 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 rewrite something already working. Search for library functions in msvcrt. There are tons of unimplemented functions.
Greetings Thomas Mertes