> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IDStorageFactoryX::OpenFile

> IDStorageFactoryX::OpenFile

# IDStorageFactoryX::OpenFile

Ouvre un fichier pour l'accès DirectStorage.

## Syntaxe

```cpp theme={null}
HRESULT OpenFile(  
         const WCHAR *path,  
         REFIID riid,  
         void **ppv  
)  
```

### Paramètres

*path*   \_In\_z\_\
Type : WCHAR \*

Chemin du fichier à ouvrir.

*riid*\
Type : REFIID

Spécifie l'interface de fichier DirectStorage, par exemple `__uuidof(IDStorageFileX)`.

*ppv*   \_COM\_Outptr\_\
Type : void \*\*

Reçoit un objet représentant le fichier ouvert.

### Valeur de retour

Type : HRESULT

Code d'erreur HRESULT standard.

## Remarques

Le fichier spécifié doit être stocké sur un périphérique NVM Express (NVMe) pris en charge par DirectStorage.

Un fichier est implicitement fermé lorsque la dernière référence à l'objet `IDStorageFileX` correspondant est libérée. Pour fermer explicitement un fichier, appelez [IDStorageFileX::Close](/fr-CA/reference/system/dstorage/interfaces/IDStorageFileX/methods/idstoragefilex_close).

Pour plus d'informations, consultez la section « IDStorageFileX » de la [Vue d'ensemble de DirectStorage](/fr-CA/build/console-features/storage/directstorage/directstorage-overview).

## Configuration requise

**En-tête :** dstorage\_xs.h

**Bibliothèque :** dstorage\_xs.lib

**Plateformes prises en charge :** consoles XBOX Series

## Voir aussi

[IDStorageFactoryX](/fr-CA/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx)\
[DStorage](/fr-CA/reference/system/dstorage/dstorage_members)


## Related topics

- [IDStorageFactoryX::OpenFile](/ja-jp/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile.md)
- [IDStorageFileX](/ko/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
