Hello,
I'm having a problem using UNICODE_STRING in a structure.
First, I have a structure with a PUNICODE type data and
others values, this a chained list and I declare a global
variable :
---
typedef struct _FOO
{
PUNICODE_STRING string;
WORD value;
struct FOO* next;
} FOO, *PFOO;
PFOO GLOBAL;
---
Second, I have a function receive a WCHAR* type data and
convert it to UNICODE_STRING and call a second function :
---
void foo(WCHAR *value)
{
UNICODE_STRING uString;
RtlInitUnicodeString(&uString, value);
foo2(&uString);
testList();
}
---
Third, the second function. It fill the structure with the
string :
---
void foo2(PUNICODE_STRING uString)
{
PFOO foo_s, e;
foo_s = ExAllocatePoo(NonPagedPool, sizeof(FOO));
foo_s->string = uString;
if (GLOBAL)
{
e = GLOBAL;
while (e->next)
e = e->next;
e->next = foo_s;
} else {
GLOBAL = foo_s;
}
}
---
Fourth, Hmm...this the "testList()" that iterate into the list:
---
void testList(void)
{
while (GLOBAL)
{
DbgPrint("%wZ\n", GLOBAL->string);
GLOBAL = GLOBAL->next;
}
}
---
My problem is the PUNICODE_STRING type data. When I display it
I have nothing !!! I diddn't put it in the test but the DWORD
value in the list is ok.
Where I'm wrong ?
Regards,