ReactOS  0.4.15-dev-1377-ga59cecd
fslist.h File Reference
#include <fmifs/fmifs.h>
Include dependency graph for fslist.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _FILE_SYSTEM_ITEM
 
struct  _FILE_SYSTEM_LIST
 

Typedefs

typedef struct _FILE_SYSTEM_ITEM FILE_SYSTEM_ITEM
 
typedef struct _FILE_SYSTEM_ITEMPFILE_SYSTEM_ITEM
 
typedef struct _FILE_SYSTEM_LIST FILE_SYSTEM_LIST
 
typedef struct _FILE_SYSTEM_LISTPFILE_SYSTEM_LIST
 

Functions

PFILE_SYSTEM_LIST CreateFileSystemList (IN SHORT Left, IN SHORT Top, IN BOOLEAN ForceFormat, IN PCWSTR SelectFileSystem)
 
VOID DestroyFileSystemList (IN PFILE_SYSTEM_LIST List)
 
VOID DrawFileSystemList (IN PFILE_SYSTEM_LIST List)
 
VOID ScrollDownFileSystemList (IN PFILE_SYSTEM_LIST List)
 
VOID ScrollUpFileSystemList (IN PFILE_SYSTEM_LIST List)
 

Typedef Documentation

◆ FILE_SYSTEM_ITEM

◆ FILE_SYSTEM_LIST

◆ PFILE_SYSTEM_ITEM

◆ PFILE_SYSTEM_LIST

Function Documentation

◆ CreateFileSystemList()

PFILE_SYSTEM_LIST CreateFileSystemList ( IN SHORT  Left,
IN SHORT  Top,
IN BOOLEAN  ForceFormat,
IN PCWSTR  SelectFileSystem 
)

Definition at line 109 of file fslist.c.

