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.

2961 lines
58 KiB

  1. /*++
  2. Copyright (c) 1990 - 1995 Microsoft Corporation
  3. Module Name:
  4. local.h
  5. Abstract:
  6. Header file for Local Print Providor
  7. Author:
  8. Dave Snipp (DaveSn) 15-Mar-1991
  9. Revision History:
  10. 06-Jun-1995 MuhuntS DRIVER_INFO_3, PRINTER_INFO_5 changes
  11. 17-May-1992 ChuckC Added CreateSplUniStr, DeleteSplUniStr.
  12. 27 June 94 MattFe pIniSpooler
  13. 10 July 94 MattFe Spl entry points for Caching
  14. --*/
  15. #include <ntfytab.h>
  16. #include "splcom.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. //
  21. // Defines to make code more readable.
  22. //
  23. #define ONEDAY 60*24
  24. #define BROADCAST TRUE
  25. #define NO_BROADCAST FALSE
  26. #define UPDATE_DS_ONLY 3
  27. #define CHANGEID_ONLY 2
  28. #define UPDATE_CHANGEID 1
  29. #define KEEP_CHANGEID 0
  30. #define FIRST_FILE_TIME_GREATER_THAN_SECOND 1
  31. #define OVERWRITE_IF_TARGET_EXISTS FALSE
  32. #define IMPERSONATE_USER TRUE
  33. #define DO_NOT_IMPERSONATE_USER FALSE
  34. #define STRINGS_ARE_EQUAL 0
  35. #define ONE_MINUTE 60*1000
  36. #define TEN_MINUTES 10*ONE_MINUTE
  37. #define TWO_MINUTES 2*ONE_MINUTE
  38. #define SEVEN_MINUTES 7*ONE_MINUTE
  39. #define HOUR_OF_MINUTES 60
  40. #define ONE_HOUR ONE_MINUTE*HOUR_OF_MINUTES
  41. #define DAY_OF_HOURS 24
  42. #define DAY_OF_MINUTES DAY_OF_HOURS*60
  43. #define DEFAULT_NUMBER_MASTER_AND_BACKUP 3
  44. #define DEFAULT_NUMBER_BROWSE_WORKSTATIONS 2
  45. #define DEFAULT_REFRESH_TIMES_PER_DECAY_PERIOD 2;
  46. #define FIND_ANY_VERSION TRUE
  47. #define FIND_COMPATIBLE_VERSION FALSE
  48. #define DRIVER_UPGRADE 2
  49. #define DRIVER_SEARCH 4
  50. #define NT3X_VERSION TRUE
  51. #define CURRENT_VERSION FALSE
  52. #define MAX_STATIC_ALLOC 2048
  53. // Default timeout values we will return
  54. #define DEFAULT_DNS_TIMEOUT 15000
  55. #define DEFAULT_TX_TIMEOUT 45000
  56. // Pruning definitions
  57. #define PRUNE_DOWNLEVEL_NEVER 0
  58. #define PRUNE_DOWNLEVEL_NICELY 1
  59. #define PRUNE_DOWNLEVEL_AGGRESSIVELY 2
  60. // Default pruning settings
  61. #define DS_PRINTQUEUE_VERSION_WIN2000 4
  62. #define DEFAULT_PRUNE_DOWNLEVEL PRUNE_DOWNLEVEL_NEVER // Never delete downlevel PQ
  63. #define DEFAULT_PRUNING_PRIORITY THREAD_PRIORITY_NORMAL
  64. #define DEFAULT_PRUNING_RETRIES 2
  65. #define DEFAULT_PRUNING_INTERVAL (DAY_OF_MINUTES/(DEFAULT_PRUNING_RETRIES + 1)) // 8 hrs
  66. #define DEFAULT_PRUNING_RETRY_LOG 0
  67. #define MAX_PRUNING_RETRIES 10
  68. // Default printQueue settings
  69. #define IMMORTAL 1
  70. #define DEFAULT_IMMORTAL !IMMORTAL
  71. #define DEFAULT_VERIFY_PUBLISHED_STATE INFINITE // This is the interval
  72. #define DEFAULT_PRINT_PUBLISH_POLICY 1
  73. #define SERVER_THREAD_OFF 0
  74. #define SERVER_THREAD_ON 1
  75. #define SERVER_THREAD_UNCONFIGURED 2
  76. // Default policy values
  77. #define KM_PRINTERS_ARE_BLOCKED 1 // 1 = blocked, 0 = not blocked
  78. #define SERVER_DEFAULT_KM_PRINTERS_ARE_BLOCKED 1
  79. #define WKS_DEFAULT_KM_PRINTERS_ARE_BLOCKED 0
  80. extern DWORD DefaultKMPrintersAreBlocked;
  81. extern DWORD gdwServerInstallTimeOut;
  82. #define INIT_TIME TRUE
  83. #define NON_INIT_TIME FALSE
  84. enum
  85. {
  86. kMaximumNumberOfBrowsePrinters = 256
  87. };
  88. extern WCHAR *szPrinterData;
  89. extern WCHAR *szConfigurationKey;
  90. extern WCHAR *szDataFileKey;
  91. extern WCHAR *szDriverVersion;
  92. extern WCHAR *szTempDir;
  93. extern WCHAR *szDriversKey;
  94. extern WCHAR *szPrintersKey;
  95. extern WCHAR *szDirectory;
  96. extern WCHAR *szDriverIni;
  97. extern WCHAR *szDriverFile;
  98. extern WCHAR *szDriverDir;
  99. extern WCHAR *szPrintProcDir;
  100. extern WCHAR *szPrinterDir;
  101. extern WCHAR *szClusterPrinterDir;
  102. extern WCHAR *szPrinterIni;
  103. extern WCHAR *szNullPort;
  104. extern WCHAR *szComma;
  105. extern WCHAR *szName;
  106. extern WCHAR *szShare;
  107. extern WCHAR *szPort;
  108. extern WCHAR *szPrintProcessor;
  109. extern WCHAR *szDatatype;
  110. extern WCHAR *szObjectGUID;
  111. extern WCHAR *szDsKeyUpdate;
  112. extern WCHAR *szDsKeyUpdateForeground;
  113. extern WCHAR *szAction;
  114. extern WCHAR *szDriver;
  115. extern WCHAR *szLocation;
  116. extern WCHAR *szDescription;
  117. extern WCHAR *szAttributes;
  118. extern WCHAR *szStatus;
  119. extern WCHAR *szPriority;
  120. extern WCHAR *szDefaultPriority;
  121. extern WCHAR *szUntilTime;
  122. extern WCHAR *szStartTime;
  123. extern WCHAR *szParameters;
  124. extern WCHAR *szSepFile;
  125. extern WCHAR *szDevMode;
  126. extern WCHAR *szSecurity;
  127. extern WCHAR *szSpoolDir;
  128. extern WCHAR *szNetMsgDll;
  129. extern WCHAR *szTimeLastChange;
  130. extern WCHAR *szHelpFile;
  131. extern WCHAR *szMonitor;
  132. extern WCHAR *szDependentFiles;
  133. extern WCHAR *szPreviousNames;
  134. extern WCHAR *szDNSTimeout;
  135. extern WCHAR *szTXTimeout;
  136. extern WCHAR *szNull;
  137. extern WCHAR *szPendingUpgrades;
  138. extern WCHAR *szMfgName;
  139. extern WCHAR *szOEMUrl;
  140. extern WCHAR *szHardwareID;
  141. extern WCHAR *szProvider;
  142. extern WCHAR *szDriverDate;
  143. extern WCHAR *szLongVersion;
  144. extern WCHAR *szClusDrvTimeStamp;
  145. extern const WCHAR szDiscardTSJobs[];
  146. extern const WCHAR szDisableFilePooling[];
  147. extern HANDLE hInst;
  148. extern PINISPOOLER pLocalIniSpooler;
  149. extern HANDLE SchedulerSignal;
  150. extern HANDLE PowerManagementSignal;
  151. extern DWORD dwSchedulerThreadPriority;
  152. extern CRITICAL_SECTION SpoolerSection;
  153. #if DBG
  154. extern HANDLE hcsSpoolerSection;
  155. #endif
  156. extern HANDLE WinStaDllHandle;
  157. extern PINIENVIRONMENT pThisEnvironment;
  158. extern WCHAR *szPrintProcKey;
  159. extern WCHAR *szEnvironment;
  160. extern WCHAR *szMajorVersion;
  161. extern WCHAR *szMinorVersion;
  162. extern WCHAR *szRegistryRoot;
  163. extern WCHAR *szEMFThrottle;
  164. extern WCHAR *szFlushShadowFileBuffers;
  165. extern WCHAR *szClusterDriverRoot;
  166. extern WCHAR *szClusterNonAwareMonitors;
  167. extern LPWSTR szRemoteDoc;
  168. extern LPWSTR szLocalDoc;
  169. extern LPWSTR szFastPrintTimeout;
  170. extern LPWSTR szRaw;
  171. extern DWORD dwUpgradeFlag;
  172. #define CHECK_SCHEDULER() SetEvent(SchedulerSignal)
  173. extern DWORD dwFastPrintWaitTimeout;
  174. extern DWORD dwPortThreadPriority;
  175. extern DWORD dwFastPrintThrottleTimeout;
  176. extern DWORD dwFastPrintSlowDownThreshold;
  177. extern DWORD dwWritePrinterSleepTime;
  178. extern DWORD dwServerThreadPriority;
  179. extern DWORD dwEnableBroadcastSpoolerStatus;
  180. extern DWORD ServerThreadTimeout;
  181. extern DWORD ServerThreadRunning;
  182. extern DWORD NetPrinterDecayPeriod;
  183. extern DWORD RefreshTimesPerDecayPeriod;
  184. extern HANDLE ServerThreadSemaphore;
  185. extern BOOL bNetInfoReady;
  186. extern DWORD FirstAddNetPrinterTickCount;
  187. extern DWORD BrowsePrintWorkstations;
  188. extern DWORD dwFlushShadowFileBuffers;
  189. extern DWORD dwMajorVersion;
  190. extern DWORD dwMinorVersion;
  191. extern DWORD dwUniquePrinterSessionID;
  192. extern DWORD PortToPrinterStatusMappings[];
  193. extern WCHAR *szSpooler;
  194. extern LPCTSTR pszLocalOnlyToken;
  195. extern LPCTSTR pszLocalsplOnlyToken;
  196. typedef DWORD NOTIFYVECTOR[NOTIFY_TYPE_MAX];
  197. typedef NOTIFYVECTOR *PNOTIFYVECTOR;
  198. #define ZERONV(dest) \
  199. dest[0] = dest[1] = 0
  200. #define COPYNV(dest, src) \
  201. { dest[0] = src[0]; dest[1] = src[1]; }
  202. #define ADDNV(dest, src) \
  203. { dest[0] |= src[0]; dest[1] |= src[1]; }
  204. extern NOTIFYVECTOR NVPrinterStatus;
  205. extern NOTIFYVECTOR NVPrinterSD;
  206. extern NOTIFYVECTOR NVJobStatus;
  207. extern NOTIFYVECTOR NVJobStatusString;
  208. extern NOTIFYVECTOR NVJobStatusAndString;
  209. extern NOTIFYVECTOR NVPurge;
  210. extern NOTIFYVECTOR NVDeletedJob;
  211. extern NOTIFYVECTOR NVAddJob;
  212. extern NOTIFYVECTOR NVSpoolJob;
  213. extern NOTIFYVECTOR NVWriteJob;
  214. extern NOTIFYVECTOR NVPrinterAll;
  215. extern NOTIFYVECTOR NVJobPrinted;
  216. extern BOOL (*pfnPrinterEvent)();
  217. extern BOOL fW3SvcInstalled; // Says if IIS or "Peer web Server" is installed on the local machine.
  218. extern PWCHAR szW3Root; // The WWWRoot dir, e.g. c:\inetpub\wwwroot
  219. extern OSVERSIONINFO OsVersionInfo;
  220. extern OSVERSIONINFOEX OsVersionInfoEx;
  221. extern WCHAR *gszNT4EMF;
  222. extern WCHAR *gszNT5EMF;
  223. extern WCHAR *ipszRegistryClusRepository;
  224. extern WCHAR *szDriversDirectory;
  225. extern WCHAR *szDriversKey;
  226. extern WCHAR *szWin95Environment;
  227. extern ERemoteRPCEndPointPolicy gRemoteRPCEndPointPolicy;
  228. BOOL
  229. IsPrinterSharingAllowed(
  230. VOID
  231. );
  232. typedef struct _JOBDATA {
  233. struct _JOBDATA *pNext;
  234. PINIJOB pIniJob;
  235. SIZE_T MemoryUse;
  236. DWORD dwWaitTime;
  237. DWORD dwScheduleTime;
  238. DWORD dwNumberOfTries;
  239. } JOBDATA, *PJOBDATA;
  240. typedef struct _Strings {
  241. DWORD nElements;
  242. PWSTR ppszString[1];
  243. } STRINGS, *PSTRINGS;
  244. typedef struct _INTERNAL_DRV_FILE {
  245. LPWSTR pFileName;
  246. DWORD dwVersion;
  247. HANDLE hFileHandle;
  248. BOOL bUpdated;
  249. } INTERNAL_DRV_FILE, *PINTERNAL_DRV_FILE;
  250. extern DWORD dwNumberOfEMFJobsRendering;
  251. extern BOOL bUseEMFScheduling;
  252. extern SIZE_T TotalMemoryForRendering;
  253. extern SIZE_T AvailMemoryForRendering;
  254. extern DWORD dwLastScheduleTime;
  255. extern PJOBDATA pWaitingList;
  256. extern PJOBDATA pScheduleList;
  257. #define JOB_SCHEDULE_LIST 0x00000001
  258. #define JOB_WAITING_LIST 0x00000002
  259. #define SPL_FIRST_JOB 0x00000001
  260. #define SPL_USE_MEMORY 0x00000002
  261. typedef BOOL (*PFNSPOOLER_MAP)( HANDLE h, PINISPOOLER pIniSpooler );
  262. typedef BOOL (*PFNPRINTER_MAP)( HANDLE h, PINIPRINTER pIniPrinter );
  263. #define DBG_CLUSTER 0x200
  264. VOID
  265. RunForEachSpooler(
  266. HANDLE h,
  267. PFNSPOOLER_MAP pfnMap
  268. );
  269. VOID
  270. RunForEachPrinter(
  271. PINISPOOLER pIniSpooler,
  272. HANDLE h,
  273. PFNPRINTER_MAP pfnMap
  274. );
  275. BOOL
  276. DsUpdateAllDriverKeys(
  277. HANDLE h,
  278. PINISPOOLER pIniSpooler
  279. );
  280. BOOL
  281. InitializeLocalspl(
  282. VOID
  283. );
  284. VOID
  285. EnterSplSem(
  286. VOID
  287. );
  288. VOID
  289. LeaveSplSem(
  290. VOID
  291. );
  292. BOOL
  293. IsThreadInSem(
  294. DWORD ThreadID
  295. );
  296. #if DBG
  297. extern HANDLE ghbtClusterRef;
  298. extern PDBG_POINTERS gpDbgPointers;
  299. VOID
  300. SplInSem(
  301. VOID
  302. );
  303. VOID
  304. SplOutSem(
  305. VOID
  306. );
  307. #else
  308. #define SplInSem()
  309. #define SplOutSem()
  310. #endif
  311. PDEVMODE
  312. AllocDevMode(
  313. PDEVMODE pDevMode
  314. );
  315. BOOL
  316. FreeDevMode(
  317. PDEVMODE pDevMode
  318. );
  319. PINIENTRY
  320. FindIniKey(
  321. PINIENTRY pIniEntry,
  322. LPWSTR lpName
  323. );
  324. VOID
  325. RemoveFromJobList(
  326. PINIJOB pIniJob,
  327. DWORD dwJobList
  328. );
  329. BOOL
  330. CheckSepFile(
  331. LPWSTR lpFileName
  332. );
  333. int
  334. DoSeparator(
  335. PSPOOL
  336. );
  337. DWORD
  338. GetFullNameFromId(
  339. IN PINIPRINTER pIniPrinter,
  340. IN DWORD JobId,
  341. IN BOOL fJob,
  342. IN PWSTR pFileName,
  343. IN SIZE_T cchFileName,
  344. IN BOOL Remote
  345. );
  346. DWORD
  347. GetPrinterDirectory(
  348. PINIPRINTER pIniPrinter,
  349. BOOL Remote,
  350. LPWSTR pFileName,
  351. DWORD MaxLength,
  352. PINISPOOLER pIniSpooler
  353. );
  354. VOID
  355. CreatePrintProcDirectory(
  356. LPWSTR lpEnvironment,
  357. PINISPOOLER pIniSpooler
  358. );
  359. VOID
  360. ProcessShadowJobs(
  361. PINIPRINTER pIniPrinter,
  362. PINISPOOLER pIniSpooler
  363. );
  364. PINIJOB
  365. ReadShadowJob(
  366. LPWSTR szDir,
  367. PWIN32_FIND_DATA pFindFileData,
  368. PINISPOOLER pIniSpooler
  369. );
  370. VOID
  371. GetDiscardTSJobsSettings(
  372. PINISPOOLER pIniSpooler
  373. );
  374. BOOL
  375. WriteShadowJob(
  376. IN PINIJOB pIniJob,
  377. IN BOOL bLeaveCS
  378. );
  379. BOOL
  380. BuildEnvironmentInfo(
  381. PINISPOOLER pIniSpooler
  382. );
  383. BOOL
  384. BuildPrinterInfo(
  385. PINISPOOLER pIniSpooler,
  386. BOOL UpdateChangeID
  387. );
  388. BOOL
  389. BuildAllPorts(
  390. );
  391. BOOL
  392. BuildDriverInfo(
  393. HKEY hEnvironmentKey,
  394. PINIENVIRONMENT pIniEnvironment,
  395. PINISPOOLER pIniSpooler
  396. );
  397. BOOL
  398. BuildTrueDependentFileField(
  399. LPWSTR pDriverPath,
  400. LPWSTR pDataFile,
  401. LPWSTR pConfigFile,
  402. LPWSTR pHelpFile,
  403. LPWSTR pInputDependentFiles,
  404. LPWSTR *ppDependentFiles
  405. );
  406. DWORD
  407. GetDriverVersionDirectory(
  408. LPWSTR pDir,
  409. DWORD MaxLength,
  410. PINISPOOLER pIniSpooler,
  411. PINIENVIRONMENT pIniEnvironment,
  412. PINIVERSION pIniVersion,
  413. PINIDRIVER pIniDriver,
  414. LPWSTR lpRemote
  415. );
  416. PINIVERSION
  417. FindVersionForDriver(
  418. PINIENVIRONMENT pIniEnvironment,
  419. PINIDRIVER pIniDriver
  420. );
  421. BOOL
  422. BuildPrintProcInfo(
  423. HKEY hEnvironmentKey,
  424. PINIENVIRONMENT pIniEnvironment,
  425. PINISPOOLER pIniSpooler
  426. );
  427. BOOL
  428. MoveNewDriverRelatedFiles(
  429. LPWSTR pNewDir,
  430. LPWSTR pCurrDir,
  431. LPWSTR pOldDir,
  432. PINTERNAL_DRV_FILE pInternalDriverFiles,
  433. DWORD dwFileCount,
  434. LPBOOL pbDriverFileMoved,
  435. LPBOOL pbConfigFileMoved
  436. );
  437. BOOL
  438. RemoveFromList(
  439. PINIENTRY *ppIniHead,
  440. PINIENTRY pIniEntry
  441. );
  442. PINIDRIVER
  443. GetDriver(
  444. HKEY hVersionKey,
  445. LPWSTR DriverName,
  446. PINISPOOLER pIniSpooler,
  447. PINIENVIRONMENT pIniEnvironment,
  448. PINIVERSION pIniVersion
  449. );
  450. DWORD
  451. GetDriverDirectory(
  452. LPWSTR lpDir,
  453. DWORD MaxLength,
  454. PINIENVIRONMENT lpEnvironment,
  455. LPWSTR lpRemotePath,
  456. PINISPOOLER pIniSpooler
  457. );
  458. DWORD
  459. GetProcessorDirectory(
  460. LPWSTR *lpDir,
  461. LPWSTR lpEnvironment,
  462. PINISPOOLER pIniSpooler
  463. );
  464. BOOL
  465. CreateCompleteDirectory(
  466. LPWSTR lpDir
  467. );
  468. HRESULT
  469. OpenMonitorPort(
  470. PINIPORT pIniPort,
  471. PINIMONITOR pIniLangMonitor,
  472. LPWSTR pszPrinterName
  473. );
  474. HRESULT
  475. CloseMonitorPort(
  476. PINIPORT pIniPort
  477. );
  478. HRESULT
  479. ReleaseMonitorPort(
  480. PINIPORT pIniPort
  481. );
  482. HANDLE
  483. GetMonitorHandle(
  484. PINIPORT pIniPort
  485. );
  486. PINIMONITOR
  487. GetOpenedMonitor(
  488. PINIPORT pIniPort
  489. );
  490. VOID
  491. ShutdownPorts(
  492. PINISPOOLER pIniSpooler
  493. );
  494. BOOL
  495. CreatePortThread(
  496. PINIPORT pIniPort
  497. );
  498. #define WAIT TRUE
  499. #define NOWAIT FALSE
  500. BOOL
  501. DestroyPortThread(
  502. PINIPORT pIniPort,
  503. BOOL bShutdown
  504. );
  505. DWORD
  506. PortThread(
  507. PINIPORT pIniPort
  508. );
  509. BOOL
  510. DeleteJob(
  511. PINIJOB pIniJob,
  512. BOOL bBroadcast
  513. );
  514. VOID
  515. DeleteJobCheck(
  516. PINIJOB pIniJob
  517. );
  518. BOOL
  519. UpdateWinIni(
  520. PINIPRINTER pIniPrinter
  521. );
  522. PKEYDATA
  523. CreateTokenList(
  524. LPWSTR pKeyData
  525. );
  526. PINIPORT
  527. CreatePortEntry(
  528. LPWSTR pPortName,
  529. PINIMONITOR pIniMonitor,
  530. PINISPOOLER pIniSpooler
  531. );
  532. VOID
  533. GetPrinterPorts(
  534. PINIPRINTER pIniPrinter,
  535. LPWSTR pszPorts,
  536. DWORD *pcbNeeded
  537. );
  538. DWORD
  539. SchedulerThread(
  540. PINISPOOLER pIniSpooler
  541. );
  542. BOOL
  543. UpdatePrinterIni(
  544. PINIPRINTER pIniPrinter,
  545. DWORD dwChangeID
  546. );
  547. BOOL
  548. UpdatePrinterNetworkName(
  549. PINIPRINTER pIniPrinter,
  550. LPWSTR pszPorts
  551. );
  552. BOOL
  553. CopyPrinterDevModeToIniPrinter(
  554. IN OUT PINIPRINTER pIniPrinter,
  555. IN LPDEVMODE pDevMode
  556. );
  557. BOOL
  558. InitializeForms(
  559. PINISPOOLER pIniSpooler
  560. );
  561. BOOL
  562. InitializeNet(
  563. VOID
  564. );
  565. BOOL
  566. ShareThisPrinter(
  567. PINIPRINTER pIniPrinter,
  568. LPWSTR pShareName,
  569. BOOL Share
  570. );
  571. DWORD
  572. AddPrintShare(
  573. PINISPOOLER pIniSpooler
  574. );
  575. PINIJOB
  576. FindJob(
  577. PINIPRINTER pIniPrinter,
  578. DWORD JobId,
  579. PDWORD pPosition
  580. );
  581. PINIJOB
  582. FindServerJob(
  583. PINISPOOLER pIniSpooler,
  584. DWORD JobId,
  585. PDWORD pPosition,
  586. PINIPRINTER* ppIniPrinter
  587. );
  588. PINIJOB
  589. FindIniJob (
  590. PSPOOL pSpool,
  591. DWORD JobId
  592. );
  593. DWORD
  594. GetJobSessionId (
  595. PSPOOL pSpool,
  596. DWORD JobId
  597. );
  598. BOOL
  599. MyName(
  600. LPWSTR pName,
  601. PINISPOOLER pIniSpooler
  602. );
  603. BOOL
  604. IsValidPrinterName(
  605. IN LPCWSTR pszPrinter,
  606. IN DWORD cchMax
  607. );
  608. BOOL
  609. CheckMyName(
  610. LPWSTR pName,
  611. PINISPOOLER pIniSpooler
  612. );
  613. PINISPOOLER
  614. FindSpoolerByNameIncRef(
  615. LPTSTR pszName,
  616. LPCTSTR *ppszLocalName OPTIONAL
  617. );
  618. VOID
  619. FindSpoolerByNameDecRef(
  620. PINISPOOLER pIniSpooler
  621. );
  622. PINISPOOLER
  623. FindSpoolerByName(
  624. LPTSTR pszName,
  625. LPCTSTR *ppszLocalName OPTIONAL
  626. );
  627. HANDLE
  628. AddNetPrinter(
  629. LPBYTE pPrinterInfo,
  630. PINISPOOLER pIniSpooler
  631. );
  632. BOOL
  633. CreateServerThread(
  634. VOID
  635. );
  636. BOOL
  637. GetSid(
  638. PHANDLE hToken
  639. );
  640. BOOL
  641. SetCurrentSid(
  642. HANDLE phToken
  643. );
  644. BOOL
  645. LocalEnumPrinters(
  646. DWORD Flags,
  647. LPWSTR Name,
  648. DWORD Level,
  649. LPBYTE pPrinterEnum,
  650. DWORD cbBuf,
  651. LPDWORD pcbNeeded,
  652. LPDWORD pcReturned
  653. );
  654. DWORD
  655. LocalOpenPrinter(
  656. LPWSTR pPrinterName,
  657. LPHANDLE phPrinter,
  658. LPPRINTER_DEFAULTS pDefault
  659. );
  660. DWORD
  661. LocalOpenPrinterEx(
  662. LPWSTR pPrinterName,
  663. LPHANDLE phPrinter,
  664. LPPRINTER_DEFAULTS pDefault,
  665. LPBYTE pSplClientInfo,
  666. DWORD dwLevel
  667. );
  668. BOOL
  669. LocalSetJob(
  670. HANDLE hPrinter,
  671. DWORD JobId,
  672. DWORD Level,
  673. LPBYTE pJob,
  674. DWORD Command
  675. );
  676. BOOL
  677. LocalGetJob(
  678. HANDLE hPrinter,
  679. DWORD JobId,
  680. DWORD Level,
  681. LPBYTE pJob,
  682. DWORD cbBuf,
  683. LPDWORD pcbNeeded
  684. );
  685. BOOL
  686. LocalEnumJobs(
  687. HANDLE hPrinter,
  688. DWORD FirstJob,
  689. DWORD NoJobs,
  690. DWORD Level,
  691. LPBYTE pJob,
  692. DWORD cbBuf,
  693. LPDWORD pcbNeeded,
  694. LPDWORD pcReturned
  695. );
  696. HANDLE
  697. LocalAddPrinter(
  698. LPWSTR pName,
  699. DWORD Level,
  700. LPBYTE pPrinter
  701. );
  702. HANDLE
  703. LocalAddPrinterEx(
  704. LPWSTR pName,
  705. DWORD Level,
  706. LPBYTE pPrinter,
  707. LPBYTE pSplClientInfo,
  708. DWORD dwClientInfoLevel
  709. );
  710. BOOL
  711. DeletePrinterForReal(
  712. PINIPRINTER pIniPrinter,
  713. BOOL bIsInitTime
  714. );
  715. VOID
  716. DeleteIniNetPort(
  717. PINIPRINTER pIniPrinter
  718. );
  719. BOOL
  720. LocalDeletePrinter(
  721. HANDLE hPrinter
  722. );
  723. BOOL
  724. LocalAddPrinterConnection(
  725. LPWSTR pName
  726. );
  727. BOOL
  728. LocalDeletePrinterConnection(
  729. LPWSTR pName
  730. );
  731. BOOL
  732. LocalAddPrinterDriver(
  733. LPWSTR pName,
  734. DWORD Level,
  735. LPBYTE pDriverInfo
  736. );
  737. BOOL
  738. LocalAddPrinterDriverEx(
  739. LPWSTR pName,
  740. DWORD Level,
  741. LPBYTE pDriverInfo,
  742. DWORD dwFileCopyFlags
  743. );
  744. BOOL
  745. LocalAddDriverCatalog(
  746. IN HANDLE hPrinter,
  747. IN DWORD dwLevel,
  748. IN VOID *pvDriverInfCatInfo,
  749. IN DWORD dwCatalogCopyFlags
  750. );
  751. BOOL
  752. LocalEnumPrinterDrivers(
  753. LPWSTR pName,
  754. LPWSTR pEnvironment,
  755. DWORD Level,
  756. LPBYTE pDriverInfo,
  757. DWORD cbBuf,
  758. LPDWORD pcbNeeded,
  759. LPDWORD pcReturned
  760. );
  761. BOOL
  762. LocalGetPrinterDriverDirectory(
  763. LPWSTR pName,
  764. LPWSTR pEnvironment,
  765. DWORD Level,
  766. LPBYTE pDriverDirectory,
  767. DWORD cbBuf,
  768. LPDWORD pcbNeeded
  769. );
  770. BOOL
  771. LocalDeletePrinterDriver(
  772. LPWSTR pName,
  773. LPWSTR pEnvironment,
  774. LPWSTR pDriverName
  775. );
  776. BOOL
  777. LocalDeletePrinterDriverEx(
  778. LPWSTR pName,
  779. LPWSTR pEnvironment,
  780. LPWSTR pDriverName,
  781. DWORD dwDeleteFlag,
  782. DWORD dwVersionNum
  783. );
  784. BOOL
  785. LocalAddPerMachineConnection(
  786. LPCWSTR pServer,
  787. LPCWSTR pPrinterName,
  788. LPCWSTR pPrintServer,
  789. LPCWSTR pProvider
  790. );
  791. BOOL
  792. LocalDeletePerMachineConnection(
  793. LPCWSTR pServer,
  794. LPCWSTR pPrinterName
  795. );
  796. BOOL
  797. LocalEnumPerMachineConnections(
  798. LPCWSTR pServer,
  799. LPBYTE pPrinterEnum,
  800. DWORD cbBuf,
  801. LPDWORD pcbNeeded,
  802. LPDWORD pcReturned
  803. );
  804. BOOL
  805. LocalAddPrintProcessor(
  806. LPWSTR pName,
  807. LPWSTR pEnvironment,
  808. LPWSTR pPathName,
  809. LPWSTR pPrintProcessorName
  810. );
  811. BOOL
  812. LocalEnumPrintProcessors(
  813. LPWSTR pName,
  814. LPWSTR pEnvironment,
  815. DWORD Level,
  816. LPBYTE pPrintProcessorInfo,
  817. DWORD cbBuf,
  818. LPDWORD pcbNeeded,
  819. LPDWORD pcReturned
  820. );
  821. BOOL
  822. LocalGetPrintProcessorDirectory(
  823. LPWSTR pName,
  824. LPWSTR pEnvironment,
  825. DWORD Level,
  826. LPBYTE pPrintProcessorInfo,
  827. DWORD cbBuf,
  828. LPDWORD pcbNeeded
  829. );
  830. BOOL
  831. LocalDeletePrintProcessor(
  832. LPWSTR pName,
  833. LPWSTR pEnvironment,
  834. LPWSTR pPrintProcessorName
  835. );
  836. BOOL
  837. LocalEnumPrintProcessorDatatypes(
  838. LPWSTR pName,
  839. LPWSTR pPrintProcessorName,
  840. DWORD Level,
  841. LPBYTE pDatatypes,
  842. DWORD cbBuf,
  843. LPDWORD pcbNeeded,
  844. LPDWORD pcReturned
  845. );
  846. DWORD
  847. LocalStartDocPrinter(
  848. HANDLE hPrinter,
  849. DWORD Level,
  850. LPBYTE pDocInfo
  851. );
  852. BOOL
  853. LocalStartPagePrinter(
  854. HANDLE hPrinter
  855. );
  856. BOOL
  857. LocalGetSpoolFileHandle(
  858. HANDLE hPrinter,
  859. LPWSTR *pSpoolDir,
  860. LPHANDLE phFile,
  861. HANDLE hSpoolerProcess,
  862. HANDLE hAppProcess
  863. );
  864. BOOL
  865. LocalCommitSpoolData(
  866. HANDLE hPrinter,
  867. DWORD cbCommit
  868. );
  869. BOOL
  870. LocalCloseSpoolFileHandle(
  871. HANDLE hPrinter
  872. );
  873. BOOL
  874. LocalFlushPrinter(
  875. HANDLE hPrinter,
  876. LPVOID pBuf,
  877. DWORD cbBuf,
  878. LPDWORD pcWritten,
  879. DWORD cSleep
  880. );
  881. DWORD
  882. LocalSendRecvBidiData(
  883. HANDLE hPrinter,
  884. LPCTSTR pAction,
  885. PBIDI_REQUEST_CONTAINER pReqData,
  886. PBIDI_RESPONSE_CONTAINER* ppResData
  887. );
  888. BOOL
  889. LocalWritePrinter(
  890. HANDLE hPrinter,
  891. LPVOID pBuf,
  892. DWORD cbBuf,
  893. LPDWORD pcWritten
  894. );
  895. BOOL
  896. LocalSeekPrinter(
  897. HANDLE hPrinter,
  898. LARGE_INTEGER liDistanceToMove,
  899. PLARGE_INTEGER pliNewPointer,
  900. DWORD dwMoveMethod,
  901. BOOL bWritePrinter
  902. );
  903. BOOL
  904. LocalEndPagePrinter(
  905. HANDLE hPrinter
  906. );
  907. BOOL
  908. LocalAbortPrinter(
  909. HANDLE hPrinter
  910. );
  911. BOOL
  912. LocalReadPrinter(
  913. HANDLE hPrinter,
  914. LPVOID pBuf,
  915. DWORD cbBuf,
  916. LPDWORD pNoBytesRead
  917. );
  918. BOOL
  919. SplReadPrinter(
  920. HANDLE hPrinter,
  921. LPBYTE *pBuf,
  922. DWORD cbBuf
  923. );
  924. BOOL
  925. LocalEndDocPrinter(
  926. HANDLE hPrinter
  927. );
  928. BOOL
  929. LocalAddJob(
  930. HANDLE hPrinter,
  931. DWORD Level,
  932. LPBYTE pData,
  933. DWORD cbBuf,
  934. LPDWORD pcbNeeded
  935. );
  936. BOOL
  937. LocalScheduleJob(
  938. HANDLE hPrinter,
  939. DWORD JobId
  940. );
  941. DWORD
  942. LocalWaitForPrinterChange(
  943. HANDLE hPrinter,
  944. DWORD Flags
  945. );
  946. BOOL
  947. SetSpoolClosingChange(
  948. PSPOOL pSpool
  949. );
  950. BOOL
  951. SetPrinterChange(
  952. PINIPRINTER pIniPrinter,
  953. PINIJOB pIniJob,
  954. PDWORD pdwNotifyVectors,
  955. DWORD Flags,
  956. PINISPOOLER pIniSpooler
  957. );
  958. BOOL
  959. LocalEnumMonitors(
  960. LPWSTR pName,
  961. DWORD Level,
  962. LPBYTE pMonitors,
  963. DWORD cbBuf,
  964. LPDWORD pcbNeeded,
  965. LPDWORD pcReturned
  966. );
  967. BOOL
  968. LocalEnumPorts(
  969. LPWSTR pName,
  970. DWORD Level,
  971. LPBYTE pPorts,
  972. DWORD cbBuf,
  973. LPDWORD pcbNeeded,
  974. LPDWORD pcReturned
  975. );
  976. BOOL
  977. LocalAddPort(
  978. LPWSTR pName,
  979. HWND hWnd,
  980. LPWSTR pMonitorName
  981. );
  982. BOOL
  983. LocalConfigurePort(
  984. LPWSTR pName,
  985. HWND hWnd,
  986. LPWSTR pPortName
  987. );
  988. BOOL
  989. LocalDeletePort(
  990. LPWSTR pName,
  991. HWND hWnd,
  992. LPWSTR pPortName
  993. );
  994. BOOL
  995. LocalXcvData(
  996. HANDLE hXcv,
  997. LPCWSTR pszDataName,
  998. PBYTE pInputData,
  999. DWORD cbInputData,
  1000. PBYTE pOutputData,
  1001. DWORD cbOutputData,
  1002. PDWORD pcbOutputNeeded,
  1003. PDWORD pdwStatus
  1004. );
  1005. DWORD
  1006. XcvOpen(
  1007. PCWSTR pszServer,
  1008. PCWSTR pszObject,
  1009. DWORD dwType,
  1010. PPRINTER_DEFAULTS pDefault,
  1011. PHANDLE phXcv,
  1012. PINISPOOLER pIniSpooler
  1013. );
  1014. BOOL
  1015. XcvClose(
  1016. PINIXCV pIniXcv
  1017. );
  1018. BOOL
  1019. XcvDeletePort(
  1020. PINIXCV pIniXcv,
  1021. PCWSTR pszDataName,
  1022. PBYTE pInputData,
  1023. DWORD cbInputData,
  1024. PBYTE pOutputData,
  1025. DWORD cbOutputData,
  1026. PDWORD pcbOutputNeeded,
  1027. PDWORD pdwStatus,
  1028. PINISPOOLER pIniSpooler
  1029. );
  1030. BOOL
  1031. XcvAddPort(
  1032. PINIXCV pIniXcv,
  1033. PCWSTR pszDataName,
  1034. PBYTE pInputData,
  1035. DWORD cbInputData,
  1036. PBYTE pOutputData,
  1037. DWORD cbOutputData,
  1038. PDWORD pcbOutputNeeded,
  1039. PDWORD pdwStatus,
  1040. PINISPOOLER pIniSpooler
  1041. );
  1042. BOOL
  1043. AddPortToSpooler(
  1044. PCWSTR pName,
  1045. PINIMONITOR pIniMonitor,
  1046. PINISPOOLER pIniSpooler
  1047. );
  1048. BOOL
  1049. DeletePortFromSpoolerStart(
  1050. PINIPORT pIniPort
  1051. );
  1052. BOOL
  1053. DeletePortFromSpoolerEnd(
  1054. PINIPORT pIniPort,
  1055. PINISPOOLER pIniSpooler,
  1056. BOOL bSuccess
  1057. );
  1058. HANDLE
  1059. LocalCreatePrinterIC(
  1060. HANDLE hPrinter,
  1061. LPDEVMODE pDevMode
  1062. );
  1063. BOOL
  1064. LocalPlayGdiScriptOnPrinterIC(
  1065. HANDLE hPrinterIC,
  1066. LPBYTE pIn,
  1067. DWORD cIn,
  1068. LPBYTE pOut,
  1069. DWORD cOut,
  1070. DWORD ul
  1071. );
  1072. BOOL
  1073. LocalDeletePrinterIC(
  1074. HANDLE hPrinterIC
  1075. );
  1076. DWORD
  1077. LocalPrinterMessageBox(
  1078. HANDLE hPrinter,
  1079. DWORD Error,
  1080. HWND hWnd,
  1081. LPWSTR pText,
  1082. LPWSTR pCaption,
  1083. DWORD dwType
  1084. );
  1085. BOOL
  1086. LocalAddMonitor(
  1087. LPWSTR pName,
  1088. DWORD Level,
  1089. LPBYTE pMonitors
  1090. );
  1091. BOOL
  1092. LocalDeleteMonitor(
  1093. LPWSTR pName,
  1094. LPWSTR pEnvironment,
  1095. LPWSTR pMonitorName
  1096. );
  1097. BOOL
  1098. LocalFindFirstPrinterChangeNotification(
  1099. HANDLE hPrinter,
  1100. DWORD fdwFlags,
  1101. DWORD fdwOptions,
  1102. HANDLE hNotify,
  1103. PDWORD pfdwStatus,
  1104. PVOID pvReserved0,
  1105. PVOID pvReserved1
  1106. );
  1107. BOOL
  1108. LocalFindClosePrinterChangeNotification(
  1109. HANDLE hPrinter
  1110. );
  1111. PINIPRINTPROC
  1112. FindDatatype(
  1113. PINIPRINTPROC pDefaultPrintProc,
  1114. LPWSTR pDatatype
  1115. );
  1116. PINIPRINTPROC
  1117. InitializePrintProcessor(
  1118. HINSTANCE hLibrary,
  1119. PINIENVIRONMENT pIniEnvironment,
  1120. LPWSTR pPrintProcessorName,
  1121. LPWSTR pDLLName
  1122. );
  1123. HRESULT
  1124. InitializeLocalPrintProcessor(
  1125. IN PINIENVIRONMENT pIniEnvironment
  1126. );
  1127. PINIPRINTPROC
  1128. LoadPrintProcessor(
  1129. PINIENVIRONMENT pIniEnvironment,
  1130. LPWSTR pPrintProcessorName,
  1131. LPWSTR pPathName,
  1132. PINISPOOLER pIniSpooler
  1133. );
  1134. PINIMONITOR
  1135. CreateMonitorEntry(
  1136. LPWSTR pMonitorDll,
  1137. LPWSTR pMonitorName,
  1138. PINISPOOLER pIniSpooler
  1139. );
  1140. PINIPORT
  1141. FindIniPortFromIniPrinter(
  1142. PINIPRINTER pIniPrinter
  1143. );
  1144. BOOL
  1145. GetPrintDriverVersion(
  1146. IN LPCWSTR pszFileName,
  1147. OUT LPDWORD pdwFileMajorVersion,
  1148. OUT LPDWORD pdwFileMinorVersion
  1149. );
  1150. BOOL
  1151. GetBinaryVersion(
  1152. IN PCWSTR pszFileName,
  1153. OUT PDWORD pdwFileMajorVersion,
  1154. OUT PDWORD pdwFileMinorVersion
  1155. );
  1156. BOOL
  1157. IsSpecialDriver(
  1158. IN PINIDRIVER pIniDriver,
  1159. IN PINIPRINTPROC pIniProc,
  1160. IN PINISPOOLER pIniSpooler
  1161. );
  1162. BOOL
  1163. IsLocalFile (
  1164. IN LPCWSTR pszFileName,
  1165. IN PINISPOOLER pIniSpooler
  1166. );
  1167. BOOL
  1168. IsEXEFile(
  1169. IN LPCWSTR pszFileName
  1170. );
  1171. LPBYTE
  1172. PackStringToEOB(
  1173. IN LPWSTR pszSource,
  1174. IN LPBYTE pEnd
  1175. );
  1176. LPVOID
  1177. MakePTR (
  1178. IN LPVOID pBuf,
  1179. IN DWORD Quantity
  1180. );
  1181. DWORD
  1182. MakeOffset (
  1183. IN LPVOID pFirst,
  1184. IN LPVOID pSecond
  1185. );
  1186. LPWSTR
  1187. GetErrorString(
  1188. DWORD Error
  1189. );
  1190. DWORD
  1191. KMPrintersAreBlocked(
  1192. );
  1193. #define NULL_TERMINATED 0
  1194. INT
  1195. AnsiToUnicodeString(
  1196. LPSTR pAnsi,
  1197. LPWSTR pUnicode,
  1198. DWORD StringLength
  1199. );
  1200. int
  1201. Message(
  1202. HWND hwnd,
  1203. DWORD Type,
  1204. int CaptionID,
  1205. int TextID,
  1206. ...
  1207. );
  1208. DWORD
  1209. PromptWriteError(
  1210. PSPOOL pSpool,
  1211. PHANDLE phThread,
  1212. PDWORD pdwThreadId
  1213. );
  1214. DWORD
  1215. InitializeEventLogging(
  1216. PINISPOOLER pIniSpooler
  1217. );
  1218. VOID
  1219. SplLogEventWorker(
  1220. IN PINISPOOLER pIniSpooler,
  1221. IN WORD EventType,
  1222. IN NTSTATUS EventID,
  1223. IN BOOL bInSplSem,
  1224. IN LPWSTR pFirstString,
  1225. IN va_list vargs
  1226. );
  1227. VOID
  1228. SplLogEvent(
  1229. PINISPOOLER pIniSpooler,
  1230. WORD EventType,
  1231. NTSTATUS EventID,
  1232. BOOL bInSplSem,
  1233. LPWSTR pFirstString,
  1234. ...
  1235. );
  1236. VOID
  1237. SplLogEventExternal(
  1238. IN WORD EventType,
  1239. IN DWORD EventID,
  1240. IN LPWSTR pFirstString,
  1241. ...
  1242. );
  1243. VOID
  1244. LogPrintProcError(
  1245. IN DWORD Error,
  1246. IN PINIJOB pIniJob
  1247. );
  1248. LONG
  1249. InterlockedAnd (
  1250. IN OUT LONG volatile *Target,
  1251. IN LONG Set
  1252. );
  1253. LONG
  1254. InterlockedOr (
  1255. IN OUT LONG volatile *Target,
  1256. IN LONG Set
  1257. );
  1258. VOID
  1259. GetServerFilePoolSettings(
  1260. PINISPOOLER pIniSpooler
  1261. );
  1262. #define IDS_LOCALSPOOLER 100
  1263. #define IDS_ERROR_WRITING_TO_PORT 101
  1264. #define IDS_ERROR_WRITING_TO_DISK 102
  1265. #define IDS_PRINTER_DRIVERS 104
  1266. #define IDS_UNNAMED 105
  1267. #define IDS_ERROR_WRITING_GENERAL 106
  1268. #define IDS_REMOTE_DOC 107
  1269. #define IDS_LOCAL_DOC 108
  1270. #define IDS_FASTPRINT_TIMEOUT 109
  1271. #define IDS_DRIVER_CHECKPOINT 110
  1272. // Maximum length of a builtin form
  1273. //
  1274. #define FORM_NAME_LEN 31
  1275. #define CUSTOM_NAME_LEN 31
  1276. #define FORM_DATA_LEN 32
  1277. // String table Ids for builtin form names
  1278. //
  1279. #define IDS_FORM_LETTER 200
  1280. #define IDS_FORM_LETTER_SMALL 201
  1281. #define IDS_FORM_TABLOID 202
  1282. #define IDS_FORM_LEDGER 203
  1283. #define IDS_FORM_LEGAL 204
  1284. #define IDS_FORM_STATEMENT 205
  1285. #define IDS_FORM_EXECUTIVE 206
  1286. #define IDS_FORM_A3 207
  1287. #define IDS_FORM_A4 208
  1288. #define IDS_FORM_A4_SMALL 209
  1289. #define IDS_FORM_A5 210
  1290. #define IDS_FORM_B4 211
  1291. #define IDS_FORM_B5 212
  1292. #define IDS_FORM_FOLIO 213
  1293. #define IDS_FORM_QUARTO 214
  1294. #define IDS_FORM_10X14 215
  1295. #define IDS_FORM_11X17 216
  1296. #define IDS_FORM_NOTE 217
  1297. #define IDS_FORM_ENVELOPE9 218
  1298. #define IDS_FORM_ENVELOPE10 219
  1299. #define IDS_FORM_ENVELOPE11 220
  1300. #define IDS_FORM_ENVELOPE12 221
  1301. #define IDS_FORM_ENVELOPE14 222
  1302. #define IDS_FORM_ENVELOPE_CSIZE_SHEET 223
  1303. #define IDS_FORM_ENVELOPE_DSIZE_SHEET 224
  1304. #define IDS_FORM_ENVELOPE_ESIZE_SHEET 225
  1305. #define IDS_FORM_ENVELOPE_DL 226
  1306. #define IDS_FORM_ENVELOPE_C5 227
  1307. #define IDS_FORM_ENVELOPE_C3 228
  1308. #define IDS_FORM_ENVELOPE_C4 229
  1309. #define IDS_FORM_ENVELOPE_C6 230
  1310. #define IDS_FORM_ENVELOPE_C65 231
  1311. #define IDS_FORM_ENVELOPE_B4 232
  1312. #define IDS_FORM_ENVELOPE_B5 233
  1313. #define IDS_FORM_ENVELOPE_B6 234
  1314. #define IDS_FORM_ENVELOPE 235
  1315. #define IDS_FORM_ENVELOPE_MONARCH 236
  1316. #define IDS_FORM_SIX34_ENVELOPE 237
  1317. #define IDS_FORM_US_STD_FANFOLD 238
  1318. #define IDS_FORM_GMAN_STD_FANFOLD 239
  1319. #define IDS_FORM_GMAN_LEGAL_FANFOLD 240
  1320. #if(WINVER >= 0x0400)
  1321. #define IDS_FORM_ISO_B4 241
  1322. #define IDS_FORM_JAPANESE_POSTCARD 242
  1323. #define IDS_FORM_9X11 243
  1324. #define IDS_FORM_10X11 244
  1325. #define IDS_FORM_15X11 245
  1326. #define IDS_FORM_ENV_INVITE 246
  1327. #define IDS_FORM_LETTER_EXTRA 247
  1328. #define IDS_FORM_LEGAL_EXTRA 248
  1329. #define IDS_FORM_TABLOID_EXTRA 249
  1330. #define IDS_FORM_A4_EXTRA 250
  1331. #define IDS_FORM_LETTER_TRANSVERSE 251
  1332. #define IDS_FORM_A4_TRANSVERSE 252
  1333. #define IDS_FORM_LETTER_EXTRA_TRANSVERSE 253
  1334. #define IDS_FORM_A_PLUS 254
  1335. #define IDS_FORM_B_PLUS 255
  1336. #define IDS_FORM_LETTER_PLUS 256
  1337. #define IDS_FORM_A4_PLUS 257
  1338. #define IDS_FORM_A5_TRANSVERSE 258
  1339. #define IDS_FORM_B5_TRANSVERSE 259
  1340. #define IDS_FORM_A3_EXTRA 260
  1341. #define IDS_FORM_A5_EXTRA 261
  1342. #define IDS_FORM_B5_EXTRA 262
  1343. #define IDS_FORM_A2 263
  1344. #define IDS_FORM_A3_TRANSVERSE 264
  1345. #define IDS_FORM_A3_EXTRA_TRANSVERSE 265
  1346. #define IDS_FORM_DBL_JAPANESE_POSTCARD 266
  1347. #define IDS_FORM_A6 267
  1348. #define IDS_FORM_JENV_KAKU2 268
  1349. #define IDS_FORM_JENV_KAKU3 269
  1350. #define IDS_FORM_JENV_CHOU3 270
  1351. #define IDS_FORM_JENV_CHOU4 271
  1352. #define IDS_FORM_LETTER_ROTATED 272
  1353. #define IDS_FORM_A3_ROTATED 273
  1354. #define IDS_FORM_A4_ROTATED 274
  1355. #define IDS_FORM_A5_ROTATED 275
  1356. #define IDS_FORM_B4_JIS_ROTATED 276
  1357. #define IDS_FORM_B5_JIS_ROTATED 277
  1358. #define IDS_FORM_JAPANESE_POSTCARD_ROTATED 278
  1359. #define IDS_FORM_DBL_JAPANESE_POSTCARD_ROTATED 279
  1360. #define IDS_FORM_A6_ROTATED 280
  1361. #define IDS_FORM_JENV_KAKU2_ROTATED 281
  1362. #define IDS_FORM_JENV_KAKU3_ROTATED 282
  1363. #define IDS_FORM_JENV_CHOU3_ROTATED 283
  1364. #define IDS_FORM_JENV_CHOU4_ROTATED 284
  1365. #define IDS_FORM_B6_JIS 285
  1366. #define IDS_FORM_B6_JIS_ROTATED 286
  1367. #define IDS_FORM_12X11 287
  1368. #define IDS_FORM_JENV_YOU4 288
  1369. #define IDS_FORM_JENV_YOU4_ROTATED 289
  1370. #define IDS_FORM_P16K 290
  1371. #define IDS_FORM_P32K 291
  1372. #define IDS_FORM_P32KBIG 292
  1373. #define IDS_FORM_PENV_1 293
  1374. #define IDS_FORM_PENV_2 294
  1375. #define IDS_FORM_PENV_3 295
  1376. #define IDS_FORM_PENV_4 296
  1377. #define IDS_FORM_PENV_5 297
  1378. #define IDS_FORM_PENV_6 298
  1379. #define IDS_FORM_PENV_7 299
  1380. #define IDS_FORM_PENV_8 300
  1381. #define IDS_FORM_PENV_9 301
  1382. #define IDS_FORM_PENV_10 302
  1383. #define IDS_FORM_P16K_ROTATED 303
  1384. #define IDS_FORM_P32K_ROTATED 304
  1385. #define IDS_FORM_P32KBIG_ROTATED 305
  1386. #define IDS_FORM_PENV_1_ROTATED 306
  1387. #define IDS_FORM_PENV_2_ROTATED 307
  1388. #define IDS_FORM_PENV_3_ROTATED 308
  1389. #define IDS_FORM_PENV_4_ROTATED 309
  1390. #define IDS_FORM_PENV_5_ROTATED 310
  1391. #define IDS_FORM_PENV_6_ROTATED 311
  1392. #define IDS_FORM_PENV_7_ROTATED 312
  1393. #define IDS_FORM_PENV_8_ROTATED 313
  1394. #define IDS_FORM_PENV_9_ROTATED 314
  1395. #define IDS_FORM_PENV_10_ROTATED 315
  1396. #define IDS_FORM_RESERVED_48 316
  1397. #define IDS_FORM_RESERVED_49 317
  1398. #define IDS_FORM_CUSTOMPAD 318
  1399. #endif /* WINVER >= 0x0400 */
  1400. VOID LogJobPrinted(
  1401. PINIJOB pIniJob
  1402. );
  1403. #define MAP_READABLE 0
  1404. #define MAP_SETTABLE 1
  1405. DWORD
  1406. MapJobStatus(
  1407. DWORD Type,
  1408. DWORD Status
  1409. );
  1410. DWORD
  1411. MapPrinterStatus(
  1412. DWORD Type,
  1413. DWORD Status
  1414. );
  1415. BOOL
  1416. OpenPrinterPortW(
  1417. LPWSTR pPrinterName,
  1418. HANDLE *pHandle,
  1419. LPPRINTER_DEFAULTS pDefault
  1420. );
  1421. VOID
  1422. BroadcastChange(
  1423. PINISPOOLER pIniSpooler,
  1424. DWORD Message,
  1425. WPARAM wParam,
  1426. LPARAM lParam
  1427. );
  1428. VOID
  1429. MyMessageBeep(
  1430. DWORD fuType,
  1431. PINISPOOLER pIniSpooler
  1432. );
  1433. VOID
  1434. SendJobAlert(
  1435. PINIJOB pIniJob
  1436. );
  1437. BOOL
  1438. CheckDataTypes(
  1439. PINIPRINTPROC pIniPrintProc,
  1440. LPWSTR pDatatype
  1441. );
  1442. BOOL
  1443. ValidatePortTokenList(
  1444. IN OUT PKEYDATA pKeyData,
  1445. IN PINISPOOLER pIniSpooler,
  1446. IN BOOL bInitialize,
  1447. OUT BOOL *pbNoPorts OPTIONAL
  1448. );
  1449. VOID
  1450. FreePortTokenList(
  1451. PKEYDATA pKeyData
  1452. );
  1453. DWORD
  1454. ValidatePrinterInfo(
  1455. IN PPRINTER_INFO_2 pPrinter,
  1456. IN PINISPOOLER pIniSpooler,
  1457. IN PINIPRINTER pIniPrinter OPTIONAL,
  1458. OUT LPWSTR* ppszLocalName OPTIONAL
  1459. );
  1460. BOOL
  1461. DeletePortEntry(
  1462. PINIPORT pIniPort
  1463. );
  1464. BOOL
  1465. GetTokenHandle(
  1466. PHANDLE pTokenHandle
  1467. );
  1468. VOID
  1469. LogJobInfo(
  1470. PINISPOOLER pIniSpooler,
  1471. NTSTATUS EventId,
  1472. DWORD JobId,
  1473. LPWSTR pDocumentName,
  1474. LPWSTR pUser,
  1475. LPWSTR pPrinterName,
  1476. DWORD curPos
  1477. );
  1478. LONG
  1479. Myatol(
  1480. LPWSTR nptr
  1481. );
  1482. ULONG_PTR
  1483. atox(
  1484. LPCWSTR psz
  1485. );
  1486. DWORD
  1487. DeleteSubkeys(
  1488. HKEY hKey,
  1489. PINISPOOLER pIniSpooler
  1490. );
  1491. DWORD
  1492. CreateClusterSpoolerEnvironmentsStructure(
  1493. IN PINISPOOLER pIniSpooler
  1494. );
  1495. DWORD
  1496. CopyNewerOrOlderFiles(
  1497. IN LPCWSTR pszSourceDir,
  1498. IN LPCWSTR pszMasterDir,
  1499. IN BOOL (WINAPI *pfn)(LPWSTR, LPWSTR)
  1500. );
  1501. PINIENVIRONMENT
  1502. GetLocalArchEnv(
  1503. IN PINISPOOLER pIniSpooler
  1504. );
  1505. DWORD
  1506. ClusterFindLanguageMonitor(
  1507. IN LPCWSTR pszMonitor,
  1508. IN LPCWSTR pszEnvName,
  1509. IN PINISPOOLER pIniSpooler
  1510. );
  1511. DWORD
  1512. ReadTimeStamp(
  1513. IN HKEY hkRoot,
  1514. IN OUT SYSTEMTIME *pSysTime,
  1515. IN LPCWSTR pszSubKey1,
  1516. IN LPCWSTR pszSubKey2,
  1517. IN LPCWSTR pszSubKey3,
  1518. IN LPCWSTR pszSubKey4,
  1519. IN LPCWSTR pszSubKey5,
  1520. IN PINISPOOLER pIniSpooler
  1521. );
  1522. DWORD
  1523. WriteTimeStamp(
  1524. IN HKEY hkRoot,
  1525. IN SYSTEMTIME SysTime,
  1526. IN LPCWSTR pszSubKey1,
  1527. IN LPCWSTR pszSubKey2,
  1528. IN LPCWSTR pszSubKey3,
  1529. IN LPCWSTR pszSubKey4,
  1530. IN LPCWSTR pszSubKey5,
  1531. IN PINISPOOLER pIniSpooler
  1532. );
  1533. BOOL
  1534. ClusterCheckDriverChanged(
  1535. IN HKEY hClusterVersionKey,
  1536. IN LPCWSTR pszDriver,
  1537. IN LPCWSTR pszEnv,
  1538. IN LPCWSTR pszVer,
  1539. IN PINISPOOLER pIniSpooler
  1540. );
  1541. DWORD
  1542. RunProcess(
  1543. IN LPCWSTR pszExe,
  1544. IN LPCWSTR pszCommand,
  1545. IN DWORD dwTimeOut,
  1546. OUT LPDWORD pdwExitCode OPTIONAL
  1547. );
  1548. DWORD
  1549. CopyICMFromLocalDiskToClusterDisk(
  1550. IN PINISPOOLER pIniSpooler
  1551. );
  1552. DWORD
  1553. CopyICMFromClusterDiskToLocalDisk(
  1554. IN PINISPOOLER pIniSpooler
  1555. );
  1556. DWORD
  1557. CreateProtectedDirectory(
  1558. IN LPCWSTR pszDir
  1559. );
  1560. DWORD
  1561. AddLocalDriverToClusterSpooler(
  1562. IN LPCWSTR pszDriver,
  1563. IN PINISPOOLER pIniSpooler
  1564. );
  1565. DWORD
  1566. StrCatPrefixMsz(
  1567. IN LPCWSTR pszPerfix,
  1568. IN LPWSTR pszzFiles,
  1569. IN OUT LPWSTR *ppszFullPathFiles
  1570. );
  1571. DWORD
  1572. ClusterSplDeleteUpgradeKey(
  1573. IN LPCWSTR pszResourceID
  1574. );
  1575. DWORD
  1576. ClusterSplReadUpgradeKey(
  1577. IN LPCWSTR pszResourceID,
  1578. OUT LPDWORD pdwValue
  1579. );
  1580. DWORD
  1581. CopyFileToDirectory(
  1582. IN LPCWSTR pszFullFileName,
  1583. IN LPCWSTR pszDestDir,
  1584. IN LPCWSTR pszDir1,
  1585. IN LPCWSTR pszDir2,
  1586. IN LPCWSTR pszDir3
  1587. );
  1588. DWORD
  1589. InstallMonitorFromCluster(
  1590. IN LPCWSTR pszName,
  1591. IN LPCWSTR pszEnvName,
  1592. IN LPCWSTR pszEnvDir,
  1593. IN PINISPOOLER pIniSpooler
  1594. );
  1595. PINIDRIVER
  1596. FindLocalDriver(
  1597. PINISPOOLER pIniSpooler,
  1598. LPWSTR pz
  1599. );
  1600. BOOL
  1601. FindLocalDriverAndVersion(
  1602. PINISPOOLER pIniSpooler,
  1603. LPWSTR pz,
  1604. PINIDRIVER *ppIniDriver,
  1605. PINIVERSION *ppIniVersion
  1606. );
  1607. BOOL
  1608. IsKMPD(
  1609. LPWSTR pDriverName
  1610. );
  1611. BOOL
  1612. IniDriverIsKMPD (
  1613. PINISPOOLER pIniSpooler,
  1614. PINIENVIRONMENT pIniEnvironment,
  1615. PINIVERSION pIniVersion,
  1616. PINIDRIVER pIniDriver
  1617. );
  1618. PINIDRIVER
  1619. FindCompatibleDriver(
  1620. PINIENVIRONMENT pIniEnvironment,
  1621. PINIVERSION * ppIniVersion,
  1622. LPWSTR pDriverName,
  1623. DWORD dwMajorVersion,
  1624. int FindAnyDriver
  1625. );
  1626. VOID
  1627. QueryUpgradeFlag(
  1628. PINISPOOLER pIniSpooler
  1629. );
  1630. BOOL
  1631. LocalAddPortEx(
  1632. LPWSTR pName,
  1633. DWORD Level,
  1634. LPBYTE pBuffer,
  1635. LPWSTR pMonitorName
  1636. );
  1637. BOOL
  1638. ValidateSpoolHandle(
  1639. PSPOOL pSpool,
  1640. DWORD dwDisallowMask
  1641. );
  1642. PSECURITY_DESCRIPTOR
  1643. MapPrinterSDToShareSD(
  1644. PSECURITY_DESCRIPTOR pPrinterSD
  1645. );
  1646. BOOL
  1647. CallDevQueryPrint(
  1648. LPWSTR pPrinterName,
  1649. LPDEVMODE pDevMode,
  1650. LPWSTR ErrorString,
  1651. DWORD dwErrorString,
  1652. DWORD dwPrinterFlags,
  1653. DWORD dwJobFlags
  1654. );
  1655. BOOL
  1656. InitializeWinSpoolDrv(
  1657. VOID
  1658. );
  1659. VOID
  1660. FixDevModeDeviceName(
  1661. LPWSTR pPrinterName,
  1662. PDEVMODE pDevMode,
  1663. DWORD cbDevMode
  1664. );
  1665. VOID
  1666. RemoveOldNetPrinters(
  1667. PPRINTER_INFO_1 pCurrentPrinterInfo1,
  1668. PINISPOOLER pIniSpooler
  1669. );
  1670. PINIJOB
  1671. AssignFreeJobToFreePort(
  1672. PINIPORT pIniPort,
  1673. DWORD *pTimeToWait
  1674. );
  1675. BOOL
  1676. ValidRawDatatype(
  1677. LPWSTR pszDataType);
  1678. BOOL
  1679. InternalAddPrinterDriverEx(
  1680. LPWSTR pName,
  1681. DWORD Level,
  1682. LPBYTE pDriverInfo,
  1683. DWORD dwFileCopyFlags,
  1684. PINISPOOLER pIniSpooler,
  1685. BOOL bUseScratchDir,
  1686. BOOL bImpersonateOnCreate
  1687. );
  1688. VOID
  1689. CheckSizeDetectionThread(
  1690. VOID
  1691. );
  1692. VOID
  1693. UpgradeForms(
  1694. PINISPOOLER pIniSpooler
  1695. );
  1696. HANDLE
  1697. CreatePrinterHandle(
  1698. LPWSTR pPrinterName,
  1699. LPWSTR pFullMachineName,
  1700. PINIPRINTER pIniPrinter,
  1701. PINIPORT pIniPort,
  1702. PINIPORT pIniNetPort,
  1703. PINIJOB pIniJob,
  1704. DWORD TypeofHandle,
  1705. HANDLE hPort,
  1706. PPRINTER_DEFAULTS pDefaults,
  1707. PINISPOOLER pIniSpooler,
  1708. DWORD AccessRequested,
  1709. LPBYTE pSplClientInfo,
  1710. DWORD dwLevel,
  1711. HANDLE hReadFile
  1712. );
  1713. DWORD
  1714. CreateServerHandle(
  1715. LPWSTR pPrinterName,
  1716. LPHANDLE pPrinterHandle,
  1717. LPPRINTER_DEFAULTS pDefaults,
  1718. PINISPOOLER pIniSpooler,
  1719. DWORD dwTypeofHandle
  1720. );
  1721. PINIPRINTER
  1722. FindPrinterShare(
  1723. LPCWSTR pShareName,
  1724. PINISPOOLER pIniSpooler
  1725. );
  1726. PINIJOB
  1727. CreateJobEntry(
  1728. PSPOOL pSpool,
  1729. DWORD Level,
  1730. LPBYTE pDocInfo,
  1731. DWORD JobId,
  1732. BOOL bRemote,
  1733. DWORD JobStatus,
  1734. LPWSTR pMachineName
  1735. );
  1736. BOOL
  1737. DeletePrinterCheck(
  1738. PINIPRINTER pIniPrinter
  1739. );
  1740. VOID
  1741. DeleteSpoolerCheck(
  1742. PINISPOOLER pIniSpooler
  1743. );
  1744. BOOL
  1745. DeletePrinterIni(
  1746. PINIPRINTER pIniPrinter
  1747. );
  1748. DWORD
  1749. SplDeleteThisKey(
  1750. HKEY hParentKey, // handle to parent of key to delete
  1751. HKEY hThisKey, // handle of key to delete
  1752. LPWSTR pThisKeyName, // name of this key
  1753. BOOL bDeleteNullKey, // if *pThisKeyName is NULL, delete it if TRUE
  1754. PINISPOOLER pIniSpooler
  1755. );
  1756. BOOL
  1757. CopyPrinterIni(
  1758. PINIPRINTER pIniPrinter,
  1759. LPWSTR pNewName
  1760. );
  1761. BOOL
  1762. UpdateString(
  1763. LPWSTR* ppszCur,
  1764. LPWSTR pszNew);
  1765. BOOL
  1766. SetPrinterPorts(
  1767. PSPOOL pSpool,
  1768. PINIPRINTER pIniPrinter,
  1769. PKEYDATA pKeyData
  1770. );
  1771. VOID
  1772. InternalDeletePrinter(
  1773. PINIPRINTER pIniPrinter
  1774. );
  1775. BOOL
  1776. PurgePrinter(
  1777. PINIPRINTER pIniPrinter
  1778. );
  1779. BOOL
  1780. AddIniPrinterToIniPort(
  1781. PINIPORT pIniPort,
  1782. PINIPRINTER pIniPrinter
  1783. );
  1784. BOOL
  1785. AddIniPortToIniPrinter(
  1786. PINIPRINTER pIniPrinter,
  1787. PINIPORT pIniPort
  1788. );
  1789. LPCWSTR
  1790. FindFileName(
  1791. LPCWSTR pPathName
  1792. );
  1793. VOID
  1794. UpdateJobAttributes(
  1795. PINIJOB pIniJob
  1796. );
  1797. BOOL
  1798. InternalCopyFile(
  1799. HANDLE hFile,
  1800. PWIN32_FIND_DATA pSourceFileData,
  1801. LPWSTR pTagetFileName,
  1802. BOOL bOverWriteIfTargetExists
  1803. );
  1804. BOOL
  1805. UpdateFile(
  1806. PINIVERSION pIniVersion,
  1807. HANDLE hSourceFile,
  1808. LPWSTR pSourceFile,
  1809. DWORD dwVersion,
  1810. LPWSTR pDestDir,
  1811. DWORD dwFileCopyFlags,
  1812. BOOL bImpersonateOnCreate,
  1813. LPBOOL pbFileUpdated,
  1814. LPBOOL pbFileMoved,
  1815. BOOL bSameEnvironment,
  1816. BOOL bWin95Environment
  1817. );
  1818. BOOL
  1819. PrinterCreateKey(
  1820. HKEY hKey,
  1821. LPWSTR pSubKey,
  1822. PHKEY phkResult,
  1823. PDWORD pdwLastError,
  1824. PINISPOOLER pIniSpooler
  1825. );
  1826. BOOL
  1827. RegSetString(
  1828. HANDLE hPrinterKey,
  1829. LPWSTR pValueName,
  1830. LPWSTR pStringValue,
  1831. PDWORD pdwLastError,
  1832. PINISPOOLER pIniSpooler
  1833. );
  1834. BOOL
  1835. RegSetDWord(
  1836. HANDLE hPrinterKey,
  1837. LPWSTR pValueName,
  1838. DWORD dwParam,
  1839. PDWORD pdwLastError,
  1840. PINISPOOLER pIniSpooler
  1841. );
  1842. VOID
  1843. CheckAndUpdatePrinterRegAll(
  1844. PINISPOOLER pIniSpooler,
  1845. LPWSTR pszPrinterName,
  1846. LPWSTR pszPort,
  1847. BOOL bDelete
  1848. );
  1849. BOOL
  1850. ForEachPrinterCallDriverDrvUpgrade(
  1851. PINISPOOLER pIniSpooler,
  1852. PINIDRIVER pIniDriver,
  1853. LPCWSTR pOldDriverDir,
  1854. PINTERNAL_DRV_FILE pInternalDriverFile,
  1855. DWORD dwFileCount,
  1856. LPBYTE pDriverInfo
  1857. );
  1858. BOOL
  1859. DeleteAllFilesInDirectory(
  1860. LPWSTR pDirectory,
  1861. BOOL bWaitForReboot
  1862. );
  1863. BOOL
  1864. DeleteAllFilesAndDirectory(
  1865. LPWSTR pDirectory,
  1866. BOOL bWaitForReboot
  1867. );
  1868. VOID
  1869. DeleteDirectoryRecursively(
  1870. LPCWSTR pDirectory,
  1871. BOOL bWaitForReboot
  1872. );
  1873. DWORD
  1874. CreateNumberedTempDirectory(
  1875. LPCWSTR pszDirectory,
  1876. LPWSTR *ppszTempDirectory
  1877. );
  1878. BOOL
  1879. FileExists(
  1880. LPWSTR pFileName
  1881. );
  1882. BOOL
  1883. DirectoryExists(
  1884. LPWSTR pDirectoryName
  1885. );
  1886. PINIVERSION
  1887. FindVersionEntry(
  1888. PINIENVIRONMENT pIniEnvironment,
  1889. DWORD dwVersion
  1890. );
  1891. BOOL
  1892. CreateDirectoryWithoutImpersonatingUser(
  1893. LPWSTR pDirectory
  1894. );
  1895. VOID
  1896. InsertVersionList(
  1897. PINIVERSION* pIniVersionHead,
  1898. PINIVERSION pIniVersion
  1899. );
  1900. int
  1901. wstrcmpEx(
  1902. LPCWSTR s1,
  1903. LPCWSTR s2,
  1904. BOOL bCaseSensitive
  1905. );
  1906. BOOL
  1907. RegSetString(
  1908. HANDLE hKey,
  1909. LPWSTR pValueName,
  1910. LPWSTR pStringValue,
  1911. PDWORD pdwLastError,
  1912. PINISPOOLER pIniSpooler
  1913. );
  1914. BOOL
  1915. RegSetDWord(
  1916. HANDLE hKey,
  1917. LPWSTR pValueName,
  1918. DWORD dwParam,
  1919. PDWORD pdwLastError,
  1920. PINISPOOLER pIniSpooler
  1921. );
  1922. BOOL
  1923. RegSetBinaryData(
  1924. HKEY hKey,
  1925. LPWSTR pValueName,
  1926. LPBYTE pData,
  1927. DWORD cbData,
  1928. PDWORD pdwLastError,
  1929. PINISPOOLER pIniSpooler
  1930. );
  1931. BOOL
  1932. RegSetMultiString(
  1933. HANDLE hKey,
  1934. LPWSTR pValueName,
  1935. LPWSTR pStringValue,
  1936. DWORD cbString,
  1937. PDWORD pdwLastError,
  1938. PINISPOOLER pIniSpooler
  1939. );
  1940. BOOL
  1941. RegGetString(
  1942. HANDLE hKey,
  1943. LPWSTR pValueName,
  1944. LPWSTR *ppValue,
  1945. LPDWORD pcchCount,
  1946. PDWORD pdwLastError,
  1947. BOOL bFailIfNotFound,
  1948. PINISPOOLER pIniSpooler
  1949. );
  1950. BOOL
  1951. RegGetMultiSzString(
  1952. HANDLE hKey,
  1953. LPWSTR pValueName,
  1954. LPWSTR *ppValue,
  1955. LPDWORD pcchValue,
  1956. PDWORD pdwLastError,
  1957. BOOL bFailIfNotFound,
  1958. PINISPOOLER pIniSpooler
  1959. );
  1960. DWORD
  1961. ValidatePrinterName(
  1962. LPWSTR pszNewName,
  1963. PINISPOOLER pIniSpooler,
  1964. PINIPRINTER pIniPrinter,
  1965. LPWSTR *ppszLocalName
  1966. );
  1967. DWORD
  1968. ValidatePrinterShareName(
  1969. LPWSTR pszNewShareName,
  1970. PINISPOOLER pIniSpooler,
  1971. PINIPRINTER pIniPrinter
  1972. );
  1973. BOOL
  1974. AllocOrUpdateStringAndTestSame(
  1975. IN LPWSTR *ppString,
  1976. IN LPCWSTR pNewValue,
  1977. IN LPCWSTR pOldValue,
  1978. IN BOOL bCaseSensitive,
  1979. IN OUT BOOL *pbFail,
  1980. IN OUT BOOL *pbIdentical
  1981. );
  1982. BOOL
  1983. AllocOrUpdateString(
  1984. IN LPWSTR *ppString,
  1985. IN LPCWSTR pNewValue,
  1986. IN LPCWSTR pOldValue,
  1987. IN BOOL bCaseSensitive,
  1988. IN OUT BOOL *bFail
  1989. );
  1990. VOID
  1991. FreeStructurePointers(
  1992. LPBYTE lpStruct,
  1993. LPBYTE lpStruct2,
  1994. LPDWORD lpOffsets);
  1995. VOID
  1996. CopyNewOffsets(
  1997. LPBYTE pStruct,
  1998. LPBYTE pTempStruct,
  1999. LPDWORD lpOffsets
  2000. );
  2001. LPWSTR
  2002. GetConfigFilePath(
  2003. IN PINIPRINTER pIniPrinter
  2004. );
  2005. PDEVMODE
  2006. ConvertDevModeToSpecifiedVersion(
  2007. IN PINIPRINTER pIniPrinter,
  2008. IN PDEVMODE pDevMode,
  2009. IN LPWSTR pszConfigFile, OPTIONAL
  2010. IN LPWSTR pszPrinterNameWithToken, OPTIONAL
  2011. IN BOOL bNt35xVersion
  2012. );
  2013. BOOL
  2014. CreateRedirectionThread(
  2015. PINIPORT pIniPort
  2016. );
  2017. VOID
  2018. RemoveDeviceName(
  2019. PINIPORT pIniPort
  2020. );
  2021. BOOL
  2022. IsPortType(
  2023. LPWSTR pPort,
  2024. LPWSTR pPrefix
  2025. );
  2026. BOOL
  2027. LocalSetPort(
  2028. LPWSTR pszName,
  2029. LPWSTR pszPortName,
  2030. DWORD dwLevel,
  2031. LPBYTE pPortInfo
  2032. );
  2033. DWORD
  2034. SetPrinterDataServer(
  2035. PINISPOOLER pIniSpooler,
  2036. LPWSTR pValueName,
  2037. DWORD Type,
  2038. LPBYTE pData,
  2039. DWORD cbData
  2040. );
  2041. BOOL
  2042. BuildPrintObjectProtection(
  2043. IN PUCHAR AceType,
  2044. IN DWORD AceCount,
  2045. IN PSID *AceSid,
  2046. IN ACCESS_MASK *AceMask,
  2047. IN BYTE *InheritFlags,
  2048. IN PSID OwnerSid,
  2049. IN PSID GroupSid,
  2050. IN PGENERIC_MAPPING GenericMap,
  2051. OUT PSECURITY_DESCRIPTOR *ppSecurityDescriptor
  2052. );
  2053. LPWSTR
  2054. AnsiToUnicodeStringWithAlloc(
  2055. LPSTR pAnsi
  2056. );
  2057. HRESULT
  2058. UnicodeToAnsiString(
  2059. IN PWSTR pszUnicode,
  2060. OUT PSTR *ppszAnsi
  2061. );
  2062. HRESULT
  2063. BuildIPArrayFromCommaList(
  2064. LPTSTR pszCommaList,
  2065. LPWSTR **ppszNames,
  2066. DWORD *pcNames
  2067. );
  2068. VOID
  2069. FreeIniMonitor(
  2070. PINIMONITOR pIniMonitor
  2071. );
  2072. DWORD
  2073. RestartJob(
  2074. PINIJOB pIniJob
  2075. );
  2076. BOOL
  2077. IsCallViaRPC(
  2078. IN VOID
  2079. );
  2080. VOID
  2081. UpdateReferencesToChainedJobs(
  2082. PINISPOOLER pIniSpooler
  2083. );
  2084. BOOL
  2085. PrinterDriverEvent(
  2086. PINIPRINTER pIniPrinter,
  2087. INT PrinterEvent,
  2088. LPARAM lParam,
  2089. DWORD *pdwReturnedError
  2090. );
  2091. BOOL
  2092. SetPrinterShareInfo(
  2093. PINIPRINTER pIniPrinter
  2094. );
  2095. VOID
  2096. LinkPortToSpooler(
  2097. PINIPORT pIniPort,
  2098. PINISPOOLER pIniSpooler
  2099. );
  2100. VOID
  2101. DelinkPortFromSpooler(
  2102. PINIPORT pIniPort,
  2103. PINISPOOLER pIniSpooler
  2104. );
  2105. DWORD
  2106. FinalInitAfterRouterInitComplete(
  2107. DWORD dwUpgrade,
  2108. PINISPOOLER pIniSpooler
  2109. );
  2110. DWORD
  2111. CheckWebPrinting(
  2112. BOOL* bWebPrintingInstalled
  2113. );
  2114. DWORD
  2115. WebShareManager(
  2116. PINISPOOLER pIniSpooler,
  2117. BOOL bEnableWebShares
  2118. );
  2119. VOID
  2120. WebShare(
  2121. LPWSTR pShareName
  2122. );
  2123. VOID
  2124. WebUnShare(
  2125. LPWSTR pShareName
  2126. );
  2127. DWORD
  2128. OpenPrinterKey(
  2129. PINIPRINTER pIniPrinter,
  2130. REGSAM samDesired,
  2131. HANDLE *phKey,
  2132. LPCWSTR pKeyName,
  2133. BOOL bOpen
  2134. );
  2135. DWORD
  2136. GetIniDriverAndDirForThisMachine(
  2137. IN PINIPRINTER pIniPrinter,
  2138. OUT LPWSTR pszDriverDir,
  2139. OUT PINIDRIVER *ppIniDriver
  2140. );
  2141. BOOL
  2142. CopyAllFilesAndDeleteOldOnes(
  2143. PINIVERSION pIniVersion,
  2144. PINTERNAL_DRV_FILE pInternalDriverFile,
  2145. DWORD dwFileCount,
  2146. LPWSTR pDestDir,
  2147. DWORD dwFileCopyFlags,
  2148. BOOL bImpersonateOnCreate,
  2149. LPBOOL pbFileMoved,
  2150. BOOL bSameEnvironment,
  2151. BOOL bWin95Environment
  2152. );
  2153. BOOL LocalDriverUnloadComplete(
  2154. LPWSTR pDriverFile);
  2155. VOID PendingDriverUpgrades(
  2156. LPWSTR pDriverFile
  2157. );
  2158. BOOL
  2159. GenerateDirectoryNamesForCopyFilesKey(
  2160. PSPOOL pSpool,
  2161. HKEY hKey,
  2162. LPWSTR *ppszSourceDir,
  2163. LPWSTR *ppszTargetDir,
  2164. DWORD cbMax
  2165. );
  2166. LPWSTR
  2167. BuildFilesCopiedAsAString(
  2168. PINTERNAL_DRV_FILE pInternalDriverFile,
  2169. DWORD dwCount
  2170. );
  2171. VOID
  2172. SeekPrinterSetEvent(
  2173. PINIJOB pIniJob,
  2174. HANDLE hFile,
  2175. BOOL bEndDoc
  2176. );
  2177. VOID
  2178. SetPortErrorEvent(
  2179. PINIPORT pIniPort
  2180. );
  2181. BOOL
  2182. DeleteIniPrinterDevNode(
  2183. PINIPRINTER pIniPrinter
  2184. );
  2185. VOID
  2186. SplConfigChange(
  2187. );
  2188. BOOL
  2189. DeletePrinterInAllConfigs(
  2190. PINIPRINTER pIniPrinter
  2191. );
  2192. BOOL
  2193. WritePrinterOnlineStatusInCurrentConfig(
  2194. PINIPRINTER pIniPrinter
  2195. );
  2196. BOOL
  2197. IsDsPresent(
  2198. VOID
  2199. );
  2200. PWSTR
  2201. FixDelim(
  2202. PCWSTR pszInBuffer,
  2203. WCHAR wcDelim
  2204. );
  2205. PWSTR
  2206. Array2DelimString(
  2207. PSTRINGS pStringArray,
  2208. WCHAR wcDelim
  2209. );
  2210. PSTRINGS
  2211. ShortNameArray2LongNameArray(
  2212. PSTRINGS pShortNames
  2213. );
  2214. PSTRINGS
  2215. DelimString2Array(
  2216. PCWSTR pszDelimString,
  2217. WCHAR wcDelim
  2218. );
  2219. BOOL
  2220. ValidateXcvHandle(
  2221. PINIXCV pIniXcv
  2222. );
  2223. VOID
  2224. FreeStringArray(
  2225. PSTRINGS pStrings
  2226. );
  2227. PSTRINGS
  2228. AllocStringArray(
  2229. DWORD nStrings
  2230. );
  2231. VOID
  2232. GetRegistryLocation(
  2233. HANDLE hKey,
  2234. LPCWSTR pszPath,
  2235. PHANDLE phKeyOut,
  2236. LPCWSTR *ppszPathOut
  2237. );
  2238. PWSTR
  2239. GetPrinterUrl(
  2240. PSPOOL pSpool
  2241. );
  2242. VOID
  2243. ClearJobError(
  2244. PINIJOB pIniJob
  2245. );
  2246. BOOL
  2247. UpdateDriverFileRefCnt(
  2248. PINIENVIRONMENT pIniEnvironment,
  2249. PINIVERSION pIniVersion,
  2250. PINIDRIVER pIniDriver,
  2251. LPCWSTR pDirectory,
  2252. DWORD dwDeleteFlag,
  2253. BOOL bIncrementFlag
  2254. );
  2255. BOOL
  2256. LocalRefreshPrinterChangeNotification(
  2257. HANDLE hPrinter,
  2258. DWORD dwColor,
  2259. PVOID pPrinterNotifyRefresh,
  2260. LPVOID* ppPrinterNotifyInfo
  2261. );
  2262. BOOL
  2263. CopyRegistryKeys(
  2264. HKEY hSourceParentKey,
  2265. LPWSTR szSourceKey,
  2266. HKEY hDestParentKey,
  2267. LPWSTR szDestKey,
  2268. PINISPOOLER pIniSpooler
  2269. );
  2270. BOOL
  2271. SplDeleteFile(
  2272. LPCTSTR lpFileName
  2273. );
  2274. BOOL
  2275. SplMoveFileEx(
  2276. LPCTSTR lpExistingFileName,
  2277. LPCTSTR lpNewFileName,
  2278. DWORD dwFlags
  2279. );
  2280. DWORD
  2281. GetDefaultForKMPrintersBlockedPolicy (
  2282. );
  2283. ULONG_PTR
  2284. AlignToRegType(
  2285. IN ULONG_PTR Data,
  2286. IN DWORD RegType
  2287. );
  2288. BOOL
  2289. InternalINFInstallDriver(
  2290. LPDRIVER_INFO_7 pDriverInfo
  2291. );
  2292. DWORD
  2293. GetServerInstallTimeOut(
  2294. );
  2295. BOOL
  2296. AllowFaxSharing(
  2297. VOID
  2298. );
  2299. BOOL
  2300. GetClientSessionData(
  2301. OUT ULONG *plSessionId
  2302. );
  2303. BOOL
  2304. ShowThisPrinter(
  2305. IN PINIPRINTER pIniPrinter,
  2306. IN HANDLE hToken OPTIONAL
  2307. );
  2308. BOOL
  2309. PrinterNotificationVisible(
  2310. IN PINIPRINTER pIniPrinter OPTIONAL,
  2311. IN PSPOOL pSpool
  2312. );
  2313. DWORD
  2314. DetermineJobSessionId(
  2315. PSPOOL pSpool
  2316. );
  2317. typedef BOOLEAN
  2318. (*PWINSTATION_SEND_MESSAGEW)(
  2319. HANDLE hServer,
  2320. ULONG LogonId,
  2321. LPWSTR pTitle,
  2322. ULONG TitleLength,
  2323. LPWSTR pMessage,
  2324. ULONG MessageLength,
  2325. ULONG Style,
  2326. ULONG Timeout,
  2327. PULONG pResponse,
  2328. BOOL DoNotWait
  2329. );
  2330. int
  2331. WinStationMessage(
  2332. DWORD SessionId,
  2333. HWND hWnd,
  2334. DWORD Type,
  2335. int CaptionID,
  2336. int TextID,
  2337. ...
  2338. );
  2339. int
  2340. WinStationMessageBox(
  2341. DWORD SessionId,
  2342. HWND hWnd,
  2343. LPCWSTR lpText,
  2344. LPCWSTR lpCaption,
  2345. UINT uType
  2346. );
  2347. BOOL
  2348. InitializeMessageBoxFunction(
  2349. );
  2350. VOID
  2351. LogFatalPortError(
  2352. IN PINISPOOLER pIniSpooler,
  2353. IN PCWSTR pszName
  2354. );
  2355. VOID
  2356. FreeIniEnvironment(
  2357. IN PINIENVIRONMENT pIniEnvironment
  2358. );
  2359. VOID
  2360. DeleteIniVersion(
  2361. IN PINIENVIRONMENT pIniEnvironment,
  2362. IN PINIVERSION pIniVersion
  2363. );
  2364. VOID
  2365. FreeIniDriver(
  2366. IN PINIENVIRONMENT pIniEnvironment,
  2367. IN PINIVERSION pIniVersion,
  2368. IN PINIDRIVER pIniDriver
  2369. );
  2370. VOID
  2371. FreeIniPrintProc(
  2372. IN PINIPRINTPROC pIniPrintProc
  2373. );
  2374. BOOL
  2375. MergeMultiSz(
  2376. IN PCWSTR pszMultiSz1,
  2377. IN DWORD cchMultiSz1,
  2378. IN PCWSTR pszMultiSz2,
  2379. IN DWORD cchMultiSz2,
  2380. OUT PWSTR *ppszMultiSzMerge,
  2381. OUT DWORD *pcchMultiSzMerge OPTIONAL
  2382. );
  2383. BOOL
  2384. AddMultiSzNoDuplicates(
  2385. IN PCWSTR pszMultiSzIn,
  2386. IN OUT PWSTR pszNewMultiSz,
  2387. IN DWORD cchNewMultiSz
  2388. );
  2389. DWORD
  2390. GetMultiSZLen(
  2391. IN LPWSTR pMultiSzSrc
  2392. );
  2393. DWORD
  2394. CheckShareSame(
  2395. IN PINIPRINTER pIniPrinter,
  2396. IN SHARE_INFO_502 *pShareInfo502,
  2397. OUT BOOL *pbSame
  2398. );
  2399. EXTERN_C
  2400. HRESULT
  2401. StrCchCopyMultipleStr(
  2402. IN PWSTR pszBuffer,
  2403. IN SIZE_T cchBuffer,
  2404. IN PCWSTR pszSource,
  2405. OUT PWSTR *ppszNext,
  2406. OUT SIZE_T *pcchRemaining
  2407. );
  2408. EXTERN_C
  2409. HRESULT
  2410. StrCbCopyMultipleStr(
  2411. IN PWSTR pszBuffer,
  2412. IN SIZE_T cbBuffer,
  2413. IN PCWSTR pszSource,
  2414. OUT PWSTR *ppszNext,
  2415. OUT SIZE_T *pcbRemaining
  2416. );
  2417. BOOL
  2418. IsStringNullTerminatedInBuffer(
  2419. IN PWSTR pszBuffer,
  2420. IN SIZE_T cchBuffer
  2421. );
  2422. VOID
  2423. DiscardJobFromPortThread(
  2424. IN PINIJOB pIniJob,
  2425. IN BOOL bStartDocComplete
  2426. );
  2427. BOOL
  2428. RetrieveMasqPrinterInfo(
  2429. IN PSPOOL pSpool,
  2430. OUT PRINTER_INFO_2 **ppPrinterInfo
  2431. );
  2432. DWORD
  2433. GetPrinterInfoFromRouter(
  2434. IN HANDLE hMasqPrinter,
  2435. OUT PRINTER_INFO_2 **ppPrinterInfo
  2436. );
  2437. DWORD
  2438. AsyncPopulateMasqPrinterCache(
  2439. IN VOID *ThreadData
  2440. );
  2441. BOOL
  2442. GetClientTokenForNotification(
  2443. IN OUT SPOOL *pSpool
  2444. );
  2445. //
  2446. // WMI macros to fill the WMI data struct.
  2447. //
  2448. #define SplWmiCopyEndJobData(WmiData, pIniJob, CreateInfo) \
  2449. { \
  2450. if ((pIniJob)->pDatatype && \
  2451. (_wcsnicmp((pIniJob)->pDatatype, L"TEXT", 4) == 0)) \
  2452. (WmiData)->uJobData.eDataType = eDataTypeTEXT; \
  2453. else if ((pIniJob)->pDatatype && \
  2454. (_wcsnicmp((pIniJob)->pDatatype, L"NT EMF", 6) == 0)) \
  2455. (WmiData)->uJobData.eDataType = eDataTypeEMF; \
  2456. else \
  2457. (WmiData)->uJobData.eDataType = eDataTypeRAW; \
  2458. (WmiData)->uJobData.ulSize = (pIniJob)->Size; \
  2459. (WmiData)->uJobData.ulPages = (pIniJob)->cPagesPrinted; \
  2460. (WmiData)->uJobData.ulPagesPerSide = (pIniJob)->dwJobNumberOfPagesPerSide; \
  2461. (WmiData)->uJobData.sFilesOpened = 0; \
  2462. (WmiData)->uJobData.sFilesOpened += \
  2463. (((CreateInfo) & FP_SHD_CREATED) ? 1 : 0); \
  2464. (WmiData)->uJobData.sFilesOpened += \
  2465. (((CreateInfo) & FP_SPL_WRITER_CREATED) ? 1 : 0); \
  2466. (WmiData)->uJobData.sFilesOpened += \
  2467. (((CreateInfo) & FP_SPL_READER_CREATED) ? 1 : 0); \
  2468. }
  2469. #define SplWmiCopyRenderedData(WmiData, pDevmode) \
  2470. { \
  2471. DWORD dmFields = (pDevmode)->dmFields; \
  2472. if (dmFields & DM_YRESOLUTION) { \
  2473. (WmiData)->uEmfData.sXRes = (pDevmode)->dmPrintQuality; \
  2474. (WmiData)->uEmfData.sYRes = (pDevmode)->dmYResolution; \
  2475. (WmiData)->uEmfData.sQuality = 0; \
  2476. } \
  2477. else if (dmFields & DM_PRINTQUALITY) { \
  2478. (WmiData)->uEmfData.sQuality = (pDevmode)->dmPrintQuality; \
  2479. (WmiData)->uEmfData.sXRes = 0; \
  2480. (WmiData)->uEmfData.sYRes = 0; \
  2481. } \
  2482. else { \
  2483. (WmiData)->uEmfData.sQuality = 0; \
  2484. (WmiData)->uEmfData.sXRes = 0; \
  2485. (WmiData)->uEmfData.sYRes = 0; \
  2486. } \
  2487. (WmiData)->uEmfData.sColor = (dmFields & DM_COLOR ? (pDevmode)->dmColor : 0); \
  2488. (WmiData)->uEmfData.sCopies = (dmFields & DM_COPIES ? (pDevmode)->dmCopies : 0); \
  2489. (WmiData)->uEmfData.sTTOption = (dmFields & DM_TTOPTION ? (pDevmode)->dmTTOption : 0); \
  2490. (WmiData)->uEmfData.ulICMMethod = (dmFields & DM_ICMMETHOD ? (pDevmode)->dmICMMethod : 0); \
  2491. (WmiData)->uEmfData.ulSize = 0;\
  2492. }
  2493. #ifdef __cplusplus
  2494. }
  2495. #endif