Previous |
Function SmbInsertTreeEntry
With the SmbInsertTreeEntry function, you can add a tree connection to a logged on user. You can use this function in the user logon function. The limit of the tree which can be added are defined with the MAX_TREE_ENTRIES macro:
int SmbInsertTreeEntry(
void *pUserData,
const char *pPath,
const char *pService,
const char *pComment,
unsigned uMode,
void *pMem);
Parameters
pUserData
A pointer to the data of the logged on user.
pPath
Is the path of connected tree, with out backslash at the end.This pointer must point to a none temporary memory !
pService
Is the name of the three connection.This pointer must point to a none temporary memory !
pComment
Is a comment for the tree connection (0=no comment). This pointer must point to a none temporary memory !
uMode
SMB_MODE_VIEWSHARES the user can only view the base tree entiers
SMB_MODE_READONLY read oly access
SMB_MODE_READWRITE read and write access
pMem
Is a memory pointer witch could be used for the none temporary memory of the other parameters !
If this entry is not zero the memory is freed with SmbMemFree(pMem).
For the allocation use SmbMemAlloc(size).
return value
Value
Meaning SMB_ERR_NONE the tree was added to the user SMB_ERR_TOOMUCHENTRIES there is no entry left in the user data SMB_ERR_NOENTRY user is not ok
Example:
SmbInsertTreeEntry(pUserData,"C:" ,"C" ,0,FALSE);
SmbInsertTreeEntry(pUserData,"D:\Mpeg","Mp3",0,FALSE);This code produces the follow tree:
Introduction
The SMB daemon
The NMB daemon
The CheckTree
Function
The
UserLogon Function
The
GetPassword Function
The
SmbInsertTreeEntry Function
The SmbInfo Function
OS-Independency
Copyright © 2003 Anton Zechner