1 /* 2 * PROJECT: ReactOS Setup Library 3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+) 4 * PURPOSE: Generic list functions 5 * COPYRIGHT: Copyright 2008-2018 Christoph von Wittich <christoph at reactos.org> 6 */ 7 8 #pragma once 9 10 typedef struct _GENERIC_LIST_ENTRY 11 { 12 LIST_ENTRY Entry; 13 struct _GENERIC_LIST* List; 14 PVOID Data; 15 ULONG_PTR UiData; // Cache variable for any UI list that displays these items 16 } GENERIC_LIST_ENTRY, *PGENERIC_LIST_ENTRY; 17 18 typedef struct _GENERIC_LIST 19 { 20 LIST_ENTRY ListHead; 21 ULONG NumOfEntries; 22 PGENERIC_LIST_ENTRY CurrentEntry; 23 } GENERIC_LIST, *PGENERIC_LIST; 24 25 26 PGENERIC_LIST 27 NTAPI 28 CreateGenericList(VOID); 29 30 VOID 31 NTAPI 32 DestroyGenericList( 33 IN OUT PGENERIC_LIST List, 34 IN BOOLEAN FreeData); 35 36 BOOLEAN 37 NTAPI 38 AppendGenericListEntry( 39 IN OUT PGENERIC_LIST List, 40 IN PVOID Data, 41 IN BOOLEAN Current); 42 43 VOID 44 NTAPI 45 SetCurrentListEntry( 46 IN PGENERIC_LIST List, 47 IN PGENERIC_LIST_ENTRY Entry); 48 49 PGENERIC_LIST_ENTRY 50 NTAPI 51 GetCurrentListEntry( 52 IN PGENERIC_LIST List); 53 54 PGENERIC_LIST_ENTRY 55 NTAPI 56 GetFirstListEntry( 57 IN PGENERIC_LIST List); 58 59 PGENERIC_LIST_ENTRY 60 NTAPI 61 GetNextListEntry( 62 IN PGENERIC_LIST_ENTRY Entry); 63 64 PVOID 65 NTAPI 66 GetListEntryData( 67 IN PGENERIC_LIST_ENTRY Entry); 68 69 ULONG_PTR 70 GetListEntryUiData( 71 IN PGENERIC_LIST_ENTRY Entry); 72 73 ULONG 74 NTAPI 75 GetNumberOfListEntries( 76 IN PGENERIC_LIST List); 77 78 /* EOF */ 79