can not break on a memory region created by MapViewOfFile

I have a user mode executable which setup a file mapping by following steps

  1. CreateFileMapping (file handle is INVALID_HANDLE_VALUE)
  2. MapViewOfFile (got a memory address)
    I set a memory write break point on the returned address
ba w 4 addr

the debugger never break on this break point, but the content of the breaking region do changed. So how to break in this situation ? Many thanks!!

Remember, that only breaks on those exact 4 bytes. Are you literally changing the first four bytes? Also remember that this only traps writes to this virtual address within this process. If the region is being written in another process, that will use a different virtual address and won’t be trapped.

@Tim_Roberts said:
If the region is being written in another process, that will use a different virtual address and won’t be trapped.
got it. This is my case I’ve never met before. Thank you.