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.

111 lines
3.7 KiB

  1. //=================================================================================================================//
  2. // MODULE: eapolinit.c
  3. //
  4. // Description:
  5. //
  6. // Attach properties for the BLOODHOUND PPP Parser.
  7. //
  8. // Modification History
  9. //
  10. // timmoore 04/04/2000 Created from PPP parser.
  11. //=================================================================================================================//
  12. #include "eapol.h"
  13. extern ENTRYPOINTS EAPOLEntryPoints;
  14. extern HPROTOCOL hEAPOL;
  15. char IniFile[INI_PATH_LENGTH];
  16. //==========================================================================================================================
  17. // FUNCTION: DllMain()
  18. //
  19. // Modification History
  20. //
  21. // timmoore 04/04/2000 Created from PPP parser.
  22. //==========================================================================================================================
  23. DWORD Attached = 0;
  24. BOOL WINAPI DllMain(HANDLE hInst, ULONG ulCommand, LPVOID lpReserved)
  25. {
  26. if (ulCommand == DLL_PROCESS_ATTACH)
  27. {
  28. if (Attached++ == 0)
  29. {
  30. hEAPOL = CreateProtocol("EAPOL", &EAPOLEntryPoints, ENTRYPOINTS_SIZE);
  31. }
  32. }
  33. else if (ulCommand == DLL_PROCESS_DETACH)
  34. {
  35. if (--Attached == 0)
  36. {
  37. DestroyProtocol(hEAPOL);
  38. }
  39. }
  40. return TRUE;
  41. //... Make the compiler happy.
  42. UNREFERENCED_PARAMETER(hInst);
  43. UNREFERENCED_PARAMETER(lpReserved);
  44. }
  45. //==========================================================================================================================
  46. // FUNCTION: ParserAutoInstallInfo()
  47. //
  48. // Modification History
  49. //
  50. // timmoore 04/04/2000
  51. //==========================================================================================================================
  52. PPF_PARSERDLLINFO WINAPI ParserAutoInstallInfo ()
  53. {
  54. PPF_PARSERDLLINFO pParserDllInfo;
  55. PPF_PARSERINFO pParserInfo;
  56. DWORD dwNumProtocols = 0;
  57. DWORD dwNumHandoffs = 0;
  58. PPF_HANDOFFSET pHandoffSet;
  59. PPF_HANDOFFENTRY pHandoffEntry;
  60. dwNumProtocols = 1;
  61. pParserDllInfo = (PPF_PARSERDLLINFO) HeapAlloc (GetProcessHeap(),
  62. HEAP_ZERO_MEMORY,
  63. sizeof( PF_PARSERDLLINFO )
  64. + dwNumProtocols * sizeof( PF_PARSERINFO));
  65. if ( pParserDllInfo == NULL )
  66. {
  67. return NULL;
  68. }
  69. pParserDllInfo->nParsers = dwNumProtocols;
  70. pParserInfo = &(pParserDllInfo->ParserInfo[0]);
  71. wsprintf ( pParserInfo->szProtocolName, "EAPOL");
  72. wsprintf (pParserInfo->szComment, "EAPOL/802.1x Protocol");
  73. wsprintf ( pParserInfo->szHelpFile, "");
  74. dwNumHandoffs = 1;
  75. pHandoffSet = (PPF_HANDOFFSET) HeapAlloc (GetProcessHeap(),
  76. HEAP_ZERO_MEMORY,
  77. sizeof( PF_HANDOFFSET ) +
  78. dwNumHandoffs * sizeof( PF_HANDOFFENTRY) );
  79. if (pHandoffSet == NULL)
  80. {
  81. return NULL;
  82. }
  83. pParserInfo->pWhoHandsOffToMe = pHandoffSet;
  84. pHandoffSet->nEntries = dwNumHandoffs;
  85. pHandoffEntry = &(pHandoffSet->Entry[0]);
  86. wsprintf( pHandoffEntry->szIniFile, "MAC.INI" );
  87. wsprintf( pHandoffEntry->szIniSection, "ETYPES" );
  88. wsprintf( pHandoffEntry->szProtocol, "EAPOL" );
  89. pHandoffEntry->dwHandOffValue = 0x888E;
  90. pHandoffEntry->ValueFormatBase = HANDOFF_VALUE_FORMAT_BASE_HEX;
  91. return pParserDllInfo;
  92. }