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.

109 lines
1.9 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1995 - 1999
  3. All rights reserved.
  4. Module Name:
  5. detect.hxx
  6. Abstract:
  7. PnP printer autodetection.
  8. Author:
  9. Lazar Ivanov (LazarI) May-06-1999
  10. Revision History:
  11. May-06-1999 - Created.
  12. --*/
  13. #ifndef _DETECT_HXX
  14. #define _DETECT_HXX
  15. /********************************************************************
  16. Defines a copy constructor and an assignment operator.
  17. Use this macro in the private section of your class if you
  18. do not support copying and assignment.
  19. ********************************************************************/
  20. #define DEFINE_COPY_ASSIGNMENT( Type ) \
  21. Type( const Type & ); \
  22. Type & operator =( const Type & )
  23. /********************************************************************
  24. TPnPDetect - PnP printer detector class
  25. ********************************************************************/
  26. class TPnPDetect
  27. {
  28. SIGNATURE( 'pnpd' ) // signature
  29. DEFINE_COPY_ASSIGNMENT( TPnPDetect ); // disable copy
  30. public:
  31. TPnPDetect(
  32. VOID
  33. );
  34. ~TPnPDetect(
  35. VOID
  36. );
  37. BOOL
  38. bKickOffPnPEnumeration(
  39. VOID
  40. );
  41. BOOL
  42. bDetectionInProgress(
  43. VOID
  44. );
  45. BOOL
  46. bFinished(
  47. DWORD dwTimeout = 0
  48. );
  49. BOOL
  50. bGetDetectedPrinterName(
  51. TString *pstrPrinterName
  52. );
  53. static DWORD WINAPI
  54. EnumThreadProc(
  55. LPVOID lpParameter
  56. );
  57. static DWORD WINAPI
  58. ProcessDevNodesWithNullDriversAll(
  59. VOID
  60. );
  61. static DWORD WINAPI
  62. ProcessDevNodesWithNullDriversForOneEnumerator(
  63. IN PCTSTR pszEnumerator
  64. );
  65. private:
  66. VOID
  67. Reset(
  68. VOID
  69. );
  70. BOOL _bDetectionInProgress;
  71. PRINTER_INFO_4* _pInfo4Before;
  72. DWORD _cInfo4Before;
  73. HANDLE _hEventDone;
  74. };
  75. #endif // _DETECT_HXX