How about using RtlEqualString() ?

        Str1.MaximumLength = 16;
        Str1.Buffer = &AnsiString;

        if (!RtlEqualString( &str1, &str2, TRUE ){

        }

-----Original Message-----
From: Nithin Raju 
Sent: Wednesday, September 17, 2014 8:34 AM
To: Samuel Ghinet
Cc: dev@openvswitch.org; Eitan Eliahu; Ankur Sharma; Alin Serdean
Subject: Re: [PATCH 2/5 v1] datapath-windows: add OvsComareString() to compare 
strings

On Sep 17, 2014, at 6:16 AM, Samuel Ghinet <sghi...@cloudbasesolutions.com>
 wrote:

> I don't think there's a need to implement such a function.
> You can use memcmp, which behaves quite like strncmp.

hi Samuel,
Thanks for the pointer. I was trying to use Rtl* functions, but if memcmp() 
works, that is great.

I have a couple of questions though that are not clear to me from the 
documentation:
1. how does memcmp() when the lengths are different? what is the length 
argument that we need to pass?
2. If the lengths are different, we should be passing the larger length, does 
memcmp() terminate when it sees the NUL ('\0') character? Obviously passing the 
smaller length would be wrong.

If memcmp() has the same limitations as RtlCompareMemory() then we need this 
function.

Thanks,
-- Nithin

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to