Set oBag= oAPI.CreatePropertyBag()
Call UpdateHWLicenseState(oBag)
Call oAPI.Return(oBag)
End Sub
Function UpdateHWLicenseState(ByRef oBag)
Call LogDebugString("Entering UpdateHWLicenseState", INFO_LEVEL)
UpdateHWLicenseState = -1
Dim oObjectItem, oManagementTargetCollection, oSystemDriver,wql, iResult, I
'LinLin need redifine..................
'iResult = licKeyValidate(featureId)
' 1, if valid but about to expire (in 14 days).
' 0, if valid.
' -1, if no license key is installed.
' -2, if the license key was already expired.
' -3, if the license key is invalid (integrity broken).
' -10, if the IMM-oriented license key was recently changed
' and needs to be reprocessed first.
' If (iResult = 1) Then
' Call oBag.AddValue("State", "Warning")
' Call oBag.AddValue("Description", "License is valid but about to expire (in 14 days)")
' ElseIf (iResult = 0) Then
' Call oBag.AddValue("State", "Healthy")
' Call oBag.AddValue("Description", "License is valid")
' ElseIf (iResult = -1) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "No license key is installed")
' ElseIf (iResult = -2) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The license key is already expired")
' ElseIf (iResult = -3) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The license key is invalid (integrity broken)")
' ElseIf (iResult = -10) Then
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "The IMM-oriented license key was recently changed and needs to be reprocessed first")
' Else
' Call oBag.AddValue("State", "Error")
' Call oBag.AddValue("Description", "Unknown error")
' End If
'HungHuynh: will need to update the licKeyValidate function. For now, we use GetEndpointLic to validate the license values
dim level
'dim toke
level = ""
'toke = ""
'iResult = GetEndpointLic(level, toke)
iResult = GetEndpointLic(level)
If (iResult = -1) Then
Call oBag.AddValue("State", "Warning") ' PXB080764: Demote from Error to Warning
Call oBag.AddValue("Description", "No license key is installed")
Else
Call oBag.AddValue("State", "Healthy")
Call oBag.AddValue("Description", "License is valid")
End If
Call LogDebugString("GetEndpointLic return: " & iResult, INFO_LEVEL_DETAIL)
'UpdateDriverMissingState = 1 ''' twoffer: possible copy/paste error?
UpdateHWLicenseState = 1