SHCreateStreamOnFile function
[SHCreateStreamOnFile is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use SHCreateStreamOnFileEx.]
Opens or creates a file and retrieves a stream to read or write to that file.
Syntax
HRESULT SHCreateStreamOnFile( _In_ LPCTSTR pszFile, _In_ DWORD grfMode, _Out_ IStream **ppstm );
Parameters
- pszFile [in]
-
Type: LPCTSTR
A pointer to a null-terminated string that specifies the file name.
- grfMode [in]
-
Type: DWORD
One or more STGM values that are used to specify the file access mode and how the object that exposes the stream is created and deleted.
- ppstm [out]
-
Type: IStream**
Receives an IStream interface pointer for the stream associated with the file.
Return value
Type: HRESULT
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
SHCreateStreamOnFileEx fully supports all STGM modes and allows the caller to specify file attributes if creating a new file.
Requirements
|
Minimum supported client |
Windows XP [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2003 [desktop apps only] |
|
End of client support |
Windows XP |
|
End of server support |
Windows Server 2003 |
|
Header |
|
|
Library |
|
|
DLL |
|
|
Unicode and ANSI names |
SHCreateStreamOnFileW (Unicode) and SHCreateStreamOnFileA (ANSI) |