43 ListUi->FirstShown =
NULL;
44 ListUi->LastShown =
NULL;
45 ListUi->BackupEntry =
NULL;
47 ListUi->GetEntryDescriptionProc = GetEntryDescriptionProc;
53 ListUi->Redraw =
TRUE;
58 ListUi->BackupEntry = ListUi->List->CurrentEntry;
65 ListUi->List->CurrentEntry = ListUi->BackupEntry;
78 coPos.
X = ListUi->Left;
79 coPos.
Y = ListUi->Top;
87 coPos.
X = ListUi->Left + 1;
88 coPos.
Y = ListUi->Top;
91 ListUi->Right - ListUi->Left - 1,
96 coPos.
X = ListUi->Right;
97 coPos.
Y = ListUi->Top;
105 for (
i = ListUi->Top + 1; i < ListUi->
Bottom;
i++)
107 coPos.
X = ListUi->Left;
115 coPos.
X = ListUi->Right;
124 coPos.
X = ListUi->Left;
125 coPos.
Y = ListUi->Bottom;
133 coPos.
X = ListUi->Left + 1;
134 coPos.
Y = ListUi->Bottom;
137 ListUi->Right - ListUi->Left - 1,
142 coPos.
X = ListUi->Right;
143 coPos.
Y = ListUi->Bottom;
163 coPos.
X = ListUi->Left + 1;
164 coPos.
Y = ListUi->Top + 1;
165 Width = ListUi->Right - ListUi->Left - 1;
167 Entry = ListUi->FirstShown;
172 if (coPos.
Y == ListUi->Bottom)
174 ListUi->LastShown =
Entry;
177 if (ListUi->GetEntryDescriptionProc)
179 ListUi->GetEntryDescriptionProc(ListEntry,
180 ListUi->CurrentItemText,
185 (
List->CurrentEntry == ListEntry) ?
200 ListUi->CurrentItemText,
210 while (coPos.
Y < ListUi->Bottom)
236 coPos.
X = ListUi->Right + 1;
237 coPos.
Y = ListUi->Top;
239 if (ListUi->FirstShown !=
List->ListHead.Flink)
256 coPos.
Y = ListUi->Bottom;
257 if (ListUi->LastShown !=
List->ListHead.Blink)
282 ULONG MaxVisibleItems, ItemCount,
i;
284 if ((ListUi->Top == 0 && ListUi->Bottom == 0) ||
291 MaxVisibleItems = (
ULONG)(ListUi->Bottom - ListUi->Top - 1);
302 ItemCount =
List->NumOfEntries;
304 if (ItemCount > MaxVisibleItems)
307 for (
i = 0;
i < MaxVisibleItems / 2;
i++)
313 ListUi->FirstShown =
Entry;
315 for (
i = 0;
i < MaxVisibleItems;
i++)
321 ListUi->LastShown =
Entry;
338 ListUi->Right = Right;
359 CHAR CurrentItemText[256];
361 if (GetEntryDescriptionProc &&
385 if (
List->CurrentEntry->Entry.Flink != &
List->ListHead)
388 if (ListUi->LastShown == &
List->CurrentEntry->Entry)
390 ListUi->FirstShown = ListUi->FirstShown->Flink;
391 ListUi->LastShown = ListUi->LastShown->Flink;
413 if (
List->CurrentEntry->Entry.Blink != &
List->ListHead)
416 if (ListUi->FirstShown == &
List->CurrentEntry->Entry)
418 ListUi->FirstShown = ListUi->FirstShown->Blink;
419 ListUi->LastShown = ListUi->LastShown->Blink;
438 ListUi->Redraw =
FALSE;
440 for (
i = ListUi->Top + 1; i < ListUi->
Bottom - 1;
i++)
450 ListUi->Redraw =
TRUE;
460 ListUi->Redraw =
FALSE;
462 for (
i = ListUi->Bottom - 1;
i > ListUi->Top + 1;
i--)
472 ListUi->Redraw =
TRUE;
484 if (
List->CurrentEntry ==
NULL || uIndex == 0)
489 if (
List->CurrentEntry->Entry.Flink != &
List->ListHead)
492 if (ListUi->LastShown == &
List->CurrentEntry->Entry)
494 ListUi->FirstShown = ListUi->FirstShown->Flink;
495 ListUi->LastShown = ListUi->LastShown->Flink;
501 while (uIndex != uCount);
514 if (ListUi->List->CurrentEntry ==
NULL)
534 ListEntry =
List->CurrentEntry;
535 OldListEntry =
List->CurrentEntry;
537 ListUi->Redraw =
FALSE;
540 if (ListUi->GetEntryDescriptionProc)
542 ListUi->GetEntryDescriptionProc(ListEntry,
543 ListUi->CurrentItemText,
547 if ((
strlen(ListUi->CurrentItemText) > 0) && (
tolower(ListUi->CurrentItemText[0]) == AsciiChar) &&
548 (
List->CurrentEntry->Entry.Flink != &
List->ListHead))
551 ListEntry =
List->CurrentEntry;
554 if (ListUi->GetEntryDescriptionProc)
556 ListUi->GetEntryDescriptionProc(ListEntry,
557 ListUi->CurrentItemText,
561 if ((
strlen(ListUi->CurrentItemText) > 0) && (
tolower(ListUi->CurrentItemText[0]) == AsciiChar))
565 while (
List->CurrentEntry->Entry.Blink != &
List->ListHead)
568 ListEntry =
List->CurrentEntry;
573 if (ListUi->GetEntryDescriptionProc)
575 ListUi->GetEntryDescriptionProc(ListEntry,
576 ListUi->CurrentItemText,
580 if ((
strlen(ListUi->CurrentItemText) > 0) && (
tolower(ListUi->CurrentItemText[0]) == AsciiChar))
586 if (
List->CurrentEntry->Entry.Flink == &
List->ListHead)
590 ListEntry =
List->CurrentEntry;
595 while (
List->CurrentEntry->Entry.Blink != &
List->ListHead)
597 if (
List->CurrentEntry != OldListEntry)
608 ListUi->Redraw =
TRUE;
ACPI_SIZE strlen(const char *String)
VOID(NTAPI * PGET_ENTRY_DESCRIPTION)(IN PGENERIC_LIST_ENTRY Entry, OUT PWSTR Buffer, IN SIZE_T cchBufferSize)
BOOL WINAPI WriteConsoleOutputCharacterA(HANDLE hConsoleOutput, IN LPCSTR lpCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
BOOL WINAPI FillConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN WORD wAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
static LPHIST_ENTRY Bottom
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
#define IsListEmpty(ListHead)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
ULONG NTAPI GetNumberOfListEntries(IN PGENERIC_LIST List)
PGENERIC_LIST_ENTRY NTAPI GetCurrentListEntry(IN PGENERIC_LIST List)
base of all file and directory entries
struct _LIST_ENTRY * Flink
#define CONTAINING_RECORD(address, type, field)
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
VOID RedrawGenericList(IN PGENERIC_LIST_UI ListUi)
VOID InitGenericListUi(IN OUT PGENERIC_LIST_UI ListUi, IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
VOID ScrollPageUpGenericList(IN PGENERIC_LIST_UI ListUi)
static VOID DrawListFrame(IN PGENERIC_LIST_UI ListUi)
VOID ScrollToPositionGenericList(IN PGENERIC_LIST_UI ListUi, IN ULONG uIndex)
VOID RestoreGenericListUiState(IN PGENERIC_LIST_UI ListUi)
VOID GenericListKeyPress(IN PGENERIC_LIST_UI ListUi, IN CHAR AsciiChar)
VOID DrawGenericList(IN PGENERIC_LIST_UI ListUi, IN SHORT Left, IN SHORT Top, IN SHORT Right, IN SHORT Bottom)
static VOID DrawScrollBarGenericList(IN PGENERIC_LIST_UI ListUi)
static VOID CenterCurrentListItem(IN PGENERIC_LIST_UI ListUi)
VOID ScrollUpGenericList(IN PGENERIC_LIST_UI ListUi)
static VOID DrawListEntries(IN PGENERIC_LIST_UI ListUi)
VOID ScrollDownGenericList(IN PGENERIC_LIST_UI ListUi)
VOID ScrollPageDownGenericList(IN PGENERIC_LIST_UI ListUi)
VOID DrawGenericListCurrentItem(IN PGENERIC_LIST List, IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc, IN SHORT Left, IN SHORT Top)
CHAR CharUpperRightCorner
CHAR CharLowerRightCorner
_Must_inspect_result_ _In_ WDFCMRESLIST List