/*****************************************************************************\
* *
* dpa_dsa.h - - Interface for the DPA and DSA structures in commtrl *
* *
* Version 1.2 *
* *
* Copyright (c) Microsoft Corporation. All rights reserved. *
* *
\*****************************************************************************/
#ifndef _INC_DPADSA
#define _INC_DPADSA
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#pragma warning(push)
#pragma warning(disable:4001) /* nonstandard extension : single line comment */
#pragma warning(disable:
4001
)
#pragma warning(disable:4201) /* nonstandard extension used : nameless struct/union */
#pragma warning(disable:
4201
)
#pragma warning(disable:4820) /* padding added after data member */
#pragma warning(disable:
4820
)
#pragma once
#endif
#include <winapifamily.h>
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#ifndef _HRESULT_DEFINED
#define _HRESULT_DEFINED
typedef _Return_type_success_(return >= 0) long HRESULT;
#endif // !_HRESULT_DEFINED
#ifndef WINCOMMCTRLAPI
#if !defined(_COMCTL32_) && defined(_WIN32)
#define WINCOMMCTRLAPI DECLSPEC_IMPORT
#else
#define WINCOMMCTRLAPI
#endif
#endif // WINCOMMCTRLAPI
#ifdef __cplusplus
extern
"C"
{
#endif
#ifndef NO_COMMCTRL_DA
#define __COMMCTRL_DA_DEFINED__
#define DA_LAST (0x7FFFFFFF)
#define DA_ERR (-1)
typedef int (CALLBACK *PFNDAENUMCALLBACK)(_In_opt_ void *p, _In_opt_ void *pData);
typedef
int
(
__stdcall
*
)(
void
*p,
void
*pData);
typedef int (CALLBACK *PFNDAENUMCALLBACKCONST)(_In_opt_ const void *p, _In_opt_ void *pData);
typedef
int
(
__stdcall
*
)(
const
void
*p,
void
*pData);
typedef int (CALLBACK *PFNDACOMPARE)(_In_opt_ void *p1, _In_opt_ void *p2, _In_ LPARAM lParam);
typedef
int
(
__stdcall
*
)(
void
*p1,
void
*p2,
lParam);
typedef int (CALLBACK *PFNDACOMPARECONST)(_In_opt_ const void *p1, _In_opt_ const void *p2, _In_ LPARAM lParam);
typedef
int
(
__stdcall
*
)(
const
void
*p1,
const
void
*p2,
lParam);
struct
;
typedef
struct
*
;
WINCOMMCTRLAPI HDSA WINAPI DSA_Create(int cbItem, int cItemGrow);
__declspec
(dllimport)
__stdcall
(
int
,
int
);
WINCOMMCTRLAPI BOOL WINAPI DSA_Destroy(_Inout_opt_ HDSA hdsa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI void WINAPI DSA_DestroyCallback(_Inout_opt_ HDSA hdsa, _In_ PFNDAENUMCALLBACK pfnCB, _In_opt_ void *pData);
__declspec
(dllimport)
void
__stdcall
(
,
,
void
*
);
#ifdef __cplusplus
extern "C++" __inline void DSA_DestroyCallback(_Inout_opt_ HDSA hdsa, _In_ PFNDAENUMCALLBACKCONST pfnCB, _In_opt_ void *pData)
extern
"C++"
__inline
void
(
,
,
void
*
)
{
(
, (
)
,
);
}
#endif
WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteItem(_Inout_ HDSA hdsa, _In_ int i);
__declspec
(dllimport)
__stdcall
(
,
int
);
WINCOMMCTRLAPI BOOL WINAPI DSA_DeleteAllItems(_Inout_ HDSA hdsa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI void WINAPI DSA_EnumCallback(_In_ HDSA hdsa, _In_ PFNDAENUMCALLBACK pfnCB, _In_opt_ void *pData);
__declspec
(dllimport)
void
__stdcall
(
,
,
void
*
);
#ifdef __cplusplus
extern "C++" __inline void DSA_EnumCallback(_In_ HDSA hdsa, _In_ PFNDAENUMCALLBACKCONST pfnCB, _In_opt_ void *pData)
extern
"C++"
__inline
void
(
,
,
void
*
)
{
(
, (
)
,
);
}
#endif
WINCOMMCTRLAPI int WINAPI DSA_InsertItem(_Inout_ HDSA hdsa, _In_ int i, _In_ const void *pitem);
__declspec
(dllimport)
int
__stdcall
(
,
int
,
const
void
*
);
WINCOMMCTRLAPI PVOID WINAPI DSA_GetItemPtr(_In_ HDSA hdsa, _In_ int i);
__declspec
(dllimport)
__stdcall
(
,
int
);
_Success_(return) WINCOMMCTRLAPI BOOL WINAPI DSA_GetItem(_In_ HDSA hdsa, _In_ int i, _Out_writes_(_Inexpressible_(pdsa->cbItem)) void *pitem);
__declspec
(dllimport)
__stdcall
(
,
int
,
void
*
);
_Success_(return) WINCOMMCTRLAPI BOOL WINAPI DSA_SetItem(_Inout_ HDSA hdsa, _In_ int i, _In_ const void *pitem);
__declspec
(dllimport)
__stdcall
(
,
int
,
const
void
*
);
#define DSA_GetItemCount(hdsa) (*(int *)(hdsa))
#define DSA_AppendItem(hdsa, pitem) DSA_InsertItem(hdsa, DA_LAST, pitem)
#if (NTDDI_VERSION >= NTDDI_VISTA)
WINCOMMCTRLAPI HDSA WINAPI DSA_Clone(_In_ HDSA hdsa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI ULONGLONG WINAPI DSA_GetSize(_In_opt_ HDSA hdsa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI BOOL WINAPI DSA_Sort(_Inout_ HDSA pdsa, _In_ PFNDACOMPARE pfnCompare, _In_ LPARAM lParam);
__declspec
(dllimport)
__stdcall
(
,
,
);
#ifdef __cplusplus
extern "C++" __inline BOOL DSA_Sort(_Inout_ HDSA hdsa, _In_ PFNDACOMPARECONST pfnCompare, _In_ LPARAM lParam)
extern
"C++"
__inline
(
,
,
)
{
return
(
, (
)(
),
);
}
#endif
#endif // NTDDI_VISTA
#define DSA_APPEND DA_LAST
#define DSA_ERR DA_ERR
#define PFNDSAENUMCALLBACK PFNDAENUMCALLBACK
#define PFNDSAENUMCALLBACKCONST PFNDAENUMCALLBACKCONST
#define PFNDSACOMPARE PFNDACOMPARE
#define PFNDSACOMPARECONST PFNDACOMPARECONST
struct
;
typedef
struct
*
;
WINCOMMCTRLAPI HDPA WINAPI DPA_Create(int cItemGrow);
__declspec
(dllimport)
__stdcall
(
int
);
WINCOMMCTRLAPI HDPA WINAPI DPA_CreateEx(_In_ int cpGrow, _In_opt_ HANDLE hheap);
__declspec
(dllimport)
__stdcall
(
int
,
);
WINCOMMCTRLAPI HDPA WINAPI DPA_Clone(_In_ const HDPA hdpa, _Inout_opt_ HDPA hdpaNew);
__declspec
(dllimport)
__stdcall
(
const
,
);
WINCOMMCTRLAPI BOOL WINAPI DPA_Destroy(_Inout_opt_ HDPA hdpa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI void WINAPI DPA_DestroyCallback(_Inout_opt_ HDPA hdpa, _In_ PFNDAENUMCALLBACK pfnCB, _In_opt_ void *pData);
__declspec
(dllimport)
void
__stdcall
(
,
,
void
*
);
#ifdef __cplusplus
extern "C++" __inline void DPA_DestroyCallback(_In_ HDPA hdpa, _In_ PFNDAENUMCALLBACKCONST pfnCB, _In_opt_ void *pData)
extern
"C++"
__inline
void
(
,
,
void
*
)
{
(
, (
)
,
);
}
#endif
WINCOMMCTRLAPI PVOID WINAPI DPA_DeletePtr(_Inout_ HDPA hdpa, _In_ int i);
__declspec
(dllimport)
__stdcall
(
,
int
);
WINCOMMCTRLAPI BOOL WINAPI DPA_DeleteAllPtrs(_Inout_ HDPA hdpa);
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI void WINAPI DPA_EnumCallback(_In_opt_ HDPA hdpa, _In_opt_ PFNDAENUMCALLBACK pfnCB, _In_opt_ void *pData);
__declspec
(dllimport)
void
__stdcall
(
,
,
void
*
);
#ifdef __cplusplus
extern "C++" __inline void DPA_EnumCallback(_In_ HDPA hdpa, _In_ PFNDAENUMCALLBACKCONST pfnCB, _In_opt_ void *pData)
extern
"C++"
__inline
void
(
,
,
void
*
)
{
(
, (
)
,
);
}
#endif
WINCOMMCTRLAPI BOOL WINAPI DPA_Grow(_Inout_ HDPA pdpa, _In_ int cp);
__declspec
(dllimport)
__stdcall
(
,
int
);
WINCOMMCTRLAPI int WINAPI DPA_InsertPtr(_Inout_ HDPA hdpa, _In_ int i, _In_opt_ void *p);
__declspec
(dllimport)
int
__stdcall
(
,
int
,
void
*
);
WINCOMMCTRLAPI BOOL WINAPI DPA_SetPtr(_Inout_ HDPA hdpa, _In_ int i, _In_opt_ void *p);
__declspec
(dllimport)
__stdcall
(
,
int
,
void
*
);
WINCOMMCTRLAPI PVOID WINAPI DPA_GetPtr(_In_ HDPA hdpa, _In_ INT_PTR i);
__declspec
(dllimport)
__stdcall
(
,
);
WINCOMMCTRLAPI int WINAPI DPA_GetPtrIndex(_In_ HDPA hdpa, _In_opt_ const void *p);
__declspec
(dllimport)
int
__stdcall
(
,
const
void
*
);
#define DPA_GetPtrCount(hdpa) (*(int *)(hdpa))
#define DPA_SetPtrCount(hdpa, cItems) (*(int *)(hdpa) = (cItems))
#define DPA_FastDeleteLastPtr(hdpa) (--*(int *)(hdpa))
#define DPA_GetPtrPtr(hdpa) (*((void * **)((BYTE *)(hdpa) + sizeof(void *))))
#define DPA_FastGetPtr(hdpa, i) (DPA_GetPtrPtr(hdpa)[i])
#define DPA_AppendPtr(hdpa, pitem) DPA_InsertPtr(hdpa, DA_LAST, pitem)
#if (NTDDI_VERSION >= NTDDI_VISTA)
WINCOMMCTRLAPI ULONGLONG WINAPI DPA_GetSize(_In_opt_ HDPA hdpa);
#endif // NTDDI_VISTA
__declspec
(dllimport)
__stdcall
(
);
WINCOMMCTRLAPI BOOL WINAPI DPA_Sort(_Inout_ HDPA hdpa, _In_ PFNDACOMPARE pfnCompare, _In_ LPARAM lParam);
__declspec
(dllimport)
__stdcall
(
,
,
);
#ifdef __cplusplus
extern "C++" __inline BOOL DPA_Sort(_Inout_ HDPA hdpa, _In_ PFNDACOMPARECONST pfnCompare, _In_ LPARAM lParam)
extern
"C++"
__inline
(
,
,
)
{
return
(
, (
)(
),
);
}
#endif
typedef
struct
{
int
;
void
*
;
}
;
struct
;
typedef HRESULT (CALLBACK *PFNDPASTREAM)(_In_ DPASTREAMINFO * pinfo, _In_ struct IStream * pstream, _In_opt_ void *pvInstData);
typedef
(
__stdcall
*
)(
* pinfo,
struct
* pstream,
void
*pvInstData);
WINCOMMCTRLAPI HRESULT WINAPI DPA_LoadStream(_Outptr_ HDPA * phdpa, _In_ PFNDPASTREAM pfn, _In_ struct IStream * pstream, _In_opt_ void *pvInstData);
__declspec
(dllimport)
__stdcall
(
*
,
,
struct
*
,
void
*
);
WINCOMMCTRLAPI HRESULT WINAPI DPA_SaveStream(_In_ HDPA hdpa, _In_ PFNDPASTREAM pfn, _In_ struct IStream * pstream, _In_opt_ void *pvInstData);
__declspec
(dllimport)
__stdcall
(
,
,
struct
*
,
void
*
);
#define DPAM_SORTED 0x00000001
#define DPAM_NORMAL 0x00000002
#define DPAM_UNION 0x00000004
#define DPAM_INTERSECT 0x00000008
typedef void* (CALLBACK *PFNDPAMERGE)(_In_ UINT uMsg, _In_ void *pvDest, _In_ void *pvSrc, _In_ LPARAM lParam);
typedef
void
* (
__stdcall
*
)(
uMsg,
void
*pvDest,
void
*pvSrc,
lParam);
typedef const void* (CALLBACK *PFNDPAMERGECONST)(_In_ UINT uMsg, _In_ const void *pvDest, _In_ const void *pvSrc, _In_ LPARAM lParam);
typedef
const
void
* (
__stdcall
*
)(
uMsg,
const
void
*pvDest,
const
void
*pvSrc,
lParam);
#define DPAMM_MERGE 1
#define DPAMM_DELETE 2
#define DPAMM_INSERT 3
WINCOMMCTRLAPI BOOL WINAPI DPA_Merge(_Inout_ HDPA hdpaDest, _In_ HDPA hdpaSrc, _In_ DWORD dwFlags, _In_ PFNDACOMPARE pfnCompare, _In_ PFNDPAMERGE pfnMerge, _In_ LPARAM lParam);
__declspec
(dllimport)
__stdcall
(
,
,
,
,
,
);
#ifdef __cplusplus
extern "C++" __inline BOOL DPA_Merge(_Inout_ HDPA hdpaDest, _In_ HDPA hdpaSrc, _In_ DWORD dwFlags, _In_ PFNDACOMPARECONST pfnCompare, _In_ PFNDPAMERGECONST pfnMerge, _In_ LPARAM lParam)
extern
"C++"
__inline
(
,
,
,
,
,
)
{
return
(
,
,
, (
)
, (
)
,
);
}
#endif
#define DPAS_SORTED 0x0001
#define DPAS_INSERTBEFORE 0x0002
#define DPAS_INSERTAFTER 0x0004
WINCOMMCTRLAPI int WINAPI DPA_Search(_In_ HDPA hdpa, _In_opt_ void *pFind, _In_ int iStart, _In_ PFNDACOMPARE pfnCompare, _In_ LPARAM lParam, _In_ UINT options);
__declspec
(dllimport)
int
__stdcall
(
,
void
*
,
int
,
,
,
);
#ifdef __cplusplus
extern "C++" __inline int DPA_Search(_In_ HDPA hdpa, _In_opt_ const void *pFind, _In_ int iStart, _In_ PFNDACOMPARECONST pfnCompare, _In_ LPARAM lParam, _In_ UINT options)
extern
"C++"
__inline
int
(
,
const
void
*
,
int
,
,
,
)
{
return
(
,
const_cast
<
void
*>(
),
, (
)
,
,
);
}
#endif
#define DPA_SortedInsertPtr(hdpa, pFind, iStart, pfnCompare, lParam, options, pitem) \
DPA_InsertPtr(hdpa, DPA_Search(hdpa, pFind, iStart, pfnCompare, lParam, (DPAS_SORTED | (options))), (pitem))
#define DPA_APPEND DA_LAST
#define DPA_ERR DA_ERR
#define PFNDPAENUMCALLBACK PFNDAENUMCALLBACK
#define PFNDPAENUMCALLBACKCONST PFNDAENUMCALLBACKCONST
#define PFNDPACOMPARE PFNDACOMPARE
#define PFNDPACOMPARECONST PFNDACOMPARECONST
#endif // NO_COMMCTRL_DA
WINCOMMCTRLAPI BOOL WINAPI Str_SetPtrW(_Inout_ LPWSTR * ppsz, _In_opt_ LPCWSTR psz);
__declspec
(dllimport)
__stdcall
(
*
,
);
#if !defined(RC_INVOKED) /* RC complains about long symbols in #ifs */
#if defined(ISOLATION_AWARE_ENABLED) && (ISOLATION_AWARE_ENABLED != 0)
#include "dpa_dsa.inl"
#endif /* ISOLATION_AWARE_ENABLED */
#endif /* RC */
#ifdef __cplusplus
}
#endif
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
#pragma warning(pop)
#endif
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#endif /* _INC_DPADSA */