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.

65 lines
1.2 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation
  3. Module Name:
  4. pendingassembly.cpp
  5. Abstract:
  6. Sources for the CPendingAssembly class
  7. Author:
  8. Michael J. Grier (MGrier) 23-Feb-2000
  9. Revision History:
  10. xiaoyuw 09/2000 replace attributes with assembly identity
  11. --*/
  12. #include "stdinc.h"
  13. #include "pendingassembly.h"
  14. CPendingAssembly::CPendingAssembly() :
  15. m_SourceAssembly(NULL),
  16. m_Identity(NULL),
  17. m_Optional(false),
  18. m_MetadataSatellite(false)
  19. {
  20. }
  21. CPendingAssembly::~CPendingAssembly()
  22. {
  23. if (m_Identity != NULL)
  24. {
  25. ::SxsDestroyAssemblyIdentity(m_Identity);
  26. m_Identity = NULL;
  27. }
  28. }
  29. BOOL
  30. CPendingAssembly::Initialize(
  31. PASSEMBLY Assembly,
  32. PCASSEMBLY_IDENTITY Identity,
  33. bool Optional,
  34. bool MetadataSatellite
  35. )
  36. {
  37. BOOL fSuccess = FALSE;
  38. FN_TRACE_WIN32(fSuccess);
  39. INTERNAL_ERROR_CHECK(m_Identity == NULL);
  40. PARAMETER_CHECK(Identity != NULL);
  41. IFW32FALSE_EXIT(::SxsDuplicateAssemblyIdentity(0, Identity, &m_Identity));
  42. m_SourceAssembly = Assembly;
  43. m_Optional = Optional;
  44. m_MetadataSatellite = MetadataSatellite;
  45. fSuccess = TRUE;
  46. Exit:
  47. return fSuccess;
  48. }