NWDSPutFilter

Prepares a search filter expression tree in a request buffer so it can be used in a call to NWDSSearch.

NetWare Server:4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98, Windows 2000, Windows XP
Library:Cross-Platform NDS (NET*.*)
Service:NDS

Syntax

C

  #include <nwnet.h> 
  or 
  #include <nwdsfilt.h> 
   
  N_EXTERN_LIBRARY (NWDSCCODE)  NWDSPutFilter  ( 
     NWDSContextHandle   context,  
     pBuf_T              buf,  
     pFilter_Cursor_T    cur,  
     void                (N_FAR N_CDECL  *freeVal)(
                              nuint32   syntax,
                              nptr      val) );
  

Pascal

  uses netwin32 
   
  Function NWDSPutFilter 
    (context : NWDSContextHandle; 
     buf : pBuf_T; 
     cur : pFilter_Cursor_T; 
     freeVal : FreeValProc 
  ) : NWDSCCODE;
  

Parameters

context

(IN) Specifies the NDS context for the request.

buf

(IN) Points to the request buffer being prepared.

cur

(IN) Points to a cursor to the filter expression tree being stored in the buffer.

freeVal

(IN) Points to the function used to free the attribute values.

Return Values

0x0000 0000

SUCCESSFUL

nonzero value

Nonzero values indicate errors. See NDS Return Values (–001 to –799).

Remarks

The buf parameter points to a Buf_T, which is allocated by NWDSAllocBuf and initialized for a DSV_SEARCH_FILTER operation by NWDSInitBuf.

NWDSPutFilter frees the area allocated to the expression tree, including the area referenced by cur. If the application needs to retain the expression tree, the application should save the tree in some form before calling NWDSPutFilter.

NOTE:NWDSPutFilter always frees the memory allocated to the expression tree, even if NWDSPutFilter returns an error. Do not call NWDSFreeFilter to free the filter if NWDSPutFilter returns an error. Doing so will corrupt memory since the filter will already have been freed.

The freeVal parameter points to a function freeing the attribute values. The function is passed the syntax attribute ID and the address of the area to free. The freeVal parameter can be NULL, in which case no attribute values are freed.

NCP Calls

See Also

NWDSAddFilterToken, NWDSAllocFilter, NWDSDelFilterToken, NWDSFreeFilter