propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
5cbc84e51e
commit
ff9601147d
|
@ -18,8 +18,12 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#define NONAMELESSUNION
|
||||
|
||||
|
@ -112,6 +116,25 @@ static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits,
|
|||
src_signed = FALSE;
|
||||
*res = 0;
|
||||
break;
|
||||
case VT_LPSTR:
|
||||
{
|
||||
char *end;
|
||||
*res = strtoll(pv->u.pszVal, &end, 0);
|
||||
if (pv->u.pszVal == end)
|
||||
return DISP_E_TYPEMISMATCH;
|
||||
src_signed = *res < 0;
|
||||
break;
|
||||
}
|
||||
case VT_LPWSTR:
|
||||
case VT_BSTR:
|
||||
{
|
||||
WCHAR *end;
|
||||
*res = strtolW(pv->u.pwszVal, &end, 0);
|
||||
if (pv->u.pwszVal == end)
|
||||
return DISP_E_TYPEMISMATCH;
|
||||
src_signed = *res < 0;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
FIXME("unhandled vt %d\n", pv->vt);
|
||||
return E_NOTIMPL;
|
||||
|
@ -698,8 +721,19 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2
|
|||
CMP_INT_VALUE(uhVal.QuadPart);
|
||||
break;
|
||||
case VT_BSTR:
|
||||
/* FIXME: Use string flags. */
|
||||
res = lstrcmpW(propvar1->u.bstrVal, propvar2->u.bstrVal);
|
||||
case VT_LPWSTR:
|
||||
/* FIXME: Use other string flags. */
|
||||
if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC))
|
||||
res = lstrcmpiW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal);
|
||||
else
|
||||
res = lstrcmpW(propvar1->u.bstrVal, propvar2_converted->u.bstrVal);
|
||||
break;
|
||||
case VT_LPSTR:
|
||||
/* FIXME: Use other string flags. */
|
||||
if (flags & (PVCF_USESTRCMPI | PVCF_USESTRCMPIC))
|
||||
res = lstrcmpiA(propvar1->u.pszVal, propvar2_converted->u.pszVal);
|
||||
else
|
||||
res = lstrcmpA(propvar1->u.pszVal, propvar2_converted->u.pszVal);
|
||||
break;
|
||||
default:
|
||||
FIXME("vartype %d not handled\n", propvar1->vt);
|
||||
|
|
|
@ -735,10 +735,10 @@ static void test_PropVariantCompare(void)
|
|||
ok(res == 0, "res=%i\n", res);
|
||||
|
||||
res = PropVariantCompareEx(&i2_2, &str_2, 0, 0);
|
||||
todo_wine ok(res == 0, "res=%i\n", res);
|
||||
ok(res == 0, "res=%i\n", res);
|
||||
|
||||
res = PropVariantCompareEx(&i2_2, &str_02, 0, 0);
|
||||
todo_wine ok(res == 0, "res=%i\n", res);
|
||||
ok(res == 0, "res=%i\n", res);
|
||||
|
||||
res = PropVariantCompareEx(&str_2, &i2_2, 0, 0);
|
||||
todo_wine ok(res == 0, "res=%i\n", res);
|
||||
|
|
Loading…
Reference in New Issue