> ## 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 工厂对象。

## Syntax

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

### Parameters

*riid*   \
类型：REFIID

指定 DirectStorage 工厂接口，例如 `__uuidof(IDStorageFactoryX2)`。

*ppv*   \
类型：void \*\*

接收对静态 DirectStorage 工厂对象引用的指针。

### Return value

类型：HRESULT

标准 HRESULT 错误代码。

## Remarks

此函数返回静态 DirectStorage 工厂对象 ([IDStorageFactoryX2](/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2))。使用该对象可以创建 DirectStorage 队列、打开供 DirectStorage 访问的文件以及执行全局操作。

有关详细信息，请参阅 [DirectStorage 概述](/build/console-features/storage/directstorage/directstorage-overview) 中的“IDStorageFactoryX”“IDStorageFactoryX1”和“IDStorageFactoryX2”几节。

## Requirements

**头文件：** dstorage\_xs.h

**库：** dstorage\_xs.lib

**受支持的平台：** XBOX Series 主机

## See also

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


## Related topics

- [IDStorageFactoryX](/zh-CN/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)
- [IDStorageFactoryX1](/zh-CN/reference/system/dstorage/interfaces/IDStorageFactoryX1/idstoragefactoryx1.md)
- [IDStorageFactoryX2](/zh-CN/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2.md)
- [DStorage](/zh-CN/reference/system/dstorage/dstorage_members.md)
- [IDStorageFactoryX1::GetStats](/zh-CN/reference/system/dstorage/interfaces/IDStorageFactoryX1/methods/idstoragefactoryx1_getstats.md)
