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

# 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](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2.md)). 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](https://docs.xbox.com/build/console-features/storage/directstorage/directstorage-overview.md).

## Requirements

**Header:** dstorage\_xs.h

**Library:** dstorage\_xs.lib

**Supported platforms:** XBOX Series consoles

## See also

[IDStorageFactoryX](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)\
[IDStorageFactoryX1](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX1/idstoragefactoryx1.md)\
[IDStorageFactoryX2](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2.md)\
[DStorage](https://docs.xbox.com/reference/system/dstorage/dstorage_members.md)


## Related topics

- [IDStorageFactoryX (Interface contents)](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX/idstoragefactoryx.md)
- [IDStorageFactoryX1 (Interface contents)](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX1/idstoragefactoryx1.md)
- [IDStorageFactoryX2 (Interface contents)](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX2/idstoragefactoryx2.md)
- [DStorage (API contents)](https://docs.xbox.com/reference/system/dstorage/dstorage_members.md)
- [DirectStorage Overview](https://docs.xbox.com/build/console-features/storage/directstorage/directstorage-overview.md)
