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

Returns the static DirectStorage factory object.

## Syntax

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

### Parameters

*riid*   \
Type: REFIID

Specifies the DirectStorage factory interface, such as `__uuidof(IDStorageFactoryX2)`.

*ppv*   \
Type: void \*\*

Pointer that receives a reference to the static DirectStorage factory object.

### Return value

Type: HRESULT

Standard HRESULT error code.

## Remarks

This function returns the static DirectStorage factory object ([IDStorageFactoryX2](/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2)). Use the object to create DirectStorage queues, open files for DirectStorage access, and perform global operations.

For more information, see the "IDStorageFactoryX", "IDStorageFactoryX1" and "IDStorageFactoryX2" sections
of [DirectStorage Overview](/build/console-features/storage/directstorage/directstorage-overview).

## Requirements

**Header:** dstorage\_xs.h

**Library:** dstorage\_xs.lib

**Supported platforms:** XBOX Series consoles

## 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](/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)
- [IDStorageFactoryX1](/reference/system/dstorage/interfaces/IDStorageFactoryX1/idstoragefactoryx1.md)
- [IDStorageFactoryX2](/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2.md)
- [DStorage](/reference/system/dstorage/dstorage_members.md)
- [IDStorageFactoryX1::GetStats](/reference/system/dstorage/interfaces/IDStorageFactoryX1/methods/idstoragefactoryx1_getstats.md)
