mirror of
https://github.com/reactos/reactos.git
synced 2025-06-26 23:09:43 +00:00
[RTL]
- Fix a number of MSVC/64 bit warnings/problems - Fix return type of RtlpInitializeHeapSegment (by Roel) svn path=/trunk/; revision=53764
This commit is contained in:
parent
54f8ab351c
commit
78f25bbeea
9 changed files with 75 additions and 74 deletions
|
@ -299,7 +299,7 @@ VOID
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
|
RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
|
||||||
{
|
{
|
||||||
ULONG EntryId;
|
SIZE_T EntryId;
|
||||||
|
|
||||||
/* Is it part of our cached entries? */
|
/* Is it part of our cached entries? */
|
||||||
if ((DebugInfo >= RtlpStaticDebugInfo) &&
|
if ((DebugInfo >= RtlpStaticDebugInfo) &&
|
||||||
|
@ -310,7 +310,7 @@ RtlpFreeDebugInfo(PRTL_CRITICAL_SECTION_DEBUG DebugInfo)
|
||||||
|
|
||||||
/* Mark as free */
|
/* Mark as free */
|
||||||
EntryId = (DebugInfo - RtlpStaticDebugInfo);
|
EntryId = (DebugInfo - RtlpStaticDebugInfo);
|
||||||
DPRINT("Freeing from Buffer: %p. Entry: %lu inside Process: %p\n",
|
DPRINT("Freeing from Buffer: %p. Entry: %Iu inside Process: %p\n",
|
||||||
DebugInfo,
|
DebugInfo,
|
||||||
EntryId,
|
EntryId,
|
||||||
NtCurrentTeb()->ClientId.UniqueProcess);
|
NtCurrentTeb()->ClientId.UniqueProcess);
|
||||||
|
|
|
@ -126,7 +126,7 @@ RtlpInitializeHeap(OUT PHEAP Heap,
|
||||||
ASSERT(HeaderSize <= PAGE_SIZE);
|
ASSERT(HeaderSize <= PAGE_SIZE);
|
||||||
|
|
||||||
/* Initialise the Heap Entry header containing the Heap header */
|
/* Initialise the Heap Entry header containing the Heap header */
|
||||||
Heap->Entry.Size = HeaderSize >> HEAP_ENTRY_SHIFT;
|
Heap->Entry.Size = (USHORT)(HeaderSize >> HEAP_ENTRY_SHIFT);
|
||||||
Heap->Entry.Flags = HEAP_ENTRY_BUSY;
|
Heap->Entry.Flags = HEAP_ENTRY_BUSY;
|
||||||
Heap->Entry.SmallTagIndex = LOBYTE(Heap->Entry.Size) ^ HIBYTE(Heap->Entry.Size) ^ Heap->Entry.Flags;
|
Heap->Entry.SmallTagIndex = LOBYTE(Heap->Entry.Size) ^ HIBYTE(Heap->Entry.Size) ^ Heap->Entry.Flags;
|
||||||
Heap->Entry.PreviousSize = 0;
|
Heap->Entry.PreviousSize = 0;
|
||||||
|
@ -157,7 +157,7 @@ RtlpInitializeHeap(OUT PHEAP Heap,
|
||||||
|
|
||||||
/* Initialise the Heap validation info */
|
/* Initialise the Heap validation info */
|
||||||
Heap->HeaderValidateCopy = NULL;
|
Heap->HeaderValidateCopy = NULL;
|
||||||
Heap->HeaderValidateLength = HeaderSize;
|
Heap->HeaderValidateLength = (USHORT)HeaderSize;
|
||||||
|
|
||||||
/* Initialise the Heap Lock */
|
/* Initialise the Heap Lock */
|
||||||
if (!(Flags & HEAP_NO_SERIALIZE) && !(Flags & HEAP_LOCK_USER_ALLOCATED))
|
if (!(Flags & HEAP_NO_SERIALIZE) && !(Flags & HEAP_LOCK_USER_ALLOCATED))
|
||||||
|
@ -656,7 +656,7 @@ RtlpFindAndCommitPages(PHEAP Heap,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Update tracking numbers */
|
/* Update tracking numbers */
|
||||||
Segment->NumberOfUnCommittedPages -= *Size / PAGE_SIZE;
|
Segment->NumberOfUnCommittedPages -= (ULONG)(*Size / PAGE_SIZE);
|
||||||
|
|
||||||
/* Calculate first and last entries */
|
/* Calculate first and last entries */
|
||||||
FirstEntry = (PHEAP_ENTRY)Address;
|
FirstEntry = (PHEAP_ENTRY)Address;
|
||||||
|
@ -738,7 +738,7 @@ RtlpDeCommitFreeBlock(PHEAP Heap,
|
||||||
PHEAP_ENTRY PrecedingInUseEntry = NULL, NextInUseEntry = NULL;
|
PHEAP_ENTRY PrecedingInUseEntry = NULL, NextInUseEntry = NULL;
|
||||||
PHEAP_FREE_ENTRY NextFreeEntry;
|
PHEAP_FREE_ENTRY NextFreeEntry;
|
||||||
PHEAP_UCR_DESCRIPTOR UcrDescriptor;
|
PHEAP_UCR_DESCRIPTOR UcrDescriptor;
|
||||||
ULONG PrecedingSize, NextSize, DecommitSize;
|
SIZE_T PrecedingSize, NextSize, DecommitSize;
|
||||||
ULONG_PTR DecommitBase;
|
ULONG_PTR DecommitBase;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
|
@ -828,7 +828,7 @@ RtlpDeCommitFreeBlock(PHEAP Heap,
|
||||||
|
|
||||||
/* Insert uncommitted pages */
|
/* Insert uncommitted pages */
|
||||||
RtlpInsertUnCommittedPages(Segment, DecommitBase, DecommitSize);
|
RtlpInsertUnCommittedPages(Segment, DecommitBase, DecommitSize);
|
||||||
Segment->NumberOfUnCommittedPages += (DecommitSize / PAGE_SIZE);
|
Segment->NumberOfUnCommittedPages += (ULONG)(DecommitSize / PAGE_SIZE);
|
||||||
|
|
||||||
if (PrecedingSize)
|
if (PrecedingSize)
|
||||||
{
|
{
|
||||||
|
@ -866,7 +866,8 @@ RtlpDeCommitFreeBlock(PHEAP Heap,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN NTAPI
|
NTSTATUS
|
||||||
|
NTAPI
|
||||||
RtlpInitializeHeapSegment(IN OUT PHEAP Heap,
|
RtlpInitializeHeapSegment(IN OUT PHEAP Heap,
|
||||||
OUT PHEAP_SEGMENT Segment,
|
OUT PHEAP_SEGMENT Segment,
|
||||||
IN UCHAR SegmentIndex,
|
IN UCHAR SegmentIndex,
|
||||||
|
@ -908,7 +909,7 @@ RtlpInitializeHeapSegment(IN OUT PHEAP Heap,
|
||||||
|
|
||||||
/* Initialise the Heap Segment location information */
|
/* Initialise the Heap Segment location information */
|
||||||
Segment->BaseAddress = Segment;
|
Segment->BaseAddress = Segment;
|
||||||
Segment->NumberOfPages = SegmentReserve >> PAGE_SHIFT;
|
Segment->NumberOfPages = (ULONG)(SegmentReserve >> PAGE_SHIFT);
|
||||||
|
|
||||||
/* Initialise the Heap Entries contained within the Heap Segment */
|
/* Initialise the Heap Entries contained within the Heap Segment */
|
||||||
Segment->FirstEntry = &Segment->Entry + Segment->Entry.Size;
|
Segment->FirstEntry = &Segment->Entry + Segment->Entry.Size;
|
||||||
|
@ -928,7 +929,7 @@ RtlpInitializeHeapSegment(IN OUT PHEAP Heap,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initialise the Heap Segment UnCommitted Range information */
|
/* Initialise the Heap Segment UnCommitted Range information */
|
||||||
Segment->NumberOfUnCommittedPages = (SegmentReserve - SegmentCommit) >> PAGE_SHIFT;
|
Segment->NumberOfUnCommittedPages = (ULONG)((SegmentReserve - SegmentCommit) >> PAGE_SHIFT);
|
||||||
Segment->NumberOfUnCommittedRanges = 0;
|
Segment->NumberOfUnCommittedRanges = 0;
|
||||||
InitializeListHead(&Segment->UCRSegmentList);
|
InitializeListHead(&Segment->UCRSegmentList);
|
||||||
|
|
||||||
|
@ -1162,7 +1163,7 @@ RtlpExtendHeap(PHEAP Heap,
|
||||||
DPRINT("RtlpExtendHeap(%p %x)\n", Heap, Size);
|
DPRINT("RtlpExtendHeap(%p %x)\n", Heap, Size);
|
||||||
|
|
||||||
/* Calculate amount in pages */
|
/* Calculate amount in pages */
|
||||||
Pages = (Size + PAGE_SIZE - 1) / PAGE_SIZE;
|
Pages = (ULONG)((Size + PAGE_SIZE - 1) / PAGE_SIZE);
|
||||||
FreeSize = Pages * PAGE_SIZE;
|
FreeSize = Pages * PAGE_SIZE;
|
||||||
DPRINT("Pages %x, FreeSize %x. Going through segments...\n", Pages, FreeSize);
|
DPRINT("Pages %x, FreeSize %x. Going through segments...\n", Pages, FreeSize);
|
||||||
|
|
||||||
|
@ -1998,11 +1999,10 @@ RtlAllocateHeap(IN PVOID HeapPtr,
|
||||||
PULONG FreeListsInUse;
|
PULONG FreeListsInUse;
|
||||||
ULONG FreeListsInUseUlong;
|
ULONG FreeListsInUseUlong;
|
||||||
SIZE_T AllocationSize;
|
SIZE_T AllocationSize;
|
||||||
SIZE_T Index;
|
SIZE_T Index, InUseIndex, i;
|
||||||
PLIST_ENTRY FreeListHead;
|
PLIST_ENTRY FreeListHead;
|
||||||
PHEAP_ENTRY InUseEntry;
|
PHEAP_ENTRY InUseEntry;
|
||||||
PHEAP_FREE_ENTRY FreeBlock;
|
PHEAP_FREE_ENTRY FreeBlock;
|
||||||
ULONG InUseIndex, i;
|
|
||||||
UCHAR FreeFlags;
|
UCHAR FreeFlags;
|
||||||
EXCEPTION_RECORD ExceptionRecord;
|
EXCEPTION_RECORD ExceptionRecord;
|
||||||
BOOLEAN HeapLocked = FALSE;
|
BOOLEAN HeapLocked = FALSE;
|
||||||
|
@ -3390,7 +3390,7 @@ RtlpValidateHeapSegment(
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UnCommittedPages += (UcrDescriptor->Size / PAGE_SIZE);
|
UnCommittedPages += (ULONG)(UcrDescriptor->Size / PAGE_SIZE);
|
||||||
UnCommittedRanges++;
|
UnCommittedRanges++;
|
||||||
|
|
||||||
CurrentEntry = (PHEAP_ENTRY)((PCHAR)UcrDescriptor->Address + UcrDescriptor->Size);
|
CurrentEntry = (PHEAP_ENTRY)((PCHAR)UcrDescriptor->Address + UcrDescriptor->Size);
|
||||||
|
|
|
@ -151,15 +151,15 @@ typedef struct _HEAP_PSEUDO_TAG_ENTRY
|
||||||
{
|
{
|
||||||
ULONG Allocs;
|
ULONG Allocs;
|
||||||
ULONG Frees;
|
ULONG Frees;
|
||||||
ULONG Size;
|
SIZE_T Size;
|
||||||
} HEAP_PSEUDO_TAG_ENTRY, *PHEAP_PSEUDO_TAG_ENTRY;
|
} HEAP_PSEUDO_TAG_ENTRY, *PHEAP_PSEUDO_TAG_ENTRY;
|
||||||
|
|
||||||
typedef struct _HEAP_COUNTERS
|
typedef struct _HEAP_COUNTERS
|
||||||
{
|
{
|
||||||
ULONG TotalMemoryReserved;
|
SIZE_T TotalMemoryReserved;
|
||||||
ULONG TotalMemoryCommitted;
|
SIZE_T TotalMemoryCommitted;
|
||||||
ULONG TotalMemoryLargeUCR;
|
SIZE_T TotalMemoryLargeUCR;
|
||||||
ULONG TotalSizeInVirtualBlocks;
|
SIZE_T TotalSizeInVirtualBlocks;
|
||||||
ULONG TotalSegments;
|
ULONG TotalSegments;
|
||||||
ULONG TotalUCRs;
|
ULONG TotalUCRs;
|
||||||
ULONG CommittOps;
|
ULONG CommittOps;
|
||||||
|
@ -173,13 +173,13 @@ typedef struct _HEAP_COUNTERS
|
||||||
ULONG CompactHeapCalls;
|
ULONG CompactHeapCalls;
|
||||||
ULONG CompactedUCRs;
|
ULONG CompactedUCRs;
|
||||||
ULONG InBlockDeccommits;
|
ULONG InBlockDeccommits;
|
||||||
ULONG InBlockDeccomitSize;
|
SIZE_T InBlockDeccomitSize;
|
||||||
} HEAP_COUNTERS, *PHEAP_COUNTERS;
|
} HEAP_COUNTERS, *PHEAP_COUNTERS;
|
||||||
|
|
||||||
typedef struct _HEAP_TUNING_PARAMETERS
|
typedef struct _HEAP_TUNING_PARAMETERS
|
||||||
{
|
{
|
||||||
ULONG CommittThresholdShift;
|
ULONG CommittThresholdShift;
|
||||||
ULONG MaxPreCommittThreshold;
|
SIZE_T MaxPreCommittThreshold;
|
||||||
} HEAP_TUNING_PARAMETERS, *PHEAP_TUNING_PARAMETERS;
|
} HEAP_TUNING_PARAMETERS, *PHEAP_TUNING_PARAMETERS;
|
||||||
|
|
||||||
typedef struct _HEAP_LIST_LOOKUP
|
typedef struct _HEAP_LIST_LOOKUP
|
||||||
|
@ -217,16 +217,16 @@ typedef struct _HEAP
|
||||||
ULONG CompatibilityFlags;
|
ULONG CompatibilityFlags;
|
||||||
ULONG EncodeFlagMask;
|
ULONG EncodeFlagMask;
|
||||||
HEAP_ENTRY Encoding;
|
HEAP_ENTRY Encoding;
|
||||||
ULONG PointerKey;
|
ULONG_PTR PointerKey;
|
||||||
ULONG Interceptor;
|
ULONG Interceptor;
|
||||||
ULONG VirtualMemoryThreshold;
|
ULONG VirtualMemoryThreshold;
|
||||||
ULONG Signature;
|
ULONG Signature;
|
||||||
ULONG SegmentReserve;
|
SIZE_T SegmentReserve;
|
||||||
ULONG SegmentCommit;
|
SIZE_T SegmentCommit;
|
||||||
ULONG DeCommitFreeBlockThreshold;
|
SIZE_T DeCommitFreeBlockThreshold;
|
||||||
ULONG DeCommitTotalFreeThreshold;
|
SIZE_T DeCommitTotalFreeThreshold;
|
||||||
ULONG TotalFreeSize;
|
SIZE_T TotalFreeSize;
|
||||||
ULONG MaximumAllocationSize;
|
SIZE_T MaximumAllocationSize;
|
||||||
USHORT ProcessHeapsListIndex;
|
USHORT ProcessHeapsListIndex;
|
||||||
USHORT HeaderValidateLength;
|
USHORT HeaderValidateLength;
|
||||||
PVOID HeaderValidateCopy;
|
PVOID HeaderValidateCopy;
|
||||||
|
@ -235,8 +235,8 @@ typedef struct _HEAP
|
||||||
PHEAP_TAG_ENTRY TagEntries;
|
PHEAP_TAG_ENTRY TagEntries;
|
||||||
LIST_ENTRY UCRList;
|
LIST_ENTRY UCRList;
|
||||||
LIST_ENTRY UCRSegments; // FIXME: non-Vista
|
LIST_ENTRY UCRSegments; // FIXME: non-Vista
|
||||||
ULONG AlignRound;
|
ULONG_PTR AlignRound;
|
||||||
ULONG AlignMask;
|
ULONG_PTR AlignMask;
|
||||||
LIST_ENTRY VirtualAllocdBlocks;
|
LIST_ENTRY VirtualAllocdBlocks;
|
||||||
LIST_ENTRY SegmentList;
|
LIST_ENTRY SegmentList;
|
||||||
struct _HEAP_SEGMENT *Segments[HEAP_SEGMENTS]; //FIXME: non-Vista
|
struct _HEAP_SEGMENT *Segments[HEAP_SEGMENTS]; //FIXME: non-Vista
|
||||||
|
@ -284,7 +284,7 @@ typedef struct _HEAP_UCR_DESCRIPTOR
|
||||||
LIST_ENTRY ListEntry;
|
LIST_ENTRY ListEntry;
|
||||||
LIST_ENTRY SegmentEntry;
|
LIST_ENTRY SegmentEntry;
|
||||||
PVOID Address;
|
PVOID Address;
|
||||||
ULONG Size;
|
SIZE_T Size;
|
||||||
} HEAP_UCR_DESCRIPTOR, *PHEAP_UCR_DESCRIPTOR;
|
} HEAP_UCR_DESCRIPTOR, *PHEAP_UCR_DESCRIPTOR;
|
||||||
|
|
||||||
typedef struct _HEAP_UCR_SEGMENT
|
typedef struct _HEAP_UCR_SEGMENT
|
||||||
|
@ -314,8 +314,8 @@ typedef struct _HEAP_VIRTUAL_ALLOC_ENTRY
|
||||||
{
|
{
|
||||||
LIST_ENTRY Entry;
|
LIST_ENTRY Entry;
|
||||||
HEAP_ENTRY_EXTRA ExtraStuff;
|
HEAP_ENTRY_EXTRA ExtraStuff;
|
||||||
ULONG CommitSize;
|
SIZE_T CommitSize;
|
||||||
ULONG ReserveSize;
|
SIZE_T ReserveSize;
|
||||||
HEAP_ENTRY BusyBlock;
|
HEAP_ENTRY BusyBlock;
|
||||||
} HEAP_VIRTUAL_ALLOC_ENTRY, *PHEAP_VIRTUAL_ALLOC_ENTRY;
|
} HEAP_VIRTUAL_ALLOC_ENTRY, *PHEAP_VIRTUAL_ALLOC_ENTRY;
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ typedef struct _DPH_BLOCK_INFORMATION
|
||||||
{
|
{
|
||||||
ULONG StartStamp;
|
ULONG StartStamp;
|
||||||
PVOID Heap;
|
PVOID Heap;
|
||||||
ULONG RequestedSize;
|
SIZE_T RequestedSize;
|
||||||
ULONG ActualSize;
|
SIZE_T ActualSize;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
LIST_ENTRY FreeQueue;
|
LIST_ENTRY FreeQueue;
|
||||||
|
@ -46,10 +46,10 @@ typedef struct _DPH_HEAP_BLOCK
|
||||||
};
|
};
|
||||||
PUCHAR pUserAllocation;
|
PUCHAR pUserAllocation;
|
||||||
PUCHAR pVirtualBlock;
|
PUCHAR pVirtualBlock;
|
||||||
ULONG nVirtualBlockSize;
|
SIZE_T nVirtualBlockSize;
|
||||||
ULONG nVirtualAccessSize;
|
SIZE_T nVirtualAccessSize;
|
||||||
ULONG nUserRequestedSize;
|
SIZE_T nUserRequestedSize;
|
||||||
ULONG nUserActualSize;
|
SIZE_T nUserActualSize;
|
||||||
PVOID UserValue;
|
PVOID UserValue;
|
||||||
ULONG UserFlags;
|
ULONG UserFlags;
|
||||||
PRTL_TRACE_BLOCK StackTrace;
|
PRTL_TRACE_BLOCK StackTrace;
|
||||||
|
@ -67,30 +67,30 @@ typedef struct _DPH_HEAP_ROOT
|
||||||
PDPH_HEAP_BLOCK pVirtualStorageListHead;
|
PDPH_HEAP_BLOCK pVirtualStorageListHead;
|
||||||
PDPH_HEAP_BLOCK pVirtualStorageListTail;
|
PDPH_HEAP_BLOCK pVirtualStorageListTail;
|
||||||
ULONG nVirtualStorageRanges;
|
ULONG nVirtualStorageRanges;
|
||||||
ULONG nVirtualStorageBytes;
|
SIZE_T nVirtualStorageBytes;
|
||||||
|
|
||||||
RTL_AVL_TABLE BusyNodesTable;
|
RTL_AVL_TABLE BusyNodesTable;
|
||||||
PDPH_HEAP_BLOCK NodeToAllocate;
|
PDPH_HEAP_BLOCK NodeToAllocate;
|
||||||
ULONG nBusyAllocations;
|
ULONG nBusyAllocations;
|
||||||
ULONG nBusyAllocationBytesCommitted;
|
SIZE_T nBusyAllocationBytesCommitted;
|
||||||
|
|
||||||
PDPH_HEAP_BLOCK pFreeAllocationListHead;
|
PDPH_HEAP_BLOCK pFreeAllocationListHead;
|
||||||
PDPH_HEAP_BLOCK pFreeAllocationListTail;
|
PDPH_HEAP_BLOCK pFreeAllocationListTail;
|
||||||
ULONG nFreeAllocations;
|
ULONG nFreeAllocations;
|
||||||
ULONG nFreeAllocationBytesCommitted;
|
SIZE_T nFreeAllocationBytesCommitted;
|
||||||
|
|
||||||
LIST_ENTRY AvailableAllocationHead;
|
LIST_ENTRY AvailableAllocationHead;
|
||||||
ULONG nAvailableAllocations;
|
ULONG nAvailableAllocations;
|
||||||
ULONG nAvailableAllocationBytesCommitted;
|
SIZE_T nAvailableAllocationBytesCommitted;
|
||||||
|
|
||||||
PDPH_HEAP_BLOCK pUnusedNodeListHead;
|
PDPH_HEAP_BLOCK pUnusedNodeListHead;
|
||||||
PDPH_HEAP_BLOCK pUnusedNodeListTail;
|
PDPH_HEAP_BLOCK pUnusedNodeListTail;
|
||||||
ULONG nUnusedNodes;
|
ULONG nUnusedNodes;
|
||||||
ULONG nBusyAllocationBytesAccessible;
|
SIZE_T nBusyAllocationBytesAccessible;
|
||||||
PDPH_HEAP_BLOCK pNodePoolListHead;
|
PDPH_HEAP_BLOCK pNodePoolListHead;
|
||||||
PDPH_HEAP_BLOCK pNodePoolListTail;
|
PDPH_HEAP_BLOCK pNodePoolListTail;
|
||||||
ULONG nNodePools;
|
ULONG nNodePools;
|
||||||
ULONG nNodePoolBytes;
|
SIZE_T nNodePoolBytes;
|
||||||
|
|
||||||
LIST_ENTRY NextHeap;
|
LIST_ENTRY NextHeap;
|
||||||
ULONG ExtraFlags;
|
ULONG ExtraFlags;
|
||||||
|
@ -117,7 +117,7 @@ UNICODE_STRING RtlpDphTargetDllsUnicode;
|
||||||
RTL_CRITICAL_SECTION RtlpDphDelayedFreeQueueLock;
|
RTL_CRITICAL_SECTION RtlpDphDelayedFreeQueueLock;
|
||||||
LIST_ENTRY RtlpDphDelayedFreeQueue;
|
LIST_ENTRY RtlpDphDelayedFreeQueue;
|
||||||
SLIST_HEADER RtlpDphDelayedTemporaryPushList;
|
SLIST_HEADER RtlpDphDelayedTemporaryPushList;
|
||||||
ULONG RtlpDphMemoryUsedByDelayedFreeBlocks;
|
SIZE_T RtlpDphMemoryUsedByDelayedFreeBlocks;
|
||||||
ULONG RtlpDphNumberOfDelayedFreeBlocks;
|
ULONG RtlpDphNumberOfDelayedFreeBlocks;
|
||||||
|
|
||||||
/* Counters */
|
/* Counters */
|
||||||
|
@ -429,7 +429,7 @@ RtlpDphWritePageHeapBlockInformation(PDPH_HEAP_ROOT DphRoot, PVOID UserAllocatio
|
||||||
RtlFillMemory(FillPtr, ROUND_UP(FillPtr, PAGE_SIZE) - (ULONG_PTR)FillPtr, DPH_FILL_SUFFIX);
|
RtlFillMemory(FillPtr, ROUND_UP(FillPtr, PAGE_SIZE) - (ULONG_PTR)FillPtr, DPH_FILL_SUFFIX);
|
||||||
|
|
||||||
/* FIXME: Check if logging stack traces is turned on */
|
/* FIXME: Check if logging stack traces is turned on */
|
||||||
//if (DphRoot->ExtraFlags &
|
//if (DphRoot->ExtraFlags &
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -758,7 +758,7 @@ RtlpDphAddNewPool(PDPH_HEAP_ROOT DphRoot, PDPH_HEAP_BLOCK NodeBlock, PVOID Virtu
|
||||||
ULONG NodeCount, i;
|
ULONG NodeCount, i;
|
||||||
|
|
||||||
//NodeCount = (Size >> 6) - 1;
|
//NodeCount = (Size >> 6) - 1;
|
||||||
NodeCount = (Size / sizeof(DPH_HEAP_BLOCK));
|
NodeCount = (ULONG)(Size / sizeof(DPH_HEAP_BLOCK));
|
||||||
DphStartNode = Virtual;
|
DphStartNode = Virtual;
|
||||||
|
|
||||||
/* Set pNextAlloc for all blocks */
|
/* Set pNextAlloc for all blocks */
|
||||||
|
@ -1903,7 +1903,8 @@ RtlpPageHeapReAllocate(HANDLE HeapPtr,
|
||||||
PDPH_HEAP_ROOT DphRoot;
|
PDPH_HEAP_ROOT DphRoot;
|
||||||
PDPH_HEAP_BLOCK Node = NULL, AllocatedNode;
|
PDPH_HEAP_BLOCK Node = NULL, AllocatedNode;
|
||||||
BOOLEAN Biased = FALSE, UseNormalHeap = FALSE, OldBlockPageHeap = TRUE;
|
BOOLEAN Biased = FALSE, UseNormalHeap = FALSE, OldBlockPageHeap = TRUE;
|
||||||
ULONG DataSize, ValidationInfo;
|
ULONG ValidationInfo;
|
||||||
|
SIZE_T DataSize;
|
||||||
PVOID NewAlloc = NULL;
|
PVOID NewAlloc = NULL;
|
||||||
|
|
||||||
/* Check requested size */
|
/* Check requested size */
|
||||||
|
|
|
@ -116,8 +116,9 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
IN PVOID Context,
|
IN PVOID Context,
|
||||||
IN PVOID Environment)
|
IN PVOID Environment)
|
||||||
{
|
{
|
||||||
ULONG InfoLength, Length, c;
|
ULONG InfoLength;
|
||||||
LONG RequiredLength, SpareLength;
|
SIZE_T Length, SpareLength, c;
|
||||||
|
LONG RequiredLength;
|
||||||
PCHAR SpareData, DataEnd;
|
PCHAR SpareData, DataEnd;
|
||||||
ULONG Type;
|
ULONG Type;
|
||||||
PWCHAR Name, p, ValueEnd;
|
PWCHAR Name, p, ValueEnd;
|
||||||
|
@ -207,7 +208,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
if (SpareLength < RequiredLength)
|
if (SpareLength < RequiredLength)
|
||||||
{
|
{
|
||||||
/* Fail and return the missing length */
|
/* Fail and return the missing length */
|
||||||
*InfoSize = SpareData - (PCHAR)KeyValueInfo + RequiredLength;
|
*InfoSize = (ULONG)(SpareData - (PCHAR)KeyValueInfo) + RequiredLength;
|
||||||
return STATUS_BUFFER_TOO_SMALL;
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +258,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
/* Do the query */
|
/* Do the query */
|
||||||
Status = RtlpQueryRegistryDirect(REG_SZ,
|
Status = RtlpQueryRegistryDirect(REG_SZ,
|
||||||
Data,
|
Data,
|
||||||
Length,
|
(ULONG)Length,
|
||||||
QueryTable->EntryContext);
|
QueryTable->EntryContext);
|
||||||
QueryTable->EntryContext = (PVOID)((ULONG_PTR)QueryTable->
|
QueryTable->EntryContext = (PVOID)((ULONG_PTR)QueryTable->
|
||||||
EntryContext +
|
EntryContext +
|
||||||
|
@ -269,7 +270,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
Status = QueryTable->QueryRoutine(Name,
|
Status = QueryTable->QueryRoutine(Name,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
Data,
|
Data,
|
||||||
Length,
|
(ULONG)Length,
|
||||||
Context,
|
Context,
|
||||||
QueryTable->EntryContext);
|
QueryTable->EntryContext);
|
||||||
}
|
}
|
||||||
|
@ -311,7 +312,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
if (FoundExpander)
|
if (FoundExpander)
|
||||||
{
|
{
|
||||||
/* Setup the source string */
|
/* Setup the source string */
|
||||||
RtlInitEmptyUnicodeString(&Source, Data, Length);
|
RtlInitEmptyUnicodeString(&Source, Data, (USHORT)Length);
|
||||||
Source.Length = Source.MaximumLength - sizeof(UNICODE_NULL);
|
Source.Length = Source.MaximumLength - sizeof(UNICODE_NULL);
|
||||||
|
|
||||||
/* Setup the desination string */
|
/* Setup the desination string */
|
||||||
|
@ -326,7 +327,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
else if (SpareLength <= MAXUSHORT)
|
else if (SpareLength <= MAXUSHORT)
|
||||||
{
|
{
|
||||||
/* This is the good case, where we fit into a string */
|
/* This is the good case, where we fit into a string */
|
||||||
Destination.MaximumLength = SpareLength;
|
Destination.MaximumLength = (USHORT)SpareLength;
|
||||||
Destination.Buffer[SpareLength / 2 - 1] = UNICODE_NULL;
|
Destination.Buffer[SpareLength / 2 - 1] = UNICODE_NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -356,9 +357,8 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
if (Status == STATUS_BUFFER_TOO_SMALL)
|
if (Status == STATUS_BUFFER_TOO_SMALL)
|
||||||
{
|
{
|
||||||
/* Set the required missing length */
|
/* Set the required missing length */
|
||||||
*InfoSize = SpareData -
|
*InfoSize = (ULONG)(SpareData - (PCHAR)KeyValueInfo) +
|
||||||
(PCHAR)KeyValueInfo +
|
RequiredLength;
|
||||||
RequiredLength;
|
|
||||||
|
|
||||||
/* Notify debugger */
|
/* Notify debugger */
|
||||||
DPRINT1("RTL: Expand variables for %wZ failed - "
|
DPRINT1("RTL: Expand variables for %wZ failed - "
|
||||||
|
@ -391,7 +391,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
/* Return the data */
|
/* Return the data */
|
||||||
Status = RtlpQueryRegistryDirect(Type,
|
Status = RtlpQueryRegistryDirect(Type,
|
||||||
Data,
|
Data,
|
||||||
Length,
|
(ULONG)Length,
|
||||||
QueryTable->EntryContext);
|
QueryTable->EntryContext);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -400,7 +400,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
||||||
Status = QueryTable->QueryRoutine(Name,
|
Status = QueryTable->QueryRoutine(Name,
|
||||||
Type,
|
Type,
|
||||||
Data,
|
Data,
|
||||||
Length,
|
(ULONG)Length,
|
||||||
Context,
|
Context,
|
||||||
QueryTable->EntryContext);
|
QueryTable->EntryContext);
|
||||||
}
|
}
|
||||||
|
@ -756,7 +756,7 @@ RtlFormatCurrentUserKeyPath(OUT PUNICODE_STRING KeyPath)
|
||||||
/* Initialize a string */
|
/* Initialize a string */
|
||||||
RtlInitEmptyUnicodeString(KeyPath,
|
RtlInitEmptyUnicodeString(KeyPath,
|
||||||
RtlpAllocateStringMemory(Length, TAG_USTR),
|
RtlpAllocateStringMemory(Length, TAG_USTR),
|
||||||
Length);
|
(USHORT)Length);
|
||||||
if (!KeyPath->Buffer)
|
if (!KeyPath->Buffer)
|
||||||
{
|
{
|
||||||
/* Free the string and fail */
|
/* Free the string and fail */
|
||||||
|
@ -840,7 +840,7 @@ RtlpNtEnumerateSubKey(IN HANDLE KeyHandle,
|
||||||
if (KeyInfo->NameLength <= SubKeyName->MaximumLength)
|
if (KeyInfo->NameLength <= SubKeyName->MaximumLength)
|
||||||
{
|
{
|
||||||
/* Set the length */
|
/* Set the length */
|
||||||
SubKeyName->Length = KeyInfo->NameLength;
|
SubKeyName->Length = (USHORT)KeyInfo->NameLength;
|
||||||
|
|
||||||
/* Copy it */
|
/* Copy it */
|
||||||
RtlMoveMemory(SubKeyName->Buffer,
|
RtlMoveMemory(SubKeyName->Buffer,
|
||||||
|
@ -1094,7 +1094,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
||||||
&KeyValueName,
|
&KeyValueName,
|
||||||
KeyValueFullInformation,
|
KeyValueFullInformation,
|
||||||
KeyValueInfo,
|
KeyValueInfo,
|
||||||
InfoSize,
|
(ULONG)InfoSize,
|
||||||
&ResultLength);
|
&ResultLength);
|
||||||
if (Status == STATUS_BUFFER_OVERFLOW)
|
if (Status == STATUS_BUFFER_OVERFLOW)
|
||||||
{
|
{
|
||||||
|
@ -1111,7 +1111,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
||||||
/* Setup a default */
|
/* Setup a default */
|
||||||
KeyValueInfo->Type = REG_NONE;
|
KeyValueInfo->Type = REG_NONE;
|
||||||
KeyValueInfo->DataLength = 0;
|
KeyValueInfo->DataLength = 0;
|
||||||
ResultLength = InfoSize;
|
ResultLength = (ULONG)InfoSize;
|
||||||
|
|
||||||
/* Call the query routine */
|
/* Call the query routine */
|
||||||
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
||||||
|
@ -1151,7 +1151,7 @@ RtlQueryRegistryValues(IN ULONG RelativeTo,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Call the query routine */
|
/* Call the query routine */
|
||||||
ResultLength = InfoSize;
|
ResultLength = (ULONG)InfoSize;
|
||||||
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
||||||
KeyValueInfo,
|
KeyValueInfo,
|
||||||
&ResultLength,
|
&ResultLength,
|
||||||
|
@ -1212,7 +1212,7 @@ ProcessValues:
|
||||||
Value,
|
Value,
|
||||||
KeyValueFullInformation,
|
KeyValueFullInformation,
|
||||||
KeyValueInfo,
|
KeyValueInfo,
|
||||||
InfoSize,
|
(ULONG)InfoSize,
|
||||||
&ResultLength);
|
&ResultLength);
|
||||||
if (Status == STATUS_BUFFER_OVERFLOW)
|
if (Status == STATUS_BUFFER_OVERFLOW)
|
||||||
{
|
{
|
||||||
|
@ -1242,7 +1242,7 @@ ProcessValues:
|
||||||
if (NT_SUCCESS(Status))
|
if (NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
/* Call the query routine */
|
/* Call the query routine */
|
||||||
ResultLength = InfoSize;
|
ResultLength = (ULONG)InfoSize;
|
||||||
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
Status = RtlpCallQueryRegistryRoutine(QueryTable,
|
||||||
KeyValueInfo,
|
KeyValueInfo,
|
||||||
&ResultLength,
|
&ResultLength,
|
||||||
|
|
|
@ -63,7 +63,7 @@ typedef struct _DISPATCHER_CONTEXT
|
||||||
PVOID
|
PVOID
|
||||||
NTAPI
|
NTAPI
|
||||||
RtlpAllocateMemory(
|
RtlpAllocateMemory(
|
||||||
ULONG Bytes,
|
SIZE_T Bytes,
|
||||||
ULONG Tag);
|
ULONG Tag);
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
|
|
|
@ -630,7 +630,7 @@ RtlAcquireSRWLockExclusive(IN OUT PRTL_SRWLOCK SRWLock)
|
||||||
/* There are no wait blocks so far, we need to add ourselves as the first
|
/* There are no wait blocks so far, we need to add ourselves as the first
|
||||||
wait block. We need to keep the shared count! */
|
wait block. We need to keep the shared count! */
|
||||||
StackWaitBlock.Exclusive = TRUE;
|
StackWaitBlock.Exclusive = TRUE;
|
||||||
StackWaitBlock.SharedCount = CurrentValue >> RTL_SRWLOCK_BITS;
|
StackWaitBlock.SharedCount = (LONG)(CurrentValue >> RTL_SRWLOCK_BITS);
|
||||||
StackWaitBlock.Next = NULL;
|
StackWaitBlock.Next = NULL;
|
||||||
StackWaitBlock.Last = &StackWaitBlock;
|
StackWaitBlock.Last = &StackWaitBlock;
|
||||||
StackWaitBlock.Wake = 0;
|
StackWaitBlock.Wake = 0;
|
||||||
|
|
|
@ -193,7 +193,7 @@ static ULONG queue_get_timeout(struct timer_queue *q)
|
||||||
if (t->expire != EXPIRE_NEVER)
|
if (t->expire != EXPIRE_NEVER)
|
||||||
{
|
{
|
||||||
ULONGLONG time = queue_current_time();
|
ULONGLONG time = queue_current_time();
|
||||||
timeout = t->expire < time ? 0 : t->expire - time;
|
timeout = t->expire < time ? 0 : (ULONG)(t->expire - time);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RtlLeaveCriticalSection(&q->cs);
|
RtlLeaveCriticalSection(&q->cs);
|
||||||
|
|
|
@ -85,7 +85,7 @@ RtlQueryTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
NTSTATUS NTAPI
|
NTSTATUS NTAPI
|
||||||
RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
{
|
{
|
||||||
ULONG Length;
|
SIZE_T Length;
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
DPRINT("RtlSetTimeZoneInformation()\n");
|
DPRINT("RtlSetTimeZoneInformation()\n");
|
||||||
|
@ -109,7 +109,7 @@ RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
L"Standard Name",
|
L"Standard Name",
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
TimeZoneInformation->StandardName,
|
TimeZoneInformation->StandardName,
|
||||||
Length);
|
(ULONG)Length);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
|
@ -143,7 +143,7 @@ RtlSetTimeZoneInformation(PRTL_TIME_ZONE_INFORMATION TimeZoneInformation)
|
||||||
L"Daylight Name",
|
L"Daylight Name",
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
TimeZoneInformation->DaylightName,
|
TimeZoneInformation->DaylightName,
|
||||||
Length);
|
(ULONG)Length);
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue