Re: UNICODE_STRING storage

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tim Roberts (timr_at_probo.com)
Date: 03/09/04


Date: Mon, 08 Mar 2004 22:17:49 -0800


"Gary G. Little" <gary.g.little.nospam@seagate.com> wrote:
>
>L"Hello World" is a UNICODE_STRING?

No, but it IS a Unicode string, as Alex said.

>Gee whiz, for about 10 years now I've
>been under the assumption that L"Hello World" would give you a pointer to a
>zero terminated double byte character string, and that passing said string
>pointer to RtlInitUnicodeString would simply set the Length, MaximunLength,
>and set Buffer to the pointer to the string constant.

Right. How is that different from what Alex said?

>Now I find out that I have wasted all those lines of code passing
>L"Something or other" to RtlInitUnicodeString because L"Something or other"
>is already a Unicode_STRING. Well golly gee.

It is a Unicode string. It is not a UNICODE_STRING. RtlInitUnicodeString
converts the first to the second.

>Methinks one needs a review of C Programming 101, Alex.

Methinks you need to read posts more carefully, especially when you turn on
the <sarcasm> modifier.

-- 
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc


Relevant Pages

  • Re: Efficency and the standard library
    ... loop will dereference a null pointer if argument strInstring is ... this code, out of adversarial hatred, envy and malice. ... Some C programmers in these threads would suggest const ... the output string. ...
    (comp.lang.c)
  • Re: retrieving user environment settings from system process
    ... you can use the StrPtr function to return a ... pointer to the existing VB unicode string. ...
    (microsoft.public.vb.winapi)
  • Re: ptrdiff_t overflow/underflow
    ... satisfy the vast majority of trim() use cases. ... It may point to a valid string, ... If any pointer can be converted to a 'void *', assuming there isn't any meta-data outside of the pointer's object representation, and assuming an implementation must not allow two 'void *' values to represent two separate objects, it seems like a fair upper bound. ... And if a pointer value includes bounds information, perhaps the implementation would be kind enough to document either the representation or how to access the information. ...
    (comp.lang.c)
  • Re: UNICODE_STRING storage
    ... Gee whiz, for about 10 years now I've ... zero terminated double byte character string, ... pointer to RtlInitUnicodeString would simply set the Length, MaximunLength, ... Methinks one needs a review of C Programming 101, Alex. ...
    (microsoft.public.development.device.drivers)
  • Re: pesky Pointers !!
    ... > and the function takes it as a reference instead of a copy. ... function may access the string passed directly, ... > *px dereferences the pointer to get the value ... If pTest is a pointer-to-string, *pTest is the string it points to ...
    (alt.comp.lang.learn.c-cpp)