114 {
117  PLIST_ENTRY ListEntry;
118 
120  if (List == NULL)
121  return NULL;
122 
123  List->Left = Left;
124  List->Top = Top;
125  List->Selected = NULL;
126  InitializeListHead(&List->ListHead);
127 
128  InitializeFileSystemList(List, ForceFormat);
129 
130  /* Search for SelectFileSystem in list */
131  ListEntry = List->ListHead.Flink;
132  while (ListEntry != &List->ListHead)
133  {
134  Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
135  if (Item->FileSystem && wcsicmp(SelectFileSystem, Item->FileSystem) == 0)
136  {
137  List->Selected = Item;
138  break;
139  }
140  ListEntry = ListEntry->Flink;
141  }
142  if (!List->Selected)
143  List->Selected = CONTAINING_RECORD(List->ListHead.Flink, FILE_SYSTEM_ITEM, ListEntry);
144 
145  return List;
146 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
static VOID InitializeFileSystemList(IN OUT PFILE_SYSTEM_LIST List, IN BOOLEAN ForceFormat)
Definition: fslist.c:65
#define wcsicmp
Definition: compat.h:15
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
Definition: typedefs.h:119
HANDLE ProcessHeap
Definition: servman.c:15
struct _FILE_SYSTEM_LIST * PFILE_SYSTEM_LIST
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define NULL
Definition: types.h:112
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
static LPHIST_ENTRY Top
Definition: history.c:53

Referenced by SelectFileSystemPage().

◆ DestroyFileSystemList()

VOID DestroyFileSystemList ( IN PFILE_SYSTEM_LIST  List)

Definition at line 149 of file fslist.c.

151 {
152  PLIST_ENTRY ListEntry;
154 
155  ListEntry = List->ListHead.Flink;
156  while (!IsListEmpty(&List->ListHead))
157  {
158  ListEntry = RemoveHeadList(&List->ListHead);
159  Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
161  }
162 
164 }
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
Definition: typedefs.h:119
HANDLE ProcessHeap
Definition: servman.c:15
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by ResetFileSystemList().

◆ DrawFileSystemList()

VOID DrawFileSystemList ( IN PFILE_SYSTEM_LIST  List)

Definition at line 167 of file fslist.c.

169 {
170  PLIST_ENTRY ListEntry;
172  COORD coPos;
173  DWORD Written;
174  ULONG Index = 0;
175  CHAR Buffer[128];
176 
177  ListEntry = List->ListHead.Flink;
178  while (ListEntry != &List->ListHead)
179  {
180  Item = CONTAINING_RECORD(ListEntry, FILE_SYSTEM_ITEM, ListEntry);
181 
182  coPos.X = List->Left;
183  coPos.Y = List->Top + (SHORT)Index;
186  sizeof(Buffer),
187  coPos,
188  &Written);
190  ' ',
191  sizeof(Buffer),
192  coPos,
193  &Written);
194 
195  if (Item->FileSystem)
196  {
197  snprintf(Buffer, sizeof(Buffer),
198  MUIGetString(Item->QuickFormat ? STRING_FORMATDISK1
200  Item->FileSystem);
201  }
202  else
203  {
205  }
206 
207  if (ListEntry == &List->Selected->ListEntry)
208  {
210  List->Top + (SHORT)Index,
211  Buffer);
212  }
213  else
214  {
215  CONSOLE_SetTextXY(List->Left,
216  List->Top + (SHORT)Index,
217  Buffer);
218  }
219  Index++;
220  ListEntry = ListEntry->Flink;
221  }
222 }
#define STRING_KEEPFORMAT
Definition: mui.h:151
VOID CONSOLE_SetTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:311
BOOL WINAPI FillConsoleOutputAttribute(IN HANDLE hConsoleOutput, IN WORD wAttribute, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfAttrsWritten)
Definition: console.c:522
char CHAR
Definition: xmlstorage.h:175
#define snprintf
Definition: wintirpc.h:48
#define FOREGROUND_WHITE
Definition: consup.h:29
BOOL WINAPI FillConsoleOutputCharacterA(IN HANDLE hConsoleOutput, IN CHAR cCharacter, IN DWORD nLength, IN COORD dwWriteCoord, OUT LPDWORD lpNumberOfCharsWritten)
Definition: console.c:557
short SHORT
Definition: pedump.c:59
HANDLE StdOutput
Definition: consup.c:37
Definition: bufpool.h:45
PCSTR MUIGetString(ULONG Number)
Definition: mui.c:230
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
#define STRING_FORMATDISK1
Definition: mui.h:149
ULONG X
Definition: bl.h:1340
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned long DWORD
Definition: ntddk_ex.h:95
VOID CONSOLE_SetInvertedTextXY(IN SHORT x, IN SHORT y, IN LPCSTR Text)
Definition: consup.c:535
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
Definition: typedefs.h:119
Definition: bl.h:1338
#define STRING_FORMATDISK2
Definition: mui.h:150
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
#define BACKGROUND_BLUE
Definition: blue.h:65
unsigned int ULONG
Definition: retypes.h:1
ULONG Y
Definition: bl.h:1341

Referenced by ScrollDownFileSystemList(), ScrollUpFileSystemList(), and SelectFileSystemPage().

◆ ScrollDownFileSystemList()

VOID ScrollDownFileSystemList ( IN PFILE_SYSTEM_LIST  List)

Definition at line 225 of file fslist.c.

227 {
228  if (List->Selected->ListEntry.Flink != &List->ListHead)
229  {
230  List->Selected = CONTAINING_RECORD(List->Selected->ListEntry.Flink, FILE_SYSTEM_ITEM, ListEntry);
232  }
233 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
VOID DrawFileSystemList(IN PFILE_SYSTEM_LIST List)
Definition: fslist.c:167

Referenced by SelectFileSystemPage().

◆ ScrollUpFileSystemList()

VOID ScrollUpFileSystemList ( IN PFILE_SYSTEM_LIST  List)

Definition at line 236 of file fslist.c.

238 {
239  if (List->Selected->ListEntry.Blink != &List->ListHead)
240  {
241  List->Selected = CONTAINING_RECORD(List->Selected->ListEntry.Blink, FILE_SYSTEM_ITEM, ListEntry);
243  }
244 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550
VOID DrawFileSystemList(IN PFILE_SYSTEM_LIST List)
Definition: fslist.c:167

Referenced by SelectFileSystemPage().