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.

63 lines
1.2 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1999.
  5. //
  6. // File: P S Z A R R A Y . C P P
  7. //
  8. // Contents: Implements the basic datatype for a collection of pointers
  9. // to strings.
  10. //
  11. // Notes:
  12. //
  13. // Author: shaunco 9 Feb 1999
  14. //
  15. //----------------------------------------------------------------------------
  16. #include <pch.h>
  17. #pragma hdrstop
  18. #include "nceh.h"
  19. #include "pszarray.h"
  20. HRESULT
  21. CPszArray::HrAddPointer (
  22. IN PCWSTR psz)
  23. {
  24. HRESULT hr;
  25. Assert (this);
  26. Assert (psz);
  27. NC_TRY
  28. {
  29. push_back (psz);
  30. hr = S_OK;
  31. }
  32. NC_CATCH_BAD_ALLOC
  33. {
  34. hr = E_OUTOFMEMORY;
  35. }
  36. TraceHr (ttidError, FAL, hr, FALSE, "CPszArray::HrAddPointer");
  37. return hr;
  38. }
  39. HRESULT
  40. CPszArray::HrReserveRoomForPointers (
  41. IN UINT cPointers)
  42. {
  43. HRESULT hr;
  44. NC_TRY
  45. {
  46. reserve (cPointers);
  47. hr = S_OK;
  48. }
  49. NC_CATCH_BAD_ALLOC
  50. {
  51. hr = E_OUTOFMEMORY;
  52. }
  53. TraceHr (ttidError, FAL, hr, FALSE,
  54. "CPszArray::HrReserveRoomForPointers");
  55. return hr;
  56. }