Commit ff960114 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

propsys: Add support for VT_LPSTR and VT_LPWSTR to PropVariantCompareEx.

parent 5cbc84e5
...@@ -18,8 +18,12 @@ ...@@ -18,8 +18,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
#define NONAMELESSUNION #define NONAMELESSUNION
...@@ -112,6 +116,25 @@ static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits, ...@@ -112,6 +116,25 @@ static HRESULT PROPVAR_ConvertNumber(REFPROPVARIANT pv, int dest_bits,
src_signed = FALSE; src_signed = FALSE;
*res = 0; *res = 0;
break; 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: default:
FIXME("unhandled vt %d\n", pv->vt); FIXME("unhandled vt %d\n", pv->vt);
return E_NOTIMPL; return E_NOTIMPL;
...@@ -698,8 +721,19 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2 ...@@ -698,8 +721,19 @@ INT WINAPI PropVariantCompareEx(REFPROPVARIANT propvar1, REFPROPVARIANT propvar2
CMP_INT_VALUE(uhVal.QuadPart); CMP_INT_VALUE(uhVal.QuadPart);
break; break;
case VT_BSTR: case VT_BSTR:
/* FIXME: Use string flags. */ case VT_LPWSTR:
res = lstrcmpW(propvar1->u.bstrVal, propvar2->u.bstrVal); /* 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; break;
default: default:
FIXME("vartype %d not handled\n", propvar1->vt); FIXME("vartype %d not handled\n", propvar1->vt);
......
...@@ -735,10 +735,10 @@ static void test_PropVariantCompare(void) ...@@ -735,10 +735,10 @@ static void test_PropVariantCompare(void)
ok(res == 0, "res=%i\n", res); ok(res == 0, "res=%i\n", res);
res = PropVariantCompareEx(&i2_2, &str_2, 0, 0); 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); 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); res = PropVariantCompareEx(&str_2, &i2_2, 0, 0);
todo_wine ok(res == 0, "res=%i\n", res); todo_wine ok(res == 0, "res=%i\n", res);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment