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

# IXtfFileIOClient::GetFileAttributes Method

> IXtfFileIOClient::GetFileAttributes Method

# IXtfFileIOClient::GetFileAttributes Method

检索开发主机上指定文件的属性。

<a id="syntaxSection" />

## 语法

```cpp theme={null}
public:
HRESULT GetFileAttributes(
         LPCWSTR pszFileName,
         LPDWORD pdwFileAttributes
)  
```

<a id="parametersSection" />

### 参数

*pszFileName*\
类型：LPCWSTR

\[in] 指向要获取其属性的文件的文件名的指针。

*pdwFileAttributes*\
类型：LPDWORD

\[out] 接收指定文件的文件属性按位或组合的指针。有关可能属性的列表，请参阅 [File Attribute Constants](https://msdn.microsoft.com/library/windows/desktop/gg258117\(v=vs.85\).aspx)。

<a id="retvalSection" />

### 返回值

类型：HRESULT

如果成功，则返回 `S_OK`；否则返回 HRESULT 错误代码。

<a id="remarksSection" />

## 备注

此函数获取开发主机上指定文件的文件属性。如果发生错误，此函数将返回 HRESULT 错误代码。有关特定于 XBOX 工具框架 (XTF) API 的 HRESULT 错误代码的详细信息，请参阅 [XTF 传输错误 (NDA 主题)](/tools/tools-console/commandlinetools/xtf-transport-errors)。

使用 [IXtfFileIOClient::SetFileAttributes](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m) 方法设置开发主机上指定文件的文件属性。

<a id="requirementsSection" />

## 要求

**头文件：** xtffileio.h

**库：** xtffileio.lib

**支持的平台：** Windows（用于 XBOX 主机工具）

<a id="seealsoSection" />

## 另请参阅

[IXtfFileIOClient::GetFileInfo](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m)\
[IXtfFileIOClient Interface](/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/ixtffileioclient-xtffileio-xbox-microsoft-t)\
[XtfFileIO](/reference/tools/xtf/xtffileio/xtffileio-xbox-microsoft-n)


## Related topics

- [IXtfFileIOClient::GetFileInfo Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/getfileinfo-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::SetFileAttributes Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/setfileattributes-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::FindFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/findfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::DeleteFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/deletefiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
- [IXtfFileIOClient::CopyFiles Method](/zh-CN/reference/tools/xtf/xtffileio/classes/IXtfFileIOClient/methods/copyfiles-ixtffileioclient-xtffileio-xbox-microsoft-m.md)
