How to lock file in Windows?

Posted by matsoor on Stack Overflow See other posts from Stack Overflow or by matsoor
Published on 2010-05-05T08:14:25Z Indexed on 2010/05/05 8:18 UTC
Read the original article Hit count: 202

Filed under:
|
|

How to lock file in Windows so that this file can be opened/read/wrote only by one process?

I found out that file can be locked with CreateFile by giving 0 to dwShareMode flag. It works but only the returned handle can be used to work with file. But I want to be able to lock the file to other processes and at the same time to create multiple handles in my process.

Please help me to solve this issue or give some tips...

© Stack Overflow or respective owner

Related posts about c++

Related posts about winapi