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?

Re: RtlUnicodeStringToInteger is either mis documented or buggy by Pavel

Pavel
Tue Apr 11 16:11:16 CDT 2006

Working too much? sleep it over...

--PA

"fat_boy" <zzebowa@hotmail.com> wrote in message news:1144767920.437917.267360@j33g2000cwa.googlegroups.com...
> 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?
>



Re: RtlUnicodeStringToInteger is either mis documented or buggy by cristalink

cristalink
Tue Apr 11 15:15:34 CDT 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.googlegroups.com...
> 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?
>



Re: RtlUnicodeStringToInteger is either mis documented or buggy by fat_boy

fat_boy
Wed Apr 12 02:25:13 CDT 2006

Actually, that was the best advice, because I slept on it, and then
realised what the documentation meant.


Re: RtlUnicodeStringToInteger is either mis documented or buggy by fat_boy

fat_boy
Wed Apr 12 02:27:31 CDT 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.


Re: RtlUnicodeStringToInteger is either mis documented or buggy by Maxim

Maxim
Wed Apr 12 18:26:23 CDT 2006

> RtlInitUnicodeString(&str, buf);
> RtlUnicodeStringToInteger(&str, 16, &val1);
>
>
> WinDbg watch:
>
> str : struct _UNICODE_STRING "123"
>
> val1 : 0x123

Correct.

> I dont know about anyone else but I was expecting 0x7B.

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


Re: RtlUnicodeStringToInteger is either mis documented or buggy by fat_boy

fat_boy
Thu Apr 13 07:34:12 CDT 2006

Val1 is the output, so cant be set.

But, see my comment above regarding the DDK documentation.


Re: RtlUnicodeStringToInteger is either mis documented or buggy by Andy

Andy
Thu Apr 13 09:22:56 CDT 2006

On Thu, 13 Apr 2006 12:34:12 GMT, fat_boy wrote:

> Val1 is the output, so cant be set.
>
> But, see my comment above regarding the DDK documentation.
>

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

Re: RtlUnicodeStringToInteger is either mis documented or buggy by Tim

Tim
Fri Apr 14 21:37:11 CDT 2006

Andy Moreton <andy.moreton@nospamartimi.com> wrote:
>
>On Thu, 13 Apr 2006 12:34:12 GMT, fat_boy wrote:
>
>> But, see my comment above regarding the DDK documentation.
>>
>
>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.

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.

Re: RtlUnicodeStringToInteger is either mis documented or buggy by Norman

Norman
Sun Apr 16 19:14:03 CDT 2006

Are you really, _really_ sure about that?