Erich Hoover wrote:
I see your point. However, since the function you are implementing is in
kernel32 anyway you could abstract it away and make both functions
(CopyFile and ReplaceFile) call some internal function. That way you
would get rid of the locking completly which is argueably somewhat ugly.
On closer inspection, CreateFile actually seems to take care of this
with the "security attributes" and "template" parameters. It does not
look like the security attributes are implemented yet (or the call to
get the security attributes for a file) but since CreateFile already
handles this it seems unnecessary to add a new break-out function. You
will likely find the attached more to your liking.
Doesn't matter what I like, in the end it's up to Alexandre.
But yes, looks much better to me (although I'd still say it makes sense
to abstract away the actually copying in a subroutine).
Felix