ReactOS  0.4.14-dev-358-gbef841c
rangelist.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS system libraries
4  * FILE: lib/rtl/rangelist.c
5  * PURPOSE: Range list implementation
6  * PROGRAMMERS: No programmer listed.
7  */
8 
9 /* INCLUDES *****************************************************************/
10 
11 #include <rtl.h>
12 
13 #define NDEBUG
14 #include <debug.h>
15 
16 /* TYPES ********************************************************************/
17 
18 typedef struct _RTL_RANGE_ENTRY
19 {
23 
24 /* FUNCTIONS ***************************************************************/
25 
26 /**********************************************************************
27  * NAME EXPORTED
28  * RtlAddRange
29  *
30  * DESCRIPTION
31  * Adds a range to a range list.
32  *
33  * ARGUMENTS
34  * RangeList Range list.
35  * Start
36  * End
37  * Attributes
38  * Flags
39  * UserData
40  * Owner
41  *
42  * RETURN VALUE
43  * Status
44  *
45  * TODO:
46  * - Support shared ranges.
47  *
48  * @implemented
49  */
51 NTAPI
54  IN ULONGLONG End,
56  IN ULONG Flags,
59 {
60  PRTL_RANGE_ENTRY RangeEntry;
61  //PRTL_RANGE_ENTRY Previous;
62  PRTL_RANGE_ENTRY Current;
64 
65  if (Start > End)
67 
68  /* Create new range entry */
69  RangeEntry = RtlpAllocateMemory(sizeof(RTL_RANGE_ENTRY), 'elRR');
70  if (RangeEntry == NULL)
72 
73  /* Initialize range entry */
74  RangeEntry->Range.Start = Start;
75  RangeEntry->Range.End = End;
76  RangeEntry->Range.Attributes = Attributes;
77  RangeEntry->Range.UserData = UserData;
78  RangeEntry->Range.Owner = Owner;
79 
80  RangeEntry->Range.Flags = 0;
82  RangeEntry->Range.Flags |= RTL_RANGE_SHARED;
83 
84  /* Insert range entry */
85  if (RangeList->Count == 0)
86  {
87  InsertTailList(&RangeList->ListHead,
88  &RangeEntry->Entry);
89  RangeList->Count++;
90  RangeList->Stamp++;
91  return STATUS_SUCCESS;
92  }
93  else
94  {
95  //Previous = NULL;
96  Entry = RangeList->ListHead.Flink;
97  while (Entry != &RangeList->ListHead)
98  {
100  if (Current->Range.Start > RangeEntry->Range.End)
101  {
102  /* Insert before current */
103  DPRINT("Insert before current\n");
104  InsertTailList(&Current->Entry,
105  &RangeEntry->Entry);
106 
107  RangeList->Count++;
108  RangeList->Stamp++;
109  return STATUS_SUCCESS;
110  }
111 
112  //Previous = Current;
113  Entry = Entry->Flink;
114  }
115 
116  DPRINT("Insert tail\n");
117  InsertTailList(&RangeList->ListHead,
118  &RangeEntry->Entry);
119  RangeList->Count++;
120  RangeList->Stamp++;
121  return STATUS_SUCCESS;
122  }
123 
124  RtlpFreeMemory(RangeEntry, 0);
125 
126  return STATUS_UNSUCCESSFUL;
127 }
128 
129 
130 /**********************************************************************
131  * NAME EXPORTED
132  * RtlCopyRangeList
133  *
134  * DESCRIPTION
135  * Copy a range list.
136  *
137  * ARGUMENTS
138  * CopyRangeList Pointer to the destination range list.
139  * RangeList Pointer to the source range list.
140  *
141  * RETURN VALUE
142  * Status
143  *
144  * @implemented
145  */
146 NTSTATUS
147 NTAPI
149  IN PRTL_RANGE_LIST RangeList)
150 {
151  PRTL_RANGE_ENTRY Current;
152  PRTL_RANGE_ENTRY NewEntry;
154 
155  CopyRangeList->Flags = RangeList->Flags;
156 
157  Entry = RangeList->ListHead.Flink;
158  while (Entry != &RangeList->ListHead)
159  {
161 
162  NewEntry = RtlpAllocateMemory(sizeof(RTL_RANGE_ENTRY), 'elRR');
163  if (NewEntry == NULL)
165 
166  RtlCopyMemory(&NewEntry->Range,
167  &Current->Range,
168  sizeof(RTL_RANGE));
169 
170  InsertTailList(&CopyRangeList->ListHead,
171  &NewEntry->Entry);
172 
173  CopyRangeList->Count++;
174 
175  Entry = Entry->Flink;
176  }
177 
178  CopyRangeList->Stamp++;
179 
180  return STATUS_SUCCESS;
181 }
182 
183 
184 /**********************************************************************
185  * NAME EXPORTED
186  * RtlDeleteOwnersRanges
187  *
188  * DESCRIPTION
189  * Delete all ranges that belong to the given owner.
190  *
191  * ARGUMENTS
192  * RangeList Pointer to the range list.
193  * Owner User supplied value that identifies the owner
194  * of the ranges to be deleted.
195  *
196  * RETURN VALUE
197  * Status
198  *
199  * @implemented
200  */
201 NTSTATUS
202 NTAPI
204  IN PVOID Owner)
205 {
206  PRTL_RANGE_ENTRY Current;
208 
209  Entry = RangeList->ListHead.Flink;
210  while (Entry != &RangeList->ListHead)
211  {
213  if (Current->Range.Owner == Owner)
214  {
216  RtlpFreeMemory(Current, 0);
217 
218  RangeList->Count--;
219  RangeList->Stamp++;
220  }
221 
222  Entry = Entry->Flink;
223  }
224 
225  return STATUS_SUCCESS;
226 }
227 
228 
229 /**********************************************************************
230  * NAME EXPORTED
231  * RtlDeleteRange
232  *
233  * DESCRIPTION
234  * Deletes a given range.
235  *
236  * ARGUMENTS
237  * RangeList Pointer to the range list.
238  * Start Start of the range to be deleted.
239  * End End of the range to be deleted.
240  * Owner Owner of the ranges to be deleted.
241  *
242  * RETURN VALUE
243  * Status
244  *
245  * @implemented
246  */
247 NTSTATUS
248 NTAPI
251  IN ULONGLONG End,
252  IN PVOID Owner)
253 {
254  PRTL_RANGE_ENTRY Current;
256 
257  Entry = RangeList->ListHead.Flink;
258  while (Entry != &RangeList->ListHead)
259  {
261  if (Current->Range.Start == Start &&
262  Current->Range.End == End &&
263  Current->Range.Owner == Owner)
264  {
266 
267  RtlpFreeMemory(Current, 0);
268 
269  RangeList->Count--;
270  RangeList->Stamp++;
271  return STATUS_SUCCESS;
272  }
273 
274  Entry = Entry->Flink;
275  }
276 
277  return STATUS_RANGE_NOT_FOUND;
278 }
279 
280 
281 /**********************************************************************
282  * NAME EXPORTED
283  * RtlFindRange
284  *
285  * DESCRIPTION
286  * Searches for an unused range.
287  *
288  * ARGUMENTS
289  * RangeList Pointer to the range list.
290  * Minimum
291  * Maximum
292  * Length
293  * Alignment
294  * Flags
295  * AttributeAvailableMask
296  * Context
297  * Callback
298  * Start
299  *
300  * RETURN VALUE
301  * Status
302  *
303  * TODO
304  * Support shared ranges and callback.
305  *
306  * @implemented
307  */
308 NTSTATUS
309 NTAPI
311  IN ULONGLONG Minimum,
312  IN ULONGLONG Maximum,
313  IN ULONG Length,
315  IN ULONG Flags,
316  IN UCHAR AttributeAvailableMask,
318  IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL,
320 {
321  PRTL_RANGE_ENTRY CurrentEntry;
322  PRTL_RANGE_ENTRY NextEntry;
324  ULONGLONG RangeMin;
325  ULONGLONG RangeMax;
326 
327  if (Alignment == 0 || Length == 0)
328  {
330  }
331 
332  if (IsListEmpty(&RangeList->ListHead))
333  {
334  *Start = ROUND_DOWN(Maximum - (Length - 1), Alignment);
335  return STATUS_SUCCESS;
336  }
337 
338  NextEntry = NULL;
339  Entry = RangeList->ListHead.Blink;
340  while (Entry != &RangeList->ListHead)
341  {
342  CurrentEntry = CONTAINING_RECORD(Entry, RTL_RANGE_ENTRY, Entry);
343 
344  RangeMax = NextEntry ? (NextEntry->Range.Start - 1) : Maximum;
345  if (RangeMax + (Length - 1) < Minimum)
346  {
347  return STATUS_RANGE_NOT_FOUND;
348  }
349 
350  RangeMin = ROUND_DOWN(RangeMax - (Length - 1), Alignment);
351  if (RangeMin < Minimum ||
352  (RangeMax - RangeMin) < (Length - 1))
353  {
354  return STATUS_RANGE_NOT_FOUND;
355  }
356 
357  DPRINT("RangeMax: %I64x\n", RangeMax);
358  DPRINT("RangeMin: %I64x\n", RangeMin);
359 
360  if (RangeMin > CurrentEntry->Range.End)
361  {
362  *Start = RangeMin;
363  return STATUS_SUCCESS;
364  }
365 
366  NextEntry = CurrentEntry;
367  Entry = Entry->Blink;
368  }
369 
370  RangeMax = NextEntry ? (NextEntry->Range.Start - 1) : Maximum;
371  if (RangeMax + (Length - 1) < Minimum)
372  {
373  return STATUS_RANGE_NOT_FOUND;
374  }
375 
376  RangeMin = ROUND_DOWN(RangeMax - (Length - 1), Alignment);
377  if (RangeMin < Minimum ||
378  (RangeMax - RangeMin) < (Length - 1))
379  {
380  return STATUS_RANGE_NOT_FOUND;
381  }
382 
383  DPRINT("RangeMax: %I64x\n", RangeMax);
384  DPRINT("RangeMin: %I64x\n", RangeMin);
385 
386  *Start = RangeMin;
387 
388  return STATUS_SUCCESS;
389 }
390 
391 
392 /**********************************************************************
393  * NAME EXPORTED
394  * RtlFreeRangeList
395  *
396  * DESCRIPTION
397  * Deletes all ranges in a range list.
398  *
399  * ARGUMENTS
400  * RangeList Pointer to the range list.
401  *
402  * RETURN VALUE
403  * None
404  *
405  * @implemented
406  */
407 VOID
408 NTAPI
410 {
412  PRTL_RANGE_ENTRY Current;
413 
414  while (!IsListEmpty(&RangeList->ListHead))
415  {
416  Entry = RemoveHeadList(&RangeList->ListHead);
418 
419  DPRINT ("Range start: %I64u\n", Current->Range.Start);
420  DPRINT ("Range end: %I64u\n", Current->Range.End);
421 
422  RtlpFreeMemory(Current, 0);
423  }
424 
425  RangeList->Flags = 0;
426  RangeList->Count = 0;
427 }
428 
429 
430 /**********************************************************************
431  * NAME EXPORTED
432  * RtlGetFirstRange
433  *
434  * DESCRIPTION
435  * Retrieves the first range of a range list.
436  *
437  * ARGUMENTS
438  * RangeList Pointer to the range list.
439  * Iterator Pointer to a user supplied list state buffer.
440  * Range Pointer to the first range.
441  *
442  * RETURN VALUE
443  * Status
444  *
445  * @implemented
446  */
447 NTSTATUS
448 NTAPI
450  OUT PRTL_RANGE_LIST_ITERATOR Iterator,
452 {
453  Iterator->RangeListHead = &RangeList->ListHead;
454  Iterator->MergedHead = NULL;
455  Iterator->Stamp = RangeList->Stamp;
456 
457  if (IsListEmpty(&RangeList->ListHead))
458  {
459  Iterator->Current = NULL;
460  *Range = NULL;
461  return STATUS_NO_MORE_ENTRIES;
462  }
463 
464  Iterator->Current = RangeList->ListHead.Flink;
465  *Range = &((PRTL_RANGE_ENTRY)Iterator->Current)->Range;
466 
467  return STATUS_SUCCESS;
468 }
469 
470 
471 /**********************************************************************
472  * NAME EXPORTED
473  * RtlGetNextRange
474  *
475  * DESCRIPTION
476  * Retrieves the next (or previous) range of a range list.
477  *
478  * ARGUMENTS
479  * Iterator Pointer to a user supplied list state buffer.
480  * Range Pointer to the first range.
481  * MoveForwards TRUE, get next range
482  * FALSE, get previous range
483  *
484  * RETURN VALUE
485  * Status
486  *
487  * @implemented
488  */
489 NTSTATUS
490 NTAPI
493  IN BOOLEAN MoveForwards)
494 {
495  PRTL_RANGE_LIST RangeList;
496  PLIST_ENTRY Next;
497 
498  RangeList = CONTAINING_RECORD(Iterator->RangeListHead, RTL_RANGE_LIST, ListHead);
499  if (Iterator->Stamp != RangeList->Stamp)
501 
502  if (MoveForwards)
503  {
504  Next = ((PRTL_RANGE_ENTRY)Iterator->Current)->Entry.Flink;
505  }
506  else
507  {
508  Next = ((PRTL_RANGE_ENTRY)Iterator->Current)->Entry.Blink;
509  }
510 
511  if (Next == Iterator->RangeListHead)
512  return STATUS_NO_MORE_ENTRIES;
513 
514  Iterator->Current = Next;
515  *Range = &((PRTL_RANGE_ENTRY)Next)->Range;
516 
517  return STATUS_SUCCESS;
518 }
519 
520 
521 /**********************************************************************
522  * NAME EXPORTED
523  * RtlInitializeRangeList
524  *
525  * DESCRIPTION
526  * Initializes a range list.
527  *
528  * ARGUMENTS
529  * RangeList Pointer to a user supplied range list.
530  *
531  * RETURN VALUE
532  * None
533  *
534  * @implemented
535  */
536 VOID
537 NTAPI
539 {
540  InitializeListHead(&RangeList->ListHead);
541  RangeList->Flags = 0;
542  RangeList->Count = 0;
543  RangeList->Stamp = 0;
544 }
545 
546 
547 /**********************************************************************
548  * NAME EXPORTED
549  * RtlInvertRangeList
550  *
551  * DESCRIPTION
552  * Inverts a range list.
553  *
554  * ARGUMENTS
555  * InvertedRangeList Inverted range list.
556  * RangeList Range list.
557  *
558  * RETURN VALUE
559  * Status
560  *
561  * @implemented
562  */
563 NTSTATUS
564 NTAPI
566  IN PRTL_RANGE_LIST RangeList)
567 {
568  PRTL_RANGE_ENTRY Previous;
569  PRTL_RANGE_ENTRY Current;
572 
573  /* Add leading and intermediate ranges */
574  Previous = NULL;
575  Entry = RangeList->ListHead.Flink;
576  while (Entry != &RangeList->ListHead)
577  {
579 
580  if (Previous == NULL)
581  {
582  if (Current->Range.Start != (ULONGLONG)0)
583  {
584  Status = RtlAddRange(InvertedRangeList,
585  (ULONGLONG)0,
586  Current->Range.Start - 1,
587  0,
588  0,
589  NULL,
590  NULL);
591  if (!NT_SUCCESS(Status))
592  return Status;
593  }
594  }
595  else
596  {
597  if (Previous->Range.End + 1 != Current->Range.Start)
598  {
599  Status = RtlAddRange(InvertedRangeList,
600  Previous->Range.End + 1,
601  Current->Range.Start - 1,
602  0,
603  0,
604  NULL,
605  NULL);
606  if (!NT_SUCCESS(Status))
607  return Status;
608  }
609  }
610 
611  Previous = Current;
612  Entry = Entry->Flink;
613  }
614 
615  /* Check if the list was empty */
616  if (Previous == NULL)
617  {
618  /* We're done */
619  return STATUS_SUCCESS;
620  }
621 
622  /* Add trailing range */
623  if (Previous->Range.End + 1 != (ULONGLONG)-1)
624  {
625  Status = RtlAddRange(InvertedRangeList,
626  Previous->Range.End + 1,
627  (ULONGLONG)-1,
628  0,
629  0,
630  NULL,
631  NULL);
632  if (!NT_SUCCESS(Status))
633  return Status;
634  }
635 
636  return STATUS_SUCCESS;
637 }
638 
639 
640 /**********************************************************************
641  * NAME EXPORTED
642  * RtlIsRangeAvailable
643  *
644  * DESCRIPTION
645  * Checks whether a range is available or not.
646  *
647  * ARGUMENTS
648  * RangeList Pointer to the range list.
649  * Start
650  * End
651  * Flags
652  * AttributeAvailableMask
653  * Context
654  * Callback
655  * Available
656  *
657  * RETURN VALUE
658  * Status
659  *
660  * TODO:
661  * - honor Flags and AttributeAvailableMask.
662  *
663  * @implemented
664  */
665 NTSTATUS
666 NTAPI
669  IN ULONGLONG End,
670  IN ULONG Flags,
671  IN UCHAR AttributeAvailableMask,
673  IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL,
674  OUT PBOOLEAN Available)
675 {
676  PRTL_RANGE_ENTRY Current;
678 
679  *Available = TRUE;
680 
681  Entry = RangeList->ListHead.Flink;
682  while (Entry != &RangeList->ListHead)
683  {
685 
686  if (!((Current->Range.Start >= End && Current->Range.End > End) ||
687  (Current->Range.Start <= Start && Current->Range.End < Start &&
688  (!(Flags & RTL_RANGE_SHARED) ||
689  !(Current->Range.Flags & RTL_RANGE_SHARED)))))
690  {
691  if (Callback != NULL)
692  {
693  *Available = Callback(Context,
694  &Current->Range);
695  }
696  else
697  {
698  *Available = FALSE;
699  }
700  }
701 
702  Entry = Entry->Flink;
703  }
704 
705  return STATUS_SUCCESS;
706 }
707 
708 
709 /**********************************************************************
710  * NAME EXPORTED
711  * RtlMergeRangeList
712  *
713  * DESCRIPTION
714  * Merges two range lists.
715  *
716  * ARGUMENTS
717  * MergedRangeList Resulting range list.
718  * RangeList1 First range list.
719  * RangeList2 Second range list
720  * Flags
721  *
722  * RETURN VALUE
723  * Status
724  *
725  * @implemented
726  */
727 NTSTATUS
728 NTAPI
730  IN PRTL_RANGE_LIST RangeList1,
731  IN PRTL_RANGE_LIST RangeList2,
732  IN ULONG Flags)
733 {
734  RTL_RANGE_LIST_ITERATOR Iterator;
737 
738  /* Copy range list 1 to the merged range list */
739  Status = RtlCopyRangeList(MergedRangeList,
740  RangeList1);
741  if (!NT_SUCCESS(Status))
742  return Status;
743 
744  /* Add range list 2 entries to the merged range list */
745  Status = RtlGetFirstRange(RangeList2,
746  &Iterator,
747  &Range);
748  if (!NT_SUCCESS(Status))
750 
751  while (TRUE)
752  {
753  Status = RtlAddRange(MergedRangeList,
754  Range->Start,
755  Range->End,
756  Range->Attributes,
757  Range->Flags | Flags,
758  Range->UserData,
759  Range->Owner);
760  if (!NT_SUCCESS(Status))
761  break;
762 
763  Status = RtlGetNextRange(&Iterator,
764  &Range,
765  TRUE);
766  if (!NT_SUCCESS(Status))
767  break;
768  }
769 
771 }
772 
773 /* EOF */
#define IN
Definition: typedefs.h:38
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define STATUS_NO_MORE_ENTRIES
Definition: ntstatus.h:193
struct _Entry Entry
Definition: kefuncs.h:640
#define STATUS_RANGE_NOT_FOUND
Definition: ntstatus.h:754
ULONGLONG Start
Definition: rtltypes.h:1463
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
struct _LIST_ENTRY * Blink
Definition: typedefs.h:120
LONG NTSTATUS
Definition: precomp.h:26
VOID NTAPI RtlpFreeMemory(_In_ PVOID Mem, _In_ ULONG Tag)
Definition: rtlcompat.c:45
#define InsertTailList(ListHead, Entry)
PVOID UserData
Definition: rtltypes.h:1465
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
NTSTATUS NTAPI RtlInvertRangeList(OUT PRTL_RANGE_LIST InvertedRangeList, IN PRTL_RANGE_LIST RangeList)
Definition: rangelist.c:565
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
struct tagRange Range
UCHAR Flags
Definition: rtltypes.h:1468
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define RTL_RANGE_LIST_ADD_SHARED
Definition: rtltypes.h:82
Definition: libsupp.c:21
VOID NTAPI RtlFreeRangeList(IN PRTL_RANGE_LIST RangeList)
Definition: rangelist.c:409
VOID NTAPI RtlInitializeRangeList(IN OUT PRTL_RANGE_LIST RangeList)
Definition: rangelist.c:538
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
PVOID NTAPI RtlpAllocateMemory(_In_ ULONG Bytes, _In_ ULONG Tag)
Definition: rtlcompat.c:34
NTSTATUS NTAPI RtlDeleteOwnersRanges(IN OUT PRTL_RANGE_LIST RangeList, IN PVOID Owner)
Definition: rangelist.c:203
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI RtlCopyRangeList(OUT PRTL_RANGE_LIST CopyRangeList, IN PRTL_RANGE_LIST RangeList)
Definition: rangelist.c:148
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
NTSTATUS NTAPI RtlAddRange(IN OUT PRTL_RANGE_LIST RangeList, IN ULONGLONG Start, IN ULONGLONG End, IN UCHAR Attributes, IN ULONG Flags, IN PVOID UserData OPTIONAL, IN PVOID Owner OPTIONAL)
Definition: rangelist.c:52
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
uint64_t ULONGLONG
Definition: typedefs.h:65
struct tagUserData UserData
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
Definition: partlist.h:33
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
unsigned char UCHAR
Definition: xmlstorage.h:181
char * PBOOLEAN
Definition: retypes.h:11
Definition: typedefs.h:117
Definition: range.c:39
UCHAR Attributes
Definition: rtltypes.h:1467
#define RTL_RANGE_SHARED
Definition: rtltypes.h:84
Status
Definition: gdiplustypes.h:24
#define ROUND_DOWN(n, align)
Definition: eventvwr.h:30
NTSTATUS NTAPI RtlMergeRangeLists(OUT PRTL_RANGE_LIST MergedRangeList, IN PRTL_RANGE_LIST RangeList1, IN PRTL_RANGE_LIST RangeList2, IN ULONG Flags)
Definition: rangelist.c:729
NTSTATUS NTAPI RtlGetFirstRange(IN PRTL_RANGE_LIST RangeList, OUT PRTL_RANGE_LIST_ITERATOR Iterator, OUT PRTL_RANGE *Range)
Definition: rangelist.c:449
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
LIST_ENTRY Entry
Definition: libsupp.c:23
ULONGLONG End
Definition: rtltypes.h:1464
NTSTATUS NTAPI RtlDeleteRange(IN OUT PRTL_RANGE_LIST RangeList, IN ULONGLONG Start, IN ULONGLONG End, IN PVOID Owner)
Definition: rangelist.c:249
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
PVOID Owner
Definition: rtltypes.h:1466
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1557
#define OUT
Definition: typedefs.h:39
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
Definition: ntbasedef.h:390
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI RtlIsRangeAvailable(IN PRTL_RANGE_LIST RangeList, IN ULONGLONG Start, IN ULONGLONG End, IN ULONG Flags, IN UCHAR AttributeAvailableMask, IN PVOID Context OPTIONAL, IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL, OUT PBOOLEAN Available)
Definition: rangelist.c:667
struct _RTL_RANGE_ENTRY * PRTL_RANGE_ENTRY
struct _RTL_RANGE_ENTRY RTL_RANGE_ENTRY
return STATUS_SUCCESS
Definition: btrfs.c:2938
LPFNPSPCALLBACK Callback
Definition: desk.c:111
NTSTATUS NTAPI RtlGetNextRange(IN OUT PRTL_RANGE_LIST_ITERATOR Iterator, OUT PRTL_RANGE *Range, IN BOOLEAN MoveForwards)
Definition: rangelist.c:491
RTL_RANGE Range
Definition: libsupp.c:24
base of all file and directory entries
Definition: entries.h:82
NTSTATUS NTAPI RtlFindRange(IN PRTL_RANGE_LIST RangeList, IN ULONGLONG Minimum, IN ULONGLONG Maximum, IN ULONG Length, IN ULONG Alignment, IN ULONG Flags, IN UCHAR AttributeAvailableMask, IN PVOID Context OPTIONAL, IN PRTL_CONFLICT_RANGE_CALLBACK Callback OPTIONAL, OUT PULONGLONG Start)
Definition: rangelist.c:310
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68