ShlwApiSHCreateStreamOnFileEx(String, StorageModeFlags, UInt32, Boolean, IStream, IStream) Method
Opens or creates a file and retrieves a stream to read or write to that file.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("ShlwApi.dll", CharSet := CharSet.Unicode, ExactSpelling := true>]
Public Shared Function SHCreateStreamOnFileEx (
fileName As String,
storageMode As StorageModeFlags,
attributes As UInteger,
create As Boolean,
<OptionalAttribute> reserved As IStream,
ByRef refStream As IStream
) As HResult
Dim fileName As String
Dim storageMode As StorageModeFlags
Dim attributes As UInteger
Dim create As Boolean
Dim reserved As IStream
Dim refStream As IStream
Dim returnValue As HResult
returnValue = ShlwApi.SHCreateStreamOnFileEx(fileName,
storageMode, attributes, create,
reserved, refStream)
public:
[DllImportAttribute(L"ShlwApi.dll", CharSet = CharSet::Unicode, ExactSpelling = true)]
static HResult SHCreateStreamOnFileEx(
String^ fileName,
StorageModeFlags storageMode,
unsigned int attributes,
bool create,
[OptionalAttribute] [InAttribute] IStream^ reserved,
IStream^% refStream
)
[<DllImportAttribute("ShlwApi.dll", CharSet = CharSet.Unicode, ExactSpelling = true)>]
static member SHCreateStreamOnFileEx :
fileName : string *
storageMode : StorageModeFlags *
attributes : uint32 *
create : bool *
[<OptionalAttribute>] reserved : IStream *
refStream : IStream byref -> HResult
No code example is currently available or this language may not be supported.
- 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.
HResult
If this function succeeds, it returns
S_OK.
Otherwise, it returns an
HResult error code.