mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 07:28:19 +00:00
Hervé Poussineau <poussine@freesurf.fr>
Replace GET_RETRIEVAL_DESCRIPTOR structure (undocumented) by RETRIEVAL_POINTERS_BUFFER. Correct alignment for some structures svn path=/trunk/; revision=13321
This commit is contained in:
parent
b142dbd5d2
commit
c05831ef5f
4 changed files with 80 additions and 84 deletions
|
@ -1485,14 +1485,14 @@ NTSTATUS STDCALL ZwFreeVirtualMemory(IN HANDLE ProcessHandle,
|
||||||
* IoStatusBlock = Caller should supply storage for
|
* IoStatusBlock = Caller should supply storage for
|
||||||
* IoControlCode = Contains the File System Control command. This is an
|
* IoControlCode = Contains the File System Control command. This is an
|
||||||
* index to the structures in InputBuffer and OutputBuffer.
|
* index to the structures in InputBuffer and OutputBuffer.
|
||||||
* FSCTL_GET_RETRIEVAL_POINTERS MAPPING_PAIR
|
* FSCTL_GET_RETRIEVAL_POINTERS [Input/Output] RETRIEVAL_POINTERS_BUFFER
|
||||||
* FSCTL_GET_RETRIEVAL_POINTERS GET_RETRIEVAL_DESCRIPTOR
|
* FSCTL_GET_VOLUME_BITMAP [Input] STARTING_LCN_INPUT_BUFFER
|
||||||
* FSCTL_GET_VOLUME_BITMAP BITMAP_DESCRIPTOR
|
* FSCTL_GET_VOLUME_BITMAP [Output] VOLUME_BITMAP_BUFFER
|
||||||
* FSCTL_MOVE_FILE MOVEFILE_DESCRIPTOR
|
* FSCTL_MOVE_FILE [Input] MOVE_FILE_DATA
|
||||||
*
|
*
|
||||||
* InputBuffer = Caller should supply storage for input buffer if FCTL expects one.
|
* InputBuffer = Caller should supply storage for input buffer if FSCTL expects one.
|
||||||
* InputBufferSize = Size of the input bufffer
|
* InputBufferSize = Size of the input bufffer
|
||||||
* OutputBuffer = Caller should supply storage for output buffer if FCTL expects one.
|
* OutputBuffer = Caller should supply storage for output buffer if FSCTL expects one.
|
||||||
* OutputBufferSize = Size of the input bufffer
|
* OutputBufferSize = Size of the input bufffer
|
||||||
* RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
|
* RETURNS: Status [ STATUS_SUCCESS | STATUS_PENDING | STATUS_ACCESS_DENIED | STATUS_INSUFFICIENT_RESOURCES |
|
||||||
* STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ]
|
* STATUS_INVALID_PARAMETER | STATUS_INVALID_DEVICE_REQUEST ]
|
||||||
|
|
|
@ -1111,32 +1111,18 @@ typedef struct _FILE_NOTIFY_INFORMATION {
|
||||||
#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073
|
#define FSCTL_GET_RETRIEVAL_POINTERS 0x90073
|
||||||
#define FSCTL_MOVE_FILE 0x90074
|
#define FSCTL_MOVE_FILE 0x90074
|
||||||
|
|
||||||
typedef struct _MAPPING_PAIR
|
/* Structure copied from ntifs.h (Must be in sync!) */
|
||||||
{
|
#include <pshpack8.h>
|
||||||
ULONGLONG Vcn;
|
typedef struct _RETRIEVAL_POINTERS_BUFFER {
|
||||||
ULONGLONG Lcn;
|
ULONG ExtentCount;
|
||||||
} MAPPING_PAIR, *PMAPPING_PAIR;
|
LARGE_INTEGER StartingVcn;
|
||||||
|
struct {
|
||||||
/* Must match RETRIEVAL_POINTERS_BUFFER (ntifs.h) */
|
LARGE_INTEGER NextVcn;
|
||||||
#include <pshpack4.h>
|
LARGE_INTEGER Lcn;
|
||||||
typedef struct _GET_RETRIEVAL_DESCRIPTOR
|
} Extents[1];
|
||||||
{
|
} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
|
||||||
ULONG NumberOfPairs;
|
|
||||||
ULONGLONG StartVcn;
|
|
||||||
MAPPING_PAIR Pair[0]; // variable size
|
|
||||||
} GET_RETRIEVAL_DESCRIPTOR, *PGET_RETRIEVAL_DESCRIPTOR;
|
|
||||||
#include <poppack.h>
|
#include <poppack.h>
|
||||||
|
|
||||||
typedef struct _MOVEFILE_DESCRIPTOR
|
|
||||||
{
|
|
||||||
HANDLE FileHandle;
|
|
||||||
ULONG Reserved;
|
|
||||||
LARGE_INTEGER StartVcn;
|
|
||||||
LARGE_INTEGER TargetLcn;
|
|
||||||
ULONG NumVcns;
|
|
||||||
ULONG Reserved1;
|
|
||||||
} MOVEFILE_DESCRIPTOR, *PMOVEFILE_DESCRIPTOR;
|
|
||||||
|
|
||||||
typedef struct _SECTION_BASIC_INFORMATION
|
typedef struct _SECTION_BASIC_INFORMATION
|
||||||
{
|
{
|
||||||
PVOID BaseAddress;
|
PVOID BaseAddress;
|
||||||
|
@ -1723,14 +1709,6 @@ typedef enum _POWER_INFORMATION_LEVEL {
|
||||||
|
|
||||||
#define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only
|
#define FSCTL_READ_MFT_RECORD 0x90068 // NTFS only
|
||||||
|
|
||||||
typedef struct _BITMAP_DESCRIPTOR
|
|
||||||
{
|
|
||||||
ULONGLONG StartLcn;
|
|
||||||
ULONGLONG ClustersToEndOfVol;
|
|
||||||
BYTE Map[0]; // variable size
|
|
||||||
} BITMAP_DESCRIPTOR, *PBITMAP_DESCRIPTOR;
|
|
||||||
|
|
||||||
|
|
||||||
//typedef enum _TIMER_TYPE
|
//typedef enum _TIMER_TYPE
|
||||||
//{
|
//{
|
||||||
// NotificationTimer,
|
// NotificationTimer,
|
||||||
|
|
|
@ -1,11 +1,29 @@
|
||||||
|
/*
|
||||||
|
* ReactOS kernel
|
||||||
|
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
|
*/
|
||||||
/* $Id$
|
/* $Id$
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* FILE: ntoskrnl/mm/pagefile.c
|
* FILE: ntoskrnl/mm/pagefile.c
|
||||||
* PURPOSE: Paging file functions
|
* PURPOSE: Paging file functions
|
||||||
*
|
* PROGRAMMER: David Welch (welch@mcmail.com)
|
||||||
* PROGRAMMERS: David Welch (welch@mcmail.com)
|
* UPDATE HISTORY:
|
||||||
|
* Created 22/05/98
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *****************************************************************/
|
/* INCLUDES *****************************************************************/
|
||||||
|
@ -27,14 +45,14 @@ typedef struct _PAGINGFILE
|
||||||
PULONG AllocMap;
|
PULONG AllocMap;
|
||||||
KSPIN_LOCK AllocMapLock;
|
KSPIN_LOCK AllocMapLock;
|
||||||
ULONG AllocMapSize;
|
ULONG AllocMapSize;
|
||||||
PGET_RETRIEVAL_DESCRIPTOR RetrievalPointers;
|
PRETRIEVAL_POINTERS_BUFFER RetrievalPointers;
|
||||||
}
|
}
|
||||||
PAGINGFILE, *PPAGINGFILE;
|
PAGINGFILE, *PPAGINGFILE;
|
||||||
|
|
||||||
typedef struct _RETRIEVEL_DESCRIPTOR_LIST
|
typedef struct _RETRIEVEL_DESCRIPTOR_LIST
|
||||||
{
|
{
|
||||||
struct _RETRIEVEL_DESCRIPTOR_LIST* Next;
|
struct _RETRIEVEL_DESCRIPTOR_LIST* Next;
|
||||||
GET_RETRIEVAL_DESCRIPTOR RetrievalPointers;
|
RETRIEVAL_POINTERS_BUFFER RetrievalPointers;
|
||||||
}
|
}
|
||||||
RETRIEVEL_DESCRIPTOR_LIST, *PRETRIEVEL_DESCRIPTOR_LIST;
|
RETRIEVEL_DESCRIPTOR_LIST, *PRETRIEVEL_DESCRIPTOR_LIST;
|
||||||
|
|
||||||
|
@ -110,27 +128,27 @@ MmShowOutOfSpaceMessagePagingFile(VOID)
|
||||||
}
|
}
|
||||||
|
|
||||||
LARGE_INTEGER STATIC
|
LARGE_INTEGER STATIC
|
||||||
MmGetOffsetPageFile(PGET_RETRIEVAL_DESCRIPTOR RetrievalPointers, LARGE_INTEGER Offset)
|
MmGetOffsetPageFile(PRETRIEVAL_POINTERS_BUFFER RetrievalPointers, LARGE_INTEGER Offset)
|
||||||
{
|
{
|
||||||
/* Simple binary search */
|
/* Simple binary search */
|
||||||
ULONG first, last, mid;
|
ULONG first, last, mid;
|
||||||
first = 0;
|
first = 0;
|
||||||
last = RetrievalPointers->NumberOfPairs - 1;
|
last = RetrievalPointers->ExtentCount - 1;
|
||||||
while (first <= last)
|
while (first <= last)
|
||||||
{
|
{
|
||||||
mid = (last - first) / 2 + first;
|
mid = (last - first) / 2 + first;
|
||||||
if ((ULONGLONG) Offset.QuadPart < RetrievalPointers->Pair[mid].Vcn)
|
if (Offset.QuadPart < RetrievalPointers->Extents[mid].NextVcn.QuadPart)
|
||||||
{
|
{
|
||||||
if (mid == 0)
|
if (mid == 0)
|
||||||
{
|
{
|
||||||
Offset.QuadPart += RetrievalPointers->Pair[0].Lcn - RetrievalPointers->StartVcn;
|
Offset.QuadPart += RetrievalPointers->Extents[0].Lcn.QuadPart - RetrievalPointers->StartingVcn.QuadPart;
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((ULONGLONG) Offset.QuadPart >= RetrievalPointers->Pair[mid-1].Vcn)
|
if (Offset.QuadPart >= RetrievalPointers->Extents[mid-1].NextVcn.QuadPart)
|
||||||
{
|
{
|
||||||
Offset.QuadPart += RetrievalPointers->Pair[mid].Lcn - RetrievalPointers->Pair[mid-1].Vcn;
|
Offset.QuadPart += RetrievalPointers->Extents[mid].Lcn.QuadPart - RetrievalPointers->Extents[mid-1].NextVcn.QuadPart;
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
last = mid - 1;
|
last = mid - 1;
|
||||||
|
@ -138,13 +156,13 @@ MmGetOffsetPageFile(PGET_RETRIEVAL_DESCRIPTOR RetrievalPointers, LARGE_INTEGER O
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mid == RetrievalPointers->NumberOfPairs - 1)
|
if (mid == RetrievalPointers->ExtentCount - 1)
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((ULONGLONG) Offset.QuadPart < RetrievalPointers->Pair[mid+1].Vcn)
|
if (Offset.QuadPart < RetrievalPointers->Extents[mid+1].NextVcn.QuadPart)
|
||||||
{
|
{
|
||||||
Offset.QuadPart += RetrievalPointers->Pair[mid+1].Lcn - RetrievalPointers->Pair[mid].Vcn;
|
Offset.QuadPart += RetrievalPointers->Extents[mid+1].Lcn.QuadPart - RetrievalPointers->Extents[mid].NextVcn.QuadPart;
|
||||||
return Offset;
|
return Offset;
|
||||||
}
|
}
|
||||||
first = mid + 1;
|
first = mid + 1;
|
||||||
|
@ -453,7 +471,7 @@ MmAllocRetrievelDescriptorList(ULONG Pairs)
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
PRETRIEVEL_DESCRIPTOR_LIST RetDescList;
|
PRETRIEVEL_DESCRIPTOR_LIST RetDescList;
|
||||||
|
|
||||||
Size = sizeof(RETRIEVEL_DESCRIPTOR_LIST) + Pairs * sizeof(MAPPING_PAIR);
|
Size = sizeof(RETRIEVEL_DESCRIPTOR_LIST) + Pairs * 2 * sizeof(LARGE_INTEGER);
|
||||||
RetDescList = ExAllocatePool(NonPagedPool, Size);
|
RetDescList = ExAllocatePool(NonPagedPool, Size);
|
||||||
if (RetDescList)
|
if (RetDescList)
|
||||||
{
|
{
|
||||||
|
@ -480,7 +498,7 @@ MmDumpToPagingFile(ULONG BugCode,
|
||||||
PULONG MdlMap;
|
PULONG MdlMap;
|
||||||
LONGLONG NextOffset = 0;
|
LONGLONG NextOffset = 0;
|
||||||
ULONG i;
|
ULONG i;
|
||||||
PGET_RETRIEVAL_DESCRIPTOR RetrievalPointers;
|
PRETRIEVAL_POINTERS_BUFFER RetrievalPointers;
|
||||||
LARGE_INTEGER DiskOffset;
|
LARGE_INTEGER DiskOffset;
|
||||||
|
|
||||||
if (MmCoreDumpPageFile == 0xFFFFFFFF)
|
if (MmCoreDumpPageFile == 0xFFFFFFFF)
|
||||||
|
@ -726,6 +744,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
IN PLARGE_INTEGER MaximumSize,
|
IN PLARGE_INTEGER MaximumSize,
|
||||||
IN ULONG Reserved)
|
IN ULONG Reserved)
|
||||||
{
|
{
|
||||||
|
NTSTATUS Status;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
HANDLE FileHandle;
|
HANDLE FileHandle;
|
||||||
IO_STATUS_BLOCK IoStatus;
|
IO_STATUS_BLOCK IoStatus;
|
||||||
|
@ -740,13 +759,12 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
ULONG BytesPerAllocationUnit;
|
ULONG BytesPerAllocationUnit;
|
||||||
LARGE_INTEGER Vcn;
|
LARGE_INTEGER Vcn;
|
||||||
ULONG ExtentCount;
|
ULONG ExtentCount;
|
||||||
ULONG MaxVcn;
|
LARGE_INTEGER MaxVcn;
|
||||||
ULONG Count;
|
ULONG Count;
|
||||||
ULONG Size;
|
ULONG Size;
|
||||||
KPROCESSOR_MODE PreviousMode;
|
KPROCESSOR_MODE PreviousMode;
|
||||||
UNICODE_STRING CapturedFileName;
|
UNICODE_STRING CapturedFileName;
|
||||||
LARGE_INTEGER SafeInitialSize, SafeMaximumSize;
|
LARGE_INTEGER SafeInitialSize, SafeMaximumSize;
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
|
||||||
|
|
||||||
DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n",
|
DPRINT("NtCreatePagingFile(FileName %wZ, InitialSize %I64d)\n",
|
||||||
FileName, InitialSize->QuadPart);
|
FileName, InitialSize->QuadPart);
|
||||||
|
@ -757,7 +775,15 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
}
|
}
|
||||||
|
|
||||||
PreviousMode = ExGetPreviousMode();
|
PreviousMode = ExGetPreviousMode();
|
||||||
|
Status = RtlCaptureUnicodeString(&CapturedFileName,
|
||||||
|
PreviousMode,
|
||||||
|
PagedPool,
|
||||||
|
FALSE,
|
||||||
|
FileName);
|
||||||
|
if (!NT_SUCCESS(Status))
|
||||||
|
{
|
||||||
|
return(Status);
|
||||||
|
}
|
||||||
if (PreviousMode == UserMode)
|
if (PreviousMode == UserMode)
|
||||||
{
|
{
|
||||||
_SEH_TRY
|
_SEH_TRY
|
||||||
|
@ -787,16 +813,6 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
SafeInitialSize = *InitialSize;
|
SafeInitialSize = *InitialSize;
|
||||||
SafeMaximumSize = *MaximumSize;
|
SafeMaximumSize = *MaximumSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
Status = RtlCaptureUnicodeString(&CapturedFileName,
|
|
||||||
PreviousMode,
|
|
||||||
PagedPool,
|
|
||||||
FALSE,
|
|
||||||
FileName);
|
|
||||||
if (!NT_SUCCESS(Status))
|
|
||||||
{
|
|
||||||
return(Status);
|
|
||||||
}
|
|
||||||
|
|
||||||
InitializeObjectAttributes(&ObjectAttributes,
|
InitializeObjectAttributes(&ObjectAttributes,
|
||||||
&CapturedFileName,
|
&CapturedFileName,
|
||||||
|
@ -884,7 +900,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ExtentCount = 0;
|
ExtentCount = 0;
|
||||||
MaxVcn = (ULONG)((SafeInitialSize.QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit);
|
MaxVcn.QuadPart = (SafeInitialSize.QuadPart + BytesPerAllocationUnit - 1) / BytesPerAllocationUnit;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
Status = ZwFsControlFile(FileHandle,
|
Status = ZwFsControlFile(FileHandle,
|
||||||
|
@ -896,7 +912,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
&Vcn,
|
&Vcn,
|
||||||
sizeof(LARGE_INTEGER),
|
sizeof(LARGE_INTEGER),
|
||||||
&CurrentRetDescList->RetrievalPointers,
|
&CurrentRetDescList->RetrievalPointers,
|
||||||
sizeof(GET_RETRIEVAL_DESCRIPTOR) + PAIRS_PER_RUN * sizeof(MAPPING_PAIR));
|
sizeof(RETRIEVAL_POINTERS_BUFFER) + PAIRS_PER_RUN * 2 * sizeof(LARGE_INTEGER));
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
while (RetDescList)
|
while (RetDescList)
|
||||||
|
@ -909,8 +925,8 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
return(Status);
|
return(Status);
|
||||||
}
|
}
|
||||||
ExtentCount += CurrentRetDescList->RetrievalPointers.NumberOfPairs;
|
ExtentCount += CurrentRetDescList->RetrievalPointers.ExtentCount;
|
||||||
if ((ULONG)CurrentRetDescList->RetrievalPointers.Pair[CurrentRetDescList->RetrievalPointers.NumberOfPairs-1].Vcn < MaxVcn)
|
if (CurrentRetDescList->RetrievalPointers.Extents[CurrentRetDescList->RetrievalPointers.ExtentCount-1].NextVcn.QuadPart < MaxVcn.QuadPart)
|
||||||
{
|
{
|
||||||
CurrentRetDescList->Next = MmAllocRetrievelDescriptorList(PAIRS_PER_RUN);
|
CurrentRetDescList->Next = MmAllocRetrievelDescriptorList(PAIRS_PER_RUN);
|
||||||
if (CurrentRetDescList->Next == NULL)
|
if (CurrentRetDescList->Next == NULL)
|
||||||
|
@ -925,7 +941,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
ZwClose(FileHandle);
|
ZwClose(FileHandle);
|
||||||
return(STATUS_NO_MEMORY);
|
return(STATUS_NO_MEMORY);
|
||||||
}
|
}
|
||||||
Vcn.QuadPart = CurrentRetDescList->RetrievalPointers.Pair[CurrentRetDescList->RetrievalPointers.NumberOfPairs-1].Vcn;
|
Vcn = CurrentRetDescList->RetrievalPointers.Extents[CurrentRetDescList->RetrievalPointers.ExtentCount-1].NextVcn;
|
||||||
CurrentRetDescList = CurrentRetDescList->Next;
|
CurrentRetDescList = CurrentRetDescList->Next;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -976,7 +992,7 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
return(STATUS_NO_MEMORY);
|
return(STATUS_NO_MEMORY);
|
||||||
}
|
}
|
||||||
DPRINT("ExtentCount: %d\n", ExtentCount);
|
DPRINT("ExtentCount: %d\n", ExtentCount);
|
||||||
Size = sizeof(GET_RETRIEVAL_DESCRIPTOR) + ExtentCount * sizeof(MAPPING_PAIR);
|
Size = sizeof(RETRIEVAL_POINTERS_BUFFER) + ExtentCount * 2 * sizeof(LARGE_INTEGER);
|
||||||
PagingFile->RetrievalPointers = ExAllocatePool(NonPagedPool, Size);
|
PagingFile->RetrievalPointers = ExAllocatePool(NonPagedPool, Size);
|
||||||
if (PagingFile->RetrievalPointers == NULL)
|
if (PagingFile->RetrievalPointers == NULL)
|
||||||
{
|
{
|
||||||
|
@ -997,22 +1013,22 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
RtlZeroMemory(PagingFile->RetrievalPointers, Size);
|
RtlZeroMemory(PagingFile->RetrievalPointers, Size);
|
||||||
|
|
||||||
Count = 0;
|
Count = 0;
|
||||||
PagingFile->RetrievalPointers->NumberOfPairs = ExtentCount;
|
PagingFile->RetrievalPointers->ExtentCount = ExtentCount;
|
||||||
PagingFile->RetrievalPointers->StartVcn = RetDescList->RetrievalPointers.StartVcn;
|
PagingFile->RetrievalPointers->StartingVcn = RetDescList->RetrievalPointers.StartingVcn;
|
||||||
CurrentRetDescList = RetDescList;
|
CurrentRetDescList = RetDescList;
|
||||||
while (CurrentRetDescList)
|
while (CurrentRetDescList)
|
||||||
{
|
{
|
||||||
memcpy(&PagingFile->RetrievalPointers->Pair[Count],
|
memcpy(&PagingFile->RetrievalPointers->Extents[Count],
|
||||||
CurrentRetDescList->RetrievalPointers.Pair,
|
CurrentRetDescList->RetrievalPointers.Extents,
|
||||||
CurrentRetDescList->RetrievalPointers.NumberOfPairs * sizeof(MAPPING_PAIR));
|
CurrentRetDescList->RetrievalPointers.ExtentCount * 2 * sizeof(LARGE_INTEGER));
|
||||||
Count += CurrentRetDescList->RetrievalPointers.NumberOfPairs;
|
Count += CurrentRetDescList->RetrievalPointers.ExtentCount;
|
||||||
RetDescList = CurrentRetDescList;
|
RetDescList = CurrentRetDescList;
|
||||||
CurrentRetDescList = CurrentRetDescList->Next;
|
CurrentRetDescList = CurrentRetDescList->Next;
|
||||||
ExFreePool(RetDescList);
|
ExFreePool(RetDescList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PagingFile->RetrievalPointers->NumberOfPairs != ExtentCount ||
|
if (PagingFile->RetrievalPointers->ExtentCount != ExtentCount ||
|
||||||
(ULONG)PagingFile->RetrievalPointers->Pair[ExtentCount - 1].Vcn != MaxVcn)
|
PagingFile->RetrievalPointers->Extents[ExtentCount - 1].NextVcn.QuadPart != MaxVcn.QuadPart)
|
||||||
{
|
{
|
||||||
ExFreePool(PagingFile->RetrievalPointers);
|
ExFreePool(PagingFile->RetrievalPointers);
|
||||||
ExFreePool(PagingFile->AllocMap);
|
ExFreePool(PagingFile->AllocMap);
|
||||||
|
@ -1025,11 +1041,11 @@ NtCreatePagingFile(IN PUNICODE_STRING FileName,
|
||||||
/*
|
/*
|
||||||
* Change the entries from lcn's to volume offset's.
|
* Change the entries from lcn's to volume offset's.
|
||||||
*/
|
*/
|
||||||
PagingFile->RetrievalPointers->StartVcn *= BytesPerAllocationUnit;
|
PagingFile->RetrievalPointers->StartingVcn.QuadPart *= BytesPerAllocationUnit;
|
||||||
for (i = 0; i < ExtentCount; i++)
|
for (i = 0; i < ExtentCount; i++)
|
||||||
{
|
{
|
||||||
PagingFile->RetrievalPointers->Pair[i].Lcn *= BytesPerAllocationUnit;
|
PagingFile->RetrievalPointers->Extents[i].Lcn.QuadPart *= BytesPerAllocationUnit;
|
||||||
PagingFile->RetrievalPointers->Pair[i].Vcn *= BytesPerAllocationUnit;
|
PagingFile->RetrievalPointers->Extents[i].NextVcn.QuadPart *= BytesPerAllocationUnit;
|
||||||
}
|
}
|
||||||
|
|
||||||
KeAcquireSpinLock(&PagingFileListLock, &oldIrql);
|
KeAcquireSpinLock(&PagingFileListLock, &oldIrql);
|
||||||
|
|
|
@ -1406,6 +1406,7 @@ typedef struct _QUERY_PATH_RESPONSE {
|
||||||
ULONG LengthAccepted;
|
ULONG LengthAccepted;
|
||||||
} QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE;
|
} QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE;
|
||||||
|
|
||||||
|
#pragma pack(push,8)
|
||||||
typedef struct _RETRIEVAL_POINTERS_BUFFER {
|
typedef struct _RETRIEVAL_POINTERS_BUFFER {
|
||||||
ULONG ExtentCount;
|
ULONG ExtentCount;
|
||||||
LARGE_INTEGER StartingVcn;
|
LARGE_INTEGER StartingVcn;
|
||||||
|
@ -1414,6 +1415,7 @@ typedef struct _RETRIEVAL_POINTERS_BUFFER {
|
||||||
LARGE_INTEGER Lcn;
|
LARGE_INTEGER Lcn;
|
||||||
} Extents[1];
|
} Extents[1];
|
||||||
} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
|
} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
typedef struct _RTL_SPLAY_LINKS {
|
typedef struct _RTL_SPLAY_LINKS {
|
||||||
struct _RTL_SPLAY_LINKS *Parent;
|
struct _RTL_SPLAY_LINKS *Parent;
|
||||||
|
|
Loading…
Reference in a new issue