Source code of Windows XP (NT5)
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.

76 lines
1.7 KiB

  1. // Cookie.cpp : Implementation of CMyComputerCookie and related classes
  2. #include "stdafx.h"
  3. #include "cookie.h"
  4. #include "atlimpl.cpp"
  5. DECLARE_INFOLEVEL(MyComputerSnapin)
  6. #include "macros.h"
  7. USE_HANDLE_MACROS("MYCOMPUT(cookie.cpp)")
  8. #ifdef _DEBUG
  9. #define new DEBUG_NEW
  10. #undef THIS_FILE
  11. static char THIS_FILE[] = __FILE__;
  12. #endif
  13. #include "stdcooki.cpp"
  14. #include <compuuid.h> // defines nodetypes for the My Computer snapin
  15. //
  16. // This is used by the nodetype utility routines in stdutils.cpp
  17. //
  18. const struct NODETYPE_GUID_ARRAYSTRUCT g_NodetypeGuids[MYCOMPUT_NUMTYPES] =
  19. {
  20. { // MYCOMPUT_COMPUTER
  21. structuuidNodetypeComputer,
  22. lstruuidNodetypeComputer },
  23. { // MYCOMPUT_SYSTEMTOOLS
  24. structuuidNodetypeSystemTools,
  25. lstruuidNodetypeSystemTools },
  26. { // MYCOMPUT_SERVERAPPS
  27. structuuidNodetypeServerApps,
  28. lstruuidNodetypeServerApps },
  29. { // MYCOMPUT_STORAGE
  30. structuuidNodetypeStorage,
  31. lstruuidNodetypeStorage }
  32. };
  33. const struct NODETYPE_GUID_ARRAYSTRUCT* g_aNodetypeGuids = g_NodetypeGuids;
  34. const int g_cNumNodetypeGuids = MYCOMPUT_NUMTYPES;
  35. //
  36. // CMyComputerCookie
  37. //
  38. // returns <0, 0 or >0
  39. HRESULT CMyComputerCookie::CompareSimilarCookies( CCookie* pOtherCookie, int* pnResult )
  40. {
  41. ASSERT( NULL != pOtherCookie );
  42. CMyComputerCookie* pcookie = ((CMyComputerCookie*)pOtherCookie);
  43. if (m_objecttype != pcookie->m_objecttype)
  44. {
  45. *pnResult = ((int)m_objecttype) - ((int)pcookie->m_objecttype); // arbitrary ordering
  46. return S_OK;
  47. }
  48. return CHasMachineName::CompareMachineNames( *pcookie, pnResult );
  49. }
  50. CCookie* CMyComputerCookie::QueryBaseCookie(int i)
  51. {
  52. UNREFERENCED_PARAMETER (i);
  53. ASSERT( i == 0 );
  54. return (CCookie*)this;
  55. }
  56. int CMyComputerCookie::QueryNumCookies()
  57. {
  58. return 1;
  59. }