From 06abe790376e2d8d53c12102e3cb9cf8549e1166 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 16 Aug 2001 18:01:41 +0000 Subject: [PATCH] Partially implement oleaut32.VarBstrCmp. --- dlls/oleaut32/oleaut32.spec | 2 +- dlls/oleaut32/variant.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/oleaut32/oleaut32.spec b/dlls/oleaut32/oleaut32.spec index a4317f1325d..2bb7f1873bc 100644 --- a/dlls/oleaut32/oleaut32.spec +++ b/dlls/oleaut32/oleaut32.spec @@ -318,7 +318,7 @@ debug_channels (ole typelib) 437 stub VarAdd # stdcall (ptr ptr ptr) 438 stub VarAnd # stdcall (ptr ptr ptr) 439 stub VarBstrCat # stdcall (ptr ptr ptr) -440 stub VarBstrCmp # stdcall (ptr ptr long long) +440 stdcall VarBstrCmp(ptr ptr long long) VarBstrCmp 441 stub VarCat # stdcall (ptr ptr ptr) 442 stub VarCmp # stdcall (ptr ptr long long) 443 stub VarCyAbs diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index c0390c6c4b1..86d20bc25a2 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -4640,3 +4640,35 @@ HRESULT WINAPI VarDateFromUdate(UDATE *pudateout, return i; } + + +/********************************************************************** + * VarBstrCmp [OLEAUT32.440] + * + * flags can be: + * NORM_IGNORECASE, NORM_IGNORENONSPACE, NORM_IGNORESYMBOLS + * NORM_IGNORESTRINGWIDTH, NORM_IGNOREKANATYPE, NORM_IGNOREKASHIDA + * + */ +HRESULT WINAPI VarBstrCmp(BSTR left, BSTR right, LCID lcid, DWORD flags) +{ + DWORD r; + + FIXME("( %s %s %ld %lx ) partial stub\n", debugstr_w(left), debugstr_w(right), lcid, flags); + + if((!left) || (!right)) + return VARCMP_NULL; + + if(flags&NORM_IGNORECASE) + r = lstrcmpiW(left,right); + else + r = lstrcmpW(left,right); + + if(r<0) + return VARCMP_LT; + if(r>0) + return VARCMP_GT; + + return VARCMP_EQ; +} +