kernel32/tests: Improve loading of debugger's test children results.
commit2486f5a0028de8bfd23c46e8f1d95064cf994be5
authorEric Pouech <eric.pouech@gmail.com>
Fri, 16 Dec 2022 15:38:54 +0000 (16 16:38 +0100)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 16 Dec 2022 17:50:50 +0000 (16 18:50 +0100)
tree23fb7044ee7d99c74706a493a793a78777a67bb2
parent2acacb83d1cc8d44c45560be625c8f15b2a77c86
kernel32/tests: Improve loading of debugger's test children results.

Even if there's a synchronisation mechanism between kernel32:debugger
and its children which ensures that child has finished writing to and
closed the blackbox logging file before reading it, there's no
guarantee that the file is not re-opened by another process: antivirus,
file indexing...
And according to [1], even the OS itself can still have opened references
to it.

So, always open/read the blackbox file in read share mode to work around
this issue.

Also, harden the code for potential errors, and be nicer in where
failures come from.

[1] https://learn.microsoft.com/en-us/windows-hardware/drivers/ifs/irp-mj-cleanup

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53456
Signed-off-by: Eric Pouech <eric.pouech@gmail.com>
dlls/kernel32/tests/debugger.c