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

# XGValidateJpegFile (XBOX One 系列)

> 驗證 JPEG 檔案是否可進行硬體解碼。

驗證 JPEG 檔案是否可進行硬體解碼。

<a id="syntaxSection" />

## 語法

```cpp theme={null}
HRESULT XGValidateJpegFile(
         const void *pJpegFileBuffer,
         UINT32 JpegFileBufferSizeBytes,
         XG_VALIDATED_JPEG_DESC *pDesc
)  
```

<a id="parametersSection" />

### 參數

*pJpegFileBuffer*<br />類型：void\*

\[in] JPEG 檔案緩衝區，以 `void` 指標表示。

*JpegFileBufferSizeBytes*<br />類型：UINT32

\[in] JPEG 檔案緩衝區的大小 (以位元組為單位)。

*pDesc*<br />類型：[XG\_VALIDATED\_JPEG\_DESC](/zh-TW/reference/graphics/xg__NR/structs/xg_validated_jpeg_desc)\*

\[out] 已驗證之 JPEG 檔案的描述，以指向 [XG\_VALIDATED\_JPEG\_DESC](/zh-TW/reference/graphics/xg__NR/structs/xg_validated_jpeg_desc) 結構的指標表示。

<a id="retvalSection" />

### 傳回值

類型：[HRESULT](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/0642cb2f-2075-4469-918c-4441e69c548a)

如果成功，會傳回 `S_OK`；否則會傳回錯誤碼。如需錯誤碼清單，請參閱[錯誤碼](/zh-TW/reference/errorcodes)。

<a id="remarksSection" />

## 備註

此函式會驗證 JPEG 檔案是否可進行硬體解碼。JPEG 檔案會以記憶體緩衝區傳遞，結果則會在輸出描述中傳遞。此函式只會檢查 JFIF 標頭資料；它不會在 CPU 上解碼影像，也不會以任何方式檢查任何影像資料。如果此函式傳回錯誤碼，DMA 引擎的 JPEG 解碼器將無法成功解碼 JPEG 檔案。

如需 XG 程式庫的詳細資訊，請參閱 [XBOX One 的原生資源管理](https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/graphics/directx/native-resource-management)。

<a id="requirementsSection" />

## 需求

**標頭：** xg.h

**程式庫：** xg\_x.lib

**支援的平台：** XBOX One 系列

<a id="seealsoSection" />

## 另請參閱

[XG\_VALIDATED\_JPEG\_DESC](/zh-TW/reference/graphics/xg__NR/structs/xg_validated_jpeg_desc)<br />[XG 參考](/zh-TW/reference/graphics/xg__NR/xg_members)


## Related topics

- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
- [XAppCaptureScreenshotFile](/zh-TW/reference/system/xappcapture/structs/xappcapturescreenshotfile.md)
- [OpenExistingHeapFromFileMapping](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device3/methods/id3d12device3_openexistingheapfromfilemapping_public.md)
- [Validate Entity Token](/api-reference/authentication/validate-entity-token.md)
- [XBOX One 與 XBOX Series X|S GDK 工具](/zh-TW/tools/tools-console/tools-sdk.md)
