Skip to content

Latest commit

 

History

History
94 lines (68 loc) · 3.26 KB

nf-shcore-createrandomaccessstreamonfile.md

File metadata and controls

94 lines (68 loc) · 3.26 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:shcore.CreateRandomAccessStreamOnFile
CreateRandomAccessStreamOnFile function (shcore.h)
Creates a Windows Runtime random access stream for a file.
CreateRandomAccessStreamOnFile
CreateRandomAccessStreamOnFile function [Windows Runtime]
shcore/CreateRandomAccessStreamOnFile
winrt.createrandomaccessstreamonfile
winrt\createrandomaccessstreamonfile.htm
WinRT
6D3D2B25-7373-4BA5-BF6B-FB461C2DE982
12/05/2018
CreateRandomAccessStreamOnFile, CreateRandomAccessStreamOnFile function [Windows Runtime], shcore/CreateRandomAccessStreamOnFile, winrt.createrandomaccessstreamonfile
shcore.h
Windows
Windows 8 [desktop apps \| UWP apps]
Windows Server 2012 [desktop apps \| UWP apps]
Shcore.lib
Shcore.dll
Windows
19H1
CreateRandomAccessStreamOnFile
shcore/CreateRandomAccessStreamOnFile
c++
APIRef
kbSyntax
DllExport
shcore.dll
API-MS-Win-ShCore-stream-WinRT-l1-1-0.dll
CreateRandomAccessStreamOnFile

CreateRandomAccessStreamOnFile function

-description

Creates a Windows Runtime random access stream for a file.

-parameters

-param filePath [in]

The fully qualified path of the file to encapsulate.

-param accessMode [in]

An AccessMode value that specifies the behavior of the RandomAccessStream that encapsulates the file.

-param riid [in]

A reference to the IID of the interface to retrieve through ppv, typically IID_RandomAccessStream.

-param ppv [out]

When this method returns successfully, contains the interface pointer requested in riid, typically the IRandomAccessStream that encapsulates the file.

-returns

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

-remarks

Use the CreateRandomAccessStreamOnFile function to create a RandomAccessStream that encapsulates a file.

We recommend that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error in riid that could lead to unexpected results.

-see-also

CreateRandomAccessStreamOverStream

CreateStreamOverRandomAccessStream

RandomAccessStream