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. // prop.cpp
  3. //
  4. #include "private.h"
  5. #include "prop.h"
  6. #include "ic.h"
  7. //////////////////////////////////////////////////////////////////////////////
  8. //
  9. // CEnumProperties
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. DBG_ID_INSTANCE(CEnumProperties);
  13. //+---------------------------------------------------------------------------
  14. //
  15. // _Init
  16. //
  17. //----------------------------------------------------------------------------
  18. BOOL CEnumProperties::_Init(CInputContext *pic)
  19. {
  20. ULONG i;
  21. CProperty *prop;
  22. // get a count of the number of properties
  23. for (i=0, prop = pic->_GetFirstProperty(); prop != NULL; prop = prop->_pNext)
  24. {
  25. i++;
  26. }
  27. // alloc an array
  28. _prgUnk = SUA_Alloc(i);
  29. if (_prgUnk == NULL)
  30. return FALSE;
  31. // copy the data
  32. for (i=0, prop = pic->_GetFirstProperty(); prop != NULL; prop = prop->_pNext)
  33. {
  34. _prgUnk->rgUnk[i] = prop;
  35. _prgUnk->rgUnk[i]->AddRef();
  36. i++;
  37. }
  38. _prgUnk->cRef = 1;
  39. _prgUnk->cUnk = i;
  40. _iCur = 0;
  41. return TRUE;
  42. }