Instead of using interop you can use the .NET FileStream class methods Lock and Unlock:
FileStream.Lock
http://msdn.microsoft.com/en-us/library/system.io.filestream.lock.aspx
FileStream.Unlock
http://msdn.microsoft.com/en-us/library/system.io.filestream.unlock.aspx