If a plug-in needs to obtain the UI context, it should do so by calling khui_context_get() and passing in a pointer to a khui_action_context structure.
Once obtained, the contents of the khui_action_context structure should be considered read-only. When the plug-in is done with the structure, it should call khui_context_release(). This cleans up any additional memory allocated for storing the context as well as releasing all the objects that were referenced from the context.
Depending on the scope, several other members of the strucre may also be set.
In general, the cursor context can be a single credential or an entire outline level. Unlike the selection context, since this specifies a single point of selection it can not be disjointed.
The contents of the identity, cred_type, cred, headers and n_headers are described in the documentation of each of the scope values above.
In this case, the selection is described by an array of khui_header elements each of which specify a criterion for narrowing down the selection of credentials. The khui_header structure specifies an attribute in the attr_id field and a value in the data and cb_data fields. The credentials that are selected are those in the root credential set whose repective attributes contain the values specified in each of the khui_header elements.
For example, the following selection:
will result in the following header specification:
ctx.n_headers = 3;
ctx.headers[0].attr_id = KCDB_ATTR_LOCATION;
ctx.headers[0].data = L"grailauth@KHMTEST";
ctx.headers[0].cb_data = sizeof(L"grailauth@KHMTEST");
ctx.headers[1].attr_id = KCDB_ATTR_ID;
ctx.headers[1].data = &handle_to_identity;
ctx.headers[1].cb_data = sizeof(khm_handle);
ctx.headers[2].attr_id = KCDB_ATTR_TYPE;
ctx.headers[2].data = &kerberos_5_credtype;
ctx.headers[2].cb_data = sizeof(khm_int32);
|
Generated on Fri Aug 3 08:27:13 2007 for Network Identity Manager by Doxygen 1.5.2 © 2004-2007 Massachusetts Institute of Technology. © 2005-2007 Secure Endpoints Inc. Contact khimaira@mit.edu |
|