Skip to content

Commit a3c614b

Browse files
committed
Add missing SAL Annotations for improved COM API wrapping
Since the API exposed by some of these headers uses COM, annotating them with the necessary SAL annotations make it more convenient to generate comprehensive external bindings for them, such as in Rust: https://github.com/Traverse-Research/amd-ext-d3d-rs
1 parent e63b841 commit a3c614b

File tree

9 files changed

+22
-23
lines changed

9 files changed

+22
-23
lines changed

AmdDxExt.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
***************************************************************************************************
1010
* @file amddxext.h
11-
* @brief AMD D3D Exension API include file.
11+
* @brief AMD D3D Extension API include file.
1212
***************************************************************************************************
1313
*/
1414
#ifndef _AMDDXEXT_H_
@@ -44,4 +44,4 @@ enum AmdDxExtFeatureToken
4444
AmdDxExtFeature_DeviceCtxSupport = 3, // Device Ctx Support
4545
};
4646

47-
#endif // _AMDDXEXT_H_
47+
#endif // _AMDDXEXT_H_

AmdDxExtApi.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
***************************************************************************************************
1010
* @file amddxextapi.h
11-
* @brief AMD D3D Exension API include file. This is the main include file for apps using extensions.
11+
* @brief AMD D3D Extension API include file. This is the main include file for apps using extensions.
1212
***************************************************************************************************
1313
*/
1414
#ifndef _AMDDXEXTAPI_H_
@@ -26,7 +26,7 @@ interface ID3D11Device;
2626
interface ID3D10Resource;
2727
interface ID3D11Resource;
2828

29-
// App must use GetProcAddress, etc. to retrive this exported function
29+
// App must use GetProcAddress, etc. to retrieve this exported function
3030
// The associated typedef provides a convenient way to define the function pointer
3131
HRESULT __cdecl AmdDxExtCreate(ID3D10Device* pDevice, IAmdDxExt** ppExt);
3232
typedef HRESULT (__cdecl *PFNAmdDxExtCreate)(ID3D10Device* pDevice, IAmdDxExt** ppExt);

AmdDxExtIface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
***************************************************************************************************
1111
* @file amddxextiface.h
1212
* @brief
13-
* AMD D3D Exension API include file. This is a helper include file for extensions. It
13+
* AMD D3D Extension API include file. This is a helper include file for extensions. It
1414
* provides a common base class for all extension interfaces
1515
***************************************************************************************************
1616
*/
@@ -38,4 +38,4 @@ class IAmdDxExtInterface
3838
virtual ~IAmdDxExtInterface() = 0 {};
3939
};
4040

41-
#endif // _AMDDXEXTIFACE_H_
41+
#endif // _AMDDXEXTIFACE_H_

AmdDxExtPerfProfile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
***************************************************************************************************
1010
* @file amddxextperfprofile.h
1111
* @brief
12-
* AMD D3D Exension API include file. This is a helper include file for extensions. It
12+
* AMD D3D Extension API include file. This is a helper include file for extensions. It
1313
* provides a common base class for all extension interfaces
1414
***************************************************************************************************
1515
*/

AmdDxExtPerfProfileApi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
***************************************************************************************************
1111
* @file amddxextperfprofileapi.h
1212
* @brief
13-
* AMD D3D Perf Profile Exension API include file.
13+
* AMD D3D Perf Profile Extension API include file.
1414
* This is the main include file for apps using perf profile extension.
1515
***************************************************************************************************
1616
*/

