51 DPRINT1(
"Index Allocation is empty.\n");
69 DPRINT1(
"ERROR: Fixing fixup failed!\n");
76 CurrentOffset += NodeSize;
119 ULONG IndexBufferSize,
121 ULONG IndexAllocationOffset,
126 ULONGLONG IndexAllocationLength, BitmapLength;
136 DPRINT(
"AllocateIndexNode(%p, %p, %lu, %p, %lu, %p) called.\n", DeviceExt,
140 IndexAllocationOffset,
156 DPRINT1(
"FIXME: Need to add bitmap attribute!\n");
163 NextNodeNumber = IndexAllocationLength / DeviceExt->NtfsInfo.BytesPerIndexRecord;
170 BytesNeeded = NextNodeNumber / 8;
181 DPRINT1(
"Error: failed to allocate bitmap!");
198 if (BytesNeeded > BitmapLength)
203 if (BitmapCtx->pRecord->IsNonResident)
221 DPRINT1(
"ERROR: Failed to set length of bitmap attribute!\n");
228 DataSize.QuadPart = IndexAllocationLength + IndexBufferSize;
231 IndexAllocationOffset,
236 DPRINT1(
"ERROR: Failed to set length of index allocation!\n");
245 DPRINT1(
"ERROR: Failed to update file record!\n");
263 DPRINT1(
"ERROR: Unable to write to $I30 bitmap attribute!\n");
268 if (IndexBufferSize < DeviceExt->NtfsInfo.BytesPerCluster)
269 *NewVCN = NextNodeNumber * (IndexBufferSize / DeviceExt->NtfsInfo.BytesPerSector);
271 *NewVCN = NextNodeNumber * (IndexBufferSize / DeviceExt->NtfsInfo.BytesPerCluster);
273 DPRINT(
"New VCN: %I64u\n", *NewVCN);
307 DPRINT1(
"Couldn't allocate memory for dummy key index entry!\n");
329 DPRINT1(
"Unable to allocate dummy key!\n");
359 DPRINT(
"CreateEmptyBTree(%p) called\n", NewTree);
363 DPRINT1(
"Couldn't allocate enough memory for B-Tree!\n");
375 DPRINT1(
"ERROR: Failed to create dummy key!\n");
494 while (Current !=
NULL)
512 ULONG CurrentEntryOffset = 0;
514 ULONG IndexBufferSize =
Vcb->NtfsInfo.BytesPerIndexRecord;
521 if (IndexAllocationAttributeCtx ==
NULL)
523 DPRINT1(
"ERROR: Couldn't find index allocation attribute even though there should be one!\n");
534 DPRINT1(
"ERROR: Couldn't allocate memory for new filename node.\n");
543 DPRINT1(
"ERROR: Failed to allocate memory for key!\n");
554 DPRINT1(
"ERROR: Couldn't allocate memory for node buffer!\n");
567 IndexAllocationAttributeCtx,
580 DPRINT1(
"ERROR: Couldn't apply fixup array to index node buffer!\n");
590 CurrentNodeEntry = FirstNodeEntry;
591 while (CurrentEntryOffset < NodeBuffer->
Header.TotalSizeOfEntries)
597 DPRINT1(
"ERROR: Couldn't allocate memory for next key!\n");
612 DPRINT1(
"ERROR: Couldn't allocate memory for next key!\n");
630 IndexAllocationAttributeCtx,
634 CurrentKey = NextKey;
647 IndexAllocationAttributeCtx,
655 CurrentEntryOffset += CurrentNodeEntry->
Length;
702 DPRINT(
"CreateBTreeFromIndex(%p, %p)\n", IndexRoot, NewTree);
706 DPRINT1(
"Couldn't allocate enough memory for B-Tree!\n");
726 &IndexAllocationContext,
729 IndexAllocationContext =
NULL;
738 DPRINT1(
"Filesystem corruption detected!\n");
750 while (CurrentOffset < IndexRoot->
Header.TotalSizeOfEntries)
756 DPRINT1(
"ERROR: Couldn't allocate memory for next key!\n");
771 DPRINT1(
"ERROR: Couldn't allocate memory for next key!\n");
791 IndexAllocationContext,
795 DPRINT1(
"ERROR: Couldn't create child node!\n");
803 CurrentOffset += CurrentNodeEntry->
Length;
805 CurrentKey = NextKey;
819 IndexAllocationContext,
823 DPRINT1(
"ERROR: Couldn't create child node!\n");
838 if (IndexAllocationContext)
868 for (
i = 0;
i <
Node->KeyCount;
i++)
874 CurrentKey = CurrentKey->
NextKey;
925 DeviceExt->NtfsInfo.BytesPerFileRecord,
928 DPRINT(
"CreateIndexRootFromBTree(%p, %p, 0x%lx, %p, %p)\n", DeviceExt,
Tree, MaxIndexSize, IndexRoot,
Length);
936 DPRINT1(
"Failed to allocate memory for Index Root!\n");
941 RtlZeroMemory(NewIndexRoot, DeviceExt->NtfsInfo.BytesPerFileRecord);
945 NewIndexRoot->
SizeOfEntry = DeviceExt->NtfsInfo.BytesPerIndexRecord;
947 if (NewIndexRoot->
SizeOfEntry < DeviceExt->NtfsInfo.BytesPerCluster)
960 CurrentKey =
Tree->RootNode->FirstKey;
964 for (
i = 0;
i <
Tree->RootNode->KeyCount;
i++)
968 if (IndexSize > MaxIndexSize)
970 DPRINT1(
"TODO: Adding file would require creating an attribute list!\n");
980 DPRINT(
"Index Node Entry Stream Length: %u\nIndex Node Entry Length: %u\n",
982 CurrentNodeEntry->
Length);
994 CurrentKey = CurrentKey->
NextKey;
999 *IndexRoot = NewIndexRoot;
1035 CurrentKey =
Node->FirstKey;
1038 for (
i = 0;
i <
Node->KeyCount;
i++)
1043 + CurrentNodeEntry->
Length;
1046 DPRINT1(
"TODO: Adding file would require creating a new node!\n");
1055 DPRINT(
"Index Node Entry Stream Length: %u\nIndex Node Entry Length: %u\n",
1057 CurrentNodeEntry->
Length);
1068 CurrentKey = CurrentKey->
NextKey;
1099 DPRINT(
"Collapsing Index Root into sub-node.\n");
1109 DPRINT1(
"ERROR: Couldn't allocate memory for new sub-node.\n");
1123 DPRINT1(
"ERROR: Couldn't allocate memory for new root node.\n");
1135 DPRINT1(
"ERROR: Couldn't allocate memory for new index root.\n");
1150 Tree->RootNode = NewIndexRoot;
1189 ULONG IndexBufferSize,
1198 ULONG IndexAllocationOffset;
1200 DPRINT(
"UpdateIndexAllocation() called.\n");
1205 HasIndexAllocation =
TRUE;
1209 IndexAllocationContext,
1214 CurrentKey =
Tree->RootNode->FirstKey;
1215 for (
i = 0;
i <
Tree->RootNode->KeyCount;
i++)
1219 if (!HasIndexAllocation)
1223 DPRINT(
"Adding index allocation...\n");
1233 DPRINT1(
"ERROR: Failed to add index allocation!\n");
1241 DPRINT1(
"ERROR: Couldn't find newly-created index allocation!\n");
1256 DPRINT1(
"ERROR: Failed to add index bitmap!\n");
1261 HasIndexAllocation =
TRUE;
1273 DPRINT1(
"ERROR: Unable to allocate memory for new index entry!\n");
1274 if (HasIndexAllocation)
1295 DPRINT1(
"ERROR: Failed to update index node!\n");
1303 CurrentKey = CurrentKey->
NextKey;
1310 if (HasIndexAllocation)
1314 IndexAllocationContext,
1327 ULONG IndexBufferSize,
1329 ULONG IndexAllocationOffset)
1337 DPRINT(
"UpdateIndexNode(%p, %p, %p, %lu, %p, %lu) called for index node with VCN %I64u\n",
1342 IndexAllocationContext,
1343 IndexAllocationOffset,
1347 for (
i = 0;
i <
Node->KeyCount;
i++)
1360 DPRINT1(
"ERROR: Failed to update child node!\n");
1373 DPRINT1(
"ERROR: Unable to allocate memory for new index entry!\n");
1394 CurrentKey = CurrentKey->
NextKey;
1399 if (
Node->DiskNeedsUpdating)
1402 ULONG LengthWritten;
1406 if (!
Node->HasValidVCN)
1412 IndexAllocationContext,
1413 IndexAllocationOffset,
1417 DPRINT1(
"ERROR: Failed to allocate index record in index allocation!\n");
1428 DPRINT1(
"ERROR: Failed to allocate %lu bytes for index buffer!\n", IndexBufferSize);
1436 DPRINT1(
"ERROR: Failed to create index buffer from node!\n");
1445 Status =
WriteAttribute(DeviceExt, IndexAllocationContext, NodeOffset, (
const PUCHAR)IndexBuffer, IndexBufferSize, &LengthWritten, FileRecord);
1448 DPRINT1(
"ERROR: Failed to update index allocation!\n");
1476 DPRINT1(
"ERROR: Failed to allocate memory for Index Entry!\n");
1493 DPRINT1(
"ERROR: Failed to allocate memory for new key!\n");
1508 if (
Key->IndexEntry)
1511 if (
Key->LesserChild)
1523 for (
i = 0;
i <
Node->KeyCount;
i++)
1526 NextKey = CurrentKey->
NextKey;
1528 CurrentKey = NextKey;
1579 if (
Key->LesserChild)
1584 DPRINT1(
"DRIVER ERROR: No Key->LesserChild despite Key->IndexEntry->Flags indicating this is a node!\n");
1601 if (
Node->HasValidVCN)
1606 DbgPrint(
" NOT ASSIGNED VCN YET\n");
1608 CurrentKey =
Node->FirstKey;
1609 for (
i = 0;
i <
Node->KeyCount;
i++)
1612 CurrentKey = CurrentKey->
NextKey;
1638 ULONG IndexBufferSize,
1641 if (IndexBufferSize < DeviceExt->NtfsInfo.BytesPerCluster)
1642 return Vcn * DeviceExt->NtfsInfo.BytesPerSector;
1644 return Vcn * DeviceExt->NtfsInfo.BytesPerCluster;
1703 ULONG MaxIndexRootSize,
1704 ULONG IndexRecordSize,
1711 ULONG AllocatedNodeSize;
1712 ULONG MaxNodeSizeWithoutHeader;
1716 *NewRightHandSibling =
NULL;
1718 DPRINT(
"NtfsInsertKey(%p, 0x%I64x, %p, %p, %s, %lu, %lu, %p, %p)\n",
1723 CaseSensitive ?
"TRUE" :
"FALSE",
1727 NewRightHandSibling);
1735 CurrentKey =
Node->FirstKey;
1737 for (
i = 0;
i <
Node->KeyCount;
i++)
1744 if (Comparison == 0)
1746 DPRINT1(
"Refusing duplicate index entry '%.*S' (existing file reference 0x%I64x)\n",
1777 DPRINT1(
"ERROR: Failed to insert key.\n");
1788 NewLeftKey->
NextKey = CurrentKey;
1792 Node->FirstKey = NewLeftKey;
1794 PreviousKey->
NextKey = NewLeftKey;
1817 if (CurrentKey ==
Node->FirstKey)
1818 Node->FirstKey = NewKey;
1820 PreviousKey->
NextKey = NewKey;
1825 PreviousKey = CurrentKey;
1826 CurrentKey = CurrentKey->
NextKey;
1839 MaxNodeSizeWithoutHeader = AllocatedNodeSize - 0x28;
1842 if (NodeSize > MaxNodeSizeWithoutHeader)
1849 DPRINT1(
"ERROR: Failed to split B-Tree node!\n");
1897 *PreviousKey =
NULL;
1900 while (CurrentKey !=
NULL &&
1903 BeforePrevious = Previous;
1904 Previous = CurrentKey;
1905 CurrentKey = CurrentKey->
NextKey;
1912 if (*LargestKey !=
NULL)
1917 if (Previous ==
NULL)
1921 *PreviousKey = BeforePrevious;
1922 *LargestKey = Previous;
1958 DPRINT1(
"ERROR: Failed to allocate memory for replacement index entry!\n");
1970 Key->IndexEntry = NewEntry;
2013 if (LargestKey !=
NULL)
2028 if (PreviousKey ==
NULL)
2029 Node->FirstKey =
Key->NextKey;
2075 for (
i = 0;
i <
Node->KeyCount;
i++)
2079 if (CurrentKey ==
NULL)
2087 if (Comparison == 0)
2094 PreviousKey = CurrentKey;
2095 CurrentKey = CurrentKey->
NextKey;
2144 ULONG MedianKeyIndex;
2145 PB_TREE_KEY LastKeyBeforeMedian, FirstKeyAfterMedian;
2151 DPRINT(
"SplitBTreeNode(%p, %p, %p, %p, %s) called\n",
2155 NewRightHandSibling,
2156 CaseSensitive ?
"TRUE" :
"FALSE");
2164 if (*NewRightHandSibling ==
NULL)
2166 DPRINT1(
"Error: Failed to allocate memory for right hand sibling!\n");
2170 (*NewRightHandSibling)->DiskNeedsUpdating =
TRUE;
2191 LastKeyBeforeMedian =
Node->FirstKey;
2195 for (
i = 0;
i <
Node->KeyCount;
i++)
2199 if (SizeSum > HalfSize)
2203 LastKeyBeforeMedian = LastKeyBeforeMedian->
NextKey;
2207 *MedianKey = LastKeyBeforeMedian->
NextKey;
2208 FirstKeyAfterMedian = (*MedianKey)->
NextKey;
2210 DPRINT(
"%lu keys, %lu median\n",
Node->KeyCount, MedianKeyIndex);
2211 DPRINT(
"\t\tMedian: %.*S\n", (*MedianKey)->IndexEntry->FileName.NameLength, (*MedianKey)->IndexEntry->FileName.Name);
2219 DPRINT1(
"Error: Couldn't allocate dummy key!\n");
2220 LastKeyBeforeMedian->
NextKey = *MedianKey;
2229 LastKeyBeforeMedian->
NextKey->LesserChild = (*MedianKey)->LesserChild;
2238 (*MedianKey)->IndexEntry->Length +
sizeof(
ULONGLONG),
2242 DPRINT1(
"Unable to allocate memory for new index entry!\n");
2243 LastKeyBeforeMedian->
NextKey = *MedianKey;
2253 (*MedianKey)->IndexEntry = NewIndexEntry;
2263 (*MedianKey)->LesserChild =
Node;
2267 Node->KeyCount = MedianKeyIndex + 2;
2273 (*NewRightHandSibling)->FirstKey = FirstKeyAfterMedian;
2274 (*NewRightHandSibling)->KeyCount =
CountBTreeKeys(FirstKeyAfterMedian);
2277 DPRINT1(
"Left-hand node after split:\n");
2280 DPRINT1(
"Right-hand sibling node after split:\n");
#define ALIGN_UP_BY(size, align)
struct NTFS_ATTR_RECORD * PNTFS_ATTR_RECORD
#define NTFS_INDEX_ENTRY_NODE
#define NTFS_INDEX_ENTRY_END
VOID DumpBTreeNode(PB_TREE Tree, PB_TREE_FILENAME_NODE Node, ULONG Number, ULONG Depth)
PB_TREE_FILENAME_NODE CreateBTreeNodeFromIndexNode(PDEVICE_EXTENSION Vcb, PINDEX_ROOT_ATTRIBUTE IndexRoot, PNTFS_ATTR_CONTEXT IndexAllocationAttributeCtx, PINDEX_ENTRY_ATTRIBUTE NodeEntry)
ULONG CountBTreeKeys(PB_TREE_KEY FirstKey)
VOID DestroyBTreeNode(PB_TREE_FILENAME_NODE Node)
NTSTATUS CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER FileRecordWithIndex, PNTFS_ATTR_CONTEXT IndexRootContext, PINDEX_ROOT_ATTRIBUTE IndexRoot, PB_TREE *NewTree)
NTSTATUS NtfsRemoveKey(PB_TREE_FILENAME_NODE Node, PB_TREE_KEY SearchKey, BOOLEAN CaseSensitive)
LONG CompareTreeKeys(PB_TREE_KEY Key1, PB_TREE_KEY Key2, BOOLEAN CaseSensitive)
NTSTATUS SplitBTreeNode(PB_TREE Tree, PB_TREE_FILENAME_NODE Node, PB_TREE_KEY *MedianKey, PB_TREE_FILENAME_NODE *NewRightHandSibling, BOOLEAN CaseSensitive)
VOID DestroyBTreeKey(PB_TREE_KEY Key)
NTSTATUS AllocateIndexNode(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, ULONG IndexBufferSize, PNTFS_ATTR_CONTEXT IndexAllocationCtx, ULONG IndexAllocationOffset, PULONGLONG NewVCN)
static VOID FindLargestKeyInSubtree(PB_TREE_FILENAME_NODE Node, PB_TREE_FILENAME_NODE *OwnerNode, PB_TREE_KEY *PreviousKey, PB_TREE_KEY *LargestKey)
ULONGLONG GetIndexEntryVCN(PINDEX_ENTRY_ATTRIBUTE IndexEntry)
NTSTATUS NtfsInsertKey(PB_TREE Tree, ULONGLONG FileReference, PFILENAME_ATTRIBUTE FileNameAttribute, PB_TREE_FILENAME_NODE Node, BOOLEAN CaseSensitive, ULONG MaxIndexRootSize, ULONG IndexRecordSize, PB_TREE_KEY *MedianKey, PB_TREE_FILENAME_NODE *NewRightHandSibling)
static NTSTATUS ReplaceKeyIndexEntry(PB_TREE_KEY Key, PB_TREE_KEY Source)
ULONGLONG GetAllocationOffsetFromVCN(PDEVICE_EXTENSION DeviceExt, ULONG IndexBufferSize, ULONGLONG Vcn)
NTSTATUS UpdateIndexAllocation(PDEVICE_EXTENSION DeviceExt, PB_TREE Tree, ULONG IndexBufferSize, PFILE_RECORD_HEADER FileRecord)
VOID DestroyBTree(PB_TREE Tree)
VOID PrintAllVCNs(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT IndexAllocationContext, ULONG NodeSize)
static NTSTATUS RemoveKeyFromNode(PB_TREE_FILENAME_NODE Node, PB_TREE_KEY PreviousKey, PB_TREE_KEY Key)
NTSTATUS CreateIndexBufferFromBTreeNode(PDEVICE_EXTENSION DeviceExt, PB_TREE_FILENAME_NODE Node, ULONG BufferSize, BOOLEAN HasChildren, PINDEX_BUFFER IndexBuffer)
NTSTATUS DemoteBTreeRoot(PB_TREE Tree)
ULONG GetSizeOfIndexEntries(PB_TREE_FILENAME_NODE Node)
PB_TREE_KEY CreateDummyKey(BOOLEAN HasChildNode)
VOID DumpBTree(PB_TREE Tree)
NTSTATUS CreateEmptyBTree(PB_TREE *NewTree)
NTSTATUS CreateIndexRootFromBTree(PDEVICE_EXTENSION DeviceExt, PB_TREE Tree, ULONG MaxIndexSize, PINDEX_ROOT_ATTRIBUTE *IndexRoot, ULONG *Length)
VOID SetIndexEntryVCN(PINDEX_ENTRY_ATTRIBUTE IndexEntry, ULONGLONG VCN)
PB_TREE_KEY CreateBTreeKeyFromFilename(ULONGLONG FileReference, PFILENAME_ATTRIBUTE FileNameAttribute)
NTSTATUS UpdateIndexNode(PDEVICE_EXTENSION DeviceExt, PFILE_RECORD_HEADER FileRecord, PB_TREE_FILENAME_NODE Node, ULONG IndexBufferSize, PNTFS_ATTR_CONTEXT IndexAllocationContext, ULONG IndexAllocationOffset)
VOID DumpBTreeKey(PB_TREE Tree, PB_TREE_KEY Key, ULONG Number, ULONG Depth)
#define STATUS_NOT_IMPLEMENTED
#define RtlInitializeBitMap
#define NT_SUCCESS(StatCode)
static const WCHAR Cleanup[]
ULONG GetFileNameAttributeLength(PFILENAME_ATTRIBUTE FileNameAttribute)
NTSTATUS AddBitmap(PNTFS_VCB Vcb, PFILE_RECORD_HEADER FileRecord, PNTFS_ATTR_RECORD AttributeAddress, PCWSTR Name, USHORT NameLength)
NTSTATUS AddIndexAllocation(PNTFS_VCB Vcb, PFILE_RECORD_HEADER FileRecord, PNTFS_ATTR_RECORD AttributeAddress, PCWSTR Name, USHORT NameLength)
struct INDEX_BUFFER * PINDEX_BUFFER
struct INDEX_ENTRY_ATTRIBUTE * PINDEX_ENTRY_ATTRIBUTE
#define COLLATION_FILE_NAME
@ AttributeIndexAllocation
#define ATTR_RECORD_ALIGNMENT
#define ExAllocatePoolWithTag(hernya, size, tag)
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define BooleanFlagOn(F, SF)
struct _FileName FileName
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
PCONFIGURATION_COMPONENT_DATA RootNode
NTSTATUS UpdateFileRecord(PDEVICE_EXTENSION Vcb, ULONGLONG MftIndex, PFILE_RECORD_HEADER FileRecord)
VOID ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
ULONGLONG AttributeDataLength(PNTFS_ATTR_RECORD AttrRecord)
NTSTATUS FindAttribute(PDEVICE_EXTENSION Vcb, PFILE_RECORD_HEADER MftRecord, ULONG Type, PCWSTR Name, ULONG NameLength, PNTFS_ATTR_CONTEXT *AttrCtx, PULONG Offset)
ULONG ReadAttribute(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, PCHAR Buffer, ULONG Length)
NTSTATUS WriteAttribute(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT Context, ULONGLONG Offset, const PUCHAR Buffer, ULONG Length, PULONG RealLengthWritten, PFILE_RECORD_HEADER FileRecord)
NTSTATUS AddFixupArray(PDEVICE_EXTENSION Vcb, PNTFS_RECORD_HEADER Record)
NTSTATUS SetNonResidentAttributeDataLength(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT AttrContext, ULONG AttrOffset, PFILE_RECORD_HEADER FileRecord, PLARGE_INTEGER DataSize)
NTSTATUS SetResidentAttributeDataLength(PDEVICE_EXTENSION Vcb, PNTFS_ATTR_CONTEXT AttrContext, ULONG AttrOffset, PFILE_RECORD_HEADER FileRecord, PLARGE_INTEGER DataSize)
NTSTATUS FixupUpdateSequenceArray(PDEVICE_EXTENSION Vcb, PNTFS_RECORD_HEADER Record)
#define ExFreePoolWithTag(_P, _T)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
__GNU_EXTENSION typedef unsigned __int64 * PULONGLONG
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define STATUS_END_OF_FILE
INDEX_HEADER_ATTRIBUTE Header
union INDEX_ENTRY_ATTRIBUTE::@970 Data
struct INDEX_ENTRY_ATTRIBUTE::@970::@971 Directory
FILENAME_ATTRIBUTE FileName
INDEX_HEADER_ATTRIBUTE Header
UCHAR ClustersPerIndexRecord
BOOLEAN DiskNeedsUpdating
struct _B_TREE_KEY * NextKey
B_TREE_FILENAME_NODE * LesserChild
PINDEX_ENTRY_ATTRIBUTE IndexEntry
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_FILE_CORRUPT_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
#define ALIGN_UP(size, type)
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesWritten
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR _In_opt_ PLONGLONG _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_opt_ PULONG_PTR BytesRead