Common Data Security Architecture (CDSA) White Paper
How to Create a CDSA Add-In Module for HP-UX
For further conceptual information about GUIDs, see “Global Unique Identifier (GUID)” on page 49.
2.Define an initializer for each
NOTE | To ensure that initialization routines are named uniquely, HP |
| recommends the following naming convention: |
| YourCompanyName_RoutineName_Init() |
|
|
The initialization routine is specified by the linker option +I when the library is created. For example:
ld -b -o libmylib.1 +I _MyAddIn_Init ....
In this example, _MyAddIn_Init() becomes your
The following is a skeletal example of an
void _MyAddIn_Init (shl_t hInstance, int loading)
{
if (loading) { /* perform initialization */ #ifdef ISL_SELF_CHECK
/*
#endif
} else { /* perform termination */
/*
}
}
As this example shows, _MyAddIn_Init() is invoked with loading == 1, when the library is loaded (usually when applications invoke CSSM_ModuleAttach).
To perform termination, _MyAddIn_Init() is invoked again with loading == 0, when applications invoke CSSM_ModuleDetach().
The main purpose of initialization is to perform the
54 | Chapter 1 |