Sm_PolicyApi_GetAgentByName()
Gets the contents of the agent identified by szAgentName. The results of this function are returned in a structure referenced by ppstructAgent.
casso126
Gets the contents of the agent identified by
szAgentName
. The results of this function are returned in a structure referenced by ppstructAgent
.Free the memory allocated for this structure by calling Sm_PolicyApi_FreeMemoryEx().
Type
Agent function, global scope.
Syntax
int SM_EXTERN Sm_PolicyApi_GetAgentByName (void*pSessionHandle,const char*pszAgentName,Sm_PolicyApi_Agent_t**ppstructAgent);
Parameter | I/O | Description |
pSessionHandle
| I | A pointer to an internal Policy Management API data structure. The structure holds information about the administrator session and the client session. |
pszAgentName
| I | A null-terminated string containing the name of an existing agent. |
ppstructAgent
| O | The address of a pointer to an agent structure. |
Returns
- Sm_PolicyApi_Success. The get operation was successful.
- Sm_PolicyApi_Failure. Memory could not be allocated to Sm_PolicyApi_Agent_t.
- Sm_PolicyApi_InvalidHandle. There was no valid initialization prior to this call.
- Sm_PolicyApi_NoSession. There is no valid administrator session.
- Sm_PolicyApi_NoPrivilege. The administrator does not have the privilege to get an agent.
- Sm_PolicyApi_NotFound. An agent with the specified name not found.