Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.1 KiB

  1. //
  2. // enumfnpr.cpp
  3. //
  4. #include "private.h"
  5. #include "enumfnpr.h"
  6. #include "tim.h"
  7. DBG_ID_INSTANCE(CEnumFunctionProviders);
  8. //+---------------------------------------------------------------------------
  9. //
  10. // _Init
  11. //
  12. //----------------------------------------------------------------------------
  13. BOOL CEnumFunctionProviders::_Init(CThreadInputMgr *tim)
  14. {
  15. ULONG uCount;
  16. ULONG i;
  17. const CTip *tip;
  18. uCount = 0;
  19. for (i=0; i<tim->_GetTIPCount(); i++)
  20. {
  21. if (tim->_GetCTip(i)->_pFuncProvider != NULL)
  22. {
  23. uCount++;
  24. }
  25. }
  26. if ((_prgUnk = SUA_Alloc(uCount)) == NULL)
  27. return FALSE;
  28. _iCur = 0;
  29. _prgUnk->cRef = 1;
  30. _prgUnk->cUnk = 0;
  31. for (i=0; i<tim->_GetTIPCount(); i++)
  32. {
  33. tip = tim->_GetCTip(i);
  34. if (tip->_pFuncProvider != NULL)
  35. {
  36. _prgUnk->rgUnk[_prgUnk->cUnk] = tip->_pFuncProvider;
  37. _prgUnk->rgUnk[_prgUnk->cUnk]->AddRef();
  38. _prgUnk->cUnk++;
  39. }
  40. }
  41. Assert(_prgUnk->cUnk == uCount);
  42. return TRUE;
  43. }