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

# IDStorageFileX::GetHandle

> IDStorageFileX::GetHandle

# IDStorageFileX::GetHandle

Gets a Win32 handle to the file represented by the object.

## Syntax

```cpp theme={null}
HANDLE GetHandle(
)
```

### Parameters

This method has no parameters.

### Return value

Type: HANDLE

## Remarks

The handle is opened with `GENERIC_READ` permissions and `FILE_SHARE_READ` sharing mode. It can be used for querying information about the file, such as its size.

Call `CloseHandle` to close the handle when it's no longer needed.

For more information, see the "IDStorageFileX" section in [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::OpenFile](/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile)\
[IDStorageFileX](/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex)


## Related topics

- [IDStorageFileX](/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
- [DirectStorage Overview](/build/console-features/storage/directstorage/directstorage-overview.md)
- [IDStorageFileX::Close](/reference/system/dstorage/interfaces/IDStorageFileX/methods/idstoragefilex_close.md)
- [IDStorageFactoryX::OpenFile](/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile.md)
- [DStorage](/reference/system/dstorage/dstorage_members.md)
