2004-04-24 01:30:00 +02:00
|
|
|
/*
|
|
|
|
* Unit test suite for MAPI property functions
|
|
|
|
*
|
|
|
|
* Copyright 2004 Jon Griffiths
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2004-04-24 01:30:00 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wine/test.h"
|
|
|
|
#include "windef.h"
|
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
|
|
|
#include "winerror.h"
|
|
|
|
#include "winnt.h"
|
2008-02-19 20:09:19 +01:00
|
|
|
#include "initguid.h"
|
2004-04-24 01:30:00 +02:00
|
|
|
#include "mapiutil.h"
|
|
|
|
#include "mapitags.h"
|
2001-09-17 00:00:00 +02:00
|
|
|
#include "mapi32_test.h"
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
static HMODULE hMapi32 = 0;
|
|
|
|
|
|
|
|
static SCODE (WINAPI *pScInitMapiUtil)(ULONG);
|
2010-01-31 01:58:11 +01:00
|
|
|
static void (WINAPI *pDeinitMapiUtil)(void);
|
2004-04-24 01:30:00 +02:00
|
|
|
static SCODE (WINAPI *pPropCopyMore)(LPSPropValue,LPSPropValue,ALLOCATEMORE*,LPVOID);
|
|
|
|
static ULONG (WINAPI *pUlPropSize)(LPSPropValue);
|
|
|
|
static BOOL (WINAPI *pFPropContainsProp)(LPSPropValue,LPSPropValue,ULONG);
|
|
|
|
static BOOL (WINAPI *pFPropCompareProp)(LPSPropValue,ULONG,LPSPropValue);
|
|
|
|
static LONG (WINAPI *pLPropCompareProp)(LPSPropValue,LPSPropValue);
|
|
|
|
static LPSPropValue (WINAPI *pPpropFindProp)(LPSPropValue,ULONG,ULONG);
|
|
|
|
static SCODE (WINAPI *pScCountProps)(INT,LPSPropValue,ULONG*);
|
2004-05-03 22:19:00 +02:00
|
|
|
static SCODE (WINAPI *pScCopyProps)(int,LPSPropValue,LPVOID,ULONG*);
|
|
|
|
static SCODE (WINAPI *pScRelocProps)(int,LPSPropValue,LPVOID,LPVOID,ULONG*);
|
2004-04-24 01:30:00 +02:00
|
|
|
static LPSPropValue (WINAPI *pLpValFindProp)(ULONG,ULONG,LPSPropValue);
|
|
|
|
static BOOL (WINAPI *pFBadRglpszA)(LPSTR*,ULONG);
|
|
|
|
static BOOL (WINAPI *pFBadRglpszW)(LPWSTR*,ULONG);
|
|
|
|
static BOOL (WINAPI *pFBadRowSet)(LPSRowSet);
|
|
|
|
static ULONG (WINAPI *pFBadPropTag)(ULONG);
|
|
|
|
static ULONG (WINAPI *pFBadRow)(LPSRow);
|
|
|
|
static ULONG (WINAPI *pFBadProp)(LPSPropValue);
|
|
|
|
static ULONG (WINAPI *pFBadColumnSet)(LPSPropTagArray);
|
2005-01-03 18:05:02 +01:00
|
|
|
static SCODE (WINAPI *pCreateIProp)(LPCIID,ALLOCATEBUFFER*,ALLOCATEMORE*,
|
|
|
|
FREEBUFFER*,LPVOID,LPPROPDATA*);
|
2005-11-08 17:10:37 +01:00
|
|
|
static SCODE (WINAPI *pMAPIAllocateBuffer)(ULONG, LPVOID);
|
|
|
|
static SCODE (WINAPI *pMAPIAllocateMore)(ULONG, LPVOID, LPVOID);
|
2010-01-31 01:58:11 +01:00
|
|
|
static SCODE (WINAPI *pMAPIInitialize)(LPVOID);
|
2005-10-27 20:29:27 +02:00
|
|
|
static SCODE (WINAPI *pMAPIFreeBuffer)(LPVOID);
|
2010-01-31 01:58:11 +01:00
|
|
|
static void (WINAPI *pMAPIUninitialize)(void);
|
2005-10-27 20:29:27 +02:00
|
|
|
|
|
|
|
static BOOL InitFuncPtrs(void)
|
|
|
|
{
|
|
|
|
hMapi32 = LoadLibraryA("mapi32.dll");
|
|
|
|
|
2010-01-18 14:00:09 +01:00
|
|
|
pPropCopyMore = (void*)GetProcAddress(hMapi32, "PropCopyMore@16");
|
|
|
|
pUlPropSize = (void*)GetProcAddress(hMapi32, "UlPropSize@4");
|
|
|
|
pFPropContainsProp = (void*)GetProcAddress(hMapi32, "FPropContainsProp@12");
|
|
|
|
pFPropCompareProp = (void*)GetProcAddress(hMapi32, "FPropCompareProp@12");
|
|
|
|
pLPropCompareProp = (void*)GetProcAddress(hMapi32, "LPropCompareProp@8");
|
|
|
|
pPpropFindProp = (void*)GetProcAddress(hMapi32, "PpropFindProp@12");
|
|
|
|
pScCountProps = (void*)GetProcAddress(hMapi32, "ScCountProps@12");
|
|
|
|
pScCopyProps = (void*)GetProcAddress(hMapi32, "ScCopyProps@16");
|
|
|
|
pScRelocProps = (void*)GetProcAddress(hMapi32, "ScRelocProps@20");
|
|
|
|
pLpValFindProp = (void*)GetProcAddress(hMapi32, "LpValFindProp@12");
|
|
|
|
pFBadRglpszA = (void*)GetProcAddress(hMapi32, "FBadRglpszA@8");
|
|
|
|
pFBadRglpszW = (void*)GetProcAddress(hMapi32, "FBadRglpszW@8");
|
|
|
|
pFBadRowSet = (void*)GetProcAddress(hMapi32, "FBadRowSet@4");
|
|
|
|
pFBadPropTag = (void*)GetProcAddress(hMapi32, "FBadPropTag@4");
|
|
|
|
pFBadRow = (void*)GetProcAddress(hMapi32, "FBadRow@4");
|
|
|
|
pFBadProp = (void*)GetProcAddress(hMapi32, "FBadProp@4");
|
|
|
|
pFBadColumnSet = (void*)GetProcAddress(hMapi32, "FBadColumnSet@4");
|
|
|
|
pCreateIProp = (void*)GetProcAddress(hMapi32, "CreateIProp@24");
|
|
|
|
|
2005-10-27 20:29:27 +02:00
|
|
|
pScInitMapiUtil = (void*)GetProcAddress(hMapi32, "ScInitMapiUtil@4");
|
2010-01-31 01:58:11 +01:00
|
|
|
pDeinitMapiUtil = (void*)GetProcAddress(hMapi32, "DeinitMapiUtil@0");
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIAllocateBuffer = (void*)GetProcAddress(hMapi32, "MAPIAllocateBuffer");
|
|
|
|
pMAPIAllocateMore = (void*)GetProcAddress(hMapi32, "MAPIAllocateMore");
|
|
|
|
pMAPIFreeBuffer = (void*)GetProcAddress(hMapi32, "MAPIFreeBuffer");
|
2010-01-31 01:58:11 +01:00
|
|
|
pMAPIInitialize = (void*)GetProcAddress(hMapi32, "MAPIInitialize");
|
|
|
|
pMAPIUninitialize = (void*)GetProcAddress(hMapi32, "MAPIUninitialize");
|
|
|
|
|
|
|
|
return pMAPIAllocateBuffer && pMAPIAllocateMore && pMAPIFreeBuffer &&
|
|
|
|
pScInitMapiUtil && pDeinitMapiUtil;
|
2005-10-27 20:29:27 +02:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
2010-01-18 14:00:01 +01:00
|
|
|
/* FIXME: Test PT_I2, PT_I4, PT_R4, PT_R8, PT_CURRENCY, PT_APPTIME, PT_SYSTIME,
|
|
|
|
* PT_ERROR, PT_BOOLEAN, PT_I8, and PT_CLSID. */
|
2004-04-24 01:30:00 +02:00
|
|
|
static ULONG ptTypes[] = {
|
2010-01-18 14:00:01 +01:00
|
|
|
PT_STRING8, PT_BINARY, PT_UNICODE
|
2004-04-24 01:30:00 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static inline int strcmpW(const WCHAR *str1, const WCHAR *str2)
|
|
|
|
{
|
|
|
|
while (*str1 && (*str1 == *str2)) { str1++; str2++; }
|
|
|
|
return *str1 - *str2;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_PropCopyMore(void)
|
|
|
|
{
|
2006-12-09 19:05:04 +01:00
|
|
|
static char szHiA[] = "Hi!";
|
|
|
|
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
|
2004-04-24 01:30:00 +02:00
|
|
|
SPropValue *lpDest = NULL, *lpSrc = NULL;
|
|
|
|
ULONG i;
|
|
|
|
SCODE scode;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pPropCopyMore)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("PropCopyMore is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
2010-01-18 14:00:01 +01:00
|
|
|
scode = pMAPIAllocateBuffer(sizeof(SPropValue), &lpDest);
|
2010-01-18 13:59:43 +01:00
|
|
|
ok(scode == S_OK, "Expected MAPIAllocateBuffer to return S_OK, got 0x%x\n", scode);
|
2004-04-24 01:30:00 +02:00
|
|
|
if (FAILED(scode))
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
skip("MAPIAllocateBuffer failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2010-01-18 14:00:01 +01:00
|
|
|
scode = pMAPIAllocateMore(sizeof(SPropValue), lpDest, &lpSrc);
|
2010-01-18 13:59:43 +01:00
|
|
|
ok(scode == S_OK, "Expected MAPIAllocateMore to return S_OK, got 0x%x\n", scode);
|
2004-04-24 01:30:00 +02:00
|
|
|
if (FAILED(scode))
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
skip("MAPIAllocateMore failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++)
|
|
|
|
{
|
|
|
|
lpSrc->ulPropTag = ptTypes[i];
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
switch (ptTypes[i])
|
|
|
|
{
|
|
|
|
case PT_STRING8:
|
2006-12-09 19:05:04 +01:00
|
|
|
lpSrc->Value.lpszA = szHiA;
|
2004-04-24 01:30:00 +02:00
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
2006-12-09 19:05:04 +01:00
|
|
|
lpSrc->Value.lpszW = szHiW;
|
2004-04-24 01:30:00 +02:00
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
|
|
|
lpSrc->Value.bin.cb = 4;
|
|
|
|
lpSrc->Value.bin.lpb = (LPBYTE)szHiA;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
memset(lpDest, 0xff, sizeof(SPropValue));
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2005-10-27 20:29:27 +02:00
|
|
|
scode = pPropCopyMore(lpDest, lpSrc, (ALLOCATEMORE*)pMAPIAllocateMore, lpDest);
|
2004-04-24 01:30:00 +02:00
|
|
|
ok(!scode && lpDest->ulPropTag == lpSrc->ulPropTag,
|
2006-10-12 20:56:25 +02:00
|
|
|
"PropCopyMore: Expected 0x0,%d, got 0x%08x,%d\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
lpSrc->ulPropTag, scode, lpDest->ulPropTag);
|
|
|
|
if (SUCCEEDED(scode))
|
|
|
|
{
|
|
|
|
switch (ptTypes[i])
|
|
|
|
{
|
|
|
|
case PT_STRING8:
|
|
|
|
ok(lstrcmpA(lpDest->Value.lpszA, lpSrc->Value.lpszA) == 0,
|
|
|
|
"PropCopyMore: Ascii string differs\n");
|
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
|
|
|
ok(strcmpW(lpDest->Value.lpszW, lpSrc->Value.lpszW) == 0,
|
|
|
|
"PropCopyMore: Unicode string differs\n");
|
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(lpDest->Value.bin.cb == 4 &&
|
2004-04-24 01:30:00 +02:00
|
|
|
!memcmp(lpSrc->Value.bin.lpb, lpDest->Value.bin.lpb, 4),
|
|
|
|
"PropCopyMore: Binary array differs\n");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
/* Since all allocations are linked, freeing lpDest frees everything */
|
2010-01-18 14:00:01 +01:00
|
|
|
scode = pMAPIFreeBuffer(lpDest);
|
|
|
|
ok(scode == S_OK, "Expected MAPIFreeBuffer to return S_OK, got 0x%x\n", scode);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_UlPropSize(void)
|
|
|
|
{
|
2006-12-09 19:05:04 +01:00
|
|
|
static char szHiA[] = "Hi!";
|
|
|
|
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
|
2004-04-24 01:30:00 +02:00
|
|
|
LPSTR buffa[2];
|
|
|
|
LPWSTR buffw[2];
|
|
|
|
SBinary buffbin[2];
|
|
|
|
ULONG pt, exp, res;
|
|
|
|
|
|
|
|
if (!pUlPropSize)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("UlPropSize is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
for (pt = 0; pt < PROP_ID_INVALID; pt++)
|
|
|
|
{
|
|
|
|
SPropValue pv;
|
|
|
|
|
|
|
|
memset(&pv, 0 ,sizeof(pv));
|
|
|
|
pv.ulPropTag = pt;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 1u; /* Default to one item for non-MV properties */
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
switch (PROP_TYPE(pt))
|
|
|
|
{
|
|
|
|
case PT_MV_I2: pv.Value.MVi.cValues = exp = 2;
|
|
|
|
case PT_I2: exp *= sizeof(USHORT); break;
|
|
|
|
case PT_MV_I4: pv.Value.MVl.cValues = exp = 2;
|
|
|
|
case PT_I4: exp *= sizeof(LONG); break;
|
|
|
|
case PT_MV_R4: pv.Value.MVflt.cValues = exp = 2;
|
|
|
|
case PT_R4: exp *= sizeof(float); break;
|
|
|
|
case PT_MV_DOUBLE: pv.Value.MVdbl.cValues = exp = 2;
|
|
|
|
case PT_R8: exp *= sizeof(double); break;
|
|
|
|
case PT_MV_CURRENCY: pv.Value.MVcur.cValues = exp = 2;
|
|
|
|
case PT_CURRENCY: exp *= sizeof(CY); break;
|
|
|
|
case PT_MV_APPTIME: pv.Value.MVat.cValues = exp = 2;
|
|
|
|
case PT_APPTIME: exp *= sizeof(double); break;
|
|
|
|
case PT_MV_SYSTIME: pv.Value.MVft.cValues = exp = 2;
|
|
|
|
case PT_SYSTIME: exp *= sizeof(FILETIME); break;
|
|
|
|
case PT_ERROR: exp = sizeof(SCODE); break;
|
|
|
|
case PT_BOOLEAN: exp = sizeof(USHORT); break;
|
|
|
|
case PT_OBJECT: exp = 0; break;
|
|
|
|
case PT_MV_I8: pv.Value.MVli.cValues = exp = 2;
|
|
|
|
case PT_I8: exp *= sizeof(LONG64); break;
|
2005-01-03 18:05:02 +01:00
|
|
|
#if 0
|
2004-04-24 01:30:00 +02:00
|
|
|
/* My version of native mapi returns 0 for PT_MV_CLSID even if a valid
|
2005-01-03 18:05:02 +01:00
|
|
|
* array is given. This _has_ to be a bug, so Wine does
|
2004-04-24 01:30:00 +02:00
|
|
|
* the right thing(tm) and we don't test it here.
|
|
|
|
*/
|
|
|
|
case PT_MV_CLSID: pv.Value.MVguid.cValues = exp = 2;
|
|
|
|
#endif
|
|
|
|
case PT_CLSID: exp *= sizeof(GUID); break;
|
|
|
|
case PT_STRING8:
|
2006-12-09 19:05:04 +01:00
|
|
|
pv.Value.lpszA = szHiA;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 4;
|
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
2006-12-09 19:05:04 +01:00
|
|
|
pv.Value.lpszW = szHiW;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 4 * sizeof(WCHAR);
|
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
|
|
|
pv.Value.bin.cb = exp = 19;
|
|
|
|
break;
|
|
|
|
case PT_MV_STRING8:
|
|
|
|
pv.Value.MVszA.cValues = 2;
|
|
|
|
pv.Value.MVszA.lppszA = buffa;
|
2006-12-09 19:05:04 +01:00
|
|
|
buffa[0] = szHiA;
|
|
|
|
buffa[1] = szHiA;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 8;
|
|
|
|
break;
|
|
|
|
case PT_MV_UNICODE:
|
|
|
|
pv.Value.MVszW.cValues = 2;
|
|
|
|
pv.Value.MVszW.lppszW = buffw;
|
2006-12-09 19:05:04 +01:00
|
|
|
buffw[0] = szHiW;
|
|
|
|
buffw[1] = szHiW;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 8 * sizeof(WCHAR);
|
|
|
|
break;
|
|
|
|
case PT_MV_BINARY:
|
|
|
|
pv.Value.MVbin.cValues = 2;
|
|
|
|
pv.Value.MVbin.lpbin = buffbin;
|
|
|
|
buffbin[0].cb = 19;
|
|
|
|
buffbin[1].cb = 1;
|
|
|
|
exp = 20;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
exp = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = pUlPropSize(&pv);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(res == exp,
|
2009-01-30 17:14:00 +01:00
|
|
|
"pt= %d: Expected %d, got %d\n", pt, exp, res);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FPropContainsProp(void)
|
|
|
|
{
|
2006-12-09 19:05:04 +01:00
|
|
|
static char szFull[] = "Full String";
|
|
|
|
static char szFullLower[] = "full string";
|
|
|
|
static char szPrefix[] = "Full";
|
|
|
|
static char szPrefixLower[] = "full";
|
|
|
|
static char szSubstring[] = "ll St";
|
|
|
|
static char szSubstringLower[] = "ll st";
|
2004-04-24 01:30:00 +02:00
|
|
|
SPropValue pvLeft, pvRight;
|
|
|
|
ULONG pt;
|
|
|
|
BOOL bRet;
|
|
|
|
|
|
|
|
if (!pFPropContainsProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FPropContainsProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
/* Ensure that only PT_STRING8 and PT_BINARY are handled */
|
|
|
|
for (pt = 0; pt < PROP_ID_INVALID; pt++)
|
|
|
|
{
|
|
|
|
if (pt == PT_STRING8 || pt == PT_BINARY)
|
|
|
|
continue; /* test these later */
|
|
|
|
|
|
|
|
memset(&pvLeft, 0 ,sizeof(pvLeft));
|
|
|
|
memset(&pvRight, 0 ,sizeof(pvRight));
|
|
|
|
pvLeft.ulPropTag = pvRight.ulPropTag = pt;
|
|
|
|
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(bRet == FALSE, "pt= %d: Expected FALSE, got %d\n", pt, bRet);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* test the various flag combinations */
|
|
|
|
pvLeft.ulPropTag = pvRight.ulPropTag = PT_STRING8;
|
2006-12-09 19:05:04 +01:00
|
|
|
pvLeft.Value.lpszA = szFull;
|
|
|
|
pvRight.Value.lpszA = szFull;
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,full)[] match failed\n");
|
2006-12-09 19:05:04 +01:00
|
|
|
pvRight.Value.lpszA = szPrefix;
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
|
|
|
ok(bRet == FALSE, "(full,prefix)[] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == TRUE, "(full,prefix)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,prefix)[SUBSTRING] match failed\n");
|
2006-12-09 19:05:04 +01:00
|
|
|
pvRight.Value.lpszA = szPrefixLower;
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "(full,prefixlow)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
|
|
|
ok(bRet == FALSE, "(full,prefixlow)[SUBSTRING] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,prefixlow)[PREFIX|IGNORECASE] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,prefixlow)[SUBSTRING|IGNORECASE] match failed\n");
|
2006-12-09 19:05:04 +01:00
|
|
|
pvRight.Value.lpszA = szSubstring;
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
|
|
|
ok(bRet == FALSE, "(full,substr)[] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "(full,substr)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,substr)[SUBSTRING] match failed\n");
|
2006-12-09 19:05:04 +01:00
|
|
|
pvRight.Value.lpszA = szSubstringLower;
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "(full,substrlow)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
|
|
|
ok(bRet == FALSE, "(full,substrlow)[SUBSTRING] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "(full,substrlow)[PREFIX|IGNORECASE] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,substrlow)[SUBSTRING|IGNORECASE] match failed\n");
|
2006-12-09 19:05:04 +01:00
|
|
|
pvRight.Value.lpszA = szFullLower;
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING|FL_IGNORECASE);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "(full,fulllow)[IGNORECASE] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
pvLeft.ulPropTag = pvRight.ulPropTag = PT_BINARY;
|
|
|
|
pvLeft.Value.bin.lpb = (LPBYTE)szFull;
|
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szFull;
|
|
|
|
pvLeft.Value.bin.cb = pvRight.Value.bin.cb = strlen(szFull);
|
|
|
|
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "bin(full,full)[] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szPrefix;
|
|
|
|
pvRight.Value.bin.cb = strlen(szPrefix);
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
|
|
|
ok(bRet == FALSE, "bin(full,prefix)[] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "bin(full,prefix)[PREFIX] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "bin(full,prefix)[SUBSTRING] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szPrefixLower;
|
|
|
|
pvRight.Value.bin.cb = strlen(szPrefixLower);
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "bin(full,prefixlow)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
|
|
|
ok(bRet == FALSE, "bin(full,prefixlow)[SUBSTRING] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "bin(full,prefixlow)[PREFIX|IGNORECASE] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "bin(full,prefixlow)[SUBSTRING|IGNORECASE] match failed\n");
|
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szSubstring;
|
|
|
|
pvRight.Value.bin.cb = strlen(szSubstring);
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING);
|
|
|
|
ok(bRet == FALSE, "bin(full,substr)[] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "bin(full,substr)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == TRUE, "bin(full,substr)[SUBSTRING] match failed\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szSubstringLower;
|
|
|
|
pvRight.Value.bin.cb = strlen(szSubstringLower);
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX);
|
|
|
|
ok(bRet == FALSE, "bin(full,substrlow)[PREFIX] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING);
|
|
|
|
ok(bRet == FALSE, "bin(full,substrlow)[SUBSTRING] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_PREFIX|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "bin(full,substrlow)[PREFIX|IGNORECASE] match failed\n");
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_SUBSTRING|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "bin(full,substrlow)[SUBSTRING|IGNORECASE] match failed\n");
|
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)szFullLower;
|
|
|
|
pvRight.Value.bin.cb = strlen(szFullLower);
|
|
|
|
bRet = pFPropContainsProp(&pvLeft, &pvRight, FL_FULLSTRING|FL_IGNORECASE);
|
|
|
|
ok(bRet == FALSE, "bin(full,fulllow)[IGNORECASE] match failed\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct tagFPropCompareProp_Result
|
|
|
|
{
|
|
|
|
SHORT lVal;
|
|
|
|
SHORT rVal;
|
|
|
|
ULONG relOp;
|
|
|
|
BOOL bRet;
|
|
|
|
} FPropCompareProp_Result;
|
|
|
|
|
|
|
|
static const FPropCompareProp_Result FPCProp_Results[] =
|
|
|
|
{
|
|
|
|
{ 1, 2, RELOP_LT, TRUE },
|
|
|
|
{ 1, 1, RELOP_LT, FALSE },
|
|
|
|
{ 2, 1, RELOP_LT, FALSE },
|
|
|
|
{ 1, 2, RELOP_LE, TRUE },
|
|
|
|
{ 1, 1, RELOP_LE, TRUE },
|
|
|
|
{ 2, 1, RELOP_LE, FALSE },
|
|
|
|
{ 1, 2, RELOP_GT, FALSE },
|
|
|
|
{ 1, 1, RELOP_GT, FALSE },
|
|
|
|
{ 2, 1, RELOP_GT, TRUE },
|
|
|
|
{ 1, 2, RELOP_GE, FALSE },
|
|
|
|
{ 1, 1, RELOP_GE, TRUE },
|
|
|
|
{ 2, 1, RELOP_GE, TRUE },
|
|
|
|
{ 1, 2, RELOP_EQ, FALSE },
|
|
|
|
{ 1, 1, RELOP_EQ, TRUE },
|
|
|
|
{ 2, 1, RELOP_EQ, FALSE }
|
|
|
|
};
|
|
|
|
|
|
|
|
static const char *relops[] = { "RELOP_LT", "RELOP_LE", "RELOP_GT", "RELOP_GE", "RELOP_EQ" };
|
|
|
|
|
|
|
|
static void test_FPropCompareProp(void)
|
|
|
|
{
|
|
|
|
SPropValue pvLeft, pvRight;
|
|
|
|
GUID lguid, rguid;
|
|
|
|
char lbuffa[2], rbuffa[2];
|
|
|
|
WCHAR lbuffw[2], rbuffw[2];
|
|
|
|
ULONG i, j;
|
|
|
|
BOOL bRet, bExp;
|
|
|
|
|
|
|
|
if (!pFPropCompareProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FPropCompareProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
lbuffa[1] = '\0';
|
|
|
|
rbuffa[1] = '\0';
|
|
|
|
lbuffw[1] = '\0';
|
|
|
|
rbuffw[1] = '\0';
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++)
|
|
|
|
{
|
|
|
|
pvLeft.ulPropTag = pvRight.ulPropTag = ptTypes[i];
|
|
|
|
|
|
|
|
for (j = 0; j < sizeof(FPCProp_Results)/sizeof(FPCProp_Results[0]); j++)
|
|
|
|
{
|
|
|
|
SHORT lVal = FPCProp_Results[j].lVal;
|
|
|
|
SHORT rVal = FPCProp_Results[j].rVal;
|
|
|
|
|
|
|
|
bExp = FPCProp_Results[j].bRet;
|
|
|
|
|
|
|
|
switch (ptTypes[i])
|
|
|
|
{
|
|
|
|
case PT_BOOLEAN:
|
|
|
|
/* Boolean values have no concept of less or greater than, only equality */
|
|
|
|
if ((lVal == 1 && rVal == 2 && FPCProp_Results[j].relOp == RELOP_LT) ||
|
|
|
|
(lVal == 2 && rVal == 1 && FPCProp_Results[j].relOp == RELOP_LE)||
|
|
|
|
(lVal == 2 && rVal == 1 && FPCProp_Results[j].relOp == RELOP_GT)||
|
|
|
|
(lVal == 1 && rVal == 2 && FPCProp_Results[j].relOp == RELOP_GE)||
|
|
|
|
(lVal == 1 && rVal == 2 && FPCProp_Results[j].relOp == RELOP_EQ)||
|
|
|
|
(lVal == 2 && rVal == 1 && FPCProp_Results[j].relOp == RELOP_EQ))
|
|
|
|
bExp = !bExp;
|
|
|
|
/* Fall through ... */
|
|
|
|
case PT_I2:
|
|
|
|
pvLeft.Value.i = lVal;
|
|
|
|
pvRight.Value.i = rVal;
|
|
|
|
break;
|
|
|
|
case PT_ERROR:
|
|
|
|
case PT_I4:
|
|
|
|
pvLeft.Value.l = lVal;
|
|
|
|
pvRight.Value.l = rVal;
|
|
|
|
break;
|
|
|
|
case PT_R4:
|
|
|
|
pvLeft.Value.flt = lVal;
|
|
|
|
pvRight.Value.flt = rVal;
|
|
|
|
break;
|
|
|
|
case PT_APPTIME:
|
|
|
|
case PT_R8:
|
|
|
|
pvLeft.Value.dbl = lVal;
|
|
|
|
pvRight.Value.dbl = rVal;
|
|
|
|
break;
|
|
|
|
case PT_CURRENCY:
|
|
|
|
pvLeft.Value.cur.int64 = lVal;
|
|
|
|
pvRight.Value.cur.int64 = rVal;
|
|
|
|
break;
|
|
|
|
case PT_SYSTIME:
|
|
|
|
pvLeft.Value.ft.dwLowDateTime = lVal;
|
|
|
|
pvLeft.Value.ft.dwHighDateTime = 0;
|
|
|
|
pvRight.Value.ft.dwLowDateTime = rVal;
|
|
|
|
pvRight.Value.ft.dwHighDateTime = 0;
|
|
|
|
break;
|
|
|
|
case PT_I8:
|
|
|
|
pvLeft.Value.li.u.LowPart = lVal;
|
|
|
|
pvLeft.Value.li.u.HighPart = 0;
|
|
|
|
pvRight.Value.li.u.LowPart = rVal;
|
|
|
|
pvRight.Value.li.u.HighPart = 0;
|
|
|
|
break;
|
|
|
|
case PT_CLSID:
|
|
|
|
memset(&lguid, 0, sizeof(GUID));
|
|
|
|
memset(&rguid, 0, sizeof(GUID));
|
|
|
|
lguid.Data4[7] = lVal;
|
|
|
|
rguid.Data4[7] = rVal;
|
|
|
|
pvLeft.Value.lpguid = &lguid;
|
|
|
|
pvRight.Value.lpguid = &rguid;
|
|
|
|
break;
|
|
|
|
case PT_STRING8:
|
|
|
|
pvLeft.Value.lpszA = lbuffa;
|
|
|
|
pvRight.Value.lpszA = rbuffa;
|
|
|
|
lbuffa[0] = '0' + lVal;
|
|
|
|
rbuffa[0] = '0' + rVal;
|
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
|
|
|
pvLeft.Value.lpszW = lbuffw;
|
|
|
|
pvRight.Value.lpszW = rbuffw;
|
|
|
|
lbuffw[0] = '0' + lVal;
|
|
|
|
rbuffw[0] = '0' + rVal;
|
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
|
|
|
pvLeft.Value.bin.cb = 1;
|
|
|
|
pvRight.Value.bin.cb = 1;
|
2005-09-02 14:26:21 +02:00
|
|
|
pvLeft.Value.bin.lpb = (LPBYTE)lbuffa;
|
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)rbuffa;
|
2004-04-24 01:30:00 +02:00
|
|
|
lbuffa[0] = lVal;
|
|
|
|
rbuffa[0] = rVal;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
bRet = pFPropCompareProp(&pvLeft, FPCProp_Results[j].relOp, &pvRight);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(bRet == bExp,
|
2009-01-30 17:14:00 +01:00
|
|
|
"pt %d (%d,%d,%s): expected %d, got %d\n", ptTypes[i],
|
2004-04-24 01:30:00 +02:00
|
|
|
FPCProp_Results[j].lVal, FPCProp_Results[j].rVal,
|
|
|
|
relops[FPCProp_Results[j].relOp], bExp, bRet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct tagLPropCompareProp_Result
|
|
|
|
{
|
|
|
|
SHORT lVal;
|
|
|
|
SHORT rVal;
|
|
|
|
INT iRet;
|
|
|
|
} LPropCompareProp_Result;
|
|
|
|
|
|
|
|
static const LPropCompareProp_Result LPCProp_Results[] =
|
|
|
|
{
|
|
|
|
{ 1, 2, -1 },
|
|
|
|
{ 1, 1, 0 },
|
|
|
|
{ 2, 1, 1 },
|
|
|
|
};
|
|
|
|
|
|
|
|
static void test_LPropCompareProp(void)
|
|
|
|
{
|
|
|
|
SPropValue pvLeft, pvRight;
|
|
|
|
GUID lguid, rguid;
|
|
|
|
char lbuffa[2], rbuffa[2];
|
|
|
|
WCHAR lbuffw[2], rbuffw[2];
|
|
|
|
ULONG i, j;
|
|
|
|
INT iRet, iExp;
|
|
|
|
|
|
|
|
if (!pLPropCompareProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("LPropCompareProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
lbuffa[1] = '\0';
|
|
|
|
rbuffa[1] = '\0';
|
|
|
|
lbuffw[1] = '\0';
|
|
|
|
rbuffw[1] = '\0';
|
|
|
|
|
|
|
|
for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++)
|
|
|
|
{
|
|
|
|
pvLeft.ulPropTag = pvRight.ulPropTag = ptTypes[i];
|
|
|
|
|
|
|
|
for (j = 0; j < sizeof(LPCProp_Results)/sizeof(LPCProp_Results[0]); j++)
|
|
|
|
{
|
|
|
|
SHORT lVal = LPCProp_Results[j].lVal;
|
|
|
|
SHORT rVal = LPCProp_Results[j].rVal;
|
|
|
|
|
|
|
|
iExp = LPCProp_Results[j].iRet;
|
|
|
|
|
|
|
|
switch (ptTypes[i])
|
|
|
|
{
|
|
|
|
case PT_BOOLEAN:
|
|
|
|
/* Boolean values have no concept of less or greater than, only equality */
|
|
|
|
if (lVal && rVal)
|
|
|
|
iExp = 0;
|
|
|
|
/* Fall through ... */
|
|
|
|
case PT_I2:
|
|
|
|
pvLeft.Value.i = lVal;
|
|
|
|
pvRight.Value.i = rVal;
|
|
|
|
break;
|
|
|
|
case PT_ERROR:
|
|
|
|
case PT_I4:
|
|
|
|
pvLeft.Value.l = lVal;
|
|
|
|
pvRight.Value.l = rVal;
|
|
|
|
break;
|
|
|
|
case PT_R4:
|
|
|
|
pvLeft.Value.flt = lVal;
|
|
|
|
pvRight.Value.flt = rVal;
|
|
|
|
break;
|
|
|
|
case PT_APPTIME:
|
|
|
|
case PT_R8:
|
|
|
|
pvLeft.Value.dbl = lVal;
|
|
|
|
pvRight.Value.dbl = rVal;
|
|
|
|
break;
|
|
|
|
case PT_CURRENCY:
|
|
|
|
pvLeft.Value.cur.int64 = lVal;
|
|
|
|
pvRight.Value.cur.int64 = rVal;
|
|
|
|
break;
|
|
|
|
case PT_SYSTIME:
|
|
|
|
pvLeft.Value.ft.dwLowDateTime = lVal;
|
|
|
|
pvLeft.Value.ft.dwHighDateTime = 0;
|
|
|
|
pvRight.Value.ft.dwLowDateTime = rVal;
|
|
|
|
pvRight.Value.ft.dwHighDateTime = 0;
|
|
|
|
break;
|
|
|
|
case PT_I8:
|
|
|
|
pvLeft.Value.li.u.LowPart = lVal;
|
|
|
|
pvLeft.Value.li.u.HighPart = 0;
|
|
|
|
pvRight.Value.li.u.LowPart = rVal;
|
|
|
|
pvRight.Value.li.u.HighPart = 0;
|
|
|
|
break;
|
|
|
|
case PT_CLSID:
|
|
|
|
memset(&lguid, 0, sizeof(GUID));
|
|
|
|
memset(&rguid, 0, sizeof(GUID));
|
|
|
|
lguid.Data4[7] = lVal;
|
|
|
|
rguid.Data4[7] = rVal;
|
|
|
|
pvLeft.Value.lpguid = &lguid;
|
|
|
|
pvRight.Value.lpguid = &rguid;
|
|
|
|
break;
|
|
|
|
case PT_STRING8:
|
|
|
|
pvLeft.Value.lpszA = lbuffa;
|
|
|
|
pvRight.Value.lpszA = rbuffa;
|
|
|
|
lbuffa[0] = '0' + lVal;
|
|
|
|
rbuffa[0] = '0' + rVal;
|
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
|
|
|
pvLeft.Value.lpszW = lbuffw;
|
|
|
|
pvRight.Value.lpszW = rbuffw;
|
|
|
|
lbuffw[0] = '0' + lVal;
|
|
|
|
rbuffw[0] = '0' + rVal;
|
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
|
|
|
pvLeft.Value.bin.cb = 1;
|
|
|
|
pvRight.Value.bin.cb = 1;
|
2005-09-02 14:26:21 +02:00
|
|
|
pvLeft.Value.bin.lpb = (LPBYTE)lbuffa;
|
|
|
|
pvRight.Value.bin.lpb = (LPBYTE)rbuffa;
|
2004-04-24 01:30:00 +02:00
|
|
|
lbuffa[0] = lVal;
|
|
|
|
rbuffa[0] = rVal;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
iRet = pLPropCompareProp(&pvLeft, &pvRight);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(iRet == iExp,
|
2009-02-04 23:39:20 +01:00
|
|
|
"pt %d (%d,%d): expected %d, got %d\n", ptTypes[i],
|
2004-04-24 01:30:00 +02:00
|
|
|
LPCProp_Results[j].lVal, LPCProp_Results[j].rVal, iExp, iRet);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_PpropFindProp(void)
|
|
|
|
{
|
|
|
|
SPropValue pvProp, *pRet;
|
|
|
|
ULONG i;
|
|
|
|
|
|
|
|
if (!pPpropFindProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("PpropFindProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++)
|
|
|
|
{
|
|
|
|
pvProp.ulPropTag = ptTypes[i];
|
|
|
|
|
|
|
|
pRet = pPpropFindProp(&pvProp, 1u, ptTypes[i]);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(pRet == &pvProp,
|
2011-08-03 23:50:18 +02:00
|
|
|
"PpropFindProp[%d]: Didn't find existing property\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
|
|
|
|
|
|
|
pRet = pPpropFindProp(&pvProp, 1u, i ? ptTypes[i-1] : ptTypes[i+1]);
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(pRet == NULL, "PpropFindProp[%d]: Found nonexistent property\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
pvProp.ulPropTag = PROP_TAG(PT_I2, 1u);
|
|
|
|
pRet = pPpropFindProp(&pvProp, 1u, PROP_TAG(PT_UNSPECIFIED, 0u));
|
|
|
|
ok(pRet == NULL, "PpropFindProp[UNSPECIFIED]: Matched on different id\n");
|
|
|
|
pRet = pPpropFindProp(&pvProp, 1u, PROP_TAG(PT_UNSPECIFIED, 1u));
|
|
|
|
ok(pRet == &pvProp, "PpropFindProp[UNSPECIFIED]: Didn't match id\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_ScCountProps(void)
|
|
|
|
{
|
2006-12-09 19:05:04 +01:00
|
|
|
static char szHiA[] = "Hi!";
|
|
|
|
static WCHAR szHiW[] = { 'H', 'i', '!', '\0' };
|
2004-04-24 01:30:00 +02:00
|
|
|
static const ULONG ULHILEN = 4; /* chars in szHiA/W incl. NUL */
|
|
|
|
LPSTR buffa[3];
|
|
|
|
LPWSTR buffw[3];
|
|
|
|
SBinary buffbin[3];
|
|
|
|
GUID iids[4], *iid = iids;
|
|
|
|
SCODE res;
|
|
|
|
ULONG pt, exp, ulRet;
|
2013-11-14 02:19:19 +01:00
|
|
|
BOOL success = TRUE;
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
if (!pScCountProps)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("ScCountProps is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
2004-08-17 01:18:48 +02:00
|
|
|
for (pt = 0; pt < PROP_ID_INVALID && success; pt++)
|
2004-04-24 01:30:00 +02:00
|
|
|
{
|
|
|
|
SPropValue pv;
|
|
|
|
|
|
|
|
memset(&pv, 0 ,sizeof(pv));
|
|
|
|
pv.ulPropTag = PROP_TAG(pt, 1u);
|
|
|
|
|
|
|
|
switch (PROP_TYPE(pt))
|
|
|
|
{
|
2005-01-03 18:05:02 +01:00
|
|
|
case PT_I2:
|
|
|
|
case PT_I4:
|
|
|
|
case PT_R4:
|
|
|
|
case PT_R8:
|
|
|
|
case PT_CURRENCY:
|
|
|
|
case PT_APPTIME:
|
|
|
|
case PT_SYSTIME:
|
|
|
|
case PT_ERROR:
|
|
|
|
case PT_BOOLEAN:
|
|
|
|
case PT_OBJECT:
|
|
|
|
case PT_I8:
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_CLSID:
|
|
|
|
pv.Value.lpguid = iid;
|
|
|
|
exp = sizeof(GUID) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_STRING8:
|
2006-12-09 19:05:04 +01:00
|
|
|
pv.Value.lpszA = szHiA;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 4 + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_UNICODE:
|
2006-12-09 19:05:04 +01:00
|
|
|
pv.Value.lpszW = szHiW;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = 4 * sizeof(WCHAR) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_BINARY:
|
|
|
|
pv.Value.bin.cb = 2;
|
|
|
|
pv.Value.bin.lpb = (LPBYTE)iid;
|
|
|
|
exp = 2 + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_I2:
|
|
|
|
pv.Value.MVi.cValues = 3;
|
|
|
|
pv.Value.MVi.lpi = (SHORT*)iid;
|
|
|
|
exp = 3 * sizeof(SHORT) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_I4:
|
|
|
|
pv.Value.MVl.cValues = 3;
|
|
|
|
pv.Value.MVl.lpl = (LONG*)iid;
|
|
|
|
exp = 3 * sizeof(LONG) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_I8:
|
|
|
|
pv.Value.MVli.cValues = 3;
|
|
|
|
pv.Value.MVli.lpli = (LARGE_INTEGER*)iid;
|
|
|
|
exp = 3 * sizeof(LARGE_INTEGER) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_R4:
|
|
|
|
pv.Value.MVflt.cValues = 3;
|
|
|
|
pv.Value.MVflt.lpflt = (float*)iid;
|
|
|
|
exp = 3 * sizeof(float) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_APPTIME:
|
|
|
|
case PT_MV_R8:
|
|
|
|
pv.Value.MVdbl.cValues = 3;
|
|
|
|
pv.Value.MVdbl.lpdbl = (double*)iid;
|
|
|
|
exp = 3 * sizeof(double) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_CURRENCY:
|
|
|
|
pv.Value.MVcur.cValues = 3;
|
|
|
|
pv.Value.MVcur.lpcur = (CY*)iid;
|
|
|
|
exp = 3 * sizeof(CY) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_SYSTIME:
|
|
|
|
pv.Value.MVft.cValues = 3;
|
|
|
|
pv.Value.MVft.lpft = (FILETIME*)iid;
|
|
|
|
exp = 3 * sizeof(CY) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_STRING8:
|
|
|
|
pv.Value.MVszA.cValues = 3;
|
|
|
|
pv.Value.MVszA.lppszA = buffa;
|
2006-12-09 19:05:04 +01:00
|
|
|
buffa[0] = szHiA;
|
|
|
|
buffa[1] = szHiA;
|
|
|
|
buffa[2] = szHiA;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = ULHILEN * 3 + 3 * sizeof(char*) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_UNICODE:
|
|
|
|
pv.Value.MVszW.cValues = 3;
|
|
|
|
pv.Value.MVszW.lppszW = buffw;
|
2006-12-09 19:05:04 +01:00
|
|
|
buffw[0] = szHiW;
|
|
|
|
buffw[1] = szHiW;
|
|
|
|
buffw[2] = szHiW;
|
2004-04-24 01:30:00 +02:00
|
|
|
exp = ULHILEN * 3 * sizeof(WCHAR) + 3 * sizeof(WCHAR*) + sizeof(pv);
|
|
|
|
break;
|
|
|
|
case PT_MV_BINARY:
|
|
|
|
pv.Value.MVbin.cValues = 3;
|
|
|
|
pv.Value.MVbin.lpbin = buffbin;
|
|
|
|
buffbin[0].cb = 17;
|
|
|
|
buffbin[0].lpb = (LPBYTE)&iid;
|
|
|
|
buffbin[1].cb = 2;
|
|
|
|
buffbin[1].lpb = (LPBYTE)&iid;
|
|
|
|
buffbin[2].cb = 1;
|
|
|
|
buffbin[2].lpb = (LPBYTE)&iid;
|
|
|
|
exp = 20 + sizeof(pv) + sizeof(SBinary) * 3;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
exp = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
ulRet = 0xffffffff;
|
|
|
|
res = pScCountProps(1, &pv, &ulRet);
|
2004-08-17 01:18:48 +02:00
|
|
|
if (!exp) {
|
|
|
|
success = res == MAPI_E_INVALID_PARAMETER && ulRet == 0xffffffff;
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(success, "pt= %d: Expected failure, got %d, ret=0x%08X\n",
|
2004-08-17 01:18:48 +02:00
|
|
|
pt, ulRet, res);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
success = res == S_OK && ulRet == exp;
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(success, "pt= %d: Expected %d, got %d, ret=0x%08X\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
pt, exp, ulRet, res);
|
2004-08-17 01:18:48 +02:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2004-05-03 22:19:00 +02:00
|
|
|
static void test_ScCopyRelocProps(void)
|
|
|
|
{
|
2006-12-09 19:05:04 +01:00
|
|
|
static char szTestA[] = "Test";
|
2004-05-03 22:19:00 +02:00
|
|
|
char buffer[512], buffer2[512], *lppszA[1];
|
|
|
|
SPropValue pvProp, *lpResProp = (LPSPropValue)buffer;
|
|
|
|
ULONG ulCount;
|
|
|
|
SCODE sc;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-05-03 22:19:00 +02:00
|
|
|
if (!pScCopyProps || !pScRelocProps)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("SPropValue copy functions are not available\n");
|
2004-05-03 22:19:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-05-03 22:19:00 +02:00
|
|
|
|
|
|
|
pvProp.ulPropTag = PROP_TAG(PT_MV_STRING8, 1u);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2006-12-09 19:05:04 +01:00
|
|
|
lppszA[0] = szTestA;
|
2004-05-03 22:19:00 +02:00
|
|
|
pvProp.Value.MVszA.cValues = 1;
|
|
|
|
pvProp.Value.MVszA.lppszA = lppszA;
|
|
|
|
ulCount = 0;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
sc = pScCopyProps(1, &pvProp, buffer, &ulCount);
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(sc == S_OK, "wrong ret %d\n", sc);
|
2008-06-25 07:17:13 +02:00
|
|
|
if(sc == S_OK)
|
|
|
|
{
|
|
|
|
ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag);
|
|
|
|
ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues);
|
|
|
|
ok(lpResProp->Value.MVszA.lppszA[0] == buffer + sizeof(SPropValue) + sizeof(char*),
|
|
|
|
"wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
|
|
|
|
ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5, "wrong count %d\n", ulCount);
|
|
|
|
ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
|
|
|
|
"wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
|
|
|
|
}
|
2004-05-03 22:19:00 +02:00
|
|
|
|
|
|
|
memcpy(buffer2, buffer, sizeof(buffer));
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-05-03 22:19:00 +02:00
|
|
|
/* Clear the data in the source buffer. Since pointers in the copied buffer
|
|
|
|
* refer to the source buffer, this proves that native always assumes that
|
|
|
|
* the copied buffers pointers are bad (needing to be relocated first).
|
|
|
|
*/
|
|
|
|
memset(buffer, 0, sizeof(buffer));
|
|
|
|
ulCount = 0;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-05-03 22:19:00 +02:00
|
|
|
sc = pScRelocProps(1, (LPSPropValue)buffer2, buffer, buffer2, &ulCount);
|
|
|
|
lpResProp = (LPSPropValue)buffer2;
|
2006-06-13 14:02:45 +02:00
|
|
|
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(sc == S_OK, "wrong ret %d\n", sc);
|
2008-06-25 07:17:13 +02:00
|
|
|
if(sc == S_OK)
|
|
|
|
{
|
|
|
|
ok(lpResProp->ulPropTag == pvProp.ulPropTag, "wrong tag %x\n",lpResProp->ulPropTag);
|
|
|
|
ok(lpResProp->Value.MVszA.cValues == 1, "wrong cValues %d\n", lpResProp->Value.MVszA.cValues);
|
|
|
|
ok(lpResProp->Value.MVszA.lppszA[0] == buffer2 + sizeof(SPropValue) + sizeof(char*),
|
|
|
|
"wrong lppszA[0] %p\n",lpResProp->Value.MVszA.lppszA[0]);
|
|
|
|
/* Native has a bug whereby it calculates the size correctly when copying
|
|
|
|
* but when relocating does not (presumably it uses UlPropSize() which
|
|
|
|
* ignores multivalue pointers). Wine returns the correct value.
|
|
|
|
*/
|
|
|
|
ok(ulCount == sizeof(SPropValue) + sizeof(char*) + 5 || ulCount == sizeof(SPropValue) + 5,
|
|
|
|
"wrong count %d\n", ulCount);
|
|
|
|
ok(!strcmp(lpResProp->Value.MVszA.lppszA[0], szTestA),
|
|
|
|
"wrong string '%s'\n", lpResProp->Value.MVszA.lppszA[0]);
|
|
|
|
}
|
2004-05-03 22:19:00 +02:00
|
|
|
|
2005-01-03 18:05:02 +01:00
|
|
|
/* Native crashes with lpNew or lpOld set to NULL so skip testing this */
|
2004-05-03 22:19:00 +02:00
|
|
|
}
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
static void test_LpValFindProp(void)
|
|
|
|
{
|
|
|
|
SPropValue pvProp, *pRet;
|
|
|
|
ULONG i;
|
|
|
|
|
|
|
|
if (!pLpValFindProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("LpValFindProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
for (i = 0; i < sizeof(ptTypes)/sizeof(ptTypes[0]); i++)
|
|
|
|
{
|
|
|
|
pvProp.ulPropTag = PROP_TAG(ptTypes[i], 1u);
|
|
|
|
|
|
|
|
pRet = pLpValFindProp(PROP_TAG(ptTypes[i], 1u), 1u, &pvProp);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(pRet == &pvProp,
|
2011-08-03 23:50:18 +02:00
|
|
|
"LpValFindProp[%d]: Didn't find existing property id/type\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
|
|
|
|
|
|
|
pRet = pLpValFindProp(PROP_TAG(ptTypes[i], 0u), 1u, &pvProp);
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(pRet == NULL, "LpValFindProp[%d]: Found nonexistent property id\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
pRet = pLpValFindProp(PROP_TAG(PT_NULL, 0u), 1u, &pvProp);
|
2011-08-03 23:50:18 +02:00
|
|
|
ok(pRet == NULL, "LpValFindProp[%d]: Found nonexistent property id/type\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
pRet = pLpValFindProp(PROP_TAG(PT_NULL, 1u), 1u, &pvProp);
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(pRet == &pvProp,
|
2011-08-03 23:50:18 +02:00
|
|
|
"LpValFindProp[%d]: Didn't find existing property id\n",
|
2004-04-24 01:30:00 +02:00
|
|
|
ptTypes[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadRglpszA(void)
|
|
|
|
{
|
|
|
|
LPSTR lpStrs[4];
|
2006-07-27 23:47:09 +02:00
|
|
|
static CHAR szString[] = "A String";
|
2004-04-24 01:30:00 +02:00
|
|
|
BOOL bRet;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pFBadRglpszA)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadRglpszA is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFBadRglpszA(NULL, 10);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszA(Null): expected TRUE, got FALSE\n");
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
lpStrs[0] = lpStrs[1] = lpStrs[2] = lpStrs[3] = NULL;
|
|
|
|
bRet = pFBadRglpszA(lpStrs, 4);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszA(Nulls): expected TRUE, got FALSE\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
lpStrs[0] = lpStrs[1] = lpStrs[2] = szString;
|
|
|
|
bRet = pFBadRglpszA(lpStrs, 3);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == FALSE, "FBadRglpszA(valid): expected FALSE, got TRUE\n");
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFBadRglpszA(lpStrs, 4);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszA(1 invalid): expected TRUE, got FALSE\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadRglpszW(void)
|
|
|
|
{
|
|
|
|
LPWSTR lpStrs[4];
|
2006-07-27 23:47:09 +02:00
|
|
|
static WCHAR szString[] = { 'A',' ','S','t','r','i','n','g','\0' };
|
2004-04-24 01:30:00 +02:00
|
|
|
BOOL bRet;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pFBadRglpszW)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadRglpszW is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFBadRglpszW(NULL, 10);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszW(Null): expected TRUE, got FALSE\n");
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
lpStrs[0] = lpStrs[1] = lpStrs[2] = lpStrs[3] = NULL;
|
|
|
|
bRet = pFBadRglpszW(lpStrs, 4);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszW(Nulls): expected TRUE, got FALSE\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
lpStrs[0] = lpStrs[1] = lpStrs[2] = szString;
|
|
|
|
bRet = pFBadRglpszW(lpStrs, 3);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == FALSE, "FBadRglpszW(valid): expected FALSE, got TRUE\n");
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
bRet = pFBadRglpszW(lpStrs, 4);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(bRet == TRUE, "FBadRglpszW(1 invalid): expected TRUE, got FALSE\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadRowSet(void)
|
|
|
|
{
|
|
|
|
ULONG ulRet;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pFBadRowSet)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadRowSet is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
ulRet = pFBadRowSet(NULL);
|
|
|
|
ok(ulRet != 0, "FBadRow(null): Expected non-zero, got 0\n");
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
/* FIXME */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadPropTag(void)
|
|
|
|
{
|
|
|
|
ULONG pt, res;
|
|
|
|
|
|
|
|
if (!pFBadPropTag)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadPropTag is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
for (pt = 0; pt < PROP_ID_INVALID; pt++)
|
|
|
|
{
|
|
|
|
BOOL bBad = TRUE;
|
|
|
|
|
|
|
|
switch (pt & (~MV_FLAG & PROP_TYPE_MASK))
|
|
|
|
{
|
|
|
|
case PT_UNSPECIFIED:
|
|
|
|
case PT_NULL: case PT_I2: case PT_I4: case PT_R4:
|
|
|
|
case PT_R8: case PT_CURRENCY: case PT_APPTIME:
|
|
|
|
case PT_ERROR: case PT_BOOLEAN: case PT_OBJECT:
|
|
|
|
case PT_I8: case PT_STRING8: case PT_UNICODE:
|
|
|
|
case PT_SYSTIME: case PT_CLSID: case PT_BINARY:
|
|
|
|
bBad = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = pFBadPropTag(pt);
|
|
|
|
if (bBad)
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt);
|
2004-04-24 01:30:00 +02:00
|
|
|
else
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(res == 0,
|
2009-01-30 17:14:00 +01:00
|
|
|
"pt= %d: Expected zero, got %d\n", pt, res);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadRow(void)
|
|
|
|
{
|
|
|
|
ULONG ulRet;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pFBadRow)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadRow is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
ulRet = pFBadRow(NULL);
|
|
|
|
ok(ulRet != 0, "FBadRow(null): Expected non-zero, got 0\n");
|
|
|
|
|
|
|
|
/* FIXME */
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadProp(void)
|
|
|
|
{
|
2006-07-27 23:47:09 +02:00
|
|
|
static WCHAR szEmpty[] = { '\0' };
|
2004-04-24 01:30:00 +02:00
|
|
|
GUID iid;
|
|
|
|
ULONG pt, res;
|
|
|
|
SPropValue pv;
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
if (!pFBadProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadProp is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
for (pt = 0; pt < PROP_ID_INVALID; pt++)
|
|
|
|
{
|
|
|
|
BOOL bBad = TRUE;
|
|
|
|
|
|
|
|
memset(&pv, 0, sizeof(pv));
|
|
|
|
pv.ulPropTag = pt;
|
|
|
|
|
|
|
|
/* Note that MV values are valid below because their array count is 0,
|
|
|
|
* so no pointers are validated.
|
2005-01-03 18:05:02 +01:00
|
|
|
*/
|
2004-04-24 01:30:00 +02:00
|
|
|
switch (PROP_TYPE(pt))
|
|
|
|
{
|
|
|
|
case (MV_FLAG|PT_UNSPECIFIED):
|
|
|
|
case PT_UNSPECIFIED:
|
2005-01-03 18:05:02 +01:00
|
|
|
case (MV_FLAG|PT_NULL):
|
|
|
|
case PT_NULL:
|
2004-04-24 01:30:00 +02:00
|
|
|
case PT_MV_I2:
|
|
|
|
case PT_I2:
|
|
|
|
case PT_MV_I4:
|
|
|
|
case PT_I4:
|
|
|
|
case PT_MV_I8:
|
|
|
|
case PT_I8:
|
|
|
|
case PT_MV_R4:
|
|
|
|
case PT_R4:
|
|
|
|
case PT_MV_R8:
|
|
|
|
case PT_R8:
|
|
|
|
case PT_MV_CURRENCY:
|
|
|
|
case PT_CURRENCY:
|
|
|
|
case PT_MV_APPTIME:
|
|
|
|
case PT_APPTIME:
|
|
|
|
case (MV_FLAG|PT_ERROR):
|
|
|
|
case PT_ERROR:
|
|
|
|
case (MV_FLAG|PT_BOOLEAN):
|
|
|
|
case PT_BOOLEAN:
|
|
|
|
case (MV_FLAG|PT_OBJECT):
|
|
|
|
case PT_OBJECT:
|
|
|
|
case PT_MV_STRING8:
|
|
|
|
case PT_MV_UNICODE:
|
|
|
|
case PT_MV_SYSTIME:
|
|
|
|
case PT_SYSTIME:
|
|
|
|
case PT_MV_BINARY:
|
|
|
|
case PT_BINARY:
|
|
|
|
case PT_MV_CLSID:
|
|
|
|
bBad = FALSE;
|
|
|
|
break;
|
|
|
|
case PT_STRING8:
|
|
|
|
case PT_UNICODE:
|
|
|
|
pv.Value.lpszW = szEmpty;
|
|
|
|
bBad = FALSE;
|
|
|
|
break;
|
|
|
|
case PT_CLSID:
|
|
|
|
pv.Value.lpguid = &iid;
|
|
|
|
bBad = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
res = pFBadProp(&pv);
|
|
|
|
if (bBad)
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt);
|
2004-04-24 01:30:00 +02:00
|
|
|
else
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(res == 0,
|
2009-01-30 17:14:00 +01:00
|
|
|
"pt= %d: Expected zero, got %d\n", pt, res);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void test_FBadColumnSet(void)
|
|
|
|
{
|
|
|
|
SPropTagArray pta;
|
|
|
|
ULONG pt, res;
|
|
|
|
|
|
|
|
if (!pFBadColumnSet)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("FBadColumnSet is not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
res = pFBadColumnSet(NULL);
|
|
|
|
ok(res != 0, "(null): Expected non-zero, got 0\n");
|
|
|
|
|
|
|
|
pta.cValues = 1;
|
|
|
|
|
|
|
|
for (pt = 0; pt < PROP_ID_INVALID; pt++)
|
|
|
|
{
|
|
|
|
BOOL bBad = TRUE;
|
|
|
|
|
|
|
|
pta.aulPropTag[0] = pt;
|
|
|
|
|
|
|
|
switch (pt & (~MV_FLAG & PROP_TYPE_MASK))
|
|
|
|
{
|
|
|
|
case PT_UNSPECIFIED:
|
|
|
|
case PT_NULL:
|
|
|
|
case PT_I2:
|
|
|
|
case PT_I4:
|
|
|
|
case PT_R4:
|
|
|
|
case PT_R8:
|
|
|
|
case PT_CURRENCY:
|
|
|
|
case PT_APPTIME:
|
|
|
|
case PT_BOOLEAN:
|
|
|
|
case PT_OBJECT:
|
|
|
|
case PT_I8:
|
|
|
|
case PT_STRING8:
|
|
|
|
case PT_UNICODE:
|
|
|
|
case PT_SYSTIME:
|
|
|
|
case PT_CLSID:
|
|
|
|
case PT_BINARY:
|
|
|
|
bBad = FALSE;
|
|
|
|
}
|
|
|
|
if (pt == (MV_FLAG|PT_ERROR))
|
|
|
|
bBad = FALSE;
|
|
|
|
|
|
|
|
res = pFBadColumnSet(&pta);
|
|
|
|
if (bBad)
|
2006-10-12 20:56:25 +02:00
|
|
|
ok(res != 0, "pt= %d: Expected non-zero, got 0\n", pt);
|
2004-04-24 01:30:00 +02:00
|
|
|
else
|
2009-06-19 12:30:43 +02:00
|
|
|
ok(res == 0,
|
2009-01-30 17:14:00 +01:00
|
|
|
"pt= %d: Expected zero, got %d\n", pt, res);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
static void test_IProp(void)
|
|
|
|
{
|
|
|
|
IPropData *lpIProp;
|
|
|
|
LPMAPIERROR lpError;
|
|
|
|
LPSPropProblemArray lpProbs;
|
|
|
|
LPSPropValue lpProps;
|
|
|
|
LPSPropTagArray lpTags;
|
|
|
|
SPropValue pvs[2];
|
|
|
|
SizedSPropTagArray(2,tags);
|
|
|
|
ULONG access[2], count;
|
|
|
|
SCODE sc;
|
|
|
|
|
|
|
|
if (!pCreateIProp)
|
2010-01-18 13:59:43 +01:00
|
|
|
{
|
|
|
|
win_skip("CreateIProp is not available\n");
|
2005-01-03 18:05:02 +01:00
|
|
|
return;
|
2010-01-18 13:59:43 +01:00
|
|
|
}
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
memset(&tags, 0 , sizeof(tags));
|
|
|
|
|
|
|
|
/* Create the object */
|
|
|
|
lpIProp = NULL;
|
2005-11-08 17:10:37 +01:00
|
|
|
sc = pCreateIProp(&IID_IMAPIPropData, (ALLOCATEBUFFER *)pMAPIAllocateBuffer, (ALLOCATEMORE*)pMAPIAllocateMore,
|
|
|
|
(FREEBUFFER *)pMAPIFreeBuffer, NULL, &lpIProp);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(sc == S_OK && lpIProp,
|
2006-10-12 20:56:25 +02:00
|
|
|
"CreateIProp: expected S_OK, non-null, got 0x%08X,%p\n", sc, lpIProp);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
if (sc != S_OK || !lpIProp)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* GetLastError - No errors set */
|
|
|
|
lpError = NULL;
|
2014-12-22 11:25:07 +01:00
|
|
|
sc = IPropData_GetLastError(lpIProp, E_INVALIDARG, 0, &lpError);
|
2005-01-03 18:05:02 +01:00
|
|
|
ok(sc == S_OK && !lpError,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetLastError: Expected S_OK, null, got 0x%08X,%p\n", sc, lpError);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Get prop tags - succeeds returning 0 items */
|
|
|
|
lpTags = NULL;
|
|
|
|
sc = IPropData_GetPropList(lpIProp, 0, &lpTags);
|
|
|
|
ok(sc == S_OK && lpTags && lpTags->cValues == 0,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetPropList(empty): Expected S_OK, non-null, 0, got 0x%08X,%p,%d\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpTags, lpTags ? lpTags->cValues : 0);
|
|
|
|
if (lpTags)
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIFreeBuffer(lpTags);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Get props - succeeds returning 0 items */
|
|
|
|
lpProps = NULL;
|
|
|
|
count = 0;
|
|
|
|
tags.cValues = 1;
|
|
|
|
tags.aulPropTag[0] = PR_IMPORTANCE;
|
|
|
|
sc = IPropData_GetProps(lpIProp, (LPSPropTagArray)&tags, 0, &count, &lpProps);
|
|
|
|
ok(sc == MAPI_W_ERRORS_RETURNED && lpProps && count == 1,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetProps(empty): Expected ERRORS_RETURNED, non-null, 1, got 0x%08X,%p,%d\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpProps, count);
|
|
|
|
if (lpProps && count > 0)
|
|
|
|
{
|
|
|
|
ok(lpProps[0].ulPropTag == CHANGE_PROP_TYPE(PR_IMPORTANCE,PT_ERROR),
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetProps(empty): Expected %x, got %x\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
CHANGE_PROP_TYPE(PR_IMPORTANCE,PT_ERROR), lpProps[0].ulPropTag);
|
|
|
|
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIFreeBuffer(lpProps);
|
2005-01-03 18:05:02 +01:00
|
|
|
}
|
|
|
|
|
2007-01-18 11:35:50 +01:00
|
|
|
/* Add (NULL) - Can't add NULLs */
|
2005-01-03 18:05:02 +01:00
|
|
|
lpProbs = NULL;
|
|
|
|
pvs[0].ulPropTag = PROP_TAG(PT_NULL,0x01);
|
|
|
|
sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs);
|
|
|
|
ok(sc == MAPI_E_INVALID_PARAMETER && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"SetProps(): Expected INVALID_PARAMETER, null, got 0x%08X,%p\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpProbs);
|
|
|
|
|
2007-01-18 11:35:50 +01:00
|
|
|
/* Add (OBJECT) - Can't add OBJECTs */
|
2005-01-03 18:05:02 +01:00
|
|
|
lpProbs = NULL;
|
|
|
|
pvs[0].ulPropTag = PROP_TAG(PT_OBJECT,0x01);
|
|
|
|
sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs);
|
|
|
|
ok(sc == MAPI_E_INVALID_PARAMETER && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"SetProps(OBJECT): Expected INVALID_PARAMETER, null, got 0x%08X,%p\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpProbs);
|
|
|
|
|
|
|
|
/* Add - Adds value */
|
|
|
|
lpProbs = NULL;
|
|
|
|
pvs[0].ulPropTag = PR_IMPORTANCE;
|
|
|
|
sc = IPropData_SetProps(lpIProp, 1, pvs, &lpProbs);
|
|
|
|
ok(sc == S_OK && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"SetProps(ERROR): Expected S_OK, null, got 0x%08X,%p\n", sc, lpProbs);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Get prop list - returns 1 item */
|
|
|
|
lpTags = NULL;
|
|
|
|
IPropData_GetPropList(lpIProp, 0, &lpTags);
|
|
|
|
ok(sc == S_OK && lpTags && lpTags->cValues == 1,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetPropList: Expected S_OK, non-null, 1, got 0x%08X,%p,%d\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpTags, lpTags ? lpTags->cValues : 0);
|
|
|
|
if (lpTags && lpTags->cValues > 0)
|
|
|
|
{
|
|
|
|
ok(lpTags->aulPropTag[0] == PR_IMPORTANCE,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetPropList: Expected %x, got %x\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
PR_IMPORTANCE, lpTags->aulPropTag[0]);
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIFreeBuffer(lpTags);
|
2005-01-03 18:05:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set access to read and write */
|
|
|
|
sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READWRITE);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08X\n", sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
tags.cValues = 1;
|
|
|
|
tags.aulPropTag[0] = PR_IMPORTANCE;
|
|
|
|
|
|
|
|
/* Set item access (bad access) - Fails */
|
|
|
|
access[0] = 0;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
|
|
|
ok(sc == MAPI_E_INVALID_PARAMETER,
|
2012-05-15 10:15:32 +02:00
|
|
|
"SetPropAccess(0): Expected INVALID_PARAMETER got 0x%08X\n",sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
access[0] = IPROP_READWRITE;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
|
|
|
ok(sc == MAPI_E_INVALID_PARAMETER,
|
2012-05-15 10:15:32 +02:00
|
|
|
"SetPropAccess(RW): Expected INVALID_PARAMETER got 0x%08X\n",sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
access[0] = IPROP_CLEAN;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
|
|
|
ok(sc == MAPI_E_INVALID_PARAMETER,
|
2012-05-15 10:15:32 +02:00
|
|
|
"SetPropAccess(C): Expected INVALID_PARAMETER got 0x%08X\n",sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Set item access to read/write/clean */
|
|
|
|
tags.cValues = 1;
|
|
|
|
tags.aulPropTag[0] = PR_IMPORTANCE;
|
|
|
|
access[0] = IPROP_READWRITE|IPROP_CLEAN;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetPropAccess(RW/C): Expected S_OK got 0x%08X\n",sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Set object access to read only */
|
|
|
|
sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READONLY);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetObjAccess(READ): Expected S_OK got 0x%08X\n", sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Set item access to read/write/dirty - doesn't care about RO object */
|
|
|
|
access[0] = IPROP_READONLY|IPROP_DIRTY;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08X\n", sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Delete any item when set to read only - Error */
|
|
|
|
lpProbs = NULL;
|
|
|
|
tags.aulPropTag[0] = PR_RESPONSE_REQUESTED;
|
|
|
|
sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs);
|
|
|
|
ok(sc == E_ACCESSDENIED && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"DeleteProps(nonexistent): Expected E_ACCESSDENIED null got 0x%08X %p\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpProbs);
|
|
|
|
|
|
|
|
/* Set access to read and write */
|
|
|
|
sc = IPropData_HrSetObjAccess(lpIProp, IPROP_READWRITE);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetObjAccess(WRITE): Expected S_OK got 0x%08X\n", sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2005-02-10 20:19:35 +01:00
|
|
|
/* Delete nonexistent item - No error */
|
2005-01-03 18:05:02 +01:00
|
|
|
lpProbs = NULL;
|
|
|
|
tags.aulPropTag[0] = PR_RESPONSE_REQUESTED;
|
|
|
|
sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs);
|
|
|
|
ok(sc == S_OK && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"DeleteProps(nonexistent): Expected S_OK null got 0x%08X %p\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpProbs);
|
|
|
|
|
2005-01-10 14:29:24 +01:00
|
|
|
/* Delete existing item (r/o) - No error, but lpProbs populated */
|
2005-01-03 18:05:02 +01:00
|
|
|
lpProbs = NULL;
|
|
|
|
tags.aulPropTag[0] = PR_IMPORTANCE;
|
|
|
|
sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs);
|
|
|
|
ok(sc == S_OK && lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"DeleteProps(RO): Expected S_OK non-null got 0x%08X %p\n", sc, lpProbs);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
if (lpProbs && lpProbs->cProblem > 0)
|
|
|
|
{
|
|
|
|
ok(lpProbs->cProblem == 1 &&
|
|
|
|
lpProbs->aProblem[0].ulIndex == 0 &&
|
|
|
|
lpProbs->aProblem[0].ulPropTag == PR_IMPORTANCE &&
|
|
|
|
lpProbs->aProblem[0].scode == E_ACCESSDENIED,
|
2006-10-12 20:56:25 +02:00
|
|
|
"DeleteProps(RO): Expected (1,0,%x,%x) got (%d,%x,%x)\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
PR_IMPORTANCE, E_ACCESSDENIED,
|
|
|
|
lpProbs->aProblem[0].ulIndex, lpProbs->aProblem[0].ulPropTag,
|
|
|
|
lpProbs->aProblem[0].scode);
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIFreeBuffer(lpProbs);
|
2005-01-03 18:05:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
lpProbs = NULL;
|
|
|
|
tags.cValues = 1;
|
|
|
|
tags.aulPropTag[0] = PR_RESPONSE_REQUESTED;
|
|
|
|
IPropData_HrAddObjProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs);
|
|
|
|
ok(sc == S_OK && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"AddObjProps(RO): Expected S_OK null got 0x%08X %p\n", sc, lpProbs);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Get prop list - returns 1 item */
|
|
|
|
lpTags = NULL;
|
|
|
|
IPropData_GetPropList(lpIProp, 0, &lpTags);
|
|
|
|
ok(sc == S_OK && lpTags && lpTags->cValues == 1,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetPropList: Expected S_OK, non-null, 1, got 0x%08X,%p,%d\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
sc, lpTags, lpTags ? lpTags->cValues : 0);
|
|
|
|
if (lpTags && lpTags->cValues > 0)
|
|
|
|
{
|
|
|
|
ok(lpTags->aulPropTag[0] == PR_IMPORTANCE,
|
2006-10-12 20:56:25 +02:00
|
|
|
"GetPropList: Expected %x, got %x\n",
|
2005-01-03 18:05:02 +01:00
|
|
|
PR_IMPORTANCE, lpTags->aulPropTag[0]);
|
2005-10-27 20:29:27 +02:00
|
|
|
pMAPIFreeBuffer(lpTags);
|
2005-01-03 18:05:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Set item to r/w again */
|
|
|
|
access[0] = IPROP_READWRITE|IPROP_DIRTY;
|
|
|
|
sc = IPropData_HrSetPropAccess(lpIProp, (LPSPropTagArray)&tags, access);
|
2012-05-15 10:15:32 +02:00
|
|
|
ok(sc == S_OK, "SetPropAccess(WRITE): Expected S_OK got 0x%08X\n", sc);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
2005-01-10 14:29:24 +01:00
|
|
|
/* Delete existing item (r/w) - No error, no problems */
|
2005-01-03 18:05:02 +01:00
|
|
|
lpProbs = NULL;
|
|
|
|
sc = IPropData_DeleteProps(lpIProp, (LPSPropTagArray)&tags, &lpProbs);
|
|
|
|
ok(sc == S_OK && !lpProbs,
|
2006-10-12 20:56:25 +02:00
|
|
|
"DeleteProps(RO): Expected S_OK null got 0x%08X %p\n", sc, lpProbs);
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
/* Free the list */
|
|
|
|
IPropData_Release(lpIProp);
|
|
|
|
}
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
START_TEST(prop)
|
2005-01-03 18:05:02 +01:00
|
|
|
{
|
2007-03-04 11:44:34 +01:00
|
|
|
SCODE ret;
|
|
|
|
|
2001-09-17 00:00:00 +02:00
|
|
|
if (!HaveDefaultMailClient())
|
|
|
|
{
|
|
|
|
win_skip("No default mail client installed\n");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2005-10-27 20:29:27 +02:00
|
|
|
if(!InitFuncPtrs())
|
2007-03-04 11:44:34 +01:00
|
|
|
{
|
2009-02-23 10:40:40 +01:00
|
|
|
win_skip("Needed functions are not available\n");
|
2004-04-24 01:30:00 +02:00
|
|
|
return;
|
2007-03-04 11:44:34 +01:00
|
|
|
}
|
2005-10-27 20:29:27 +02:00
|
|
|
|
2007-03-04 11:44:34 +01:00
|
|
|
SetLastError(0xdeadbeef);
|
|
|
|
ret = pScInitMapiUtil(0);
|
|
|
|
if ((ret != S_OK) && (GetLastError() == ERROR_PROC_NOT_FOUND))
|
|
|
|
{
|
2009-02-23 10:40:40 +01:00
|
|
|
win_skip("ScInitMapiUtil is not implemented\n");
|
2007-03-04 11:44:34 +01:00
|
|
|
FreeLibrary(hMapi32);
|
|
|
|
return;
|
|
|
|
}
|
2009-06-19 12:30:43 +02:00
|
|
|
else if ((ret == E_FAIL) && (GetLastError() == ERROR_INVALID_HANDLE))
|
|
|
|
{
|
|
|
|
win_skip("ScInitMapiUtil doesn't work on some Win98 and WinME systems\n");
|
|
|
|
FreeLibrary(hMapi32);
|
|
|
|
return;
|
|
|
|
}
|
2004-04-24 01:30:00 +02:00
|
|
|
|
|
|
|
test_PropCopyMore();
|
|
|
|
test_UlPropSize();
|
2010-01-31 01:58:11 +01:00
|
|
|
|
|
|
|
/* We call MAPIInitialize here for the benefit of native extended MAPI
|
|
|
|
* providers which crash in the FPropContainsProp tests when MAPIInitialize
|
|
|
|
* has not been called. Since MAPIInitialize is irrelevant for FPropContainsProp
|
|
|
|
* on Wine, we do not care whether MAPIInitialize succeeds. */
|
|
|
|
if (pMAPIInitialize)
|
|
|
|
ret = pMAPIInitialize(NULL);
|
2004-04-24 01:30:00 +02:00
|
|
|
test_FPropContainsProp();
|
2010-01-31 01:58:11 +01:00
|
|
|
if (pMAPIUninitialize && ret == S_OK)
|
|
|
|
pMAPIUninitialize();
|
|
|
|
|
2004-04-24 01:30:00 +02:00
|
|
|
test_FPropCompareProp();
|
|
|
|
test_LPropCompareProp();
|
|
|
|
test_PpropFindProp();
|
|
|
|
test_ScCountProps();
|
2004-05-03 22:19:00 +02:00
|
|
|
test_ScCopyRelocProps();
|
2004-04-24 01:30:00 +02:00
|
|
|
test_LpValFindProp();
|
|
|
|
test_FBadRglpszA();
|
|
|
|
test_FBadRglpszW();
|
|
|
|
test_FBadRowSet();
|
|
|
|
test_FBadPropTag();
|
|
|
|
test_FBadRow();
|
|
|
|
test_FBadProp();
|
|
|
|
test_FBadColumnSet();
|
2005-01-03 18:05:02 +01:00
|
|
|
|
|
|
|
test_IProp();
|
2010-01-31 01:58:11 +01:00
|
|
|
|
|
|
|
pDeinitMapiUtil();
|
2005-10-27 20:29:27 +02:00
|
|
|
FreeLibrary(hMapi32);
|
2004-04-24 01:30:00 +02:00
|
|
|
}
|