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)
#include <\nlm\nit\nwbindry.h>
int CreateBinderyObject (
char *objectName,
WORD objectType,
BYTE objectFlag,
BYTE objectSecurity);
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.
ChangeBinderyObjectPassword, CreateProperty, DeleteBinderyObject, RenameBinderyObject, ScanBinderyObject
#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);
}