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

# 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](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::OpenFile](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile.md)\
[IDStorageFileX](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)


## Related topics

- [IDStorageFileX (Interface contents)](https://docs.xbox.com/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
- [DirectStorage Overview](https://docs.xbox.com/build/console-features/storage/directstorage/directstorage-overview.md)
- [GET (/handles/{handle-id})](https://docs.xbox.com/reference/live/rest/uri/sessiondirectory/uri-handleshandleidget.md)
- [GET (/handles/{handleId}/session)](https://docs.xbox.com/reference/live/rest/uri/sessiondirectory/uri-handleshandleidsessionget.md)
- [GetDescriptorHandleIncrementSize](https://docs.xbox.com/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getdescriptorhandleincrementsize_public.md)
