Difference between revisions of "Unit NTFSUtils"

From Ultibo.org
Jump to: navigation, search
Line 45: Line 45:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 57: Line 57:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 72: Line 72:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Buffer'''
+
! Buffer
 
| Buffer must always be a full compression unit in size
 
| Buffer must always be a full compression unit in size
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the size of a cluster
 
| Size is the size of a cluster
 
|-
 
|-
! '''Shift'''
+
! Shift
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must have confirmed that the unit is compressed
 
| Caller must have confirmed that the unit is compressed
 
|-
 
|-
Line 93: Line 93:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Source'''
+
! Source
 
| Source buffer contains the uncompressed data on entry
 
| Source buffer contains the uncompressed data on entry
 
Source buffer must always be a full compression unit in size
 
Source buffer must always be a full compression unit in size
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| Dest buffer will contain the compressed data on exit
 
| Dest buffer will contain the compressed data on exit
 
Dest buffer must always be a full compression unit in size
 
Dest buffer must always be a full compression unit in size
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the size of a cluster
 
| Size is the size of a cluster
 
|-
 
|-
! '''Shift'''
+
! Shift
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
|-
 
|-
! '''Start'''
+
! Start
 
| Start is the starting cluster for the compression (zero to start at the first cluster)
 
| Start is the starting cluster for the compression (zero to start at the first cluster)
 
|-
 
|-
! '''Count'''
+
! Count
 
| Count is the number of clusters to be compressed
 
| Count is the number of clusters to be compressed
 
|-
 
|-
! '''Total'''
+
! Total
 
| Total is the number of bytes to be compressed (from start) (may be less than a full unit)
 
| Total is the number of bytes to be compressed (from start) (may be less than a full unit)
 
|-
 
|-
! '''Note'''
+
! Note
 
| Compress block will detect an uncompressable block as the final length after compression will be greater than 4096 in length. If compress block reaches the end of the dest buffer then it will fail the compress block and compress unit and the whole unit will be considered as uncompressable. If the data available for the block is less then 4096 then it may grow after compression but will not be marked as uncompressed unless it exceeds 4096 bytes.
 
| Compress block will detect an uncompressable block as the final length after compression will be greater than 4096 in length. If compress block reaches the end of the dest buffer then it will fail the compress block and compress unit and the whole unit will be considered as uncompressable. If the data available for the block is less then 4096 then it may grow after compression but will not be marked as uncompressed unless it exceeds 4096 bytes.
 
|-
 
|-
Line 128: Line 128:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Source'''
+
! Source
 
| Source buffer contains the compressed data on entry
 
| Source buffer contains the compressed data on entry
 
Source buffer must always be a full compression unit in size
 
Source buffer must always be a full compression unit in size
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| Dest buffer will contain the uncompressed data on exit
 
| Dest buffer will contain the uncompressed data on exit
 
Dest buffer must always be a full compression unit in size
 
Dest buffer must always be a full compression unit in size
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the size of a cluster
 
| Size is the size of a cluster
 
|-
 
|-
! '''Shift'''
+
! Shift
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
| Shift is the cluster to compression unit shift count (Usually 4)
 
|-
 
|-
! '''Start'''
+
! Start
 
| Start is the starting cluster for the decompression (zero to start at the first cluster)
 
| Start is the starting cluster for the decompression (zero to start at the first cluster)
 
|-
 
|-
! '''Count'''
+
! Count
 
| Count is the number of blocks to be decompressed
 
| Count is the number of blocks to be decompressed
 
|-
 
|-
! '''Total'''
+
! Total
 
| Total is the number of bytes to be decompressed (from start) (may be less than a full unit)
 
| Total is the number of bytes to be decompressed (from start) (may be less than a full unit)
 
|-
 
|-
! '''Note'''
+
! Note
 
| Caller must have confirmed that the unit is compressed
 
| Caller must have confirmed that the unit is compressed
 
|-
 
|-
Line 163: Line 163:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the size of a cluster
 
| Size is the size of a cluster
 
|-
 
|-
Line 175: Line 175:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Source'''
+
! Source
 
| Source buffer contains the uncompressed data on entry
 
| Source buffer contains the uncompressed data on entry
 
Source buffer must have at least one 4k block available
 
Source buffer must have at least one 4k block available
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| Dest buffer will contain the compressed data on exit
 
