FindFirstStreamW function
Enumerates the first stream with a ::$DATA stream type in the specified file or directory.
To perform this operation as a transacted operation, use the FindFirstStreamTransactedW function.
Syntax
HANDLE WINAPI FindFirstStreamW( _In_ LPCWSTR lpFileName, _In_ STREAM_INFO_LEVELS InfoLevel, _Out_ LPVOID lpFindStreamData, _Reserved_ DWORD dwFlags );
Parameters
- lpFileName [in]
-
The fully qualified file name.
- InfoLevel [in]
-
The information level of the returned data. This parameter is one of the values in the STREAM_INFO_LEVELS enumeration type.
Value Meaning - FindStreamInfoStandard
- 0
The data is returned in a WIN32_FIND_STREAM_DATA structure.
- lpFindStreamData [out]
-
A pointer to a buffer that receives the file stream data. The format of this data depends on the value of the InfoLevel parameter.
- dwFlags
-
Reserved for future use. This parameter must be zero.
Return value
If the function succeeds, the return value is a search handle that can be used in subsequent calls to the FindNextStreamW function.
If the function fails, the return value is INVALID_HANDLE_VALUE. To get extended error information, call GetLastError.
If no streams can be found, the function fails and GetLastError returns ERROR_HANDLE_EOF (38).
Remarks
The FindFirstStreamW function opens a search handle and returns information about the first ::$DATA stream in the specified file or directory. For files, this is always the default data stream, "::$DATA". After the search handle has been established, use it in the FindNextStreamW function to search for other streams in the specified file or directory. When the search handle is no longer needed, it should be closed using the FindClose function.
In Windows 8 and Windows Server 2012, this function is supported by the following technologies.
| Technology | Supported |
|---|---|
|
Server Message Block (SMB) 3.0 protocol |
Yes |
|
SMB 3.0 Transparent Failover (TFO) |
Yes |
|
SMB 3.0 with Scale-out File Shares (SO) |
Yes |
|
Cluster Shared Volume File System (CsvFS) |
Yes |
|
Resilient File System (ReFS) |
Yes |
SMB 3.0 supports list of streams less than or equal to 64K.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- File Management Functions
- FindClose
- FindFirstStreamTransactedW
- FindNextStreamW
- STREAM_INFO_LEVELS
- WIN32_FIND_STREAM_DATA