I'm writing a TFTP server program for university, which needs exclusive access to the files it opens for reading. Thus it can be configured that if a file is locked by another process that it waits for the file to become unlocked.

Is there any way on Win32 to wait for a file become unlocked without creating a handle for it first?

The reason I ask, is that if another process calls [CreateFile()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx) with a dwShareMode that is incompatible to the one my process uses, I won't even be able to get a file handle to use for waiting on the lock using [LockFileEx()](http://msdn.microsoft.com/en-us/library/windows/desktop/aa365203%28v=VS.85%29.aspx).

Thanks for your help in advance!