LPASIDLIST Display_GetSelectedList (void) { LPASIDLIST pAsidList = NULL; HWND hDlg = GetTabChild (GetDlgItem (g.hMain, IDC_TAB)); HWND hList = GetDlgItem (hDlg, IDC_GROUPS_LIST); if (!IsWindow (hList)) hList = GetDlgItem (hDlg, IDC_USERS_LIST); if (!IsWindow (hList)) hList = GetDlgItem (hDlg, IDC_MACHINES_LIST); if (IsWindow (hList)) { if (asc_AsidListCreate (&pAsidList)) { for (HLISTITEM hItem = FastList_FindFirstSelected (hList); hItem != NULL; hItem = FastList_FindNextSelected (hList, hItem)) { ASID idObject = (ASID)FastList_GetItemParam (hList, hItem); if (idObject) asc_AsidListAddEntry (&pAsidList, idObject, 0); } } } return pAsidList; }
void TestForNotifications (UINT_PTR idClient, ASID idCell, ASID idObject) { if (l.pListeners) { // First we'll zip through our list of listeners and // build an ASIDLIST reflecting the objects in this cell // for which we're listening. // LPASIDLIST pAsidList = NULL; for (LPENUM pEnum = l.pListeners->FindFirst(); pEnum; pEnum = pEnum->FindNext()) { LPLISTENER pl = (LPLISTENER)( pEnum->GetObject() ); if (pl->idCell != idCell) continue; if (idObject && (pl->idObject != idObject)) continue; if (!pAsidList) { if (!asc_AsidListCreate (&pAsidList)) break; } if (!asc_AsidListAddEntry (&pAsidList, pl->idObject, 0)) break; } // Then we'll call one of our cache routines, which in turn will tell // the admin server what version of the properties we have for each // of these objects; if any have newer properties available, we'll // get them back--and that will cause us to send out notifications to // our listeners. // if (pAsidList) { ULONG status; (void)RefreshCachedProperties (idClient, idCell, pAsidList, GET_ALL_DATA, &status); } } }
EXPORTED BOOL ADMINAPI AfsAppLib_asc_AsidListCreate (LPASIDLIST *ppList) { return asc_AsidListCreate (ppList); }