NWLogPhysicalRecord

Logs a physical record in preparation for a lock

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Synchronization

Syntax

  #include <nwfile.h> 
  or 
  #include <nwcalls.h> 
   
  N_EXTERN_LIBRARY( NWCCODE )NWLogPhysicalRecord  ( 
     NWFILE_HANDLE   fileHandle,  
     nuint32         recStartOffset,  
     nuint32         recLength,  
     nuint8          lockFlags,  
     nuint16         timeOut);
  

Delphi Syntax

  uses calwin32 
   
  Function NWLogPhysicalRecord 
    (fileHandle : NWFILE_HANDLE; 
     recStartOffset : nuint32; 
     recLength : nuint32; 
     lockFlags : nuint8; 
     timeOut : nuint16 
  ) : NWCCODE;
  

Parameters

fileHandle
(IN) Specifies the file handle of the file whose record is being logged (must be valid).
recStartOffset
(IN) Specifies the offset into the file where the record being logged begins.
recLength
(IN) Specifies the length, in bytes, of the record to be logged.
lockFlags
(IN) Specifies the lock flags.
timeOut
(IN) Specifies the length of time the NetWare server attempts to lock the record before timing out.

Return Values

These are common return values; see Return Values (NDK: Connection, Message, and NCP Extensions) for more information.

0x0000

SUCCESSFUL

0x0006

INVALID_HANDLE

0x8988

INVALID_FILE_HANDLE

0x8996

SERVER_OUT_OF_MEMORY

0x89FD

LOCK_COLLISION

0x89FE

TIMEOUT_FAILURE

0x89FF

LOCK_ERROR

Remarks

The NetWare server attempts to log the record for the length of time specified by timeOutLimit before returning a time out error. timeOut is specified in units of 1/18 second (0 = no wait).

lockFlags ’ values follow:

  0 = Log only 
  1 = Log and lock exclusive 
  3 = Log and lock shareable
  

timeOut is specified in units of 1/18 second (0 = no wait).

Normally, a set of files or records is logged and then locked as a set. However, a single file or record can also be locked when it is entered in the log table.

The release functions, NWReleasePhysicalRecord and NWReleasePhysicalRecordSet, unlock a lock or set of locks. The clear functions, NWClearPhysicalRecord and NWClearPhysicalRecordSet, unlock and remove a lock or set of locks from the log table.

To avoid deadlock, request those resources needing to be locked by making an entry in the File Log Table at the NetWare server. Once the log table is complete, NWLogPhysicalRecord can then lock those records. The locking works only if all records in the table are available. If some of the logged resources cannot be locked, the lock fails and none of the resources are locked.

NWLogPhysicalRecord returns 0x0006 if an invalid file handle is passed to the fileHandle parameter.

NCP Calls

See Also

NWClearLogicalRecord, NWClearLogicalRecordSet, NWLockLogicalRecordSet, NWReleaseLogicalRecord, NWReleaseLogicalRecordSet