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.

113 lines
5.3 KiB

  1. <HTML>
  2. <HEAD>
  3. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
  4. <META NAME="Generator" CONTENT="Microsoft Word 97">
  5. <TITLE>Irclass</TITLE>
  6. <META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
  7. </HEAD>
  8. <BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff" leftmargin="8">
  9. <FONT FACE="Verdana"><H2><A NAME="MYSAMPLE">Infrared (Network) Class Coinstaller
  10. </A> </H2>
  11. <h3>SUMMARY</h3>
  12. </font><font FACE="Verdana" SIZE="2">
  13. This sample demonstrates the handling of DIF_ calls during device installation and the
  14. insertion of a property page into the install wizard and into the device properties. </p>
  15. <h3>BUILDING THE SAMPLE</h3>
  16. </font><font FACE="Verdana" SIZE="2">
  17. <p>To build Irclass.dll, select either the checked or free DDK environment, change to the
  18. directory Irclass, and type <B>BUILD</B>.</p>
  19. <p>This sample is included as part of Windows&#174; 2000 for installing and configuring serial
  20. infrared devices. The corresponding .inf file, Netirsir.inf, can be found in the
  21. \WinNt\Inf directory after installation of the operating system.</p>
  22. </font><font FACE="Verdana">
  23. <h3>CODE TOUR</h3>
  24. <h4>File Manifest</h4>
  25. </font>
  26. <pre>
  27. <u><font face="Courier">Files Description</font>
  28. </u><font face="Courier">Irclass.htm The documentation for this sample (this file)</font><u>
  29. </u><font
  30. FACE="Courier">Sources The generic file for building the code sample
  31. Irclass.c The only source code for this sample
  32. Irclass.h Header for Irclass.c
  33. Irclass.def DLL definition and exports
  34. Irclass.rc Dialogs and string tables
  35. Irexe.ico Icon for infrared devices
  36. Makefile Standard makefile
  37. Resource.h Microsoft Developer Studio generated include file
  38. </pre>
  39. </font>
  40. <h4><font face="Verdana">Programming Tour</font></h4>
  41. <font face="Verdana" size="2">
  42. <p>This code tour focuses on insertion of page into the install wizard.</p>
  43. <p>The major topics covered in this tour include the following.
  44. <ul>
  45. <li>Coinstaller</font><font FACE="Verdana" SIZE="2"></li>
  46. <li>Property Page Provider</font><font FACE="Verdana" SIZE="2"></li>
  47. </ul>
  48. <h4><font face="Verdana" size="2">Coinstaller</h4>
  49. </font>
  50. <p><font face="Verdana" size="2">Coinstallers are meant to handle special cases of
  51. installation of which a generic class installer may not be aware.&nbsp; Infrared devices
  52. are essentially network devices, and so the majority of the installation is handled by the
  53. network class installer.&nbsp; There are details about an infrared device of which the
  54. network class installer is unaware, such as the selection of the serial port the device is
  55. attached to, and the coinstaller mechanism is provided to extend the functionality of a
  56. more generic class installer in these situations.</font></p>
  57. <p><font face="Verdana" size="2">A coinstaller is very similar to a regular class
  58. installer.&nbsp; It receives each DIF_* call before the regular class installer does, but
  59. it only needs to provide handlers for those DIF_* calls where it desires to modify or
  60. extend the behavior or the regular class installer.&nbsp; In this sample,
  61. IrSIRClassCoinstaller is the main coinstaller function, and it only handles two calls,
  62. DIF_INSTALLDEVICE and DIF_NEWDEVICEWIZARD_FINISHINSTALL.</font></p>
  63. <p><font face="Verdana" size="2">DIF_INSTALLDEVICE is handled by the coinstaller to allow
  64. it to check and modify the UPPERFILTER and LOWERFILTER values for the Irsir.sys driver.
  65. &nbsp; Irsir.sys may use Serial.sys as a lower filter, and it sets this value here.
  66. &nbsp; It reads the LowerFilters entry from Netirsir.inf, and writes this value to the
  67. registry.&nbsp; It also clears the UPPERFILTER value because Serial.sys may use
  68. Serenum.sys as an upper filter, which is inappropriate for Irsir.sys.
  69. &nbsp; DIF_INSTALLDEVICE is the most convenient place to do this because at this point the
  70. driver has not yet been loaded.</font></p>
  71. <p><font face="Verdana" size="2">DIF_NEWDEVICEWIZARD_FINISHINSTALL is the coinstaller's
  72. best opportunity to prompt for special parameters for the driver.&nbsp; The driver may
  73. have already been started at this point, so you should ensure that your driver does not
  74. crash if any parameter is not set yet.&nbsp; This function allows us to insert a final
  75. page into the wizard to query the user.&nbsp; The PortSelectionDlg function handles
  76. inserting the page, which will subsequently be invoked by the install mechanism.</font></p>
  77. <h4><font face="Verdana" size="2">Property Page Provider</font></h4>
  78. <p><font face="Verdana" size="2">You should note that the Property Page Provider and the
  79. Wizard page share a common message handling function, PortDlgProc.&nbsp; Minor differences
  80. are handled by the FirstTimeInstall flag which is set to TRUE in the wizard page
  81. initialization code, and FALSE otherwise.&nbsp; At the dialog completion, it calls
  82. WriteRegistrySettings, which sets the flag </font>DI_FLAGSEX_PROPCHANGE_PENDING.
  83. &nbsp; This is the cue to the OS that a driver's settings have changed, and the driver
  84. needs to either reload them or be restarted depending on its capabilities.</p>
  85. </FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
  86. <TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
  87. <TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
  88. <P></TD>
  89. </TR>
  90. </TABLE>
  91. <FONT FACE="MS Sans Serif" SIZE=1><P>&copy; 1999 Microsoft Corporation</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
  92. </HTML>