AmdExtD3D.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
/**
2727
***********************************************************************************************************************
2828
* @file AmdExtD3D.h
29-
* @brief AMD D3D Exension API factory include file.
29+
* @brief AMD D3D Extension API factory include file.
3030
***********************************************************************************************************************
3131
*/
3232
#pragma once
@@ -45,10 +45,10 @@
4545
// The app must use GetProcAddress, etc. to retrieve this exported function
4646
// The associated typedef provides a convenient way to define the function pointer
4747
HRESULT __cdecl AmdExtD3DCreateInterface(
48-
IUnknown* pOuter, ///< [in] object on which to base this new interface; usually a D3D device
49-
REFIID riid, ///< ID of the requested interface
50-
void** ppvObject); ///< [out] The result interface object
51-
typedef HRESULT (__cdecl *PFNAmdExtD3DCreateInterface)(IUnknown* pOuter, REFIID riid, void** ppvObject);
48+
IUnknown* pOuter, ///< [in] object on which to base this new interface; usually a D3D device
49+
REFIID riid, ///< ID of the requested interface
50+
_COM_Outptr_ void** ppvObject); ///< [out] The result interface object
51+
typedef HRESULT (__cdecl *PFNAmdExtD3DCreateInterface)(IUnknown* pOuter, REFIID riid, _COM_Outptr_ void** ppvObject);
5252

5353
/**
5454
***********************************************************************************************************************
@@ -62,8 +62,8 @@ IAmdExtD3DFactory : public IUnknown
6262
{
6363
public:
6464
virtual HRESULT CreateInterface(
65-
IUnknown* pOuter, ///< [in] An object on which to base this new interface; the required object type
66-
///< is usually a device object but not always
67-
REFIID riid, ///< The ID of the requested interface
68-
void** ppvObject) = 0; ///< [out] The result interface object
65+
IUnknown* pOuter, ///< [in] An object on which to base this new interface; the required object type
66+
///< is usually a device object but not always
67+
REFIID riid, ///< The ID of the requested interface
68+
_COM_Outptr_ void** ppvObject) = 0; ///< [out] The result interface object
6969
};

AmdExtD3DCommandListMarkerApi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ IAmdExtD3DCommandListMarker : public IUnknown
5151
virtual VOID PopMarker() = 0;
5252
/// Set a command list marker to indicate a rendering activity
5353
virtual VOID SetMarker(const char* pMarker) = 0;
54-
};
54+
};

AmdExtD3DDeviceApi.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@
2525
*/
2626

2727
#pragma once
28-
#include "unknwn.h"
28+
#include <unknwn.h>
2929
#include <d3d12.h>
30-
#include "AmdExtD3DDeviceApi.h"
3130

3231
/**
3332
***********************************************************************************************************************
@@ -88,7 +87,7 @@ IAmdExtD3DDevice : public IUnknown
8887
const AmdExtD3DCreateInfo* pAmdExtCreateInfo,
8988
const D3D12_GRAPHICS_PIPELINE_STATE_DESC* pDesc,
9089
REFIID riid,
91-
void** ppPipelineState) = 0;
90+
_COM_Outptr_ void** ppPipelineState) = 0;
9291
};
9392

9493
/**
@@ -103,4 +102,4 @@ IAmdExtD3DDevice1 : public IAmdExtD3DDevice
103102
virtual VOID PushMarker(ID3D12GraphicsCommandList* pGfxCmdList, const char* pMarker) = 0;
104103
virtual VOID PopMarker(ID3D12GraphicsCommandList* pGfxCmdList) = 0;
105104
virtual VOID SetMarker(ID3D12GraphicsCommandList* pGfxCmdList, const char* pMarker) = 0;
106-
};
105+
};

AmdExtGpaInterfaceApi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ IAmdExtGpaSession : public IUnknown
8181
virtual UINT32 BeginSample(ID3D12GraphicsCommandList* pGfxCmdList, const AmdExtGpaSampleConfig& config) = 0;
8282
virtual VOID EndSample(ID3D12GraphicsCommandList* pGfxCmdList, UINT32 sampleId) = 0;
8383
virtual bool IsReady() const = 0;
84-
virtual HRESULT GetResults(UINT32 sampleId, size_t* pSizeInBytes, void *pData) const = 0;
84+
virtual HRESULT GetResults(UINT32 sampleId, _Inout_ size_t* pSizeInBytes, _Out_writes_bytes_opt_(*pSizeInBytes) void *pData) const = 0;
8585
virtual HRESULT Reset() = 0;
8686
virtual VOID CopyResults(ID3D12GraphicsCommandList* pGfxCmdList) = 0;
8787
};

0 commit comments

Comments
 (0)