By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Slides:



Advertisements
Similar presentations
Pointers.
Advertisements

EENG212 Algorithms and Data Structures
Linked Lists Linked Lists Representation Traversing a Linked List
Data Structures Using C++
Doubly-linked list library.
Module R2 Overview. Process queues As processes enter the system and transition from state to state, they are stored queues. There may be many different.
Chapter 3 Memory Management. 3.1 From Programs To Address Space 3 steps to run the programs of an application – A Compiler translates the source code.
Linked Lists list elements are stored, in memory, in an arbitrary order explicit information (called a link) is used to go from one element to the next.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition Chapter 17: Linked Lists.
The kernel’s task list Introduction to process descriptors and their related data-structures for Linux kernel version
Linked Lists Chained nodes of information create what are called linked lists, with each node providing a link to the next node. A useful feature of linked.
Main Index Contents 11 Main Index Contents Abstract Model of a List Obj. Abstract Model of a List Obj. Insertion into a List Insertion into a List Linked.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 17 Linked.
Chapter 4 Linked Lists. © 2005 Pearson Addison-Wesley. All rights reserved4-2 Preliminaries Options for implementing an ADT List –Array has a fixed size.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 17: Linked Lists.
2 Preliminaries Options for implementing an ADT List Array has a fixed size Data must be shifted during insertions and deletions Linked list is able to.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 4: Linked Lists Data Abstraction & Problem Solving with.
Implementation of Linked List For more notes and topics visit: eITnotes.com.
Department of Computer Science Data Structures Using C++ 2E Chapter 5 Linked Lists.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Copyright © 2012 Pearson Education, Inc. Chapter 17: Linked Lists.
CIRSCALC - CT BONE DENSITOMETRY. Agenda  What is CIRSCALC project?  Tools Used.  Code Description Database Connectivity Crystal Reports Graph  Demo.
Review 1 Polish Notation Prefix Infix Postfix Precedence of Operators Converting Infix to Postfix Evaluating Postfix.
Data Structures Using C++1 Chapter 5 Linked Lists.
Debugging 1/6/2016. Debugging 1/6/2016 Debugging  Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a program.
1. Circular Linked List In a circular linked list, the last node contains a pointer to the first node of the list. In a circular linked list,
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 240 Elementary Data Structures Linked Lists Linked Lists Dale.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Chapter 17: Linked Lists. Objectives In this chapter, you will: – Learn about linked lists – Learn the basic properties of linked lists – Explore insertion.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Linked List. LINKED LIST Link is collection of similar type of elements. There are two ways of maintaining a list in memory. The first way is store the.
Single Linked Lists Objectives In this lesson, you will learn to: *Define single linked list *Identify the following types of linked lists: Single linked.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)
Data Structure and Algorithm: CIT231 Lecture 6: Linked Lists DeSiaMorewww.desiamore.com/ifm1.
© Oxford University Press All rights reserved. Data Structures Using C, 2e Reema Thareja.
List Structures What is a list? A homogeneous collection of elements with a linear relationship between the elements linear relationship - each element.
Copyright © 2012 Pearson Education, Inc. Chapter 17: Linked Lists.
A05. List Debug Intro Data Structures & SE Computer Science Dept Va Tech Aug., 2001 © Barnette ND, McQuain WD 1 MSVC IDE Debugger List Tracing.
CPSC 252 Linked Lists III Page 1 Variations on Singly Linked Lists Inserting or deleting at the front of a list is different from at any other point in.
Kernel data structures. outline linked list queues maps binary trees algorithmic complexity.
Chapter 16: Linked Lists.
Linked List ADT used to store information in a list
[Chapter 4; Chapter 6, pp ] CSC 143 Linked Lists (cont) [Chapter 4; Chapter 6, pp ]
Lectures linked lists Chapter 6 of textbook
UNIT – I Linked Lists.
Review Deleting an Element from a Linked List Deletion involves:
Pointers, Enum, and Structures
UNIT-3 LINKED LIST.
Chapter 4 Linked Lists.
Chapter 18: Linked Lists.
Linked Lists Chapter 4.
Chapter 17: Linked Lists.
Structures in c By Anand George.
Introduction to Windbg
Pointer Arithmetic By Anand George.
Functions By Anand George.
Introduction to Windbg – Part2 Symbols
Kernel Debugging with VMplayer and Windbg
BY PROF. IRSHAD AHMAD LONE.
Chapter 9 Linked Lists.
Hello World Program In Visual Studio and Debugging
Assignment 5 … Data Next pointer Data Next pointer Data Next pointer
Presentation transcript:

By Anand George SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

LIST_ENTRY  Very commonly used in windows driver code and windows kernel.  Contains forward and backward link.  Normally comes in the middle of the structure.  Used for keeping Circular doubly linked list.  So in the code we may have to subtract the offset to go to the beginning of the record.  From WinNT.h typedef struct _LIST_ENTRY { struct _LIST_ENTRY *Flink; struct _LIST_ENTRY *Blink; } LIST_ENTRY, *PLIST_ENTRY, *RESTRICTED_POINTER PRLIST_ENTRY; SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

CONTAINING_RECORD  Automate the subtraction of LIST_ENTRY record.  Used to access any specific field.  Looks complicated in the initial look but it a matter of getting used to.  From winNT.h  Incorrect by C standard as null pointer de reference but almost all complier generate correct code for this MSVC, gcc etc. And all most all OS kernel linux, windows, bsd has something similar to below. // // Calculate the address of the base of the structure given its type, and an // address of a field within the structure. // #define CONTAINING_RECORD(address, type, field) ((type *)( \ (PCHAR)(address) - \ (ULONG_PTR)(&((type *)0)->field))) SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Demo  A doubly linked list with LIST_ENTRY and accessing the elements with CONTAINING_RECORD.  Looking at the dt command of windbg to display the content from the memory to display processes running on a system.  Understanding LIST_ENTRY and containing record. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Summary  LIST_ENTRY  CONTAIN RECORD  Importance. SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)

Thank you SourceLens.org Copyright. All rights reserved. Content Owner - Meera R (meera at sourcelens.org)