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.

654 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. PLATFORM
  204. PSetupThisPlatform(
  205. VOID
  206. );
  207. BOOL
  208. PSetupGetPathToSearch(
  209. IN HWND hwnd,
  210. IN LPCTSTR pszTitle,
  211. IN LPCTSTR pszDiskName,
  212. IN LPCTSTR pszFileName,
  213. IN BOOL bPromptForInf,
  214. IN OUT TCHAR szPath[MAX_PATH]
  215. );
  216. BOOL
  217. PSetupProcessPrinterAdded(
  218. IN HDEVINFO hDevInfo,
  219. IN PPSETUP_LOCAL_DATA pLocalData,
  220. IN LPCTSTR pszPrinterName,
  221. IN HWND hwnd
  222. );
  223. BOOL
  224. PSetupSetSelectDevTitleAndInstructions(
  225. IN HDEVINFO hDevInfo,
  226. IN LPCTSTR pszTitle,
  227. IN LPCTSTR pszSubTitle,
  228. IN LPCTSTR pszInstn
  229. );
  230. BOOL
  231. PSetupSelectDeviceButtons(
  232. IN HDEVINFO hDevInfo,
  233. IN DWORD dwFlagsSet,
  234. IN DWORD dwFlagsClear
  235. );
  236. BOOL
  237. PSetupGetLocalDataField(
  238. IN PPSETUP_LOCAL_DATA pLocalData,
  239. IN PLATFORM platform,
  240. IN OUT PDRIVER_FIELD pDrvField
  241. );
  242. VOID
  243. PSetupFreeDrvField(
  244. IN PDRIVER_FIELD pDrvField
  245. );
  246. //
  247. // Internet printing support
  248. //
  249. BOOL
  250. PSetupGetDriverInfForPrinter(
  251. IN HDEVINFO hDevInfo,
  252. IN LPCTSTR pszPrinterName,
  253. IN OUT LPTSTR pszInfName,
  254. IN OUT LPDWORD pcbInfNameSize
  255. );
  256. DWORD
  257. PSetupInstallPrinterDriverFromTheWeb(
  258. IN HDEVINFO hDevInfo,
  259. IN PPSETUP_LOCAL_DATA pLocalData,
  260. IN PLATFORM platform,
  261. IN LPCTSTR pszServerName,
  262. IN LPOSVERSIONINFO pOsVersionInfo,
  263. IN HWND hwnd,
  264. IN LPCTSTR pszSource
  265. );
  266. //
  267. // Monitor Installation Functions
  268. //
  269. HANDLE
  270. PSetupCreateMonitorInfo(
  271. IN HWND hwnd,
  272. IN LPCTSTR pszServerName
  273. );
  274. VOID
  275. PSetupDestroyMonitorInfo(
  276. IN OUT HANDLE h
  277. );
  278. BOOL
  279. PSetupEnumMonitor(
  280. IN HANDLE h,
  281. IN DWORD dwIndex,
  282. OUT LPTSTR pMonitorName,
  283. IN OUT LPDWORD pdwSize
  284. );
  285. BOOL
  286. PSetupInstallMonitor(
  287. IN HWND hwnd
  288. );
  289. //
  290. // Following exported for test team's use
  291. //
  292. LPDRIVER_INFO_3
  293. PSetupGetDriverInfo3(
  294. IN PSELECTED_DRV_INFO pDrvInfo
  295. );
  296. VOID
  297. PSetupDestroyDriverInfo3(
  298. IN LPDRIVER_INFO_3 pDriverInfo3
  299. );
  300. BOOL
  301. PSetupFindMappedDriver(
  302. IN BOOL bWinNT,
  303. IN LPCTSTR pszDriverName,
  304. OUT LPTSTR *ppszRemappedDriverName,
  305. OUT BOOL *pbDriverFound
  306. );
  307. //
  308. // For Win9x upgrade
  309. //
  310. BOOL
  311. PSetupAssociateICMProfiles(
  312. IN LPCTSTR pszzICMFiles,
  313. IN LPCTSTR pszPrinterName
  314. );
  315. BOOL
  316. PSetupInstallICMProfiles(
  317. IN LPCTSTR pszServerName,
  318. IN LPCTSTR pszzICMFiles
  319. );
  320. //
  321. // For spooler
  322. //
  323. VOID
  324. PSetupFreeMem(
  325. PVOID p
  326. );
  327. //
  328. // Following are the typdefs for calling GetProcAddress()
  329. //
  330. typedef
  331. HDEVINFO
  332. (*pfPSetupCreatePrinterDeviceInfoList)(
  333. IN HWND hwnd
  334. );
  335. typedef
  336. VOID
  337. (*pfPSetupDestroyPrinterDeviceInfoList)(
  338. IN HDEVINFO h
  339. );
  340. typedef
  341. BOOL
  342. (*pfPSetupSelectDriver)(
  343. IN HDEVINFO h
  344. );
  345. typedef
  346. HPROPSHEETPAGE
  347. (*pfPSetupCreateDrvSetupPage)(
  348. IN HDEVINFO h,
  349. IN HWND hwnd
  350. );
  351. typedef
  352. PPSETUP_LOCAL_DATA
  353. (*pfPSetupGetSelectedDriverInfo)(
  354. IN HDEVINFO h
  355. );
  356. typedef
  357. VOID
  358. (*pfPSetupDestroySelectedDriverInfo)(
  359. IN PPSETUP_LOCAL_DATA pSelectedDrvInfo
  360. );
  361. typedef
  362. DWORD
  363. (*pfPSetupInstallPrinterDriver)(
  364. IN HDEVINFO h,
  365. IN PPSETUP_LOCAL_DATA pSelectedDrvInfo,
  366. IN LPCTSTR pszDriverName,
  367. IN PLATFORM platform,
  368. IN DWORD dwVersion,
  369. IN LPCTSTR pszServerName,
  370. IN HWND hwnd,
  371. IN LPCTSTR pszPlatformName,
  372. IN LPCTSTR pszSourcePath,
  373. IN DWORD dwInstallFlags,
  374. IN DWORD dwAddDrvFlags,
  375. OUT LPTSTR *ppszNewDriverName
  376. );
  377. typedef
  378. BOOL
  379. (*pfPSetupIsDriverInstalled)(
  380. IN LPCTSTR pszServerName,
  381. IN LPCTSTR pszDriverName,
  382. IN PLATFORM platform,
  383. IN DWORD dwMajorVersion
  384. );
  385. typedef
  386. INT
  387. (*pfPSetupIsTheDriverFoundInInfInstalled)(
  388. IN LPCTSTR pszServerName,
  389. IN PPSETUP_LOCAL_DATA pLocalData,
  390. IN PLATFORM platform,
  391. IN DWORD dwMajorVersion
  392. );
  393. typedef
  394. PLATFORM
  395. (*pfPSetupThisPlatform)(
  396. VOID
  397. );
  398. typedef
  399. BOOL
  400. (*pfPSetupGetPathToSearch)(
  401. IN HWND hwnd,
  402. IN LPCTSTR pszTitle,
  403. IN LPCTSTR pszDiskName,
  404. IN LPCTSTR pszFileName,
  405. IN BOOL bPromptForInf,
  406. OUT TCHAR szPath[MAX_PATH]
  407. );
  408. typedef
  409. PPSETUP_LOCAL_DATA
  410. (*pfPSetupDriverInfoFromName)(
  411. IN HDEVINFO h,
  412. IN LPCTSTR pszModel
  413. );
  414. typedef
  415. BOOL
  416. (*pfPSetupPreSelectDriver)(
  417. IN HDEVINFO h,
  418. IN LPCTSTR pszManufacturer, OPTIONAL
  419. IN LPCTSTR pszModel OPTIONAL
  420. );
  421. typedef
  422. HANDLE
  423. (*pfPSetupCreateMonitorInfo)(
  424. IN HWND hwnd,
  425. IN LPCTSTR pszServerName
  426. );
  427. typedef
  428. VOID
  429. (*pfPSetupDestroyMonitorInfo)(
  430. IN HANDLE h
  431. );
  432. typedef
  433. BOOL
  434. (*pfPSetupEnumMonitor)(
  435. IN HANDLE h,
  436. IN DWORD dwIndex,
  437. OUT LPTSTR pMonitorName,
  438. IN OUT LPDWORD pdwSize
  439. );
  440. typedef
  441. BOOL
  442. (*pfPSetupInstallMonitor)(
  443. IN HWND hwnd
  444. );
  445. typedef
  446. BOOL
  447. (*pfPSetupProcessPrinterAdded)(
  448. IN HDEVINFO hDevInfo,
  449. IN PPSETUP_LOCAL_DATA pLocalData,
  450. IN LPCTSTR pszPrinterName,
  451. IN HWND hwnd
  452. );
  453. typedef
  454. BOOL
  455. (*pfPSetupBuildDriversFromPath)(
  456. IN HANDLE h,
  457. IN LPCTSTR pszDriverPath,
  458. IN BOOL bEnumSingleInf
  459. );
  460. typedef
  461. BOOL
  462. (*pfPSetupSetSelectDevTitleAndInstructions)(
  463. IN HDEVINFO hDevInfo,
  464. IN LPCTSTR pszTitle,
  465. IN LPCTSTR pszSubTitle,
  466. IN LPCTSTR pszInstn
  467. );
  468. typedef
  469. BOOL
  470. (*pfPSetupSelectDeviceButtons)(
  471. IN HDEVINFO hDevInfo,
  472. IN DWORD dwFlagsSet,
  473. IN DWORD dwFlagsClear
  474. );
  475. typedef
  476. DWORD
  477. (*pfPSetupInstallPrinterDriverFromTheWeb)(
  478. IN HDEVINFO hDevInfo,
  479. IN PPSETUP_LOCAL_DATA pLocalData,
  480. IN PLATFORM platform,
  481. IN LPCTSTR pszServerName,
  482. IN LPOSVERSIONINFO pOsVersionInfo,
  483. IN HWND hwnd,
  484. IN LPCTSTR pszSource
  485. );
  486. typedef
  487. BOOL
  488. (*pfPSetupGetLocalDataField)(
  489. IN PPSETUP_LOCAL_DATA pLocalData,
  490. IN PLATFORM platform,
  491. IN OUT PDRIVER_FIELD pDrvField
  492. );
  493. typedef
  494. VOID
  495. (*pfPSetupFreeDrvField)(
  496. IN PDRIVER_FIELD pDrvField
  497. );
  498. typedef
  499. BOOL
  500. (*pfPSetupAssociateICMProfiles)(
  501. IN LPCTSTR pszzICMFiles,
  502. IN LPCTSTR pszPrinterName
  503. );
  504. typedef
  505. BOOL
  506. (*pfPSetupInstallICMProfiles)(
  507. IN LPCTSTR pszServerName,
  508. IN LPCTSTR pszzICMFiles
  509. );
  510. typedef
  511. BOOL
  512. (*pfPSetupIsCompatibleDriver)(
  513. IN LPCTSTR pszServer, OPTIONAL
  514. IN LPCTSTR pszDriverModel,
  515. IN LPCTSTR pszDriverPath, // main rendering driver dll
  516. IN LPCTSTR pszEnvironment,
  517. IN DWORD dwVersion,
  518. IN FILETIME *pFileTimeDriver,
  519. OUT DWORD *pdwBlockingStatus,
  520. OUT LPTSTR *ppszReplacementDriver OPTIONAL // caller must free it.
  521. );
  522. typedef
  523. DWORD
  524. (*pfPSetupShowBlockedDriverUI)(
  525. HWND hParentWnd,
  526. DWORD BlockingStatus // can be BSP_PRINTER_DRIVER_BLOCKED or BSP_PRINTER_DRIVER_WARNED, OR'd with BSP_INBOX_REPLACEMENT_AVAILABLE
  527. );
  528. typedef
  529. BOOL
  530. (*pfPSetupFindMappedDriver)(
  531. IN BOOL bWinNT,
  532. IN LPCTSTR pszDriverName,
  533. OUT LPTSTR *ppszRemappedDriverName,
  534. OUT BOOL *pbDriverFound
  535. );
  536. typedef
  537. DWORD
  538. (*pfPSetupInstallInboxDriverSilently)(
  539. IN LPCTSTR pszDriverName
  540. );
  541. typedef
  542. VOID
  543. (*pfPSetupFreeMem)(
  544. PVOID p
  545. );
  546. #ifdef __cplusplus
  547. }
  548. #endif
  549. #endif // #ifndef _SPLSETUP_H