internal static unsafe IList <DeployedServicePackageHealthState> FromNativeList(IntPtr nativeListPtr)
 {
     if (nativeListPtr != IntPtr.Zero)
     {
         var nativeList = (NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_LIST *)nativeListPtr;
         return(DeployedServicePackageHealthStateList.FromNativeList(nativeList));
     }
     else
     {
         return(new DeployedServicePackageHealthStateList());
     }
 }
        internal static unsafe DeployedServicePackageHealthStateList FromNativeList(
            NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE_LIST *nativeList)
        {
            var retval = new DeployedServicePackageHealthStateList();

            var nativeItemArray = (NativeTypes.FABRIC_DEPLOYED_SERVICE_PACKAGE_HEALTH_STATE *)nativeList->Items;

            for (int i = 0; i < nativeList->Count; ++i)
            {
                var nativeItem = *(nativeItemArray + i);
                var item       = DeployedServicePackageHealthState.FromNative(nativeItem);
                if (item != null)
                {
                    retval.Add(item);
                }
            }

            return(retval);
        }