DFSReadNoWait

Reads the sectors requested from a file using DFS (returns after initiation)

Local Servers:blocking
Remote Servers:N/A
NetWare Server:4.x, 5.x, 6.x
Platform:NLM
Service:Direct File System

Syntax

  #include <nwdfs.h>  
   
  LONG DFSReadNoWait  (  
     LONG      fileHandle,   
     LONG      startingSector,   
     LONG      sectorCount,   
     BYTE     *buffer,   
     struct DFSCallBackParameters   *callBackNode); 
  

Parameters

fileHandle
(IN) Specifies the file handle returned from a prior call to open for the indicated file.
startingSector
(IN) Specifies the starting sector number (logical offset from beginning of file) in the file where the read operation is to begin.
sectorCount
(IN) Specifies the number of sectors to be read into the buffer.
buffer
(OUT) Points to a contiguous buffer area large enough to contain the number of sectors indicated to be read.
callBackNode
(IN) Pointer to a structure used to signal completion of all requested reads for a particular call to DFSReadNoWait.

Return Values

0

Read Normal Initiation

!=0

Read not initiated

NOTE:The actual completion is stored in the completionCode field of the DFSCallBackParameters upon completion of the request.

Remarks

This function is identical to DFSRead, except that the return to the function caller is made immediately after posting the reads to the driver. This means that the status returned from the function only indicates whether the call was initiated or not. The completion status is returned in the structure provided for completion notification. A calling process must allow other processes to run. Consequently, any long sequence of code including this function call should make frequent calls to ThreadSwitch to allow other processes to be executed.

The DFSCallBackParameters structure is defined as follows:

  struct DFSCallBackParameters  
  {  
     LONG   localSemaphoreHandle;  
     LONG   completionCode;  
  }; 
  

The localSemaphoreHandle field contains a local semaphore handle obtained by calling OpenLocalSemaphore. WaitOnLocalSemaphore or ExamineLocalSemaphore should be called to determine when the semaphore has been signalled.

The completionCode field contains the actual completion code, initialized to -1 by this function and updated upon completion. For completion code values, see DFSRead.

See Also

DFSRead, DFSWriteNoWait, OpenLocalSemaphore (NDK: NLM Threads Management)