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.

91 lines
2.4 KiB

  1. ///////////////////////////////////////////////////////////////////////////
  2. //
  3. // Bloodhound initialization for the MSRPC parser DLL
  4. //
  5. ///////////////////////////////////////////////////////////////////////////
  6. #include "precomp.h"
  7. #pragma hdrstop
  8. extern PROPERTYINFO MSRPCPropertyTable[];
  9. //MSRPC protocol Entry Points from rpc.c
  10. extern VOID WINAPI MSRPC_Register(HPROTOCOL);
  11. extern VOID WINAPI MSRPC_Deregister(HPROTOCOL);
  12. extern LPBYTE WINAPI MSRPC_RecognizeFrame(HFRAME, LPBYTE, LPBYTE, DWORD, DWORD, HPROTOCOL, DWORD, LPDWORD, LPHPROTOCOL, LPDWORD);
  13. extern LPBYTE WINAPI MSRPC_AttachProperties(HFRAME, LPBYTE, LPBYTE, DWORD, DWORD, HPROTOCOL, DWORD, DWORD);
  14. extern DWORD WINAPI MSRPC_FormatProperties(HFRAME, LPBYTE, LPBYTE, DWORD, LPPROPERTYINST);
  15. extern VOID WINAPI SSPRegister(HPROTOCOL);
  16. extern VOID WINAPI SSPDeregister(HPROTOCOL);
  17. extern LPBYTE WINAPI SSPRecognizeFrame(HFRAME, LPVOID, LPVOID, DWORD, DWORD, HPROTOCOL, DWORD, LPDWORD, LPHPROTOCOL, LPDWORD);
  18. extern LPBYTE WINAPI SSPAttachProperties(HFRAME, LPVOID, LPVOID, DWORD, DWORD, HPROTOCOL, DWORD, DWORD);
  19. extern DWORD WINAPI SSPFormatProperties(HFRAME, LPVOID, LPVOID, DWORD, LPPROPERTYINST);
  20. ENTRYPOINTS MSRPC_EntryPoints =
  21. {
  22. // MSRPC Entry Points
  23. MSRPC_Register,
  24. MSRPC_Deregister,
  25. MSRPC_RecognizeFrame,
  26. MSRPC_AttachProperties,
  27. MSRPC_FormatProperties
  28. };
  29. ENTRYPOINTS SSPEntryPoints =
  30. {
  31. SSPRegister,
  32. SSPDeregister,
  33. SSPRecognizeFrame,
  34. SSPAttachProperties,
  35. SSPFormatProperties
  36. };
  37. char IniFile[MAX_PATH];
  38. HPROTOCOL hMSRPC = NULL;
  39. HPROTOCOL hSSP = NULL;
  40. DWORD Attached = 0;
  41. BOOL WINAPI DLLEntry(HANDLE hInst, ULONG ulCommand, LPVOID lpReserved)
  42. {
  43. if (ulCommand == DLL_PROCESS_ATTACH)
  44. {
  45. if (Attached++ == 0)
  46. {
  47. hMSRPC = CreateProtocol("MSRPC", &MSRPC_EntryPoints, ENTRYPOINTS_SIZE);
  48. hSSP = CreateProtocol("SSP", &SSPEntryPoints, ENTRYPOINTS_SIZE);
  49. if (BuildINIPath(IniFile, "MSRPC.DLL") == NULL)
  50. {
  51. #ifdef DEBUG
  52. BreakPoint();
  53. #endif
  54. return FALSE;
  55. }
  56. }
  57. }
  58. if (ulCommand == DLL_PROCESS_DETACH)
  59. {
  60. if (--Attached == 0)
  61. {
  62. DestroyProtocol(hMSRPC);
  63. DestroyProtocol(hSSP);
  64. }
  65. }
  66. return TRUE;
  67. //... Make the compiler happy.
  68. UNREFERENCED_PARAMETER(hInst);
  69. UNREFERENCED_PARAMETER(lpReserved);
  70. }