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.

110 lines
3.2 KiB

  1. HttpExtensionProc():
  2. - ListSharedPrinter():
  3. - pAllInfo->iQueryCommand = CMD_ListPrinters)
  4. - dwRet = ParseTemplateFile(pAllInfo);
  5. - PreProc.ProcessHTML
  6. or
  7. - ShowPrinterPage():
  8. if (pAllInfo->iQueryCommand == CMD_Invalid)
  9. pAllInfo->iQueryCommand = CMD_ListJobs;
  10. case CMD_ListJobs:
  11. case CMD_ShowDetails:
  12. case CMD_ShowJobInfo:
  13. dwRet = ParseTemplateFile(pAllInfo, &ppi);
  14. break;
  15. =======================================================================
  16. LPSTR GetTemplateFileName(PALLINFO pAllInfo)
  17. {
  18. LPSTR pszBuf = pAllInfo->pf.szStringBuf0;
  19. LPSTR pszTmp = NULL;
  20. // Find the root filename
  21. switch (pAllInfo->iQueryCommand)
  22. {
  23. case CMD_ListJobs : pszTmp = "prtpage.htm"; break;
  24. case CMD_ListPrinters : pszTmp = "prtlist.htm"; break;
  25. case CMD_ShowDetails : pszTmp = "prtdtail.htm"; break; //NOTIMPL
  26. case CMD_ShowJobInfo : pszTmp = "prtjobd.htm"; break; //NOTIMPL
  27. case CMD_CreateExe : pszTmp = "prtinst.htm"; break; //NOTIMPL
  28. // CMD_UploadFile,
  29. // CMD_Install,
  30. // CMD_JobControl
  31. // CMD_JobStart,
  32. // CMD_JobData,
  33. // CMD_JobEnd,
  34. };
  35. - CMD_ShowJobInfo is invoked when user click on the icon on the left most column of the
  36. job table in prtpage.htm (see <a href={=WinPrt.PrinterCommandURL}?ShowJobInfo&{=WinPrt.JobID}>)
  37. - CMD_ShowDetails is there, in prtpage.htm when you click "Show Printer Details..."
  38. - So there are 4 HTML pages running.
  39. - ShowJobInfo() and ShowDetails are not used......
  40. ==========================================================================
  41. prthtml.cxx:
  42. - m_pTemplateData -> points to the beginning of the template file.
  43. - m_pIn -> points to somewhere within the loaded template file.
  44. ==============
  45. {WinPrt.PrinterCommandURL} writes: /scripts/sharename/.printer
  46. {=WinPrt.PrinterShareURL} is http://server/sharename not used really for "href" commands.
  47. {=WinPrt.PrinterCommandURL}?ShowDetails loads prtdtail.htm (print prop details page)
  48. {=WinPrt.PrinterDetailsURL}
  49. {=WinPrt.PrinterCommandURL}?CreateExe loads prtinst.htm (print install page)
  50. {=WinPrt.PrinterInstallURL}
  51. {=WinPrt.PrinterCommandURL}?ShowJobInfo&{=WinPrt.JobID}> loads prtjobd.htm (job detail page)
  52. {=WinPrt.JobDetailsURL}
  53. Job specific tags like this one are only valid in ShowJobInfo (prtjobd.htm) and inside BeginJob loop.
  54. How can a custom tag get the job id? Add a JobID field to the struct and have it be filled for
  55. the cases where JobID is relavant, like when inside a BeginJob or in ShowJobInfo page.
  56. How to send commnads? call an exported API out of the tag processor.
  57. ==================
  58. Sharing:
  59. 1) If ISAPI installed, create wwwroot/sharename for all printrers. Currently done by
  60. ShareThisPrinter() which is called during spooler init and later on.
  61. 2) If need to share all printers, including not shared ones, then during SplAddPrinter() create a
  62. URL friendly name, and create wwwroot\thisURLFriendlyName. It could be done by replacing bad chars
  63. with '_', then adding 1, 2, 3 to the end for uniqueness.
  64. 3) Currently WebUnshare is called from ShareThisPrinter() when the printer is being unshared, and it
  65. deletes the wwwroot\sharename.