include: Move some definitions to public header, use PSDK names.

This commit is contained in:
Nikolay Sivov 2009-09-10 23:45:56 +04:00 committed by Alexandre Julliard
parent 7044ac8751
commit 3b6ac3000f
3 changed files with 39 additions and 43 deletions

View File

@ -61,15 +61,6 @@ typedef struct _STREAMDATA
DWORD dwItems;
} STREAMDATA, *PSTREAMDATA;
typedef struct _LOADDATA
{
INT nCount;
PVOID ptr;
} LOADDATA, *LPLOADDATA;
typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
/**************************************************************************
* DPA_LoadStream [COMCTL32.9]
*
@ -79,29 +70,29 @@ typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
* phDpa [O] pointer to a handle to a dynamic pointer array
* loadProc [I] pointer to a callback function
* pStream [I] pointer to a stream
* lParam [I] application specific value
* pData [I] pointer to callback data
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* NOTES
* No more information available yet!
*/
HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
IStream *pStream, LPARAM lParam)
HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, PFNDPASTREAM loadProc,
IStream *pStream, LPVOID pData)
{
HRESULT errCode;
LARGE_INTEGER position;
ULARGE_INTEGER newPosition;
STREAMDATA streamData;
LOADDATA loadData;
DPASTREAMINFO streamInfo;
ULONG ulRead;
HDPA hDpa;
PVOID *ptr;
FIXME ("phDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
phDpa, loadProc, pStream, lParam);
FIXME ("phDpa=%p loadProc=%p pStream=%p pData=%p\n",
phDpa, loadProc, pStream, pData);
if (!phDpa || !loadProc || !pStream)
return E_INVALIDARG;
@ -127,7 +118,7 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
streamData.dwSize, streamData.dwData2, streamData.dwItems);
if ( ulRead < sizeof(STREAMDATA) ||
lParam < sizeof(STREAMDATA) ||
(DWORD)pData < sizeof(STREAMDATA) ||
streamData.dwSize < sizeof(STREAMDATA) ||
streamData.dwData2 < 1) {
errCode = E_FAIL;
@ -146,19 +137,19 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
/* load data from the stream into the dpa */
ptr = hDpa->ptrs;
for (loadData.nCount = 0; loadData.nCount < streamData.dwItems; loadData.nCount++) {
errCode = (loadProc)(&loadData, pStream, lParam);
for (streamInfo.iPos = 0; streamInfo.iPos < streamData.dwItems; streamInfo.iPos++) {
errCode = (loadProc)(&streamInfo, pStream, pData);
if (errCode != S_OK) {
errCode = S_FALSE;
break;
}
*ptr = loadData.ptr;
*ptr = streamInfo.pvItem;
ptr++;
}
/* set the number of items */
hDpa->nItemCount = loadData.nCount;
hDpa->nItemCount = streamInfo.iPos;
/* store the handle to the dpa */
*phDpa = hDpa;
@ -177,21 +168,21 @@ HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
* hDpa [I] handle to a dynamic pointer array
* loadProc [I] pointer to a callback function
* pStream [I] pointer to a stream
* lParam [I] application specific value
* pData [I] pointer to callback data
*
* RETURNS
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* NOTES
* No more information available yet!
*/
HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc,
IStream *pStream, LPARAM lParam)
HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, PFNDPASTREAM loadProc,
IStream *pStream, LPVOID pData)
{
FIXME ("hDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
hDpa, loadProc, pStream, lParam);
FIXME ("hDpa=%p loadProc=%p pStream=%p pData=%p\n",
hDpa, loadProc, pStream, pData);
return E_FAIL;
}

View File

