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.

160 lines
4.5 KiB

  1. /*************************************************************************
  2. * Microsoft Windows NT *
  3. * *
  4. * Copyright(c) Microsoft Corp., 1994 *
  5. * *
  6. * Revision History: *
  7. * *
  8. * Jan. 22,94 Koti Created *
  9. * *
  10. * Description: *
  11. * *
  12. * This file contains all externs and prototypes of functions. *
  13. * *
  14. *************************************************************************/
  15. #include <tcpsvcs.h>
  16. // externs
  17. extern SERVICE_STATUS ssSvcStatusGLB;
  18. extern SERVICE_STATUS_HANDLE hSvcHandleGLB;
  19. extern HANDLE hEventShutdownGLB;
  20. extern HANDLE hEventLastThreadGLB;
  21. extern HANDLE hLogHandleGLB;
  22. extern SOCKCONN scConnHeadGLB;
  23. extern CRITICAL_SECTION csConnSemGLB;
  24. extern COMMON_LPD Common;
  25. extern DWORD dwMaxUsersGLB;
  26. extern DWORD MaxQueueLength;
  27. extern BOOL fJobRemovalEnabledGLB;
  28. extern BOOL fAllowPrintResumeGLB;
  29. extern BOOL fAlwaysRawGLB;
  30. extern DWORD dwRecvTimeout;
  31. extern BOOL fShuttingDownGLB;
  32. extern CHAR szNTVersion[8];
  33. extern LIST_ENTRY DbgMemList;
  34. extern CHAR *g_ppszStrings[];
  35. // Prototypes
  36. VOID ServiceEntry( DWORD dwArgc, LPTSTR *lpszArgv,
  37. PTCPSVCS_GLOBAL_DATA pGlobalData );
  38. VOID LPDCntrlHandler( DWORD dwControl );
  39. BOOL TellSrvcController( DWORD dwCurrentState, DWORD dwWin32ExitCode,
  40. DWORD dwCheckPoint, DWORD dwWaitHint);
  41. VOID LPDCntrlHandler( DWORD dwControl );
  42. DWORD StartLPD( DWORD dwArgc, LPTSTR *lpszArgv );
  43. VOID StopLPD( VOID );
  44. DWORD LoopOnAccept( LPVOID lpArgv );
  45. VOID SureCloseSocket( SOCKET sSockToClose );
  46. DWORD ReplyToClient( PSOCKCONN pscConn, WORD wResponse );
  47. DWORD GetCmdFromClient( PSOCKCONN pscConn );
  48. DWORD GetControlFileFromClient( PSOCKCONN pscConn, DWORD FileSize, PCHAR FileName );
  49. BOOL LicensingApproval( PSOCKCONN pscConn );
  50. DWORD ReadData( SOCKET sDestSock, PCHAR pchBuf, DWORD cbBytesToRead );
  51. DWORD ReadDataEx( SOCKET sDestSock, PCHAR pchBuf, DWORD cbBytesToRead );
  52. DWORD SendData( SOCKET sDestSock, PCHAR pchBuf, DWORD cbBytesToSend );
  53. DWORD ServiceTheClient( PSOCKCONN pscConn );
  54. DWORD WINAPI WorkerThread( LPVOID pscConn );
  55. VOID TerminateConnection( PSOCKCONN pscConn );
  56. VOID ProcessJob( PSOCKCONN pscConn );
  57. VOID SendQueueStatus( PSOCKCONN pscConn, WORD wMode );
  58. DWORD RemoveJobs( PSOCKCONN pscConn );
  59. DWORD ParseSubCommand( PSOCKCONN pscConn, DWORD *FileLen, PCHAR *FileName );
  60. DWORD ParseControlFile( PSOCKCONN pscConn, PCFILE_ENTRY pCFileEntry );
  61. BOOL ParseQueueName( PSOCKCONN pscConn );
  62. BOOL InitStuff( VOID );
  63. DWORD ResumePrinting( PSOCKCONN pscConn );
  64. DWORD InitializePrinter( PSOCKCONN pscConn );
  65. DWORD UpdateJobInfo( PSOCKCONN pscConn, PCFILE_INFO pCFileInfo );
  66. DWORD UpdateJobType( PSOCKCONN pscConn, PCHAR pchDataBuf, DWORD cbDataLen);
  67. PCHAR StoreIpAddr( PSOCKCONN pscConn );
  68. VOID ShutdownPrinter( PSOCKCONN pscConn );
  69. DWORD SpoolData( HANDLE hSpoolFile, PCHAR pchDataBuf, DWORD cbDataBufLen );
  70. DWORD PrintData( PSOCKCONN pcsConn );
  71. DWORD PrintIt( PSOCKCONN pscConn, PCFILE_ENTRY pCFileEntry, PCFILE_INFO pCFileInfo, PCHAR pFileName );
  72. VOID AbortThisJob( PSOCKCONN pscConn );
  73. VOID LpdFormat( PCHAR pchDest, PCHAR pchSource, DWORD dwLimit );
  74. DWORD ParseQueueRequest( PSOCKCONN pscConn, BOOL fAgent );
  75. INT FillJobStatus( PSOCKCONN pscConn, PCHAR pchDest,
  76. PJOB_INFO_2 pji2QState, DWORD dwNumJobs );
  77. VOID GetClientInfo( PSOCKCONN pscConn );
  78. VOID GetServerInfo( PSOCKCONN pscConn );
  79. BOOL InitLogging( VOID );
  80. VOID LpdReportEvent( DWORD idMessage, WORD wNumStrings,
  81. CHAR *aszStrings[], DWORD dwErrcode );
  82. VOID EndLogging( VOID );
  83. VOID ReadRegistryValues( VOID );
  84. VOID CleanupCFile( PCFILE_ENTRY pCFile );
  85. VOID CleanupDFile( PDFILE_ENTRY pDFile );
  86. VOID FreeStrings();