ShlwApiSHCreateStreamOnFileEx(String, StorageModeFlags, UInt32, Boolean, IStream, IStream) Method

Opens or creates a file and retrieves a stream to read or write to that file.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
public static HResult SHCreateStreamOnFileEx(
	string fileName,
	StorageModeFlags storageMode,
	uint attributes,
	bool create,
	[OptionalAttribute] IStream reserved,
	ref IStream refStream
)

Parameters

fileName  String
Specifies the file name.
storageMode  StorageModeFlags
One or more StorageModeFlags values that are used to specify the file access mode and how the object that exposes the stream is created and deleted.
attributes  UInt32
One or more flag values that specify file attributes in the case that a new file is created.

For a complete list of possible values, see the flagsAndAttributes parameter of the CreateFile(String, FileAccessRights, FileShare, IntPtr, FileMode, CreateFileFlags, IntPtr) function.

create  Boolean
A boolean value that helps specify, in conjunction with storageMode parameter, how existing files should be treated when creating the stream.
reserved  IStream  (Optional)
Reserved value. It must be null.
refStream  IStream
Receives an IStream interface for the stream associated with the file.

Return Value

HResult
If this function succeeds, it returns S_OK. Otherwise, it returns an HResult error code.

Remarks

See Also