@ -33,14 +33,6 @@
#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
typedef struct _ITEMDATA
{
INT iPos;
PVOID pvData;
} ITEMDATA, *LPITEMDATA;
typedef HRESULT (CALLBACK *PFNDPASTM)(LPITEMDATA,IStream*,LPARAM);
static HDPA (WINAPI *pDPA_Clone)(const HDPA,const HDPA);
static HDPA (WINAPI *pDPA_Create)(INT);
static HDPA (WINAPI *pDPA_CreateEx)(INT,HANDLE);
@ -53,9 +45,9 @@ static INT (WINAPI *pDPA_GetPtr)(const HDPA,INT);
static INT (WINAPI *pDPA_GetPtrIndex)(const HDPA,PVOID);
static BOOL (WINAPI *pDPA_Grow)(HDPA,INT);
static INT (WINAPI *pDPA_InsertPtr)(const HDPA,INT,PVOID);
static HRESULT (WINAPI *pDPA_LoadStream)(HDPA*,PFNDPASTM,IStream*,LPARAM);
static HRESULT (WINAPI *pDPA_LoadStream)(HDPA*,PFNDPASTREAM,IStream*,LPARAM);
static BOOL (WINAPI *pDPA_Merge)(const HDPA,const HDPA,DWORD,PFNDPACOMPARE,PFNDPAMERGE,LPARAM);
static HRESULT (WINAPI *pDPA_SaveStream)(HDPA,PFNDPASTM,IStream*,LPARAM);
static HRESULT (WINAPI *pDPA_SaveStream)(HDPA,PFNDPASTREAM,IStream*,LPARAM);
static INT (WINAPI *pDPA_Search)(HDPA,PVOID,INT,PFNDPACOMPARE,LPARAM,UINT);
static BOOL (WINAPI *pDPA_SetPtr)(const HDPA,INT,PVOID);
static BOOL (WINAPI *pDPA_Sort)(const HDPA,PFNDPACOMPARE,LPARAM);
@ -140,29 +132,29 @@ static INT CALLBACK CB_EnumFirstThree(PVOID pItem, PVOID lp)
return pItem != (PVOID)3;
}
static HRESULT CALLBACK CB_Save(LPITEMDATA pInfo, IStream *pStm, LPARAM lp)
static HRESULT CALLBACK CB_Save(DPASTREAMINFO *pInfo, IStream *pStm, LPVOID lp)
{
HRESULT hRes;
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
ok(lp == (LPVOID)0xdeadbeef, "lp=%p\n", lp);
hRes = IStream_Write(pStm, &pInfo->iPos, sizeof(INT), NULL);
ok(hRes == S_OK, "hRes=0x%x\n", hRes);
hRes = IStream_Write(pStm, &pInfo->pvData, sizeof(PVOID), NULL);
hRes = IStream_Write(pStm, &pInfo->pvItem, sizeof(PVOID), NULL);
ok(hRes == S_OK, "hRes=0x%x\n", hRes);
return S_OK;
}
static HRESULT CALLBACK CB_Load(LPITEMDATA pInfo, IStream *pStm, LPARAM lp)
static HRESULT CALLBACK CB_Load(DPASTREAMINFO *pInfo, IStream *pStm, LPVOID lp)
{
HRESULT hRes;
INT iOldPos;
iOldPos = pInfo->iPos;
ok(lp == 0xdeadbeef, "lp=%ld\n", lp);
ok(lp == (LPVOID)0xdeadbeef, "lp=%p\n", lp);
hRes = IStream_Read(pStm, &pInfo->iPos, sizeof(INT), NULL);
ok(hRes == S_OK, "hRes=0x%x\n", hRes);
ok(pInfo->iPos == iOldPos, "iPos=%d iOldPos=%d\n", pInfo->iPos, iOldPos);
hRes = IStream_Read(pStm, &pInfo->pvData, sizeof(PVOID), NULL);
hRes = IStream_Read(pStm, &pInfo->pvItem, sizeof(PVOID), NULL);
ok(hRes == S_OK, "hRes=0x%x\n", hRes);
return S_OK;
}

View File

@ -5011,6 +5011,19 @@ void WINAPI DPA_DestroyCallback(HDPA, PFNDPAENUMCALLBACK, LPVOID);
INT WINAPI DPA_Search(HDPA, LPVOID, INT, PFNDPACOMPARE, LPARAM, UINT);
BOOL WINAPI DPA_Merge(HDPA, HDPA, DWORD, PFNDPACOMPARE, PFNDPAMERGE, LPARAM);
/* save/load from stream */
typedef struct _DPASTREAMINFO
{
INT iPos; /* item index */
LPVOID pvItem;
} DPASTREAMINFO;
struct IStream;
typedef HRESULT (CALLBACK *PFNDPASTREAM)(DPASTREAMINFO*, struct IStream*, LPVOID);
HRESULT WINAPI DPA_LoadStream(HDPA*, PFNDPASTREAM, struct IStream*, LPVOID);
HRESULT WINAPI DPA_SaveStream(HDPA, PFNDPASTREAM, struct IStream*, LPVOID);
BOOL WINAPI Str_SetPtrW (LPWSTR *, LPCWSTR);
/**************************************************************************