Hi,
I wrote the following code to walk a linked list:
>LIST_ENTRY DoubleHead; //points to the head of the double-linked
> list, initialized
>
> [...]
> PLIST_ENTRY plistentry = NULL;
> PMYSTRUCT pmystruct = NULL;
>
> if(!IsListEmpty(&DoubleHead))
> {
> plistentry = DoubleHead.Flink;
> while(plistentry != &DoubleHead)
> {
> pmystruct = CONTAINING_RECORD(plistentry, MYSTRUCT,
> linkfield);
>
> [...]//Doing some checking with pmystruct here
> plistentry = plistentry->Flink;//next one
> }
> }
>
Now, the problem is: although the list is filled with valid members
(not shown), when I check the items that way, 'pmystruct' contains
only invalid members. What am I doing wrong?
Thanks a lot
Peter