| Dest buffer will contain the compressed data on exit
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the available bytes in the dest buffer
 
| Size is the available bytes in the dest buffer
 
|-
 
|-
! '''Total'''
+
! Total
 
| Total is the number of bytes to be compressed (may be less than a full block)
 
| Total is the number of bytes to be compressed (may be less than a full block)
 
|-
 
|-
! '''Note'''
+
! Note
 
| Compress block will detect an uncompressable block as the final length after compression will be greater than 4096 in length. If compress block reaches the end of the dest buffer then it will fail the compress block and compress unit and the whole unit will be considered as uncompressable. If the data available for the block is less then 4096 then it may grow after compression but will not be marked as uncompressed unless it exceeds 4096 bytes.
 
| Compress block will detect an uncompressable block as the final length after compression will be greater than 4096 in length. If compress block reaches the end of the dest buffer then it will fail the compress block and compress unit and the whole unit will be considered as uncompressable. If the data available for the block is less then 4096 then it may grow after compression but will not be marked as uncompressed unless it exceeds 4096 bytes.
 
|-
 
|-
Line 200: Line 200:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Source'''
+
! Source
 
| Source buffer contains the compressed data on entry
 
| Source buffer contains the compressed data on entry
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| Dest buffer will contain the uncompressed data on exit
 
| Dest buffer will contain the uncompressed data on exit
 
Dest buffer must have at least one 4k block available
 
Dest buffer must have at least one 4k block available
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the available bytes in the source buffer
 
| Size is the available bytes in the source buffer
 
|-
 
|-
Line 219: Line 219:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Offset'''
+
! Offset
 
| Offset is the offset into the uncompressed data at the point of the tag
 
| Offset is the offset into the uncompressed data at the point of the tag
 
|-
 
|-
Line 234: Line 234:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 246: Line 246:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 258: Line 258:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 270: Line 270:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 282: Line 282:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 297: Line 297:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Size'''
+
! Size
 
| Size is the length of the Name in characters (WideChar or Word)
 
| Size is the length of the Name in characters (WideChar or Word)
 
|-
 
|-
! '''UpCase'''
+
! UpCase
 
| UpCase is the UpCase conversion table from NTFS volume or defaults
 
| UpCase is the UpCase conversion table from NTFS volume or defaults
 
|-
 
|-
Line 312: Line 312:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 327: Line 327:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 339: Line 339:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 354: Line 354:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 366: Line 366:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 378: Line 378:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 390: Line 390:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 402: Line 402:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 414: Line 414:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 429: Line 429:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 441: Line 441:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 456: Line 456:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 468: Line 468:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 480: Line 480:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 492: Line 492:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 504: Line 504:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 516: Line 516:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 528: Line 528:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 540: Line 540:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 552: Line 552:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 564: Line 564:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 576: Line 576:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 588: Line 588:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 600: Line 600:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 612: Line 612:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-
Line 624: Line 624:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
 
| None documented
 
| None documented
 
|-
 
|-

Revision as of 03:50, 24 April 2018

Return to Unit Reference


Description


Ultibo NTFS utilities unit

To be documented

Constants


None defined

Type definitions


None defined

Public variables



NTFS specific variables

UpCase:PNTFSUpCaseData = nil; A default $UpCase table


Function declarations



NTFS support functions

[Expand]
function NTFSInitUpCase:Boolean;
Description: To be documented


[Expand]
function NTFSGetUpCase:PNTFSUpCaseData;
Description: To be documented


NTFS compression functions

[Expand]
function NTFSGetUnitUsed(ABuffer:Pointer; ASize,AShift:LongWord):LongWord;
Description: Get the actual size consumed by the compressed data in the unit


[Expand]
function NTFSCompressUnit(ASource,ADest:Pointer; ASize,AShift,AStart,ACount,ATotal:LongWord):Boolean;
Description: Compress a unit of data from source to dest buffers


[Expand]
function NTFSDecompressUnit(ASource,ADest:Pointer; ASize,AShift,AStart,ACount,ATotal:LongWord):Boolean;
Description: Decompress a unit (or partial unit) of data from source to dest buffers


[Expand]
function NTFSGetBlockShift(ASize:LongWord):LongWord;
Description: Get the shift count for cluster to 4k block conversion


[Expand]
function NTFSCompressBlock(ASource,ADest:Pointer; ASize,ATotal:LongWord):Boolean;
Description: Compress a 4k block of data from source to dest buffers


[Expand]
function NTFSDecompressBlock(ASource,ADest:Pointer; ASize:LongWord):Boolean;
Description: Decompress a 4k block of data from source to dest buffers


[Expand]
function NTFSGetTagShiftMask(AOffset:LongWord; var AMask,AShift:Word):Boolean;
Description: Get the Mask bits and Shift count for Tag encode and decode based on the offset


NTFS string functions

[Expand]
function NTFSBufferToString(ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):String;
Description: To be documented


[Expand]
function NTFSStringToBuffer(const AString:String; ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):Boolean;
Description: To be documented


[Expand]
function NTFSWideBufferToString(ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):String;
Description: To be documented


[Expand]
function NTFSStringToWideBuffer(const AString:String; ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):Boolean;
Description: To be documented


[Expand]
function NTFSTypeToString(AType:TNTFSType):String;
Description: To be documented


NTFS hash functions

[Expand]
function NTFSGenerateNameHash(AName:PWideChar; ASize:Integer; AUpCase:PNTFSUpCaseData):LongWord;
Description: To be documented


[Expand]
function NTFSGenerateSecurityHash(ADescriptor:Pointer; ASize:LongWord):LongWord;
Description: To be documented


NTFS SID functions

[Expand]
function NTFSCreateDefaultSid(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSDestroyDefaultSid(ASid:Pointer; AVersion:Word):Boolean;
Description: To be documented


NTFS descriptor functions

[Expand]
function NTFSCreateDefaultDescriptor(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSCreateInheritedDescriptor(AParent:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSCreateMergedDescriptor(AParent,AChild:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSDestroyDefaultDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSDestroyInheritedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented


[Expand]
function NTFSDestroyMergedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented


NTFS conversion functions

[Expand]
function NTFSAttributeNameToStreamName(AType:LongWord; const AName:String):String;
Description: Format Attribute Name as a Stream Name (eg :<Name>:<Type>)


[Expand]
function NTFSStreamNameToAttributeName(AType:LongWord; const AName:String):String;
Description: Extract Attribute Name from a Stream Name (eg :<Name>:<Type>)


NTFS rounding functions

[Expand]
function NTFSRoundWordTo8Bytes(AValue:Word):Word;
Description: To be documented


[Expand]
function NTFSRoundWordTo16Bytes(AValue:Word):Word;
Description: To be documented


[Expand]
function NTFSRoundWordTo512Bytes(AValue:Word):Word;
Description: To be documented


[Expand]
function NTFSRoundLongWordTo8Bytes(AValue:LongWord):LongWord;
Description: To be documented


[Expand]
function NTFSRoundLongWordTo16Bytes(AValue:LongWord):LongWord;
Description: To be documented


[Expand]
function NTFSRoundLongWordTo512Bytes(AValue:LongWord):LongWord;
Description: To be documented


[Expand]
function NTFSRoundQuadWordTo8Bytes(const AValue:Int64):Int64;
Description: To be documented


[Expand]
function NTFSRoundQuadWordTo16Bytes(const AValue:Int64):Int64;
Description: To be documented


[Expand]
function NTFSRoundQuadWordTo512Bytes(const AValue:Int64):Int64;
Description: To be documented


[Expand]
function NTFSRoundWordToUnitSize(AValue:Word; AShift,ASize:LongWord):Word;
Description: To be documented


[Expand]
function NTFSRoundLongWordToUnitSize(AValue,AShift,ASize:LongWord):LongWord;
Description: To be documented


[Expand]
function NTFSRoundQuadWordToUnitSize(const AValue:Int64; AShift,ASize:LongWord):Int64;
Description: To be documented


[Expand]
function NTFSRoundWordToClusterSize(AValue:Word;AShift,ASize:LongWord):Word;
Description: To be documented


[Expand]
function NTFSRoundLongWordToClusterSize(AValue,AShift,ASize:LongWord):LongWord;
Description: To be documented


[Expand]
function NTFSRoundQuadWordToClusterSize(const AValue:Int64; AShift,ASize:LongWord):Int64;
Description: To be documented


Return to Unit Reference