ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

slist.c
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT:       See COPYING in the top level directory
00003  * PROJECT:         ReactOS Runtime Library
00004  * PURPOSE:         Slist Routines
00005  * FILE:            lib/rtl/slist.c
00006  * PROGRAMERS:      Stefan Ginsberg (stefan__100__@hotmail.com)
00007  */
00008 
00009 /* INCLUDES *****************************************************************/
00010 
00011 #include <rtl.h>
00012 
00013 #define NDEBUG
00014 #include <debug.h>
00015 
00016 /* FUNCTIONS ***************************************************************/
00017 
00018 VOID
00019 NTAPI
00020 RtlInitializeSListHead(IN PSLIST_HEADER ListHead)
00021 {
00022 #ifdef _WIN64
00023     ListHead->Alignment = 0;
00024     ListHead->Region = 0;
00025     ListHead->Header8.Init = 1;
00026     // ListHead->Header8.HeaderType = 1; // FIXME: depending on cmpxchg16b support?
00027 #else
00028     ListHead->Alignment = 0;
00029 #endif
00030 }
00031 
00032 PSLIST_ENTRY
00033 NTAPI
00034 RtlFirstEntrySList(IN const SLIST_HEADER *ListHead)
00035 {
00036 #ifdef _WIN64
00037     if (ListHead->Header8.HeaderType)
00038     {
00039         return (PVOID)(ListHead->Region & ~0xF);
00040     }
00041     else
00042     {
00043         union {
00044             PVOID P;
00045             struct {
00046                 ULONG64 Reserved:4;
00047                 ULONG64 NextEntry:39;
00048                 ULONG64 Reserved2:21;
00049             } Bits;
00050         } Pointer;
00051 
00052         Pointer.P = (PVOID)ListHead;
00053         Pointer.Bits.NextEntry = ListHead->Header8.NextEntry;
00054         return Pointer.P;
00055     }
00056 #else
00057     return ListHead->Next.Next;
00058 #endif
00059 }
00060 
00061 WORD
00062 NTAPI
00063 RtlQueryDepthSList(IN PSLIST_HEADER ListHead)
00064 {
00065 #ifdef _WIN64
00066     return ListHead->Header8.HeaderType ?
00067         (WORD)ListHead->Header16.Sequence : (WORD)ListHead->Header8.Sequence;
00068 #else
00069     return ListHead->Depth;
00070 #endif
00071 }

Generated on Sat May 26 2012 04:35:23 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.