Tech Support > Microsoft Windows > Drivers > UNICODE_STRING storage
UNICODE_STRING storage
Posted by Alex on March 5th, 2004


If I initialize a UNICODE_STRING like this...

UNICODE_STRING someString;
RtlInitUnicodeString(&someString,L"hello world");

Who owns the storage under UNICODE_STRING for the acctual string?

If it is me, how do I free it?


Posted by Alex on March 5th, 2004



"Alex" <AlX@a> wrote in message
news:ekSk9auAEHA.1732@TK2MSFTNGP12.phx.gbl...
Nobody, the string prefixed with L is allready unicode

No, you don't free it...

bleah , I need to take some time before diciding to post here



Posted by Maxim S. Shatskih on March 5th, 2004


You.

RtlInitUnicodeString does not allocate any memory. It is:

String->Buffer = Sz;
String->Length = (USHORT)( wcslen(Sz) * sizeof(WCHAR) );
String->MaximumLength = String->Length;

and that's all. Well, possibly MaximumLength is 1 characters longer to contain
the trailing zero.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com



Posted by Alex on March 6th, 2004


I realized that, but later..I keep posting stupid questions...
Thanx for answering anyway

"Maxim S. Shatskih" <maxim@storagecraft.com> wrote in message
news:uZI92bvAEHA.220@TK2MSFTNGP09.phx.gbl...


Posted by Mark Roddy on March 6th, 2004


Just remember that there are no stupid questions, only stupid posters :-)

--

=====================
Mark Roddy
Windows 2003/XP/2000 Consulting
Hollis Technology Solutions 603-321-1032
www.hollistech.com
markr@hollistech.com


"Alex" <AlX@a> wrote in message news:uzesu$wAEHA.220@TK2MSFTNGP09.phx.gbl...



Similar Posts