forked from project-jedi/jcl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNTFS.dtx
839 lines (832 loc) · 40.6 KB
/
NTFS.dtx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
@@TStreamId
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
NTFS file stream IDs which denote the kind of data stored in an NTFS stream.
Description:
NTFS file stream IDs which denote the kind of data stored in an NTFS stream.
Donator:
Marcel van Brakel
@@TStreamId.siInvalid
Invalid stream.
@@TStreamId.siStandard
Standard data stream.
@@TStreamId.siExtendedAttribute
Extended attribute data.
@@TStreamId.siSecurity
Security descriptor data.
@@TStreamId.siAlternate
Alternate data stream.
@@TStreamId.siHardLink
Hard link information stream.
@@TStreamId.siProperty
Property Data.
@@TStreamId.siObjectIdentifier
Object identifiers.
@@TStreamId.siReparsePoints
Reparse point.
@@TStreamId.siSparseFile
Sparse file.
@@TStreamIds
<GROUP FilesandIO.FileSystems.NTFS>
<COMBINE TStreamId>
--------------------------------------------------------------------------------
@@TFindStreamData
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Record type used by the NtfsFindFirstStream, NtfsFindNextStream and NtfsFindStreamClose functions which contains information about the streams in a NTFS file.
Description:
Record type used by the NtfsFindFirstStream, NtfsFindNextStream and NtfsFindStreamClose functions which contains information about the streams in a NTFS file.
Donator:
Marcel van Brakel
@@TFindStreamData.Internal
Internal data field used to store context - do not touch.
@@TFindStreamData.Attributes
Stream attributes (bit flags). can be one or more of the following values: <TABLE> <TR VALIGN="top"> <TH align=left width=36%>Value</TH> <TH align=left width=64%>Description</TH> </TR> <TR VALIGN="top"> <TD width=36%>STREAM_MODIFIED_WHEN_READ</TD> <TD width=64%>Attribute set if the stream contains data that is modified when read. Allows the backup application to know that verification of data will fail.</TD> </TR> <TR VALIGN="top"> <TD width=36%>STREAM_CONTAINS_SECURITY</TD> <TD width=64%>Stream contains security data (general attributes). Allows the stream to be ignored on cross-operations restore.</TD> </TR> </TABLE> Note that there are in fact a few more attributes but these are undocumented. Search WinBase for "Stream Attributes" to find them.
@@TFindStreamData.StreamID
Stream ID which denotes the type of data stored in the stream. See TStreamId for more information.
@@TFindStreamData.Name
Name of the stream or an empty string if the stream is unnamed.
@@TFindStreamData.Size
Size, in bytes, of the data part of the stream.
--------------------------------------------------------------------------------
@@NtfsFindFirstStream
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Starts the enumeration of streams in a file.
Description:
Use NtfsFindFirstStream to kick off the enumeration of streams in the specified file.
You can limit the enumeration to specific streams through the StreamIds set and
information about the first found stream is returned through the Data parameter.
Use NtfsFindStreamNext to continue the enumeration and NtfsFindStreamClose to end it.
Note that the enumeration of streams requires that the caller has the
SE_BACKUP_NAME and SE_RESTORE_NAME privileges. To avoid confusion, the streams
enumerated by this function are the kind of streams that have been supported by
the NTFS filesystem since its inception, not the kind of streams referred to
when one speaks of (COM) structured storage files.
Parameters:
FileName - The fully qualified name of the file for which to enumerate the streams it contains. The specified file must reside on an NTFS formatted volume.
StreamIds - Set of stream IDs which denotes which streams are enumerated. For more information about stream IDs see the documentation for TStreamIds.
Data - Record which, upon successful return, contains information about the first found stream. This information includes the stream name, size and attributes. For more information see the documentation for TFindStreamData.
Result:
If the function succeeds it returns True, if it fails it returns False. In the
latter case you can call GetLastError to retrieve more information about the
reason of failure. If the function succeeds you must eventually release the
context resources stored in the Data record by calling NtfsFindStreamClose. In case
of failure this is unnecessary (in fact FindStreamClose will return False).
Notes:
The set of functions for the enumeration of streams was adapted from the PSDK sample EnumStreams.
See also:
NtfsFindNextStream
NtfsFindStreamClose
TFindStreamData
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsFindNextStream
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns the next stream in a file.
Description:
NtfsFindNextStream returns the next stream which matched the conditions specified
in a previous call to FindFirstStream. The Data parameter must be the same
variable as the one specified in the call to NtfsFindFirstStream. When there are no
more streams in the file, the function fails and GetLastError returns
ERROR_NO_MORE_FILES. Note that if the function fails for this or any other
reason you must eventually call NtfsFindStreamClose to release the context resources
stored in the Data record.
Parameters:
Data - Record which, upon successful return, contains information about the next found stream. This information includes the stream name, size and attributes. For more information see the documentation for TFindStreamData.
Result:
If the function succeeds in finding another stream it returns True, otherwise it
returns False. In this latter case you can call GetLastError to retrieve detailed
information about the cause of failure.
See also:
NtfsFindFirstStream
NtfsFindStreamClose
TFindStreamData
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsFindStreamClose
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Terminates the enumeration of streams.
Description:
NtfsFindStreamClose terminates the enumeration of streams in a file initiated with
NtfsFindFirstStream and releases all context resources stored in the Data parameter.
It's important that if a previous call to NtfsFindFirstStream succeeds, you eventually
call this function regardless of what happens in the remainder of the enumeration.
Parameters:
Data - The TFindStreamData record returned from NtfsFindFirstStream.
Result:
If the function succeeds it returns True, otherwise it returns False. In the
latter case you can call GetLastError to retrieve the reason of failure.
Notes:
Note that if NtfsFindFirstStream fails there's no need to call this function because NtfsFindFirstStream performs the necessary cleanup. It is however, harmless to call this function anyway (though it will fail and GetLastError will return ERROR_INVALID_HANDLE).
See also:
NtfsFindFirstStream
NtfsFindNextStream
TFindStreamData
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsCreateJunctionPoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Creates an NTFS junction point.
Description:
A junction point is similar to a softlink as available in other operating systems
such as Linux. In a nutshell it is a directory which links to another directory.
As such the junction point itself doesn't contain any data but when accessed
redirects to another directory whose contents are accessed. The NtfsCreateJunctionPoint
routine transforms a normal, empty directory into a junction point. Junction
points are similar to volume mount points
except that as opposed to mounting a volume, they 'mount' a directory.
Parameters:
Source - Fully qualified path of the directory that is to be transformed into a juntion point. This directory must exist and be empty or the function fails.
Destination - Fully qualified name of the target directory for the mountpoint. Naturally it must exist but doesn't have to be empty.
Result:
If the function succeeds it returns True, otherwise it returns False. Upon failure you
can call GetLastError to get a more specific failure description. The most common
reason for failure is that either the Source doesn't exist or isn't empty or
that the destination directory doesn't exist.
See also:
NtfsDeleteJunctionPoint
NtfsGetJunctionPointDestination
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsDeleteJunctionPoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Deletes a junction point.
Description:
The NtfsDeleteJunctionPoint routine deletes the specified junction point. Note
that deletion in this context means that if the function succeeds the specified
Source is no longer a junction point (the reparse tag which identifies it as
a junction point is removed) but the directory itself will not be deleted, you'll
just have an ordinary, empty directory.
Parameters:
Source - The junction point to delete.
Result:
If the function succeeds it returns True, otherwise it returns False.
See also:
NtfsCreateJunctionPoint
NtfsGetJunctionPointDestination
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsGetJunctionPointDestination
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns the destination directory of a junction point.
Description:
NtfsGetJunctionPointDestination returns the destinaton of a junction point. That
is, it returns the directory to which Source is 'mounted'. Note that the returned
directory string is prefixed with '\??'.
Parameters:
Source - The junction point for which to retrieve the destination.
Destination - Receives the destination of the junction point.
Result:
If the function succeeds it returns True, otherwise it returns False. In the latter
case the contents of Destination are undefined.
See also:
NtfsCreateJunctionPoint
NtfsDeleteJunctionPoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsZeroDataByName
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Decommits storage for a specified range within a sparse file.
Description:
NtfsZeroDataByHandle tells the NTFS filesystem to 'zero' the data in the specified
range for the file identified by Handle. This in effect decommits storage for the
specified range. That is, the specified range no longer occupies storage space.
Subsequently reading a byte in this range will return 0. The range will remain
uncommitted until you write to it again.
Parameters:
FileName - Identifies the file for which you want to zero a range.
First - Indicates the file offset, in bytes, of the start of the range to set to zeroes.
Last - Indicates the byte offset of the first byte beyond the last zeroed byte.
Result:
If the function succeeds it returns True, otherwise it returns False.
See also:
NtfsZeroDataByHandle
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsZeroDataByHandle
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Decommits storage for a specified range within a sparse file.
Description:
NtfsZeroDataByHandle tells the NTFS filesystem to 'zero' the data in the specified
range for the file identified by Handle. This in effect decommits storage for the
specified range. That is, the specified range no longer occupies storage space.
Subsequently reading a byte in this range will return 0. The range will remain
uncommitted until you write to it again.
Parameters:
Handle - Identifies the file for which you want to zero a range.
First - Indicates the file offset, in bytes, of the start of the range to set to zeroes.
Last - Indicates the byte offset of the first byte beyond the last zeroed byte.
Result:
If the function succeeds it returns True, otherwise it returns False.
See also:
NtfsZeroDataByName
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsSparseStreamsSupported
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Test if the volume supports sparse streams.
Description:
NtfsSparseStreamsSupported tests if the filesystem specified by the Volume supports
sparse streams. Currently only NTFS version 5.0 supports sparse streams and for
all other filesystems the function always returns False.
Parameters:
Volume - The volume to test e.g. 'c:'.
Result:
If the specified volume supports sparse streams the function returns True, otherwise
it returns False.
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@TNtfsAllocRanges
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
TNtfsAllocRanges is initialized by a call to NtfsQueryAllocRanges. It holds the data that describes the allocated ranges in the file within the boundaries that the file was queried for. You can use the NtfsGetAllocRangeEntry to extract the individual entries from this record. WARNING: After you're done with this record you are responsible for freeing the memory associated with the Data member, i.e. you must call: FreeMem(Ranges.Data).
Description:
TNtfsAllocRanges is initialized by a call to NtfsQueryAllocRanges. It holds the data that describes the allocated ranges in the file within the boundaries that the file was queried for. You can use the NtfsGetAllocRangeEntry to extract the individual entries from this record. WARNING: After you're done with this record you are responsible for freeing the memory associated with the Data member, i.e. you must call: FreeMem(Ranges.Data).
See also:
NtfsGetAllocRangeEntry
NtfsQueryAllocRanges
Donator:
Marcel van Brakel
@@TNtfsAllocRanges.Entries
The number of entries contained in the record.
@@TNtfsAllocRanges.Data
Buffer that holds the actual data.
@@TNtfsAllocRanges.MoreData
True if there was more data than could be returned in this buffer.
--------------------------------------------------------------------------------
@@NtfsGetAllocRangeEntry
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Extracts an entry from the ranges record.
Description:
NtfsGetAllocRangeEntry extracts an entry from the Ranges record returned from a
call to NtfsQueryAllocRanges. The returned TFileAllocatedRangeBuffer record
contains the following members:
* FileOffset: TLargeInteger The starting byte offset of the allocated range.
* Length: TLargeInteger The length, in bytes, of the allocated range.
Parameters:
Ranges - The Ranges record returned from NtfsQueryAllocRanges.
Index - 0 based index of the entry to extract.
Result:
The function returns the TFileAllocatedRangeBuffer at the specified Index. The
index is asserted to be within range.
See also:
NtfsSetSparse
TNtfsAllocRanges
NtfsQueryAllocRanges
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsQueryAllocRanges
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Queries the specified sparse file for the ranges that are actually allocated.
Description:
A sparse file is a normal file but one which only uses disk space for those
portions of the file that actually contain data. This however is not automatic,
see the other NtfsXxxx functions and the Platform SDK for details. The
NtfsQueryAllocRanges function queries the filesytem about the ranges of the
specified sparse file that actually contain data and as such occupy disk space.
For a normal, non-sparse file, the returned range is always 0 - FileSize. However,
for a sparse file any number of ranges are possible. This function assumes that
the file contains at most 256 ranges. If the file contains more ranges only the
first 256 are returned. To query for the other ranges call NtfsQueryAllocRanges
again, this time starting at offset = Entry.FileOffset + Entry.Length and with
count = FILE_SIZE - offset (FILE_SIZE is the total size of the file and Entry
is the last entry returned by the previous call). The TNtfsAllocRanges.MoreData
is set to True if the file contains more than 256 ranges. You can use the NtfsGetAllocRangeEntry
function to extract the individual ranges from the returned Ranges variable.
Parameters:
FileName - The name of the file whose allocated ranges you want to know.
Offset - The starting offset, in bytes, of the range to query.
Count - The length, in bytes, of the range to query.
Range - On return contains the allocated ranges in the specified file within the boundaries of the specified range (Offset..Offset + Length).
Result:
If the function succeeds the function returns True, otherwise it returns False.
Notes:
The caller is responsible for freeing the memory associated with the Data member of the TNtfsAllocRanges record.
Sparse files are only supported by NTFS version 5.0 and higher.
See also:
NtfsSetSparse
TNtfsAllocRanges
NtfsGetAllocRangeEntry
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsGetSparse
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Tests whether the file is a sparse file.
Description:
NtfsGetSparse tests if the specified file is a sparse file. A sparse file is
a normal file but one which only uses disk space for those portions of the file
that actually contain data. This however is not automatic, see the other NtfsXxxx
functions and the Platform SDK for details.
Parameters:
FileName - The file to test.
Result:
If the specified file is a sparse file the function returns True, otherwise it
returns False.
Notes:
Sparse files are only supported by NTFS version 5.0 and higher.
See also:
NtfsSetSparse
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsSetSparse
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the sparse file attribute.
Description:
NtfsSetSparse makes the specified file a sparse file. A sparse file is a
normal file but one which only uses disk space for those portions of the file
that actually contain data. This however is not automatic, see the other NtfsXxxx
functions and the Platform SDK for details. Keep in mind that no storage is
decommited until you call NtfsZeroDataByHandle or NtfsZeroDataByName.
Parameters:
FileName - The file to make into a sparse file.
Result:
If the function succeeds the return value is True, otherwise it's False.
Notes:
Sparse files are only supported by NTFS version 5.0 and higher.
See also:
NtfsGetSparse
NtfsZeroDataByHandle
NtfsZeroDataByName
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsDeleteReparsePoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Deletes a reparse point.
Description:
NtfsDeleteReparsePoint deletes the reparse point with a given tag for the
specified file or directory.
Parameters:
FileName - The fully qualified name of the file or directory whose associated reparse point to delete.
ReparseTag - The tag of the reparse point to delete.
Result:
If the function succeeds the function returns True, otherwise it returns False.
See also:
NtfsSetReparsePoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsSetReparsePoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets a reparse point for a file or directory.
Description:
NtfsSetReparsePoint sets a reparse point on the specified file or directory.
Parameters:
FileName - The fully qualified name of the file or directory with which to associate a reparse point.
ReparseData - A TReparseGuidData record which contains the reparse point data.
Result:
If the function succeeds it returns True, otherwise it returns False.
See also:
NtfsDeleteReparsePoint
NtfsGetReparsePoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsGetReparsePoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns the reparse point data associated with the specified file or directory.
Description:
NtfsGetReparsePoint returns the reparse point data associated with the specified
file or directory.
Parameters:
FileName - Fully qualified name of the file or directory of which to get the reparse data.
ReparseData - A TReparseGuidDataBuffer record which receives the reparse data. Note that the ReparseDataLength and DataBuffer members must be properly intialized by the caller (e.g. allocate memory and initialize ReparseDataLength to the size of this memory).
Result:
If the function succeeds in retrieving all reparse data it returns True. If the
function succeeds in retrieving a part of the reparse data or fails completely
it returns False and sets ReparseDataLength to the number of bytes retrieved.
You can distinguish between no data and partial data by calling GetLastError which
will return ERROR_INSUFFICIENT_BUFFER or ERROR_MORE_DATA respectively.
See also:
NtfsDeleteReparsePoint
NtfsSetReparsePoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsGetReparseTag
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns the reparse tag of a file or directory.
Description:
NtfsGetReparseTag returns the reparse tag of the reparse point associated with
the specified file or directory. If the specified file has no associated reparse
point the function fails.
Parameters:
Path - Fully qualified name of the file or directory for which you want to know the tag of the associated reparse point, if any.
Tag - If the function succeeds the Tag parameter receives the reparse tag of the reparse point associated with the file or directory. If the function fails the value is undefined.
Result:
If the function succeeds it returns True, otherwise it returns False. In the latter
case the value of Tag is undefined.
See also:
NtfsReparsePointsSupported
NtfsFileHasReparsePoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsReparsePointsSupported
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns whether a filesystem supports reparse points.
Description:
NtfsReparsePointsSupported returns whether the filesystem installed on the
specified Volume supports reparse points. Currently only the Windows 2000 version
of NTFS (version 5) supports reparse points.
Parameters:
Volume - Name of the volume to test. This parameter must be of the form "x:\" or "x:" where x is the volume to test.
Result:
If the specified volume supports reparse points the function returns True. If the
volume does not support reparse points or the function fails, the return value is False.
See also:
NtfsGetReparseTag
NtfsFileHasReparsePoint
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsFileHasReparsePoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns whether a specified file or directory has an associated reparse point.
Description:
NtfsFileHasReparsePoint returns whether the specified file or directory has an
associated reparse point. A reparse point can be set by an application or by the
NTFS filesystem itself. For example, mount points are implemented using a reparse
point. You can use NtfsGetReparseTag to extract the reparse tag of the
reparse point associated with a file or directory. For the above example this
would return the reserved value of IO_REPARSE_TAG_MOUNT_POINT.
Parameters:
Path - Fully qualified name of the file or directory to test.
Result:
If the function succeeds and the specified file or directory has an associated
reparse point, the function returns True. Otherwise it returns False.
See also:
NtfsGetReparseTag
NtfsReparsePointsSupported
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsIsFolderMountPoint
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Returns whether a directory is a mount point.
Description:
NtfsIsFolderMountPoint returns whether the specified directory is actually a
mount point.
Parameters:
Path - The directory to test.
Result:
If the function succeeds and the specified directory is a mount point the function
returns True, otherwise it returns False.
See also:
NtfsMountDeviceAsDrive
NtfsMountVolume
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsMountDeviceAsDrive
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Mounts a device as a drive.
Description:
NtfsMountDeviceAsDrive mounts the specified device as the specified drive. That is,
you can use this function to mount, for example, the CD-Rom drive as drive K. If
the mounting succeeds you can then access the CD-Rom by specifying K. Note that
a particular device can only be mounted once. If the specified device is already
mounted to a drive, you must first delete that mount point using the DeleteVolumeMountPoint
API function. Also, keep in mind that mounting a device can have side effects.
For example mounting a volume (hard disk partition or CD-Rom) which has an
autorun file, will trigger execution of that autorun file (assuming the autorun
feature is enabled).
Parameters:
Device - The device to mount. This is a string of the form \Device\MyDevice where MyDevice is replaced with the appropriate device name. For example the first CD-Rom drive would be \Device\CdRom0 and the first partition on the harddrive would be \Device\HarddiskVolume1.
Drive - The drive letter to mount the device on. Note that if the drive already exists the previously mounted device is not automatically unmounted first. You must explicitly unmount it or the call will fail.
Result:
If the function succeeds it returns True, otherwise it returns False. Failure
is usually due to the specified device already being mounted or the device name
being incorrect. You can call GetLastError but this will usually simply return
the error "parameter is incorrect".
Notes:
Internally this function has to temporarily create a symbolic link for the specified device. This link is deleted as soon as possible. Although very unlikely, it is possible that deleting this link will fail. If so, the function raises an EJclNtfsError exception and exits without mounting the device. If this happens you should try to delete the symbolic link at a later time and retry. See the implementation of this function for how to achieve this.
See also:
NtfsIsFolderMountPoint
NtfsMountVolume
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsMountVolume
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Mounts a volume to a specified directory.
Description:
NtfsMountVolume mounts the specified volume to the the specified mount point. You
can, for example, use NtfsMountVolume('c', 'd:\mnt\c\') to mount the C drive to
the d:\mnt\c folder. If the call succeeds you can subsequently access the C drive
through the d:\mnt\c folder.
Parameters:
Volume - The volume to mount.
MountPoint - The directory to which the volume should be mounted. Note that if the directory doesn't exist yet it is automatically created.
Result:
If the function succeeds it returns True otherwise it returns False.
See also:
NtfsIsFolderMountPoint
NtfsMountDeviceAsDrive
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsSetCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the compression state of a file.
Description:
NtfsSetCompression sets the compression state of the specified file or directory.
The underlying filesystem must support per stream compression or this function will
fail. Currently only LZNT1 is supported as the compression format but this may
change in future releases of the Windows operating system.
Parameters:
FileName - The name of the file for which you want to set the compression state.
State - The desired compression state. Currently this can be one of the following values: * COMPRESSION_FORMAT_NONE Uncompress the file or directory. * COMPRESSION_FORMAT_LZNT1 Compress the file or directory with the LZNT1 format. * COMPRESSION_FORMAT_DEFAULT Compress the file or directory with the default format. * All other values: reserved for future use.
Result:
If the function succeeds in setting the compression state the result it True,
otherwise it's False.
Notes:
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
Directories are not actually compressed by this operation. Rather, the operation sets the default state for files created in the directory to be compressed. To change the compression state of a directory and all of its contents, use NtfsSetDirectoryTreeCompression.
See also:
NtfsGetCompression
NtfsSetFileCompression
NtfsSetDefaultFileCompression
NtfsSetDirectoryTreeCompression
NtfsSetPathCompression
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@NtfsSetFileCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the compression state of a file.
Description:
NtfsSetDirectoryTreeCompression sets the compression state of the specified file.
The underlying filesystem must support per stream compression or this function
will fail. Currently only LZNT1 is supported as the compression format but this
may change in future releases of the Windows operating system.
Parameters:
FileName - The name of the file for which you want to set the compression state.
State - The desired compression state.
Notes:
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
NtfsSetFileCompression will raise an EJclInvalidArgument exception if the 'FileName' parameter denotes a directory. To change the compression state of a directory, use NtfsSetDirectoryTreeCompression.
See also:
TFileCompressionState
NtfsSetDefaultFileCompression
NtfsSetDirectoryTreeCompression
NtfsSetPathCompression
NtfsGetCompression
Donator:
Robert Rossmair
--------------------------------------------------------------------------------
@@NtfsSetDirectoryTreeCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the compression state of a directory and its contents.
Description:
NtfsSetDirectoryTreeCompression sets the compression state of the specified
directory, including all of its files and subdirectories.
The underlying filesystem must support per stream compression or this function
will fail. Currently only LZNT1 is supported as the compression format but this
may change in future releases of the Windows operating system.
Parameters:
Directory - The name of the directory for which you want to set the compression state.
State - The desired compression state.
Notes:
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
NtfsSetDirectoryTreeCompression will raise an EJclInvalidArgument exception if the 'Directory' parameter does not denote a directory.
See also:
TFileCompressionState
NtfsSetPathCompression
NtfsSetDefaultFileCompression
NtfsSetFileCompression
NtfsGetCompression
Donator:
Robert Rossmair
--------------------------------------------------------------------------------
@@NtfsSetPathCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the compression state for all files specified by Path.
Description:
NtfsSetPathCompression sets the compression state for all files in the directory
specified by Path which match the file name implied by Path.
When Recursive is set, subdirectories are processed as well.
The underlying filesystem must support per stream compression or this function
will fail. Currently only LZNT1 is supported as the compression format but this
may change in future releases of the Windows operating system.
Parameters:
Directory - The name of the directory for which you want to set the compression state.
State - The desired compression state.
Recursive - Determines whether subdirectories are affected.
Notes:
The file compression default (compare NtfsSetDefaultFileCompression) for the involved directories is affected only if Path denotes a directory. If, in addition, Recursive is set, NtfsSetPathCompression will work exactly like NtfsSetDirectoryTreeCompression(Path, State).
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
See also:
TFileCompressionState
NtfsSetDefaultFileCompression
NtfsSetFileCompression
NtfsSetDirectoryTreeCompression
NtfsGetCompression
Donator:
Robert Rossmair
--------------------------------------------------------------------------------
@@NtfsSetDefaultFileCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Sets the default compression state of a directory.
Description:
NtfsSetDefaultFileCompression sets the default compression state for files created
in 'Directory'.
The underlying filesystem must support per stream compression or this function
will fail. Currently only LZNT1 is supported as the compression format but this
may change in future releases of the Windows operating system.
Parameters:
Directory - The name of the directory for which you want to set the compression state.
State - The desired compression state.
Notes:
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
This operation does not alter the compression state of files already existing in the directory. To change the compression state of a directory and all of its contents, use NtfsSetDirectoryTreeCompression.
NtfsSetDefaultFileCompression will raise an EJclInvalidArgument exception if the 'Directory' parameter does not denote a directory.
See also:
TFileCompressionState
NtfsSetFileCompression
NtfsSetDirectoryTreeCompression
NtfsSetPathCompression
NtfsGetCompression
Donator:
Robert Rossmair
--------------------------------------------------------------------------------
@@NtfsGetCompression
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Obtains the compression state of a file.
Description:
NtfsGetCompression returns the compression state of the specified file or directory.
The underlying filesystem must support per stream compression or this function will
fail. Currently only LZNT1 is supported as the compression format but this may
change in future releases of the Windows operating system.
Parameters:
FileName - The name of the file you want to test.
State - Variable that receives the compression state of the specified file. Currently this can be one of the following values: * COMPRESSION_FORMAT_NONE The file is not compressed. * COMPRESSION_FORMAT_LZNT1 The file is compressed with the LZNT1 format * All other values: Reserved for future use.
Result:
If the function succeeds in retrieving the compression state the result is True,
otherwise it's False. In the latter case the content of the State parameter is
undefined upon return.
The second variant of NtfsGetCompression returns the compression state of the
specified file; in case of failure an exception is raised.
Notes:
The underlying filesystem must support per stream compression. Currently that means the specified file or directory must reside on an NTFS formatted partition. The FAT filesystem does not support compression.
See also:
TFileCompressionState
NtfsSetCompression
Donator:
Marcel van Brakel
--------------------------------------------------------------------------------
@@TFileCompressionState
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
Enumeration which describes possible file compression states.
Description:
Enumeration which describes possible compression states of a file or directory
on a volume whose file system supports per-file and per-directory compression.
Note that currently LZNT1 is the only compression algorithm implemented. As a
result, LZNT1 will be used as the default compression method; which implies that
fcDefaultCompression and fcLZNT1Compression are equivalent. This,
however, might change in the future.
See also:
NtfsGetCompression
NtfsSetFileCompression
NtfsSetDefaultFileCompression
NtfsSetDirectoryTreeCompression
Donator:
Robert Rossmair
@@TFileCompressionState.fcNoCompression
no compression.
@@TFileCompressionState.fcDefaultCompression
default compression.
@@TFileCompressionState.fcLZNT1Compression
LZNT1 compression.
--------------------------------------------------------------------------------
@@_REPARSE_GUID_DATA_BUFFER
<GROUP FilesandIO.FileSystems.NTFS>
Summary:
TGenericReparseBuffer is a generic record type used for reparse point operations on an NTFS volume.
Description:
TGenericReparseBuffer is a generic record type used for reparse point operations
on an NTFS volume.
See also:
NtfsDeleteReparsePoint
NtfsSetReparsePoint
NtfsGetReparsePoint
Donator:
Marcel van Brakel
@@TReparseGuidDataBuffer
<GROUP FilesandIO.FileSystems.NTFS>
<COMBINE _REPARSE_GUID_DATA_BUFFER>
@@PReparseGuidDataBuffer
<GROUP FilesandIO.FileSystems.NTFS>
<COMBINE _REPARSE_GUID_DATA_BUFFER>
--------------------------------------------------------------------------------
@@NtfsCreateHardLink
Summary:
Creates a hard link.
Description:
Creates a hard link. Both LinkFileName and ExistingFileName must reside on the same, NTFS formatted volume.
Parameters:
LinkName - Name of the hard link to create.
ExistingFileName - Fully qualified path of the file for which to create a hard link.
Result:
True if successfull, False if failed. In the latter case use GetLastError to obtain the reason of failure.
Remarks:
On NT 3.51 and 4.0 you must be a member of the Administrators or Backup Operators group.
Requirements:
Windows NT 3.51, 4.0, 2000 or XP
Donator:
Anonymous
Contributor:
Anonymous
--------------------------------------------------------------------------------
@@NtfsGetHardLinkInfo
Summary:
Returns information about a hard link.
Description:
Returns information about a hard link. Specifically it's link count and fileindex.
Parameters:
LinkName - Name of the file for which to get hard link information.
Info - A TNtfsHardLinkInfo containing the requested information.
Result:
If the function succeeds it returns True, otherwise it returns False.
Requirements:
The specified file must reside on an NTFS formatted volume
Donator:
Anonymous
--------------------------------------------------------------------------------
@@NtfsFindHardLinks
Summary:
Builds a list of fully qualified hard link path names for the specified file.
Description:
Builds a list of fully qualified hard link path names for the specified file.
The function recursively searches the specified directory and all it's subdirectories.
Usually you set Path to the root of a volume to search the entire volume for hard links, but this
is not strictly necessary.
Parameters:
Path - The path where the function should search for hard links, without trailing backslash
FileIndexHigh, FileIndexLow - The file-index of the file for which to find the hard links. You can obtain the
file-index by calling the NtfsGetHardLinkInfo function.
List - A TStrings derivative that receives the fully qualified path names of all found hard links.
Result:
If the function succeeds it returns True, otherwise it returns False. In the latter case, some hard links
may have been found and stored in List but it's not guarenteed to be all hard links.
Remarks:
It's possible that this function doesn't find all hard links due to access rights...
Requirements:
Path must point to a directory on an NTFS formatted volume.
Donator:
Anonymous
--------------------------------------------------------------------------------
@@NtfsDeleteHardLinks
Description: Given the name of a file, this function deletes all hard links (including the specified one). This will result in
the file actually being deleted, including all of it's hard links. This in contrast to the DeleteFile function that
only deleted the specified hard link but doesn't affect other hard links (if any exist the file remains).
Parameters:
FileName - The name of the file to delete
Result:
If the function succeeds it returns True, otherwise it returns False.
Notes:
Note that in case of failure the function attempts to restore the hard links it had already deleted, but
it can't be guarenteed that this will succeed. So in case of failure, some hard links might already have been deleted
Donator:
Anonymous