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.

127 lines
2.8 KiB

  1. #include "inspch.h"
  2. #include "util2.h"
  3. #include "inseng.h"
  4. #include "ciffile.h"
  5. //=--------------------------------------------------------------------------=
  6. // Function name here
  7. //=--------------------------------------------------------------------------=
  8. // Function description
  9. //
  10. // Parameters:
  11. //
  12. // Returns:
  13. //
  14. // Notes:
  15. //
  16. CCifMode::CCifMode(LPCSTR pszCompID, CCifFile *pCif) : CCifEntry(pszCompID, pCif)
  17. {
  18. }
  19. //=--------------------------------------------------------------------------=
  20. // Function name here
  21. //=--------------------------------------------------------------------------=
  22. // Function description
  23. //
  24. // Parameters:
  25. //
  26. // Returns:
  27. //
  28. // Notes:
  29. //
  30. CCifMode::~CCifMode()
  31. {
  32. }
  33. STDMETHODIMP CCifMode::GetID(LPSTR pszID, DWORD dwSize)
  34. {
  35. lstrcpyn(pszID, _szID, dwSize);
  36. return NOERROR;
  37. }
  38. STDMETHODIMP CCifMode::GetDescription(LPSTR pszDesc, DWORD dwSize)
  39. {
  40. return(MyTranslateString(_pCif->GetCifPath(), _szID, DISPLAYNAME_KEY, pszDesc, dwSize));
  41. }
  42. STDMETHODIMP CCifMode::GetDetails(LPSTR pszDetails, DWORD dwSize)
  43. {
  44. return(MyTranslateString(_pCif->GetCifPath(), _szID, DETAILS_KEY, pszDetails, dwSize));
  45. }
  46. STDMETHODIMP CCifMode::EnumComponents(IEnumCifComponents **pp, DWORD dwFilter, LPVOID pv)
  47. {
  48. CCifComponentEnum *pce;
  49. HRESULT hr = E_FAIL;
  50. *pp = 0;
  51. pce = new CCifComponentEnum(_pCif->GetComponentList(), dwFilter, PARENTTYPE_MODE, _szID);
  52. if(pce)
  53. {
  54. *pp = (IEnumCifComponents *) pce;
  55. (*pp)->AddRef();
  56. hr = NOERROR;
  57. }
  58. return hr;
  59. }
  60. //================= ICifRWMode Implementation =============================
  61. //
  62. CCifRWMode::CCifRWMode(LPCSTR pszID, CCifFile *pCif) : CCifMode(pszID, pCif)
  63. {
  64. }
  65. CCifRWMode::~CCifRWMode()
  66. {
  67. }
  68. STDMETHODIMP CCifRWMode::GetID(LPSTR pszID, DWORD dwSize)
  69. {
  70. return(CCifMode::GetID(pszID, dwSize));
  71. }
  72. STDMETHODIMP CCifRWMode::GetDescription(LPSTR pszDesc, DWORD dwSize)
  73. {
  74. return(CCifMode::GetDescription(pszDesc, dwSize));
  75. }
  76. STDMETHODIMP CCifRWMode::GetDetails(LPSTR pszDetails, DWORD dwSize)
  77. {
  78. return(CCifMode::GetDetails(pszDetails, dwSize));
  79. }
  80. STDMETHODIMP CCifRWMode::EnumComponents(IEnumCifComponents **pp, DWORD dwFilter, LPVOID pv)
  81. {
  82. CCifComponentEnum *pce;
  83. HRESULT hr = E_FAIL;
  84. *pp = 0;
  85. pce = new CCifComponentEnum((CCifComponent**)_pCif->GetComponentList(), dwFilter, PARENTTYPE_MODE, _szID);
  86. if(pce)
  87. {
  88. *pp = (IEnumCifComponents *) pce;
  89. (*pp)->AddRef();
  90. hr = NOERROR;
  91. }
  92. return hr;
  93. }
  94. STDMETHODIMP CCifRWMode::SetDescription(LPCSTR pszDesc)
  95. {
  96. return(WriteTokenizeString(_pCif->GetCifPath(), _szID, DISPLAYNAME_KEY, pszDesc));
  97. }
  98. STDMETHODIMP CCifRWMode::SetDetails(LPCSTR pszDetails)
  99. {
  100. return(WriteTokenizeString(_pCif->GetCifPath(), _szID, DETAILS_KEY, pszDetails));
  101. }