The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: gavin on October 07, 2005, 09:32:16 PM

Title: LockFile (Low-order word of the starting byte)
Post by: gavin on October 07, 2005, 09:32:16 PM
Hi guys

I'm recoding an app i wrote as i know how to do it more effienctly now and with more options.
But ran into this slight problem maybe you have used this before?


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    invoke LockFile,     
    hFile,                                      ;file handle
    dwFileOffsetLow,                     ;where the lock should begin
   dwFileOffsetHigh,                      ;where the lock should begin
   nNumberOfBytesToLockLow,      ;length of the byte range to be locked
   nNumberOfBytesToLockHigh       ;length of the byte range to be locked
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


Im just locking this file just incase of users trying to edit it read it or write to it etc.
Thanks
Title: Re: LockFile (Low-order word of the starting byte)
Post by: QvasiModo on October 07, 2005, 10:25:16 PM
You shouldn't need this API unless you want to lock parts of the file. If you want to lock the whole file pass the appropriate flags to CreateFile. :)
Title: Re: LockFile (Low-order word of the starting byte)
Post by: gavin on October 08, 2005, 12:17:07 PM
Ah i see now.
How stupid i was to try use this.

I used the file_share_read instead  :lol
Thanks .