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.

206 lines
3.4 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. Matt Feton (MattFe) Jan 17 1995 add separate heaps
  11. --*/
  12. #define ONEDAY 60*24
  13. #define MIN_UNC_PRINTER_NAME 5
  14. // Timeout to start spooler's phase 2 initialization in milliseconds
  15. #define SPOOLER_START_PHASE_TWO_INIT 2*60*1000
  16. #define offsetof(type, identifier) (DWORD)(&(((type*)0)->identifier))
  17. extern char *szDriverIni;
  18. extern char *szDriverFileEntry;
  19. extern char *szDriverDataFile;
  20. extern char *szDriverConfigFile;
  21. extern char *szDriverDir;
  22. extern char *szPrintProcDir;
  23. extern char *szPrinterDir;
  24. extern char *szPrinterIni;
  25. extern char *szAllShadows;
  26. extern char *szNullPort;
  27. extern char *szComma;
  28. extern HANDLE hHeap;
  29. extern HANDLE HeapSemaphore;
  30. extern HANDLE InitSemaphore;
  31. extern BOOL Initialized;
  32. extern CRITICAL_SECTION SpoolerSection;
  33. extern DWORD gbFailAllocs;
  34. extern PrintSpoolerServerExports *gpServerExports;
  35. BOOL
  36. LocalInitialize(
  37. VOID
  38. );
  39. VOID
  40. EnterSplSem(
  41. VOID
  42. );
  43. VOID
  44. LeaveSplSem(
  45. VOID
  46. );
  47. LPVOID
  48. DllAllocSplMem(
  49. DWORD cb
  50. );
  51. BOOL
  52. DllFreeSplMem(
  53. LPVOID pMem
  54. );
  55. LPVOID
  56. DllReallocSplMem(
  57. LPVOID lpOldMem,
  58. DWORD cbOld,
  59. DWORD cbNew
  60. );
  61. BOOL
  62. DllFreeSplStr(
  63. LPWSTR lpStr
  64. );
  65. BOOL
  66. ValidateReadPointer(
  67. PVOID pPoint,
  68. ULONG Len
  69. );
  70. BOOL
  71. ValidateWritePointer(
  72. PVOID pPoint,
  73. ULONG Len
  74. );
  75. BOOL
  76. DeleteSubKeyTree(
  77. HKEY ParentHandle,
  78. WCHAR SubKeyName[]
  79. );
  80. LPWSTR
  81. AppendOrderEntry(
  82. LPWSTR szOrderString,
  83. DWORD cbStringSize,
  84. LPWSTR szOrderEntry,
  85. LPDWORD pcbBytesReturned
  86. );
  87. LPWSTR
  88. RemoveOrderEntry(
  89. LPWSTR szOrderString,
  90. DWORD cbStringSize,
  91. LPWSTR szOrderEntry,
  92. LPDWORD pcbBytesReturned
  93. );
  94. LPPROVIDOR
  95. InitializeProvidor(
  96. LPWSTR pProvidorName,
  97. LPWSTR pFullName
  98. );
  99. VOID
  100. WaitForSpoolerInitialization(
  101. VOID
  102. );
  103. HKEY
  104. GetClientUserHandle(
  105. IN REGSAM samDesired
  106. );
  107. BOOL
  108. MyUNCName(
  109. LPWSTR pNameStart
  110. );
  111. BOOL
  112. BuildOtherNamesFromMachineName(
  113. LPWSTR **ppszMyOtherNames,
  114. DWORD *cOtherNames
  115. );
  116. BOOL
  117. bCompatibleDevMode(
  118. PPRINTHANDLE pPrintHandle,
  119. PDEVMODE pDevModeBase,
  120. PDEVMODE pDevModeNew
  121. );
  122. LPWSTR
  123. FormatPrinterForRegistryKey(
  124. LPCWSTR pSource, /* The string from which backslashes are to be removed. */
  125. LPWSTR pScratch, /* Scratch buffer for the function to write in; */
  126. DWORD cchScratchLen /* must be at least as long as pSource. */
  127. );
  128. LPWSTR
  129. FormatRegistryKeyForPrinter(
  130. LPWSTR pSource, /* The string from which backslashes are to be added. */
  131. LPWSTR pScratch, /* Scratch buffer for the function to write in; */
  132. DWORD cchScratchLen /* must be at least as long as pSource. */
  133. );
  134. PWSTR
  135. AutoCat(
  136. PCWSTR pszInput,
  137. PCWSTR pszCat
  138. );
  139. BOOL
  140. bGetDevModePerUserEvenForShares(
  141. IN HKEY hKeyUser, OPTIONAL
  142. IN LPCWSTR pszPrinter,
  143. OUT PDEVMODE *ppDevMode
  144. );
  145. DWORD
  146. GetAPDPolicy(
  147. IN HKEY hKey,
  148. IN LPCWSTR pszRelPath,
  149. IN LPCWSTR pszValueName,
  150. IN LPDWORD pValue
  151. );
  152. DWORD
  153. SetAPDPolicy(
  154. IN HKEY hKey,
  155. IN LPCWSTR pszRelPath,
  156. IN LPCWSTR pszValueName,
  157. IN DWORD Value
  158. );