Both Rtlcopymemory and rtlmovememory are memory replicas. The difference is that rtlcopymemory non-overlapping replication, while rtlmovememory is overlapping replication, what exactly does that mean? The specific explanations are as follows:
ABCD represents the start and end addresses of the three-segment memory, respectively. If you need to copy the A-to-C memory into the B-to-D memory, this is the memory of the B-to-c segment, which is the overlapping part. The internal implementation of the Rtlcopymemory function is based on the memcpy function. According to the C99 definition, memcpy does not consider overlapping portions, so he cannot guarantee that overlapping parts will be duplicated. In order to ensure that overlapping parts are also copied correctly, C99 specifies that the Memmove function accomplishes this task. This function determines whether or not two memory overlaps, and this judgment sacrifices the speed.
If the programmer can ensure that the copied memory does not overlap, select Use memcpy. If it is not guaranteed, choose to use the Memmove function. To ensure portability, DDK uses macros to encapsulate these two functions, namely: Rtlcopymemory and RtlMoveMemory.