ScanBinderyObjectTrusteePaths
Returns the paths to which an object has trustee rights (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWScanObjectTrusteePaths )
#include <\nlm\nit\nwdir.h>
int ScanBinderyObjectTrusteePaths (
LONG objectID,
BYTE volumeNumber,
int *sequenceNumber,
WORD *trusteeAccessMask,
char *trusteePathName);
volume:directory\...\directory | file
The maximum is 319 characters (MAX_SERVER + MAX_VOLUME + MAX_PATH). If the buffer allocated to this parameter is smaller than 319 characters, the server can abend if the buffer is overwritten.
This function is used iteratively to scan and return all of the paths (directories and files) and the corresponding access masks for which the specified object is a trustee.
The sequenceNumber parameter should initially be set to -1 to get the first trustee path. Upon return, the sequence number is set to the value needed for the next call. Do not modify this value as this function is iteratively called to obtain all of the trustee’s paths.
When all valid trustee paths have been returned, ERR_NO_MORE_TRUSTEES is returned and trusteePathName is set to "\0."
Only the supervisor, the object, or a bindery object that is security equivalent to the supervisor or object, can scan an object’s trustee paths.
The trusteeAccessMask gives the trustee specific rights within the directory or the file, and if it is a directory, in all that directory’s subdirectories, unless the trustee’s rights are explicitly disallowed (using the Inherited Rights Mask) in those directories.
Figure 6-2 The trusteeAccessMask for NetWare 3.0 and above

For versions of NetWare previous to 3.0, the trustee rights appear in a 1-byte format as follows:
Figure 6-3 The 1-byte trustee rights mask for NetWare 2.x

GetVolumeNumber (NetWare SDK)
#include <stdlib.h>
#include <stddef.h>
#include <stdio.h>
#include <nwconio.h>
#include <nwtypes.h>
#include <nwdir.h>
main()
{
int rc,i;
long oid;
int sn;
WORD tam;
char path[1000];
printf("object id to scan (hex): ");
scanf("%x",&oid);
i = 0;
sn = 0;
while(!(rc = ScanBinderyObjectTrusteePaths
(oid,0,&sn,&tam,path)))
{
i++;
printf("sequence number = %d\n",sn);
printf("access mask = %#X\n",tam);
printf("path name is\n%s\n\n",path);
}
printf("number of paths = %d\n",i);
printf("rc = %x\n",rc);
}