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

# DSTORAGE_ERROR_RECORD

> DSTORAGE_ERROR_RECORD

# DSTORAGE\_ERROR\_RECORD

失败的 DirectStorage 请求的详细记录。

## Syntax

```cpp theme={null}
typedef struct DSTORAGE_ERROR_RECORD {  
    UINT32 FailureCount;  
    struct   
    {  
        HRESULT HResult ;  
        DSTORAGE_COMMAND_TYPE CommandType;  
        union  
        {  
            struct   
            {  
                DSTORAGE_REQUEST_OPTIONS Options;  
                void *Destination;  
                UINT32 DestinationSize;  
                WCHAR Filename[MAX_PATH];  
                UINT64 FileOffset;  
                void *Source;  
                UINT32 SourceSize;  
                UINT64 CancellationTag;  
                CHAR Name[DSTORAGE_REQUEST_MAX_NAME];  
            } Request;  
            struct   
            {  
                IDStorageStatusArrayX *StatusArray;  
                UINT32 Index;  
            } Status;  
            struct   
            {  
                ID3D12Fence *Fence;  
                UINT64 Value;  
            } Signal;  
        };  
    } FirstFailure;  
} DSTORAGE_ERROR_RECORD  
```

### Members

*FailureCount*\
类型：UINT32

自上一次调用 `RetrieveErrorRecord` 以来队列中失败请求的数量。

*HResult*\
类型：HRESULT

失败的 HRESULT 代码。

*CommandType*\
类型：[DSTORAGE\_COMMAND\_TYPE](/reference/system/dstorage/enums/dstorage_command_type)

导致失败的入队请求类型。

*Options*\
类型：[DSTORAGE\_REQUEST\_OPTIONS](/reference/system/dstorage/structs/dstorage_request_options)

失败请求的各种选项。

*Destination*\
类型：void \*

用于接收失败请求最终结果的缓冲区地址。

*DestinationSize*\
类型：UINT32

失败请求最终结果的预期大小（以字节为单位），此值由初始请求的一部分传入。

*Filename*\
类型：WCHAR\[MAX\_PATH]

请求所针对文件的名称。

*FileOffset*\
类型：UINT64

失败读取请求起始位置在文件中的偏移量（以字节为单位）。

\**Source*\
类型：void

对于以内存为源的请求，指向要读取的缓冲区地址。

*SourceSize*\
类型：UINT32

要从源读取的字节数。

*CancellationTag*\
类型：UINT64

用于取消匹配的任意 UINT64 数值。

*Name*\
类型：CHAR\[DSTORAGE\_REQUEST\_MAX\_NAME]

请求的名称。

\**StatusArray*\
类型：IDStorageStatusArrayX

对于状态写入请求，指向 [IDStorageStatusArrayX](/reference/system/dstorage/interfaces/IDStorageStatusArrayX/idstoragestatusarrayx) 对象。

*Index*\
类型：UINT32

对于状态写入请求，`IDStorageStatusArrayX` 对象中用于接收状态的状态条目索引。

\**Fence*\
类型：ID3D12Fence

对于 fence 写入请求，指向 `ID3D12Fence` 对象。

*Value*\
类型：UINT64

对于 fence 写入请求，要写入 fence 的值。

## Remarks

此结构由 [IDStorageQueueX::RetrieveErrorRecord](/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_retrieveerrorrecord) 方法使用。

如果 *CommandType* 为 `DSTORAGE_COMMAND_TYPE_NONE`，则其余数据未定义。

有关详细信息，请参阅 [DirectStorage 概述](/build/console-features/storage/directstorage/directstorage-overview) 中的“GetErrorEvent/RetrieveErrorRecord”一节。

## Requirements

**头文件：** dstorage\_xs.h

**受支持的平台：** XBOX Series 主机

## See also

[DStorage](/reference/system/dstorage/dstorage_members)


## Related topics

- [IDStorageQueueX::RetrieveErrorRecord](/zh-CN/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_retrieveerrorrecord.md)
- [DSTORAGE_COMMAND_TYPE](/zh-CN/reference/system/dstorage/enums/dstorage_command_type.md)
- [DSTORAGE_REQUEST_OPTIONS](/zh-CN/reference/system/dstorage/structs/dstorage_request_options.md)
- [DStorage](/zh-CN/reference/system/dstorage/dstorage_members.md)
- [IDStorageQueueX::CancelRequestsWithTag](/zh-CN/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_cancelrequestswithtag.md)
