Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Development
Backup
Backup
Backup Reference
Backup Structures
 WIN32_STREAM_ID structure
WIN32_STREAM_ID structure

Applies to: desktop apps only

The WIN32_STREAM_ID structure contains stream data.

Syntax

typedef struct _WIN32_STREAM_ID {
  DWORD         dwStreamId;
  DWORD         dwStreamAttributes;
  LARGE_INTEGER Size;
  DWORD         dwStreamNameSize;
  WCHAR         cStreamName[ANYSIZE_ARRAY];
} WIN32_STREAM_ID, *LPWIN32_STREAM_ID;

Members

dwStreamId

Type of data. This member can be one of the following values.

ValueMeaning
BACKUP_ALTERNATE_DATA
0x00000004

Alternative data streams. This corresponds to the NTFS $DATA stream type on a named data stream.

BACKUP_DATA
0x00000001

Standard data. This corresponds to the NTFS $DATA stream type on the default (unnamed) data stream.

BACKUP_EA_DATA
0x00000002

Extended attribute data. This corresponds to the NTFS $EA stream type.

BACKUP_LINK
0x00000005

Hard link information. This corresponds to the NTFS $FILE_NAME stream type.

BACKUP_OBJECT_ID
0x00000007

Objects identifiers. This corresponds to the NTFS $OBJECT_ID stream type.

BACKUP_PROPERTY_DATA
0x00000006

Property data.

BACKUP_REPARSE_DATA
0x00000008

Reparse points. This corresponds to the NTFS $REPARSE_POINT stream type.

BACKUP_SECURITY_DATA
0x00000003

Security descriptor data.

BACKUP_SPARSE_BLOCK
0x00000009

Sparse file. This corresponds to the NTFS $DATA stream type for a sparse file.

BACKUP_TXFS_DATA
0x0000000A

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.

 

dwStreamAttributes

Attributes of data to facilitate cross-operating system transfer. This member can be one or more of the following values.

ValueMeaning
STREAM_MODIFIED_WHEN_READ

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

Stream contains security data (general attributes). Allows the stream to be ignored on cross-operations restore.

 

Size

Size of data, in bytes.

dwStreamNameSize

Length of the name of the alternative data stream, in bytes.

cStreamName

Unicode string that specifies the name of the alternative data stream.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winbase.h (include Windows.h)

See also

BackupRead
BackupSeek
BackupWrite

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
VB.NET      eriklitze   |   Edit   |   Show History

<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 Integer
End Structure
'<StructLayout(LayoutKind.Sequential, Size:=20)> _
<StructLayout(LayoutKind.Sequential, Pack:=4)> _
Public Structure WIN32_STREAM_ID
Dim dwStreamId As Integer
Dim dwStreamAttributes As Integer
Dim Size As LARGE_INTEGER
Dim dwStreamNameSize As Integer
'Dim cStreamName As IntPtr
End Structure
Tags What's this?: Add a tag
Flag as ContentBug
Review for (See Also) section for all Backup functions content pages.      eriklitze   |   Edit   |   Show History
The See Also section should reference the following source for 2010. The documentation includes PDF information that was not previously available about these backup functions. Thank you.

[MS-BKUP]: Microsoft NT Backup File Structure
http://msdn.microsoft.com/en-us/library/dd305136(PROT.13).aspx
More Info      eriklitze   |   Edit   |   Show History


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

Tags What's this?: Add a tag
Flag as ContentBug
How to restore sparse files      harsha_shaha   |   Edit   |   Show History

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 ?

Flag as ContentBug
how to backup and restore the file attributes?      endlesscpp   |   Edit   |   Show History

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

Tags What's this?: Add a tag
Flag as ContentBug
Why doesn't BackupRead/Write apply file times?      Ikenga   |   Edit   |   Show History
I'm using BackupRead/BackupWrite and I notice that the destination file does not have matching file create/modified time stampes as the original.
Tags What's this?: Add a tag
Flag as ContentBug
More information about the various BACKUP_* constants      Roland Illig   |   Edit   |   Show History
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.aspx

Note that not all files have object identifiers. Here's how that information is formatted: http://msdn2.microsoft.com/en-us/library/aa364393.aspx

Here are pointers for the other stream types:

BACKUP_ALTERNATE_DATA and BACKUP_DATA: http://msdn2.microsoft.com/en-us/library/aa364406.aspx

BACKUP_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.aspx

BACKUP_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.aspx

BACKUP_SECURITY_DATA: http://msdn2.microsoft.com/en-us/library/aa379573.aspx

BACKUP_SPARSE_BLOCK: http://msdn2.microsoft.com/en-us/library/aa364057.aspx

Here'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.mspx

I hope this helps. If you have more questions, let me know.

Best regards,

--Diane

Microsoft Windows SDK Feedback Team
Tags What's this?: Add a tag
Flag as ContentBug
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker