Difference between revisions of "Unit NTFSUtils"
From Ultibo.org
(12 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
---- | ---- | ||
− | '' | + | '''Ultibo NTFS Utilities unit''' |
=== Constants === | === Constants === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Type definitions === | === Type definitions === | ||
---- | ---- | ||
− | '' | + | ''None defined'' |
=== Public variables === | === Public variables === | ||
---- | ---- | ||
− | '' | + | |
+ | '''NTFS specific variables''' | ||
+ | |||
+ | {| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;" | ||
+ | |- | ||
+ | | <code>UpCase:PNTFSUpCaseData = nil;</code> | ||
+ | | style="width: 40%;"|A default $UpCase table | ||
+ | |- | ||
+ | |} | ||
+ | <br /> | ||
=== Function declarations === | === Function declarations === | ||
Line 34: | Line 43: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 46: | Line 55: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 61: | Line 70: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Buffer |
| Buffer must always be a full compression unit in size | | Buffer must always be a full compression unit in size | ||
|- | |- | ||
− | ! | + | ! Size |
| Size is the size of a cluster | | Size is the size of a cluster | ||
|- | |- | ||
− | ! | + | ! Shift |
| Shift is the cluster to compression unit shift count (Usually 4) | | Shift is the cluster to compression unit shift count (Usually 4) | ||
|- | |- | ||
− | ! | + | ! Note |
| Caller must have confirmed that the unit is compressed | | Caller must have confirmed that the unit is compressed | ||
|- | |- | ||
Line 82: | Line 91: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 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 is the size of a cluster | | Size is the size of a cluster | ||
|- | |- | ||
− | ! | + | ! 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 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 is the number of clusters to be compressed | | Count is the number of clusters to be compressed | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 117: | Line 126: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 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 is the size of a cluster | | Size is the size of a cluster | ||
|- | |- | ||
− | ! | + | ! 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 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 is the number of blocks to be decompressed | | Count is the number of blocks to be decompressed | ||
|- | |- | ||
− | ! | + | ! 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 |
| Caller must have confirmed that the unit is compressed | | Caller must have confirmed that the unit is compressed | ||
|- | |- | ||
Line 152: | Line 161: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Size |
| Size is the size of a cluster | | Size is the size of a cluster | ||
|- | |- | ||
Line 164: | Line 173: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 buffer will contain the compressed data on exit | | Dest buffer will contain the compressed data on exit | ||
|- | |- | ||
− | ! | + | ! Size |
| Size is the available bytes in the dest buffer | | Size is the available bytes in the dest buffer | ||
|- | |- | ||
− | ! | + | ! 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 |
| 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 189: | Line 198: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Source |
| Source buffer contains the compressed data on entry | | Source buffer contains the compressed data on entry | ||
|- | |- | ||
− | ! | + | ! 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 is the available bytes in the source buffer | | Size is the available bytes in the source buffer | ||
|- | |- | ||
Line 208: | Line 217: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! 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 223: | Line 232: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 235: | Line 244: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 247: | Line 256: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 259: | Line 268: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! | + | ! Note |
| None documented | | None documented | ||
|- | |- | ||
Line 271: | Line 280: | ||
{| class="wikitable" style="font-size: 14px; background: white;" | {| class="wikitable" style="font-size: 14px; background: white;" | ||
|- | |- | ||
− | ! '''Note''' | + | ! Note |
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''NTFS hash functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSGenerateNameHash(AName:PWideChar; ASize:Integer; AUpCase:PNTFSUpCaseData):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Size | ||
+ | | Size is the length of the Name in characters (WideChar or Word) | ||
+ | |- | ||
+ | ! UpCase | ||
+ | | UpCase is the UpCase conversion table from NTFS volume or defaults | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSGenerateSecurityHash(ADescriptor:Pointer; ASize:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''NTFS SID functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSCreateDefaultSid(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSDestroyDefaultSid(ASid:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''NTFS descriptor functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSCreateDefaultDescriptor(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSCreateInheritedDescriptor(AParent:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSCreateMergedDescriptor(AParent,AChild:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSDestroyDefaultDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSDestroyInheritedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSDestroyMergedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''NTFS conversion functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSAttributeNameToStreamName(AType:LongWord; const AName:String):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Format Attribute Name as a Stream Name (eg :<Name>:<Type>)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSStreamNameToAttributeName(AType:LongWord; const AName:String):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Extract Attribute Name from a Stream Name (eg :<Name>:<Type>)</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''NTFS rounding functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundWordTo8Bytes(AValue:Word):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundWordTo16Bytes(AValue:Word):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundWordTo512Bytes(AValue:Word):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundLongWordTo8Bytes(AValue:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundLongWordTo16Bytes(AValue:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundLongWordTo512Bytes(AValue:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundQuadWordTo8Bytes(const AValue:Int64):Int64;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundQuadWordTo16Bytes(const AValue:Int64):Int64;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundQuadWordTo512Bytes(const AValue:Int64):Int64;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundWordToUnitSize(AValue:Word; AShift,ASize:LongWord):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundLongWordToUnitSize(AValue,AShift,ASize:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundQuadWordToUnitSize(const AValue:Int64; AShift,ASize:LongWord):Int64;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundWordToClusterSize(AValue:Word;AShift,ASize:LongWord):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundLongWordToClusterSize(AValue,AShift,ASize:LongWord):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
+ | | None documented | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function NTFSRoundQuadWordToClusterSize(const AValue:Int64; AShift,ASize:LongWord):Int64;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! Note | ||
| None documented | | None documented | ||
|- | |- |
Latest revision as of 05:39, 31 August 2021
Return to Unit Reference
Description
Ultibo NTFS Utilities unit
Constants
None defined
Type definitions
None defined
Public variables
NTFS specific variables
UpCase:PNTFSUpCaseData = nil;
|
A default $UpCase table |
Function declarations
NTFS support functions
function NTFSInitUpCase:Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSGetUpCase:PNTFSUpCaseData;
Description: To be documented
Note | None documented |
---|
NTFS compression functions
function NTFSGetUnitUsed(ABuffer:Pointer; ASize,AShift:LongWord):LongWord;
Description: Get the actual size consumed by the compressed data in the unit
Buffer | Buffer must always be a full compression unit in size |
---|---|
Size | Size is the size of a cluster |
Shift | Shift is the cluster to compression unit shift count (Usually 4) |
Note | Caller must have confirmed that the unit is compressed |
function NTFSCompressUnit(ASource,ADest:Pointer; ASize,AShift,AStart,ACount,ATotal:LongWord):Boolean;
Description: Compress a unit of data from source to dest buffers
Source | Source buffer contains the uncompressed data on entry
Source buffer must always be a full compression unit in size |
---|---|
Dest | Dest buffer will contain the compressed data on exit
Dest buffer must always be a full compression unit in size |
Size | Size is the size of a cluster |
Shift | Shift is the cluster to compression unit shift count (Usually 4) |
Start | Start is the starting cluster for the compression (zero to start at the first cluster) |
Count | Count is the number of clusters to be compressed |
Total | Total is the number of bytes to be compressed (from start) (may be less than a full unit) |
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. |
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
Source | Source buffer contains the compressed data on entry
Source buffer must always be a full compression unit in size |
---|---|
Dest | Dest buffer will contain the uncompressed data on exit
Dest buffer must always be a full compression unit in size |
Size | Size is the size of a cluster |
Shift | Shift is the cluster to compression unit shift count (Usually 4) |
Start | Start is the starting cluster for the decompression (zero to start at the first cluster) |
Count | Count is the number of blocks to be decompressed |
Total | Total is the number of bytes to be decompressed (from start) (may be less than a full unit) |
Note | Caller must have confirmed that the unit is compressed |
function NTFSGetBlockShift(ASize:LongWord):LongWord;
Description: Get the shift count for cluster to 4k block conversion
Size | Size is the size of a cluster |
---|
function NTFSCompressBlock(ASource,ADest:Pointer; ASize,ATotal:LongWord):Boolean;
Description: Compress a 4k block of data from source to dest buffers
Source | Source buffer contains the uncompressed data on entry
Source buffer must have at least one 4k block available |
---|---|
Dest | Dest buffer will contain the compressed data on exit |
Size | Size is the available bytes in the dest buffer |
Total | Total is the number of bytes to be compressed (may be less than a full block) |
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. |
function NTFSDecompressBlock(ASource,ADest:Pointer; ASize:LongWord):Boolean;
Description: Decompress a 4k block of data from source to dest buffers
Source | Source buffer contains the compressed data on entry |
---|---|
Dest | Dest buffer will contain the uncompressed data on exit
Dest buffer must have at least one 4k block available |
Size | Size is the available bytes in the source buffer |
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
Offset | Offset is the offset into the uncompressed data at the point of the tag |
---|
NTFS string functions
function NTFSBufferToString(ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):String;
Description: To be documented
Note | None documented |
---|
function NTFSStringToBuffer(const AString:String; ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSWideBufferToString(ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):String;
Description: To be documented
Note | None documented |
---|
function NTFSStringToWideBuffer(const AString:String; ABuffer:Pointer; AOffset:LongWord; ALength:LongWord):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSTypeToString(AType:TNTFSType):String;
Description: To be documented
Note | None documented |
---|
NTFS hash functions
function NTFSGenerateNameHash(AName:PWideChar; ASize:Integer; AUpCase:PNTFSUpCaseData):LongWord;
Description: To be documented
Size | Size is the length of the Name in characters (WideChar or Word) |
---|---|
UpCase | UpCase is the UpCase conversion table from NTFS volume or defaults |
function NTFSGenerateSecurityHash(ADescriptor:Pointer; ASize:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
NTFS SID functions
function NTFSCreateDefaultSid(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSDestroyDefaultSid(ASid:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
NTFS descriptor functions
function NTFSCreateDefaultDescriptor(AType:LongWord; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSCreateInheritedDescriptor(AParent:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSCreateMergedDescriptor(AParent,AChild:Pointer; var ACreated:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSDestroyDefaultDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSDestroyInheritedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
function NTFSDestroyMergedDescriptor(ADescriptor:Pointer; AVersion:Word):Boolean;
Description: To be documented
Note | None documented |
---|
NTFS conversion functions
function NTFSAttributeNameToStreamName(AType:LongWord; const AName:String):String;
Description: Format Attribute Name as a Stream Name (eg :<Name>:<Type>)
Note | None documented |
---|
function NTFSStreamNameToAttributeName(AType:LongWord; const AName:String):String;
Description: Extract Attribute Name from a Stream Name (eg :<Name>:<Type>)
Note | None documented |
---|
NTFS rounding functions
function NTFSRoundWordTo8Bytes(AValue:Word):Word;
Description: To be documented
Note | None documented |
---|
function NTFSRoundWordTo16Bytes(AValue:Word):Word;
Description: To be documented
Note | None documented |
---|
function NTFSRoundWordTo512Bytes(AValue:Word):Word;
Description: To be documented
Note | None documented |
---|
function NTFSRoundLongWordTo8Bytes(AValue:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
function NTFSRoundLongWordTo16Bytes(AValue:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
function NTFSRoundLongWordTo512Bytes(AValue:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
function NTFSRoundQuadWordTo8Bytes(const AValue:Int64):Int64;
Description: To be documented
Note | None documented |
---|
function NTFSRoundQuadWordTo16Bytes(const AValue:Int64):Int64;
Description: To be documented
Note | None documented |
---|
function NTFSRoundQuadWordTo512Bytes(const AValue:Int64):Int64;
Description: To be documented
Note | None documented |
---|
function NTFSRoundWordToUnitSize(AValue:Word; AShift,ASize:LongWord):Word;
Description: To be documented
Note | None documented |
---|
function NTFSRoundLongWordToUnitSize(AValue,AShift,ASize:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
function NTFSRoundQuadWordToUnitSize(const AValue:Int64; AShift,ASize:LongWord):Int64;
Description: To be documented
Note | None documented |
---|
function NTFSRoundWordToClusterSize(AValue:Word;AShift,ASize:LongWord):Word;
Description: To be documented
Note | None documented |
---|
function NTFSRoundLongWordToClusterSize(AValue,AShift,ASize:LongWord):LongWord;
Description: To be documented
Note | None documented |
---|
function NTFSRoundQuadWordToClusterSize(const AValue:Int64; AShift,ASize:LongWord):Int64;
Description: To be documented
Note | None documented |
---|
Return to Unit Reference