RenameBinderyObject

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

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 RenameBinderyObject (  
      char   *objectName,  
      char   *newObjectName,  
      WORD   objectType); 
   

Parameters

objectName
(IN) Specifies the string containing the name of a currently defined bindery object (maximum 48 characters, including the NULL terminator).
newObjectName
(IN) Specifies the string containing the new name of the bindery object (maximum 48 characters, including the NULL terminator).
objectType
(IN) Specifies the type of the bindery object (OT_USER, OT_GROUP, OT_PRINT_SERVER, and so on).

Return Values

0

(0x00)

ESUCCESS

150

(0x96)

ERR_SERVER_OUT_OF_MEMORY

239

(0xEF)

ERR_INVALID_NAME

240

(0xF0)

ERR_WILDCARD_NOT_ALLOWED

243

(0xF3)

ERR_NO_OBJECT_RENAME_PRIVILEGE

252

(0xFC)

ERR_NO_SUCH_OBJECT

254

(0xFE)

ERR_SERVER_BINDERY_LOCKED

255

(0xFF)

ERR_BINDERY_FAILURE

Remark

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.

See Also

CreateBinderyObject, DeleteBinderyObject

RenameBinderyObject Example

   #include <stdio.h>  
   #include <\nlm\nit\nwbindry.h>  
    
   main()  
   {  
   int   completionCode;  
   char  objectName[48];  
   char  newObjectName[48];  
   WORD  objectType;  
    
      printf ("\n\n  —- RENAME BINDERY OBJECT —-\n\n ");  
      printf ("FROM:  ");  
      scanf ("%s", objectName);  
      printf ("\n TO:    ");  
      scanf ("%s", newObjectName);  
      printf ("\nEnter type of object:  ");  
      scanf ("%d", &objectType);  
      completionCode = RenameBinderyObject (objectName,  
          newObjectName, objectType);  
      if (completionCode)  
      {  
         printf ("\n\n\n");  
         if (completionCode == 150)  
            printf ("SERVER OUT OF MEMORY\n\n");  
         if (completionCode == 239)  
            printf ("INVALID NAME\n\n");  
         if (completionCode == 240)  
            printf ("WILDCARD NOT ALLOWED\n\n");  
         if (completionCode == 252)  
            printf ("NO SUCH OBJECT\n\n");  
         if (completionCode == 254)  
            printf ("SERVER BINDERY LOCKED\n\n");  
         if (completionCode == 255)  
            printf ("BINDERY FAILURE\n\n");  
      }  
      else  
      printf ("\n\n\nSUCCESSFULLY renamed %s to %s\n",  
               objectName, newObjectName);  
   }