> ## 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.

# DStorageGetFactory

> DStorageGetFactory

# DStorageGetFactory

傳回靜態 DirectStorage Factory 物件。

## 語法

```cpp theme={null}
HRESULT DStorageGetFactory(  
         REFIID riid,  
         void **ppv  
)  
```

### 參數

*riid*   \
類型：REFIID

指定 DirectStorage Factory 介面，例如 `__uuidof(IDStorageFactoryX2)`。

*ppv*   \
類型：void \*\*

接收靜態 DirectStorage Factory 物件參考的指標。

### 傳回值

類型：HRESULT

標準 HRESULT 錯誤碼。

## 備註

此函式會傳回靜態 DirectStorage Factory 物件 ([IDStorageFactoryX2](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2))。使用此物件可建立 DirectStorage 佇列、開啟檔案以供 DirectStorage 存取，以及執行全域作業。

如需詳細資訊，請參閱 [DirectStorage 概觀](/zh-TW/build/console-features/storage/directstorage/directstorage-overview)的
「IDStorageFactoryX」、「IDStorageFactoryX1」和「IDStorageFactoryX2」各節。

## 需求

**標頭：** dstorage\_xs.h

**程式庫：** dstorage\_xs.lib

**支援的平台：** XBOX Series 主機

## 另請參閱

[IDStorageFactoryX](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx)\
[IDStorageFactoryX1](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX1/idstoragefactoryx1)\
[IDStorageFactoryX2](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2)\
[DStorage](/zh-TW/reference/system/dstorage/dstorage_members)


## Related topics

- [DStorageGetFactory](/reference/system/dstorage/functions/dstoragegetfactory.md)
- [IDStorageFactoryX](/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)
