CreateBinderyObject

Creates a bindery object (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWCreateObject)

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 CreateBinderyObject (  
      char   *objectName,  
      WORD   objectType,  
      BYTE   objectFlag,  
      BYTE   objectSecurity); 
   

Parameters

objectName
(IN) Specifies the string containing the name of the new bindery object (maximum 48 characters, including the NULL terminator).
objectType
(IN) Specifies the type of the new bindery object (OT_USER, OT_GROUP, OT_PRINT_SERVER, and so on).
objectFlag
(IN) Indicates whether the new bindery object is Dynamic or Static (BF_DYNAMIC or BF_STATIC).
objectSecurity
(IN) Indicates the read/write access of others to the new bindery object.

Return Values

0

(0x00)

ESUCCESS

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

238

(0xEE)

ERR_OBJECT_ALREADY_EXISTS

239

(0xEF)

ERR_INVALID_NAME

241

(0xF1)

ERR_INVALID_BINDERY_SECURITY

245

(0xF5)

ERR_NO_OBJECT_CREATE_PRIVILEGE

254

(0xFE)

ERR_SERVER_BINDERY_LOCKED

255

(0xFF)

ERR_BINDERY_FAILURE

Remarks

The objectName and objectType parameters must uniquely identify the bindery object and must not contain wildcard characters. The objectName can be from 1 to 48 characters long, including the NULL terminator. Only printable characters can be used. Slashes, backslashes, colons, semicolons, commas, asterisks, and question marks are prohibited.

The objectFlag parameter is a one-byte parameter which indicates whether the object is Dynamic (0x01) or Static (0x00). A dynamic object is an object that is created and deleted frequently. Dynamic objects are deleted from the bindery when the server is initialized or when the object is specifically deleted. Static objects remain in the bindery until deleted with DeleteBinderyObject.

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.

The bindery object must have a password property to log in to a server. The ChangeBinderyObjectPassword and CreateProperty functions add the property PASSWORD to an object.

See Also

ChangeBinderyObjectPassword, CreateProperty, DeleteBinderyObject, RenameBinderyObject, ScanBinderyObject

CreateBinderyObject Example

   #include <stdio.h>  
   #include <\nlm\nit\nwbindry.h>  
    
   main()  
   {  
      int    completionCode;  
      char   objectName[48];  
      WORD   ;  
      BYTE   objectFlag;  
      BYTE   objectSecurity;  
      strcpy (objectName, "JDOE");  
      objectType = 1;  
      objectFlag = BF_STATIC;  
      objectSecurity = 0x31;  
      completionCode = CreateBinderyObject (objectName, objectType,  
         objectFlag, objectSecurity);  
      if (completionCode == 0)  
         printf ("Successfully created object %s of type %d\n",  
                  objectName, objectType);  
      else  
         printf ("Error %d in CreateBinderyObject\n",  
         completionCode);  
   }