AllocateBlockOfTasks

Returns a unique set of task numbers for the exclusive use of the requesting NLM

Local Servers:nonblocking
Remote Servers:nonblocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Connection Number and Task Management

Syntax

  #include <nwcntask.h>  
   
  LONG AllocateBlockOfTasks  (  
     LONG   numberWanted); 
  

Parameters

numberWanted
(IN) Specifies the requested number of tasks in the set.

Return Values

This function returns the first task number in the set. It returns a value of 0 if no task numbers are available.

Remarks

Several entities can make requests to NetWare® 3.x and above using a given connection number. Unique task numbers enable the calling NLM to use a connection number without any danger of conflict with other entities using that same connection. AllocateBlockOfTasks returns a unique set of task numbers, ensuring that the connection number/task number combination of the NLM is unique.

AllocateBlockOfTasks allocates the requested number of consecutive task numbers on the current connection for exclusive use by the NLM. An NLM that meets the following criteria would call this function:

  • Needs more than one task number for a given connection number.
  • Uses connection 0 or uses a client’s connection number.

The SetCurrentTask function should be used if the NLM needs only one task.

See Also

ReturnBlockOfTasks, SetCurrentTask