ScanBinderyObject

Scans the bindery for an object (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWScanObject)

Local Servers:blocking
Remote Servers:blocking
Classification:3.x, 4.x, 5.x, 6.x
Service:Server-Based Bindery

Syntax

   #include <\nlm\nit\nwbindry.h>  
    
   int ScanBinderyObject (  
      char   *searchObjectName,  
      WORD   searchObjectType,  
      long   *objectID,  
      char   *objectName,  
      WORD   *objectType,  
      char   *objectHasProperties,  
      char   *objectFlag,  
      char   *objectSecurity); 
   

Parameters

searchObjectName
(IN) Specifies the string containing the bindery object to search for (maximum 48 characters; can contain wildcard characters, including the NULL terminator).
searchObjectType
(IN/OUT) Specifies the type of the bindery object to search for (OT_WILD, OT_USER, OT_GROUP, OT_PRINT_SERVER, and so on).
objectID
(IN/OUT) Contains the object ID from the previous search (initial search requires a -1), and receives the unique bindery object ID for the matching object.
objectName
(OUT) Receives a NULL-terminated string containing the name of the matching bindery object (maximum 48 characters, including the NULL terminator).
objectType
(OUT) Receives the type of the matching bindery object (OT_USER, OT_GROUP, OT_PRINT_SERVER, and so on).
objectHasProperties
(OUT) Receives a flag that indicates if the bindery object has properties to scan: 0 = No properties for object. 255 = Object has properties.
objectFlag
(OUT) Receives a flag that indicates if the matching bindery object is Dynamic or Static (BF_DYNAMIC or BF_STATIC).
objectSecurity
(OUT) Receives a flag that indicates the read and write access of others to the matching bindery object.

Return Values

0

(0x00)

ESUCCESS

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

239

(0xEF)

ERR_INVALID_NAME

252

(0xFC)

ERR_NO_SUCH_OBJECT

254

(0xFE)

ERR_SERVER_BINDERY_LOCKED

255

(0xFF)

ERR_BINDERY_FAILURE

Remarks

This function is used iteratively to scan the bindery for all objects that match both the searchObjectName and the searchObjectType parameters.

The objectID parameter should be set to -1 for the first search. Upon return, the objectID parameter receives a number which is the value in the objectID parameter for the next call. This function can scan for one particular object type or all object types (WILD). It can also scan for a specific object name, or it can use wildcard characters to scan for a group of related object names.

The objectSecurity parameter is actually two nibbles. The low-order nibble determines who can scan for and find the object. The high-order nibble determines who can add properties to the object. The following values are defined for each nibble:

0

0 0 0 0

Anyone

1

0 0 0 1

Logged

2

0 0 1 0

Object

3

0 0 1 1

Supervisor

4

0 1 0 0

NetWare Operating System

For example, 0x31 indicates that any user logged in to the server can find the object, but only the supervisor can add a property to the object.

See Also

ChangeBinderyObjectSecurity, CreateBinderyObject, DeleteBinderyObject, ScanProperty

ScanBinderyObject Example

   #include <stdio.h>  
   #include <\nlm\nit\nwbindry.h>  
    
   main()  
   {  
   int   completionCode;  
   char  searchObjectName[48];  
   WORD  searchObjectType;  
   long  objectID = -1;  
   char  objectName[48];  
   WORD  objectType;  
   char  objectHasProperties;  
   char  objectFlag;  
   char  objectSecurity;  
    
      printf ("\n\n");  
      printf ("Enter Object name to search:  ");  
      scanf ("%s", searchObjectName);  
      printf ("\nEnter object type to search:  ");  
      scanf ("%4X", &searchObjectType);  
      printf ("\nObject name...     %s\n", searchObjectName);  
      printf ("\nObject type...     %d\n", searchObjectType);  
      printf ("\nObject type...     %4X\n", searchObjectType);  
      printf ("\n\n\n\n\n\n");  
      printf ("OBJECT NAME        OBJECT TYPE       OBJECT ID\n");  
      printf ("———-        ———-       ——\n\n");  
      for (objectID = -1, completionCode = 0; !completionCode;)  
      {  
         completionCode = ScanBinderyObject (searchObjectName,  
             searchObjectType, &objectID, objectName,  
             &objectType, &objectHasProperties,  
             &objectFlag, &objectSecurity);  
         if (completionCode == 0)  
         {  
            printf ("%15s             %2d               %8lX\n",  
                    objectName, objectType, objectID);  
            printf ("More %d, Dynamic/Static %d, R/W Access %d\n",  
                    objectHasProperties, objectFlag,  
                    objectSecurity);  
         }  
      }  
   }