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.

188 lines
4.3 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All Rights Reserved.
  3. Module Name:
  4. msoobci.h
  5. Abstract:
  6. Exception Pack installer helper DLL
  7. Public API header
  8. Author:
  9. Jamie Hunter (jamiehun) 2001-11-27
  10. Revision History:
  11. Jamie Hunter (jamiehun) 2001-11-27
  12. Initial Version
  13. --*/
  14. #ifndef __MSOOBCI_H__
  15. #define __MSOOBCI_H__
  16. //
  17. // DriverInstallComponents is a standard co-installer entrypoint
  18. // return status is WinError form, as expected by SetupAPI
  19. //
  20. DWORD
  21. CALLBACK
  22. DriverInstallComponents (
  23. IN DI_FUNCTION InstallFunction,
  24. IN HDEVINFO DeviceInfoSet,
  25. IN PSP_DEVINFO_DATA DeviceInfoData,
  26. IN OUT PCOINSTALLER_CONTEXT_DATA Context
  27. );
  28. //
  29. // InstallComponent is a generic entry point
  30. // return status is HRESULT form, providing success codes
  31. //
  32. // CompGuid - if NULL, use GUID specified in INF (ComponentId)
  33. // else verify against GUID specified in INF
  34. // VerMajor/VerMinor/VerBuild/VerQFE
  35. // - if -1, use version specified in INF (ComponentVersion)
  36. // else use this version and verify against version if specified in INF
  37. // Name
  38. // - if NULL, use name specified in INF (ComponentName)
  39. // else use this component name.
  40. //
  41. #define INST_S_REBOOT ((HRESULT)(0x20000100)) // 'success' code that indicates reboot required
  42. #define INST_S_REBOOTING ((HRESULT)(0x20000101)) // indicates reboot in progress
  43. #define COMP_FLAGS_NOINSTALL 0x00000001 // place in store, don't install
  44. #define COMP_FLAGS_NOUI 0x00000002 // don't show any UI
  45. #define COMP_FLAGS_NOPROMPTREBOOT 0x00000004 // reboot if needed (no prompt)
  46. #define COMP_FLAGS_PROMPTREBOOT 0x00000008 // prompt for reboot if needed
  47. #define COMP_FLAGS_NEEDSREBOOT 0x00000010 // assume reboot needed
  48. #define COMP_FLAGS_FORCE 0x00000020 // don't do version check
  49. HRESULT
  50. WINAPI
  51. InstallComponentA(
  52. IN LPCSTR InfPath,
  53. IN DWORD Flags,
  54. IN const GUID * CompGuid, OPTIONAL
  55. IN INT VerMajor, OPTIONAL
  56. IN INT VerMinor, OPTIONAL
  57. IN INT VerBuild, OPTIONAL
  58. IN INT VerQFE, OPTIONAL
  59. IN LPCSTR Name OPTIONAL
  60. );
  61. HRESULT
  62. WINAPI
  63. InstallComponentW(
  64. IN LPCWSTR InfPath,
  65. IN DWORD Flags,
  66. IN const GUID * CompGuid, OPTIONAL
  67. IN INT VerMajor, OPTIONAL
  68. IN INT VerMinor, OPTIONAL
  69. IN INT VerBuild, OPTIONAL
  70. IN INT VerQFE, OPTIONAL
  71. IN LPCWSTR Name OPTIONAL
  72. );
  73. #ifdef UNICODE
  74. #define InstallComponent InstallComponentW
  75. #else
  76. #define InstallComponent InstallComponentA
  77. #endif
  78. //
  79. // DoInstall is a RunDll32 entrypoint.
  80. // CommandLine = "InfPath;Flags;GUID;Version;Name"
  81. // where version has format High.Low.Build.QFE
  82. //
  83. // calls InstallComponent, but drops return status
  84. //
  85. VOID
  86. WINAPI
  87. DoInstallA(
  88. IN HWND Window,
  89. IN HINSTANCE ModuleHandle,
  90. IN PCSTR CommandLine,
  91. IN INT ShowCommand
  92. );
  93. VOID
  94. WINAPI
  95. DoInstallW(
  96. IN HWND Window,
  97. IN HINSTANCE ModuleHandle,
  98. IN PCWSTR CommandLine,
  99. IN INT ShowCommand
  100. );
  101. #ifdef UNICODE
  102. #define DoInstall DoInstallW
  103. #else
  104. #define DoInstall DoInstallA
  105. #endif
  106. //
  107. // lower-level install API's
  108. // install from specified section of specified INF
  109. // if SectionName not specified, install from (potentially decorated)
  110. // "DefaultInstall"
  111. //
  112. HRESULT
  113. WINAPI
  114. InstallInfSectionA(
  115. IN LPCSTR InfPath,
  116. IN LPCSTR SectionName, OPTIONAL
  117. IN DWORD Flags
  118. );
  119. HRESULT
  120. WINAPI
  121. InstallInfSectionW(
  122. IN LPCWSTR InfPath,
  123. IN LPCWSTR SectionName, OPTIONAL
  124. IN DWORD Flags
  125. );
  126. #ifdef UNICODE
  127. #define InstallInfSection InstallInfSectionW
  128. #else
  129. #define InstallInfSection InstallInfSectionA
  130. #endif
  131. //
  132. // check to see if current user has admin rights
  133. // Caller is NOT expected to be impersonating anyone and IS
  134. // expected to be able to open their own process and process
  135. // token.
  136. //
  137. BOOL
  138. WINAPI
  139. IsUserAdmin(
  140. VOID
  141. );
  142. //
  143. // see if process is running in an interactive window station
  144. // (ie, can show dialogs and get input off user)
  145. //
  146. BOOL
  147. WINAPI
  148. IsInteractiveWindowStation(
  149. VOID
  150. );
  151. #endif // __MSOOBCI_H__