SetNLMID
Changes the current NLM ID
#include <nwthread.h>
int SetNLMID (
int newNLMID);
This function returns the ID of the previously current NLM if successful. Otherwise, it returns EFAILURE and sets errno to:
SetNLMID changes the NLM context for the calling thread and its entire thread group. If a library NLM calls SetNLMID from a client thread, the NLM level context of the thread's entire thread group in the client NLM is changed. For this reason, library NLMs are discouraged from calling SetNLMID.
The current NLM determines which NLM "owns" resources that are subsequently allocated. (See Connection Number and Task Management Concepts (NDK: Connection, Message, and NCP Extensions) for a discussion of resources.)
The main implication of "ownership" of resources is the automatic cleanup performed by the NetWare API when an NLM terminates. In the case of a library/client relationship:
NOTE:A library should save and restore the client’s NLM ID when it changes the current NLM ID.