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

取得物件所代表之檔案的 Win32 控制代碼。

## 語法

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

### 參數

此方法沒有參數。

### 傳回值

類型：HANDLE

## 備註

此控制代碼以 `GENERIC_READ` 權限和 `FILE_SHARE_READ` 共用模式開啟。它可用來查詢檔案的相關資訊，例如檔案大小。

不再需要此控制代碼時，請呼叫 `CloseHandle` 將其關閉。

如需詳細資訊，請參閱 [DirectStorage 概觀](/zh-TW/build/console-features/storage/directstorage/directstorage-overview)中的「IDStorageFileX」一節。

## 需求

**標頭：** dstorage\_xs.h

**程式庫：** dstorage\_xs.lib

**支援的平台：** XBOX Series 主機

## 另請參閱

[IDStorageFactoryX::OpenFile](/zh-TW/reference/system/dstorage/interfaces/IDStorageFactoryX/methods/idstoragefactoryx_openfile)\
[IDStorageFileX](/zh-TW/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex)


## Related topics

- [IDStorageFileX::GetHandle](/reference/system/dstorage/interfaces/IDStorageFileX/methods/idstoragefilex_gethandle.md)
- [IDStorageFileX](/reference/system/dstorage/interfaces/IDStorageFileX/idstoragefilex.md)
