LPM_Initialize
The LPM_Initialize function initializes a local policy module (LPM). This occurs when the Admission Control Service needs to do policy based–admission control, such as when an SBM becomes the Designated Subnet Bandwidth Manager (DSBM). LPMs should initialize themselves, synchronously, before returning.
int
LPM_Initialize (
LPM_HANDLE LpmHandle,
int ResultTimeLimit,
void MemoryAllocator,
void FreeMemory,
void *(cbpAdmitRsvpMsg)(...),
void *(cbpGetRsvpObjects)(...),
int ConfiguredLpmCount,
int *SupportedPeType,
int Reserved
);
Parameters
- LpmHandle
- [in] Unique handle for the LPM, assigned by the PCM.
- ResultTimeLimit
- [in] Represents the value, in seconds, within which the LPM must respond to PCM requests. An LPM's failure to respond to PCM requests within ResultTimeLimit results in assumed rejection of the PCM request. The PCM will ignore responses provided after ResultTimeLimit.
- MemoryAllocator
- [in] PCM provided–memory allocation routine PALLOCMEM. This function call must be used by LPMs when returning policy information to the PCM. This function, combined with the PFREEMEM function, allows the SBM to use different memory management schemes without requiring the recompilation of LPMs. Its use is recommended. LPMs do not need to use this function to manage their local buffers.
- FreeMemory
- [in] PCM provided–memory freeing routine PFREEMEM. This function, combined with the function PALLOCMEM, allows the SBM to use different memory-management schemes without requiring the recompilation of LPMs. Its use is recommended. If memory allocated with MemoryAllocator is not returned to PCM, nor freed with this call, a memory leak will result. LPMs do not need to use this function to manage their local buffers. The SBM will free this buffer when it is no longer needed. This function call must be used by LPMs when returning policy information to the PCM.
- cbpAdmitRsvpMsg
- [in] Pointer to the function used to asynchronously return results to the LPM_AdmitRsvpMsg request.
- cbpGetRsvpObjects
- [in] Pointer to the function used to asynchronously return policy data objects from calls to the LPM_GetRsvpObjects request.
- ConfiguredLpmCount
- [in] Number of LPMs configured for use with the PCM. Note that this value does not indicate whether LPMs have been successfully loaded or initialized. This value is a useful indication that the PCM will attempt to load multiple LPMs on the system.
- SupportedPeType
- [out] Valid Policy Element (PE) type that the LPM uses to make policy based–admission control decisions. Each LPM can only support one PE type, though future versions may allow an LPM to support multiple PE types. Reserved PE types are defined in Lpmapi.h.
It is possible for a single DLL to support multiple PE types by having the DLL name entered multiple times in the PCM configuration data. Under such circumstances, the PCM will load and call the same LPM_Initialize routine multiple times; it is the LPM's responsibility to return different PE types for these additional calls.
LPMs can return a special PE type, LPM_ALL_PE_TYPES, to indicate that it will make policy based–admission control decisions based on all policy data objects. In this scenario, the PCM will assume that this LPM understands how to generate policy data objects for outgoing messages that the PCM is not able to understand.
- Reserved
- [in, out] Reserved for future use.
Return Values
If the LPM is initialized successfully, and a valid PE type is returned in SupportedPeType, the return value will be LPM_OK. The PCM treats any value other than LPM_OK as an error, and unloads the DLL (LPMs are always implemented as DLLs). If a value other than LPM_OK is returned or SupportedPeType is invalid, the PCM writes a record to the Event Log and includes the name of the DLL and the returned error value.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Unsupported.
Header: Declared in Lpmapi.h.