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.

117 lines
3.0 KiB

  1. /*++
  2. Copyright (c) 1994-7 Microsoft Corporation
  3. Module Name:
  4. netinf.h
  5. Abstract:
  6. This file contains the structures and prototypes necessary for the
  7. netcard inf parser handler as required by the BINL remote boot server.
  8. Author:
  9. Andy Herron (andyhe) 12-Mar-1998
  10. Environment:
  11. User Mode - Win32
  12. Revision History:
  13. --*/
  14. #ifndef _NETINF_
  15. #define _NETINF_
  16. //
  17. // This is the structure we keep per registry value. Off of each
  18. // NETCARD_RESPONSE_DATABASE is a list of these (stored in Registry).
  19. // It is a parameter that is required in the HKR path for the driver.
  20. //
  21. #define NETCARD_REGISTRY_TYPE_INT '1'
  22. #define NETCARD_REGISTRY_TYPE_STRING '2'
  23. typedef struct _NETCARD_REGISTRY_PARAMETERS {
  24. LIST_ENTRY RegistryListEntry;
  25. UNICODE_STRING Parameter;
  26. ULONG Type;
  27. UNICODE_STRING Value;
  28. } NETCARD_REGISTRY_PARAMETERS, *PNETCARD_REGISTRY_PARAMETERS;
  29. typedef struct _NETCARD_FILECOPY_PARAMETERS {
  30. LIST_ENTRY FileCopyListEntry;
  31. UNICODE_STRING SourceFile;
  32. // if DestFile is null, SourceFile is the file name for the target
  33. UNICODE_STRING DestFile;
  34. } NETCARD_FILECOPY_PARAMETERS, *PNETCARD_FILECOPY_PARAMETERS;
  35. //
  36. // this is the main structure that we return for any given net driver
  37. //
  38. typedef struct _NETCARD_RESPONSE_DATABASE {
  39. ULONG ReferenceCount;
  40. LIST_ENTRY NetCardEntry;
  41. PWCHAR HardwareId; // hardware ID to return ("PCI\\VEN_8086&DEV_1229")
  42. PWCHAR DriverName; // driver name to return ("e100bnt.sys")
  43. PWCHAR InfFileName; // inf file name to return ("net557.inf")
  44. PWCHAR SectionName; // section name within the inf ("F1100C.ndi")
  45. PWCHAR SectionNameExt; // name with architecture extension ("F1100C.ndi.ntx86")
  46. PWCHAR ServiceName; // server name to add for this card ("E100B")
  47. PWCHAR DriverDescription; // description of the driver ("Intel 82557B-based Ethernet PCI Adapter (10/100)")
  48. LIST_ENTRY FileCopyList;
  49. LIST_ENTRY Registry;
  50. } NETCARD_RESPONSE_DATABASE, * PNETCARD_RESPONSE_DATABASE;
  51. ULONG
  52. NetInfStartHandler (
  53. VOID
  54. );
  55. ULONG
  56. NetInfCloseHandler (
  57. VOID
  58. );
  59. //
  60. // This finds a specific driver for a given hardware description.
  61. // Be sure to call NetInfDereferenceNetcardEntry when you're done with the
  62. // entry.
  63. //
  64. ULONG
  65. NetInfFindNetcardInfo (
  66. PWCHAR InfDirectory,
  67. ULONG Architecture,
  68. ULONG CardInfoVersion,
  69. NET_CARD_INFO UNALIGNED * CardIdentity,
  70. PWCHAR *FullDriverBuffer OPTIONAL,
  71. PNETCARD_RESPONSE_DATABASE *pInfEntry
  72. );
  73. //
  74. // After calling NetInfFindNetcardInfo, call NetInfDereferenceNetcardEntry
  75. // when you're done with the entry so that it can be marked as not in use.
  76. // Otherwise it'll leak memory when you close call NetInfCloseNetcardInfo.
  77. //
  78. VOID
  79. NetInfDereferenceNetcardEntry (
  80. PNETCARD_RESPONSE_DATABASE pInfEntry
  81. );
  82. #endif _NETINF_