{ Win32 specific implementation of the functions declared in VpUsrLow }

function SetResult(Success: Boolean): LongInt;
begin
  Result:= 0;
  if not Success then
    Result:= GetLastError;
end;

function SysLockFile(_Handle, _LockStart, _LockLength: LongInt): LongInt;
var
  Success: Boolean;
begin
  Success:= Windows.LockFile(_Handle, _LockStart, 0, _LockLength, 0);
  Result:= SetResult(Success);
end;

function SysUnLockFile(_Handle, _LockStart, _LockLength: LongInt): LongInt;
var
  Success: Boolean;
begin
  Success:= Windows.UnLockFile(_Handle, _LockStart, 0, _LockLength, 0);
  Result:= SetResult(Success);
end;

