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.

90 lines
2.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 2001, Microsoft Corporation All rights reserved.
  4. //
  5. // Module Name:
  6. //
  7. // Component.h
  8. //
  9. // Abstract:
  10. //
  11. // This file contains the Component object definition.
  12. //
  13. // Revision History:
  14. //
  15. // 2001-06-20 lguindon Created.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #ifndef _COMPONENT_H_
  19. #define _COMPONENT_H_
  20. ///////////////////////////////////////////////////////////////////////////////
  21. //
  22. // Includes Files.
  23. //
  24. ///////////////////////////////////////////////////////////////////////////////
  25. #define ARRAYLEN(x) (sizeof(x) / sizeof((x)[0]))
  26. #include "infparser.h"
  27. ///////////////////////////////////////////////////////////////////////////////
  28. //
  29. // Class definition.
  30. //
  31. ///////////////////////////////////////////////////////////////////////////////
  32. class Component
  33. {
  34. public:
  35. Component(LPSTR name, LPSTR folderName, LPSTR infName, LPSTR sectionName)
  36. {
  37. HRESULT hr;
  38. BOOL bSuccess = TRUE;
  39. hr = StringCchCopyA(m_Name, ARRAYLEN(m_Name), name);
  40. if(!SUCCEEDED(hr)) {
  41. bSuccess = FALSE;
  42. }
  43. hr = StringCchCopyA(m_FolderName, ARRAYLEN(m_FolderName), folderName);
  44. if(!SUCCEEDED(hr)) {
  45. bSuccess = FALSE;
  46. }
  47. hr = StringCchCopyA(m_InfName, ARRAYLEN(m_InfName), infName);
  48. if(!SUCCEEDED(hr)) {
  49. bSuccess = FALSE;
  50. }
  51. hr = StringCchCopyA(m_InfInstallSectionName, ARRAYLEN(m_InfInstallSectionName), sectionName);
  52. if(!SUCCEEDED(hr)) {
  53. bSuccess = FALSE;
  54. }
  55. m_Next = NULL;
  56. m_Previous = NULL;
  57. if(!bSuccess )
  58. printf("Error in Component::Component() \n");
  59. };
  60. LPSTR getName() { return (m_Name);};
  61. LPSTR getFolderName() { return (m_FolderName); };
  62. LPSTR getInfName() { return (m_InfName); };
  63. LPSTR getInfInstallSectionName() { return (m_InfInstallSectionName); };
  64. Component* getNext() { return (m_Next); };
  65. Component* getPrevious() { return (m_Previous); };
  66. void setNext(Component *next) { m_Next = next; };
  67. void setPrevious(Component *previous) { m_Previous = previous; };
  68. private:
  69. CHAR m_Name[MAX_PATH];
  70. CHAR m_FolderName[MAX_PATH];
  71. CHAR m_InfName[MAX_PATH];
  72. CHAR m_InfInstallSectionName[MAX_PATH];
  73. Component *m_Next;
  74. Component *m_Previous;
  75. };
  76. #endif //_COMPONENT_H_