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.

163 lines
2.6 KiB

  1. /*
  2. * Copyright (c) 1996 Microsoft Corporation
  3. *
  4. * Module Name:
  5. *
  6. * oc.h
  7. *
  8. * Abstract:
  9. *
  10. * This file defines oc manager generic component
  11. *
  12. * Author:
  13. *
  14. * Kazuhiko Matsubara (kazum) June-16-1999
  15. *
  16. * Environment:
  17. *
  18. * User Mode
  19. */
  20. #ifdef _OC_H_
  21. #error "oc.h already included!"
  22. #else
  23. #define _OC_H_
  24. #endif
  25. #ifndef _WINDOWS_H_
  26. #include <windows.h>
  27. #endif
  28. #ifndef _TCHAR_H_
  29. #include <tchar.h>
  30. #endif
  31. #ifndef _SETUPAPI_H_
  32. #include <setupapi.h>
  33. #endif
  34. #ifndef _OCMANAGE_H_
  35. #include "ocmanage.h"
  36. #endif
  37. #ifndef _PRSHT_H_
  38. #include <prsht.h>
  39. #endif
  40. #ifndef _RESOURCE_H_
  41. #include "resource.h"
  42. #endif
  43. /*-[ types and defines ]-----------------------------------*/
  44. // standard buffer sizes
  45. #define S_SIZE 1024
  46. #define SBUF_SIZE (S_SIZE * sizeof(TCHAR))
  47. // per component data
  48. typedef struct _PER_COMPONENT_DATA {
  49. struct _PER_COMPONENT_DATA* Next;
  50. LPCTSTR ComponentId;
  51. HINF hinf;
  52. DWORDLONG Flags;
  53. TCHAR* SourcePath;
  54. OCMANAGER_ROUTINES HelperRoutines;
  55. EXTRA_ROUTINES ExtraRoutines;
  56. HSPFILEQ queue;
  57. } PER_COMPONENT_DATA, *PPER_COMPONENT_DATA;
  58. /*-[ functions ]-------------------------------------------*/
  59. //
  60. // oc.cpp
  61. //
  62. DWORD
  63. OnInitComponent(
  64. LPCTSTR ComponentId,
  65. PSETUP_INIT_COMPONENT psc
  66. );
  67. DWORD
  68. OnQuerySelStateChange(
  69. LPCTSTR ComponentId,
  70. LPCTSTR SubcomponentId,
  71. UINT state,
  72. UINT flags
  73. );
  74. DWORD
  75. OnCalcDiskSpace(
  76. LPCTSTR ComponentId,
  77. LPCTSTR SubcomponentId,
  78. DWORD addComponent,
  79. HDSKSPC dspace
  80. );
  81. DWORD
  82. OnCompleteInstallation(
  83. LPCTSTR ComponentId,
  84. LPCTSTR SubcomponentId
  85. );
  86. DWORD
  87. OnQueryState(
  88. LPCTSTR ComponentId,
  89. LPCTSTR SubcomponentId,
  90. UINT state
  91. );
  92. DWORD
  93. OnExtraRoutines(
  94. LPCTSTR ComponentId,
  95. PEXTRA_ROUTINES per
  96. );
  97. PPER_COMPONENT_DATA
  98. AddNewComponent(
  99. LPCTSTR ComponentId
  100. );
  101. PPER_COMPONENT_DATA
  102. LocateComponent(
  103. LPCTSTR ComponentId
  104. );
  105. BOOL
  106. StateInfo(
  107. PPER_COMPONENT_DATA cd,
  108. LPCTSTR SubcomponentId,
  109. BOOL *state
  110. );
  111. // just for utility
  112. #ifdef UNICODE
  113. #define tsscanf swscanf
  114. #define tvsprintf vswprintf
  115. #else
  116. #define tsscanf sscanf
  117. #define tvsprintf vsprintf
  118. #endif
  119. /*-[ global data ]-----------------------------------------*/
  120. #ifndef _OC_CPP_
  121. #define EXTERN extern
  122. #else
  123. #define EXTERN
  124. #endif
  125. // general stuff
  126. EXTERN HINSTANCE ghinst; // app instance handle
  127. EXTERN HWND ghwnd; // wizard window handle
  128. // per-component info storage
  129. EXTERN PPER_COMPONENT_DATA gcd; // array of all components we are installing