- RtlUnicodeStringToInteger is either mis documented or buggy
- Posted by fat_boy on April 11th, 2006
Code:
RtlInitUnicodeString(&str, buf);
RtlUnicodeStringToInteger(&str, 16, &val1);
WinDbg watch:
str : struct _UNICODE_STRING "123"
val1 : 0x123
I dont know about anyone else but I was expecting 0x7B. Ie, that it
works the same as atoi.
Anyone got any views on this?
- Posted by cristalink on April 11th, 2006
I am not sure if you have read the documentation, but 16 means str is
treated as a hexadecimal, thus producing the perfectly correct result of
0x123.
"fat_boy" <zzebowa@hotmail.com> wrote in message
news:1144767920.437917.267360@j33g2000cwa.googlegr oups.com...
- Posted by Pavel A. on April 11th, 2006
Working too much? sleep it over...
--PA
"fat_boy" <zzebowa@hotmail.com> wrote in message news:1144767920.437917.267360@j33g2000cwa.googlegr oups.com...
- Posted by fat_boy on April 12th, 2006
Actually, that was the best advice, because I slept on it, and then
realised what the documentation meant.
- Posted by fat_boy on April 12th, 2006
Yes, it dawned on me at about 4 in the morning what the documentation
meant:
'An optional argument that indicates the base of the number expressed
as a Unicode string'
Which means 'that indicates the base of the Unicode String to be
expressed as a number'.
At least that is how I would write it.
- Posted by Maxim S. Shatskih on April 13th, 2006
Correct.
Then please set "val1" to 0x7b or 123, and not to 0x123 
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
- Posted by fat_boy on April 13th, 2006
Val1 is the output, so cant be set.
But, see my comment above regarding the DDK documentation.
- Posted by Andy Moreton on April 13th, 2006
On Thu, 13 Apr 2006 12:34:12 GMT, fat_boy wrote:
What comment ?
Please include some quoted context when writing a reply - not everyone will
see your previous messages, or see them in the same order.
AndyM
- Posted by Tim Roberts on April 15th, 2006
Andy Moreton <andy.moreton@nospamartimi.com> wrote:
I'm not sure that's really true any more. Every modern newsreader supports
threading, including Google groups.
With all the flak being thrown around about quoting, it may be that the
least offensive strategy is simply not to do it at all.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
- Posted by Norman Diamond on April 17th, 2006
Are you really, _really_ sure about that?