[KDVM] Fix definition of RtlEqualMemory() (#6988)

Comply with the standard documented behaviour:

https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlequalmemory#return-value
> RtlEqualMemory returns TRUE if Source1 and Source2 are equivalent; otherwise, it returns FALSE.

and
https://learn.microsoft.com/en-us/windows-hardware/drivers/ddi/wdm/nf-wdm-rtlcomparememory#return-value
> [...] If all bytes match up to the specified Length value, the Length value is returned.
This commit is contained in:
Hermès Bélusca-Maïto 2024-06-03 21:12:35 +02:00
parent 0a8b421d53
commit b84f2a1cdc
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 2 additions and 2 deletions

View file

@ -121,7 +121,7 @@ KdVmSendReceive(
return NULL;
}
if (RtlEqualMemory(ReceiveHeader->Magic, KdVmReplyMagic, 9))
if (!RtlEqualMemory(ReceiveHeader->Magic, KdVmReplyMagic, 9))
{
KDDBGPRINT("KdVmSendReceive: got invalid Magic: '%*s'\n",
sizeof(KdVmReplyMagic), ReceiveHeader->Magic);

View file

@ -15,7 +15,7 @@
#include <arc/arc.h>
#undef RtlEqualMemory
#define RtlEqualMemory(a, b, c) (RtlCompareMemory(a, b, c) != c)
#define RtlEqualMemory(dst, src, len) (RtlCompareMemory((dst), (src), (len)) == (len))
//#define KDDEBUG /* uncomment to enable debugging this dll */