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.

680 lines
15 KiB

  1. /*++
  2. Copyright (c) 1995-97 Microsoft Corporation
  3. All rights reserved.
  4. Module Name:
  5. splsetup.h
  6. Abstract:
  7. Holds spooler install headers.
  8. Author:
  9. Muhunthan Sivapragasam (MuhuntS) 20-Oct-1995
  10. Revision History:
  11. --*/
  12. #ifndef _SPLSETUP_H
  13. #define _SPLSETUP_H
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. //
  18. // Type definitions
  19. //
  20. typedef enum {
  21. PlatformAlpha,
  22. PlatformX86,
  23. PlatformMIPS,
  24. PlatformPPC,
  25. PlatformWin95,
  26. PlatformIA64,
  27. PlatformAlpha64
  28. } PLATFORM;
  29. typedef enum {
  30. DRIVER_NAME,
  31. INF_NAME,
  32. DRV_INFO_4,
  33. PRINT_PROCESSOR_NAME,
  34. ICM_FILES,
  35. DRV_INFO_6
  36. } FIELD_INDEX;
  37. typedef struct _DRIVER_FIELD {
  38. FIELD_INDEX Index;
  39. union {
  40. LPTSTR pszDriverName;
  41. LPTSTR pszInfName;
  42. LPDRIVER_INFO_4 pDriverInfo4;
  43. LPTSTR pszPrintProc;
  44. LPTSTR pszzICMFiles;
  45. LPDRIVER_INFO_6 pDriverInfo6;
  46. };
  47. } DRIVER_FIELD, *PDRIVER_FIELD;
  48. typedef struct _PSETUP_LOCAL_DATA * PPSETUP_LOCAL_DATA;
  49. typedef struct _SELECTED_DRV_INFO * PSELECTED_DRV_INFO;
  50. #define SELECT_DEVICE_HAVEDISK 0x00000001
  51. #define SELECT_DEVICE_FROMWEB 0x00000002
  52. //
  53. // Function prototypes
  54. //
  55. HDEVINFO
  56. PSetupCreatePrinterDeviceInfoList(
  57. IN HWND hwnd
  58. );
  59. BOOL
  60. PSetupDestroyPrinterDeviceInfoList(
  61. IN HDEVINFO hPrinterDevInfo
  62. );
  63. HPROPSHEETPAGE
  64. PSetupCreateDrvSetupPage(
  65. IN HDEVINFO hDevInfo,
  66. IN HWND hwnd
  67. );
  68. BOOL
  69. PSetupBuildDriversFromPath(
  70. IN HDEVINFO hDevInfo,
  71. IN LPCTSTR pszDriverPath,
  72. IN BOOL bEnumSingleInf
  73. );
  74. BOOL
  75. PSetupSelectDriver(
  76. IN HDEVINFO hPrinterDevInfo
  77. );
  78. BOOL
  79. PSetupPreSelectDriver(
  80. IN HDEVINFO hDevInfo,
  81. IN LPCTSTR pszManufacturer, OPTIONAL
  82. IN LPCTSTR pszModel OPTIONAL
  83. );
  84. PPSETUP_LOCAL_DATA
  85. PSetupGetSelectedDriverInfo(
  86. IN HDEVINFO hDevInfo
  87. );
  88. PPSETUP_LOCAL_DATA
  89. PSetupDriverInfoFromName(
  90. IN HDEVINFO hDevInfo,
  91. IN LPCTSTR pszModel
  92. );
  93. BOOL
  94. PSetupDestroySelectedDriverInfo(
  95. IN PPSETUP_LOCAL_DATA pLocalData
  96. );
  97. //
  98. // Driver install flags
  99. //
  100. #define DRVINST_FLATSHARE 0x00000001
  101. #define DRVINST_DONOTCOPY_INF 0x00000002
  102. #define DRVINST_DRIVERFILES_ONLY 0x00000004
  103. #define DRVINST_PROMPTLESS 0x00000008
  104. #define DRVINST_PROGRESSLESS 0x00000010
  105. #define DRVINST_WEBPNP 0x00000020
  106. /*
  107. DRVINST_WINDOWS_UPDATE - Flag for PrintUI to set to ensure that SPOST_URL gets set.
  108. Setting the SPOST_URL is for setup to ignore the inf of this
  109. driver during all setup calls except for a Web Point and Print.
  110. This flag makes sure that the driver is install with all the
  111. spoolers hosted by the local machines (including cluster spoolers)
  112. */
  113. #define DRVINST_WINDOWS_UPDATE 0x00000040
  114. /*
  115. DRVINST_PRIVATE_DIRECTORY - Flag to tell that we want to use a private directory for the copying.
  116. This is specifically to fix TS where we can get into a AddPrinterDriver
  117. race condition where the drivers can get deleted before APD is called when
  118. adding multiple drivers.
  119. Note - using this flag means that NTPrint must do the file deletion.
  120. */
  121. #define DRVINST_PRIVATE_DIRECTORY 0x00000080
  122. //
  123. // Set if we install drivers for a non-native platform
  124. //
  125. #define DRVINST_ALT_PLATFORM_INSTALL 0x00000100
  126. //
  127. // Set if we want PSetupInstallPrinterDriver not advertise warned or blocked
  128. // drivers through the UI. Note that if DRVINST_PROMPTLESS is specified, this
  129. // is implied.
  130. //
  131. #define DRVINST_NO_WARNING_PROMPT 0x00000200
  132. //
  133. // Set if we want PSetupInstallPrinterDriver to install the printer driver
  134. // without asking the user if they would rather have an inbox printer driver
  135. // be installed. This is because the print UI can't necessarily take advantage
  136. // of the new driver at all points.
  137. //
  138. #define DRVINST_DONT_OFFER_REPLACEMENT 0x00000400
  139. //
  140. // return values for pdwBlockingStatusFlags
  141. //
  142. #define BSP_PRINTER_DRIVER_OK 0
  143. #define BSP_PRINTER_DRIVER_BLOCKED 0x00000001
  144. #define BSP_PRINTER_DRIVER_WARNED 0x00000002
  145. #define BSP_BLOCKING_LEVEL_MASK 0x000000ff
  146. #define BSP_INBOX_DRIVER_AVAILABLE 0x00000100
  147. #define BSP_PRINTER_DRIVER_CANCELLED 0x80000000
  148. #define BSP_PRINTER_DRIVER_PROCEEDED 0x40000000
  149. #define BSP_PRINTER_DRIVER_REPLACED 0x20000000
  150. #define BSP_USER_RESPONSE_MASK 0xff000000
  151. DWORD
  152. PSetupInstallPrinterDriver(
  153. IN HDEVINFO hDevInfo,
  154. IN PPSETUP_LOCAL_DATA pLocalData,
  155. IN LPCTSTR pszDriverName,
  156. IN PLATFORM platform,
  157. IN DWORD dwVersion,
  158. IN LPCTSTR pszServerName,
  159. IN HWND hwnd,
  160. IN LPCTSTR pszDiskName,
  161. IN LPCTSTR pszSource,
  162. IN DWORD dwInstallFlags,
  163. IN DWORD dwAddDrvFlags,
  164. OUT LPTSTR *ppszNewDriverName
  165. );
  166. BOOL
  167. PSetupIsCompatibleDriver(
  168. IN LPCTSTR pszServer, OPTIONAL
  169. IN LPCTSTR pszDriverModel,
  170. IN LPCTSTR pszDriverPath, // main rendering driver dll
  171. IN LPCTSTR pszEnvironment,
  172. IN DWORD dwVersion,
  173. IN FILETIME *pFileTimeDriver,
  174. OUT DWORD *pdwBlockingStatus, // returns BSP_DRIVER_OK, BSP_PRINTER_DRIVER_BLOCKED or BSP_PRINTER_DRIVER_WARNED
  175. OUT LPTSTR *ppszReplacementDriver OPTIONAL // caller must free it.
  176. );
  177. //
  178. // returns BSP_PRINTER_DRIVER_CANCELLED, BSP_PRINTER_DRIVER_PROCEEDED or BSP_PRINTER_DRIVER_REPLACED
  179. //
  180. DWORD
  181. PSetupShowBlockedDriverUI(
  182. HWND hParentWnd,
  183. DWORD BlockingStatus // can be BSP_DRIVER_OK, BSP_PRINTER_DRIVER_BLOCKED or BSP_PRINTER_DRIVER_WARNED OR'd with BSP_INBOX_REPLACEMENT_AVAILABLE
  184. );
  185. #define DRIVER_MODEL_NOT_INSTALLED 0
  186. #define DRIVER_MODEL_INSTALLED_AND_IDENTICAL 1
  187. #define DRIVER_MODEL_INSTALLED_BUT_DIFFERENT -1
  188. #define KERNEL_MODE_DRIVER_VERSION -1
  189. BOOL
  190. PSetupIsDriverInstalled(
  191. IN LPCTSTR pszServerName,
  192. IN LPCTSTR pszDriverName,
  193. IN PLATFORM platform,
  194. IN DWORD dwMajorVersion
  195. );
  196. INT
  197. PSetupIsTheDriverFoundInInfInstalled(
  198. IN LPCTSTR pszServerName,
  199. IN PPSETUP_LOCAL_DATA pLocalData,
  200. IN PLATFORM platform,
  201. IN DWORD dwMajorVersion
  202. );
  203. BOOL
  204. PSetupRefreshDriverList(
  205. IN HDEVINFO hDevInfo
  206. );
  207. BOOL
  208. PSetupIsOemDriver(
  209. IN HDEVINFO hDevInfo,
  210. IN PPSETUP_LOCAL_DATA pLocalData,
  211. IN PBOOL pbIsOemDriver
  212. );
  213. PLATFORM
  214. PSetupThisPlatform(
  215. VOID
  216. );
  217. BOOL
  218. PSetupGetPathToSearch(
  219. IN HWND hwnd,
  220. IN LPCTSTR pszTitle,
  221. IN LPCTSTR pszDiskName,
  222. IN LPCTSTR pszFileName,
  223. IN BOOL bPromptForInf,
  224. IN OUT TCHAR szPath[MAX_PATH]
  225. );
  226. BOOL
  227. PSetupProcessPrinterAdded(
  228. IN HDEVINFO hDevInfo,
  229. IN PPSETUP_LOCAL_DATA pLocalData,
  230. IN LPCTSTR pszPrinterName,
  231. IN HWND hwnd
  232. );
  233. BOOL
  234. PSetupSetSelectDevTitleAndInstructions(
  235. IN HDEVINFO hDevInfo,
  236. IN LPCTSTR pszTitle,
  237. IN LPCTSTR pszSubTitle,
  238. IN LPCTSTR pszInstn
  239. );
  240. BOOL
  241. PSetupSelectDeviceButtons(
  242. IN HDEVINFO hDevInfo,
  243. IN DWORD dwFlagsSet,
  244. IN DWORD dwFlagsClear
  245. );
  246. BOOL
  247. PSetupGetLocalDataField(
  248. IN PPSETUP_LOCAL_DATA pLocalData,
  249. IN PLATFORM platform,
  250. IN OUT PDRIVER_FIELD pDrvField
  251. );
  252. VOID
  253. PSetupFreeDrvField(
  254. IN PDRIVER_FIELD pDrvField
  255. );
  256. //
  257. // Internet printing support
  258. //
  259. BOOL
  260. PSetupGetDriverInfForPrinter(
  261. IN HDEVINFO hDevInfo,
  262. IN LPCTSTR pszPrinterName,
  263. IN OUT LPTSTR pszInfName,
  264. IN OUT LPDWORD pcbInfNameSize
  265. );
  266. DWORD
  267. PSetupInstallPrinterDriverFromTheWeb(
  268. IN HDEVINFO hDevInfo,
  269. IN PPSETUP_LOCAL_DATA pLocalData,
  270. IN PLATFORM platform,
  271. IN LPCTSTR pszServerName,
  272. IN LPOSVERSIONINFO pOsVersionInfo,
  273. IN HWND hwnd,
  274. IN LPCTSTR pszSource
  275. );
  276. //
  277. // Monitor Installation Functions
  278. //
  279. HANDLE
  280. PSetupCreateMonitorInfo(
  281. IN HWND hwnd,
  282. IN LPCTSTR pszServerName
  283. );
  284. VOID
  285. PSetupDestroyMonitorInfo(
  286. IN OUT HANDLE h
  287. );
  288. BOOL
  289. PSetupEnumMonitor(
  290. IN HANDLE h,
  291. IN DWORD dwIndex,
  292. OUT LPTSTR pMonitorName,
  293. IN OUT LPDWORD pdwSize
  294. );
  295. BOOL
  296. PSetupInstallMonitor(
  297. IN HWND hwnd
  298. );
  299. //
  300. // Following exported for test team's use
  301. //
  302. LPDRIVER_INFO_3
  303. PSetupGetDriverInfo3(
  304. IN PSELECTED_DRV_INFO pDrvInfo
  305. );
  306. VOID
  307. PSetupDestroyDriverInfo3(
  308. IN LPDRIVER_INFO_3 pDriverInfo3
  309. );
  310. BOOL
  311. PSetupFindMappedDriver(
  312. IN BOOL bWinNT,
  313. IN LPCTSTR pszDriverName,
  314. OUT LPTSTR *ppszRemappedDriverName,
  315. OUT BOOL *pbDriverFound
  316. );
  317. //
  318. // For Win9x upgrade
  319. //
  320. BOOL
  321. PSetupAssociateICMProfiles(
  322. IN LPCTSTR pszzICMFiles,
  323. IN LPCTSTR pszPrinterName
  324. );
  325. BOOL
  326. PSetupInstallICMProfiles(
  327. IN LPCTSTR pszServerName,
  328. IN LPCTSTR pszzICMFiles
  329. );
  330. //
  331. // For spooler
  332. //
  333. VOID
  334. PSetupFreeMem(
  335. PVOID p
  336. );
  337. //
  338. // Following are the typdefs for calling GetProcAddress()
  339. //
  340. typedef
  341. HDEVINFO
  342. (*pfPSetupCreatePrinterDeviceInfoList)(
  343. IN HWND hwnd
  344. );
  345. typedef
  346. VOID
  347. (*pfPSetupDestroyPrinterDeviceInfoList)(
  348. IN HDEVINFO h
  349. );
  350. typedef
  351. BOOL
  352. (*pfPSetupSelectDriver)(
  353. IN HDEVINFO h
  354. );
  355. typedef
  356. HPROPSHEETPAGE
  357. (*pfPSetupCreateDrvSetupPage)(
  358. IN HDEVINFO h,
  359. IN HWND hwnd
  360. );
  361. typedef
  362. PPSETUP_LOCAL_DATA
  363. (*pfPSetupGetSelectedDriverInfo)(
  364. IN HDEVINFO h
  365. );
  366. typedef
  367. VOID
  368. (*pfPSetupDestroySelectedDriverInfo)(
  369. IN PPSETUP_LOCAL_DATA pSelectedDrvInfo
  370. );
  371. typedef
  372. DWORD
  373. (*pfPSetupInstallPrinterDriver)(
  374. IN HDEVINFO h,
  375. IN PPSETUP_LOCAL_DATA pSelectedDrvInfo,
  376. IN LPCTSTR pszDriverName,
  377. IN PLATFORM platform,
  378. IN DWORD dwVersion,
  379. IN LPCTSTR pszServerName,
  380. IN HWND hwnd,
  381. IN LPCTSTR pszPlatformName,
  382. IN LPCTSTR pszSourcePath,
  383. IN DWORD dwInstallFlags,
  384. IN DWORD dwAddDrvFlags,
  385. OUT LPTSTR *ppszNewDriverName
  386. );
  387. typedef
  388. BOOL
  389. (*pfPSetupIsDriverInstalled)(
  390. IN LPCTSTR pszServerName,
  391. IN LPCTSTR pszDriverName,
  392. IN PLATFORM platform,
  393. IN DWORD dwMajorVersion
  394. );
  395. typedef
  396. INT
  397. (*pfPSetupIsTheDriverFoundInInfInstalled)(
  398. IN LPCTSTR pszServerName,
  399. IN PPSETUP_LOCAL_DATA pLocalData,
  400. IN PLATFORM platform,
  401. IN DWORD dwMajorVersion
  402. );
  403. typedef
  404. BOOL
  405. (*pfPSetupRefreshDriverList)(
  406. IN HDEVINFO h
  407. );
  408. typedef
  409. PLATFORM
  410. (*pfPSetupThisPlatform)(
  411. VOID
  412. );
  413. typedef
  414. BOOL
  415. (*pfPSetupGetPathToSearch)(
  416. IN HWND hwnd,
  417. IN LPCTSTR pszTitle,
  418. IN LPCTSTR pszDiskName,
  419. IN LPCTSTR pszFileName,
  420. IN BOOL bPromptForInf,
  421. OUT TCHAR szPath[MAX_PATH]
  422. );
  423. typedef
  424. PPSETUP_LOCAL_DATA
  425. (*pfPSetupDriverInfoFromName)(
  426. IN HDEVINFO h,
  427. IN LPCTSTR pszModel
  428. );
  429. typedef
  430. BOOL
  431. (*pfPSetupPreSelectDriver)(
  432. IN HDEVINFO h,
  433. IN LPCTSTR pszManufacturer, OPTIONAL
  434. IN LPCTSTR pszModel OPTIONAL
  435. );
  436. typedef
  437. HANDLE
  438. (*pfPSetupCreateMonitorInfo)(
  439. IN HWND hwnd,
  440. IN LPCTSTR pszServerName
  441. );
  442. typedef
  443. VOID
  444. (*pfPSetupDestroyMonitorInfo)(
  445. IN HANDLE h
  446. );
  447. typedef
  448. BOOL
  449. (*pfPSetupEnumMonitor)(
  450. IN HANDLE h,
  451. IN DWORD dwIndex,
  452. OUT LPTSTR pMonitorName,
  453. IN OUT LPDWORD pdwSize
  454. );
  455. typedef
  456. BOOL
  457. (*pfPSetupInstallMonitor)(
  458. IN HWND hwnd
  459. );
  460. typedef
  461. BOOL
  462. (*pfPSetupProcessPrinterAdded)(
  463. IN HDEVINFO hDevInfo,
  464. IN PPSETUP_LOCAL_DATA pLocalData,
  465. IN LPCTSTR pszPrinterName,
  466. IN HWND hwnd
  467. );
  468. typedef
  469. BOOL
  470. (*pfPSetupBuildDriversFromPath)(
  471. IN HANDLE h,
  472. IN LPCTSTR pszDriverPath,
  473. IN BOOL bEnumSingleInf
  474. );
  475. typedef
  476. BOOL
  477. (*pfPSetupSetSelectDevTitleAndInstructions)(
  478. IN HDEVINFO hDevInfo,
  479. IN LPCTSTR pszTitle,
  480. IN LPCTSTR pszSubTitle,
  481. IN LPCTSTR pszInstn
  482. );
  483. typedef
  484. BOOL
  485. (*pfPSetupSelectDeviceButtons)(
  486. IN HDEVINFO hDevInfo,
  487. IN DWORD dwFlagsSet,
  488. IN DWORD dwFlagsClear
  489. );
  490. typedef
  491. DWORD
  492. (*pfPSetupInstallPrinterDriverFromTheWeb)(
  493. IN HDEVINFO hDevInfo,
  494. IN PPSETUP_LOCAL_DATA pLocalData,
  495. IN PLATFORM platform,
  496. IN LPCTSTR pszServerName,
  497. IN LPOSVERSIONINFO pOsVersionInfo,
  498. IN HWND hwnd,
  499. IN LPCTSTR pszSource
  500. );
  501. typedef
  502. BOOL
  503. (*pfPSetupIsOemDriver)(
  504. IN HDEVINFO hDevInfo,
  505. IN PPSETUP_LOCAL_DATA pLocalData,
  506. IN OUT PBOOL pbIsOemDriver
  507. );
  508. typedef
  509. BOOL
  510. (*pfPSetupGetLocalDataField)(
  511. IN PPSETUP_LOCAL_DATA pLocalData,
  512. IN PLATFORM platform,
  513. IN OUT PDRIVER_FIELD pDrvField
  514. );
  515. typedef
  516. VOID
  517. (*pfPSetupFreeDrvField)(
  518. IN PDRIVER_FIELD pDrvField
  519. );
  520. typedef
  521. BOOL
  522. (*pfPSetupAssociateICMProfiles)(
  523. IN LPCTSTR pszzICMFiles,
  524. IN LPCTSTR pszPrinterName
  525. );
  526. typedef
  527. BOOL
  528. (*pfPSetupInstallICMProfiles)(
  529. IN LPCTSTR pszServerName,
  530. IN LPCTSTR pszzICMFiles
  531. );
  532. typedef
  533. BOOL
  534. (*pfPSetupIsCompatibleDriver)(
  535. IN LPCTSTR pszServer, OPTIONAL
  536. IN LPCTSTR pszDriverModel,
  537. IN LPCTSTR pszDriverPath, // main rendering driver dll
  538. IN LPCTSTR pszEnvironment,
  539. IN DWORD dwVersion,
  540. IN FILETIME *pFileTimeDriver,
  541. OUT DWORD *pdwBlockingStatus,
  542. OUT LPTSTR *ppszReplacementDriver OPTIONAL // caller must free it.
  543. );
  544. typedef
  545. DWORD
  546. (*pfPSetupShowBlockedDriverUI)(
  547. HWND hParentWnd,
  548. DWORD BlockingStatus // can be BSP_PRINTER_DRIVER_BLOCKED or BSP_PRINTER_DRIVER_WARNED, OR'd with BSP_INBOX_REPLACEMENT_AVAILABLE
  549. );
  550. typedef
  551. BOOL
  552. (*pfPSetupFindMappedDriver)(
  553. IN BOOL bWinNT,
  554. IN LPCTSTR pszDriverName,
  555. OUT LPTSTR *ppszRemappedDriverName,
  556. OUT BOOL *pbDriverFound
  557. );
  558. typedef
  559. DWORD
  560. (*pfPSetupInstallInboxDriverSilently)(
  561. IN LPCTSTR pszDriverName
  562. );
  563. typedef
  564. VOID
  565. (*pfPSetupFreeMem)(
  566. PVOID p
  567. );
  568. #ifdef __cplusplus
  569. }
  570. #endif
  571. #endif // #ifndef _SPLSETUP_H