Some functions, such as SmDirReleaseInstance(), may be passed either the directory instance handle or the directory entry (user) instance handle. The sample code provides a way you can distinguish the directory instance handle from the directory entry (user) instance handle.
Notice that nTag is the first field of both DirHandle_t and UserHandle_t. When SmDirInitDirInstance() is called, nTag is set to 0 in DirHandle_t. When SmDirInitUserInstance is called, nTag is set to 1 in UserHandle_t.
When a function that accepts either type of handle is called, the value of nTag is checked to see which type of handle is being passed.
Copyright © 2010 CA. All rights reserved. | Email CA about this topic |