Applies to: desktop apps only
The WIN32_STREAM_ID structure contains stream data.
typedef struct _WIN32_STREAM_ID { DWORD dwStreamId; DWORD dwStreamAttributes; LARGE_INTEGER Size; DWORD dwStreamNameSize; WCHAR cStreamName[ANYSIZE_ARRAY]; } WIN32_STREAM_ID, *LPWIN32_STREAM_ID;
Type of data. This member can be one of the following values.
Alternative data streams. This corresponds to the NTFS $DATA stream type on a named data stream.
Standard data. This corresponds to the NTFS $DATA stream type on the default (unnamed) data stream.
Extended attribute data. This corresponds to the NTFS $EA stream type.
Hard link information. This corresponds to the NTFS $FILE_NAME stream type.
Objects identifiers. This corresponds to the NTFS $OBJECT_ID stream type.
Property data.
Reparse points. This corresponds to the NTFS $REPARSE_POINT stream type.
Security descriptor data.
Sparse file. This corresponds to the NTFS $DATA stream type for a sparse file.
Transactional NTFS (TxF) data stream. This corresponds to the NTFS $TXF_DATA stream type.
Windows Server 2003 and Windows XP/2000: This value is not supported.
Attributes of data to facilitate cross-operating system transfer. This member can be one or more of the following values.
Attribute set if the stream contains data that is modified when read. Allows the backup application to know that verification of data will fail.
Stream contains security data (general attributes). Allows the stream to be ignored on cross-operations restore.
Size of data, in bytes.
Length of the name of the alternative data stream, in bytes.
Unicode string that specifies the name of the alternative data stream.
Minimum supported client
Minimum supported server
Header
Send comments about this topic to Microsoft
Build date: 2/3/2012
<StructLayout(LayoutKind.Explicit, Size:=8)> _Public Structure LARGE_INTEGER<FieldOffset(0)> Dim QuadPart As Long<FieldOffset(0)> Dim LowPart As UInteger<FieldOffset(4)> Dim HighPart As IntegerEnd Structure'<StructLayout(LayoutKind.Sequential, Size:=20)> _<StructLayout(LayoutKind.Sequential, Pack:=4)> _Public Structure WIN32_STREAM_IDDim dwStreamId As IntegerDim dwStreamAttributes As IntegerDim Size As LARGE_INTEGERDim dwStreamNameSize As Integer'Dim cStreamName As IntPtrEnd Structure
BackupRead() Cannot Read a File with a 0-Byte Alternate Data Stream http://support.microsoft.com/kb/812802
PRB: The Sparse Flag May Not Be Preserved By Using BackupRead() or BackupWrite() http://support.microsoft.com/kb/271398
BUG: The BackupWrite() Function Does Not Restore Security Descriptor Control Bits
http://support.microsoft.com/default.aspx/kb/259393?p=1
Calling BackupWrite with BACKUP_SPARSE_BLOCK is not recreating the sparse file. DeviceIOControl is also used for setting sparse attribute. Any extra things needs to be done ?
When I use BackupRead() and WriteFile() to backup a file, then use ReadFile() and BackupWrite() to restore it, the file's attributes can't be restored it.
I don't know if i should set the file's attributes explicitly using SetFileAttributes()?
Thanks
Hi Roland,Unfortunately, the reference page for WIN32_STREAM_ID is incomplete. I'll see what I can do to fix that.In the meantime, the BACKUP_OBJECT_ID stream contains object identifier information for a file. This information is used by the Distributed Link Tracking service: http://msdn2.microsoft.com/en-us/library/aa363997.aspxNote that not all files have object identifiers. Here's how that information is formatted: http://msdn2.microsoft.com/en-us/library/aa364393.aspxHere are pointers for the other stream types:BACKUP_ALTERNATE_DATA and BACKUP_DATA: http://msdn2.microsoft.com/en-us/library/aa364406.aspxBACKUP_EA_DATA: This one does not appear to be documented. However, it is related to the FILE_EA_INFORMATION structure that appears in ntifs.h (in the Windows Driver Kit). Here is the definition for that structure:typedef struct _FILE_EA_INFORMATION { ULONG EaSize;} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;EaSize is the combined length, in bytes, of the extended attributes (EA) for the file.BACKUP_LINK: http://msdn2.microsoft.com/en-us/library/ms791522.aspxBACKUP_PROPERTY_DATA: This one is also not documented, but I believe it is not used anywhere, and I could not find any related structures.BACKUP_REPARSE_DATA: Can be either of these 2 structures, depending on whether the reparse point is MS or from a 3rd party: http://msdn2.microsoft.com/en-us/library/aa365500.aspx or http://msdn2.microsoft.com/en-us/library/ms791514.aspxBACKUP_SECURITY_DATA: http://msdn2.microsoft.com/en-us/library/aa379573.aspxBACKUP_SPARSE_BLOCK: http://msdn2.microsoft.com/en-us/library/aa364057.aspxHere's an overview that explains a little bit about what some of the above data types are used for:http://technet2.microsoft.com/windowsserver/en/library/8cc5891d-bf8e-4164-862d-dac5418c59481033.mspxI hope this helps. If you have more questions, let me know.Best regards,--DianeMicrosoft Windows SDK Feedback Team
typedef struct _FILE_EA_INFORMATION {
ULONG EaSize;
} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION;