Reputation: 1
I know I can use memcmp in Windows but I'm wondering if there's something native to the platform like CompareMemory. I have heard of RtlCompareMemory but that's for drivers apparently.
Upvotes: 2
Views: 2516
Reputation: 1
There is the "RtlEqualMemory" macro in the Windows API. It returns TRUE if the Destination and Source are same, and FALSE otherwise.
#define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length)))
Upvotes: 0
Reputation: 386
According to this https://support.microsoft.com/en-us/help/99456/win32-equivalents-for-c-run-time-functions
It would appear there is no Win32 equivalent to memcmp.
It is also worth noting that RtlCompareMemory's return value is different from memcmp. It returns the count of identical bytes.
Upvotes: 1