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

> DSTORAGE_REQUEST

# DSTORAGE\_REQUEST

代表 DirectStorage 讀取要求。

## 語法

```cpp theme={null}
struct DSTORAGE_REQUEST {
    DSTORAGE_REQUEST_OPTIONS Options;

    union
    {
        void *Destination;

        struct
        {
            PULONG_PTR DestinationPageArray;

            UINT16 DestinationPageOffset;
        };
    };

    UINT32 DestinationSize;

    union
    {
        struct
        {
            IDStorageFileX *File;

            UINT64 FileOffset;
        };
        void *Source;

        struct
        {
            PULONG_PTR SourcePageArray;

            UINT16 SourcePageOffset;
        };
    };

    UINT32 SourceSize;

    UINT32 IntermediateSize;

    UINT64 CancellationTag;

    const CHAR *Name;
};
```

### 成員

*Options*\
類型：[DSTORAGE\_REQUEST\_OPTIONS](/zh-TW/reference/system/dstorage/structs/dstorage_request_options)

此要求的各種選項。

*Destination*\
類型：void \*

用來接收此要求最終結果之緩衝區的位址。

*DestinationPageArray*\
類型：PULONG\_PTR

如果指定了 *DestinationIsPhysicalPages*，這是用來接收此要求最終結果之頁面陣列的位址。每個項目都是一個 64 KB 頁面編號。

*DestinationPageOffset*\
類型：UINT16

如果指定了 *DestinationIsPhysicalPages*，這是目的地在 64 KB 頁面中起始處的位移。

*DestinationSize*\
類型：UINT32

此要求最終結果的預期大小 (以位元組為單位)。如果要求不包含解壓縮，此值應等於 *SourceSize*。對於包含解壓縮的要求，此值會大於 *SourceSize*。

*File*\
類型：IDStorageFileX \*

如果 *SourceType* 為 `DSTORAGE_REQUEST_SOURCE_FILE`，這是要從中執行此讀取要求的檔案。

*FileOffset*\
類型：UINT64

如果 *SourceType* 為 `DSTORAGE_REQUEST_SOURCE_FILE`，這是讀取要求在檔案中起始處的位移 (以位元組為單位)。如果指定了 *ZlibDecompress* 或 *BcpackMode*，位移必須以 16 位元組對齊。

\**Source*\
類型：void

如果 *SourceType* 為 `DSTORAGE_REQUEST_SOURCE_MEMORY` 且未指定 *SourceIsPhysicalPages*，這是要讀取之來源緩衝區的位址。

*SourcePageArray*\
類型：PULONG\_PTR

如果 *SourceType* 為 `DSTORAGE_REQUEST_SOURCE_MEMORY` 且指定了 *SourceIsPhysicalPages*，這是提供要讀取之來源緩衝區的頁面陣列位址。每個項目都是一個 64 KB 頁面編號。

*SourcePageOffset*\
類型：UINT16

如果 *SourceType* 為 `DSTORAGE_REQUEST_SOURCE_MEMORY` 且指定了 *SourceIsPhysicalPages*，這是來源在 64 KB 頁面中起始處的位移。

*SourceSize*\
類型：UINT32

要從檔案或記憶體來源讀取的大小 (以位元組為單位)。

*IntermediateSize*\
類型：UINT32

如果同時指定了 *ZlibDecompress* 和 *BcpackMode*，這是 BCPack 壓縮資料的位元組數目。

*CancellationTag*\
類型：UINT64

用於比對取消的任意 UINT64 數字。

\**Name*\
類型：const CHAR

要求的選擇性名稱。用於偵錯。如果有指定，此字串在要求完成之前都應可供存取。

## 備註

此結構由
[IDStorageQueueX::EnqueueRequest](/zh-TW/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_enqueuerequest) 方法使用。一旦 `EnqueueRequest` 傳回，
就可以重複使用此結構。

單一要求必須符合下列其中一項大小需求：

* DestinationSize 等於或小於 32MiB (**DSTORAGE\_MAX\_4K\_PAGE\_DESTINATION\_SIZE**)。

  **或**

* SourceSize (僅適用於記憶體對記憶體要求) +
  DestinationSize 的合計記憶體使用量等於或小於 1GiB (**DSTORAGE\_MAX\_REQUEST\_SIZE**)，
  且大於 32MiB 的記憶體緩衝區必須使用 64KiB 頁面
  或 2MiB 頁面。

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

## 需求

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

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

## 另請參閱

[DStorage](/zh-TW/reference/system/dstorage/dstorage_members)


## Related topics

- [DSTORAGE_REQUEST_OPTIONS](/zh-TW/reference/system/dstorage/structs/dstorage_request_options.md)
- [DStorage](/zh-TW/reference/system/dstorage/dstorage_members.md)
- [IDStorageQueueX::EnqueueRequest](/zh-TW/reference/system/dstorage/interfaces/IDStorageQueueX/methods/idstoragequeuex_enqueuerequest.md)
- [DirectStorage 概觀](/zh-TW/build/console-features/storage/directstorage/directstorage-overview.md)
- [DSTORAGE_REQUEST_SOURCE_TYPE](/zh-TW/reference/system/dstorage/enums/dstorage_request_source_type.md)
