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.

70 lines
1.3 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1995.
  5. //
  6. // File: libmain.c
  7. //
  8. // Contents:
  9. //
  10. // Classes:
  11. //
  12. // Functions:
  13. //
  14. // History: 8-01-95 RichardW Created
  15. // 8-13-95 TerenceS Mutated to PCT
  16. // 1-19-97 jbanes Remove dead code
  17. //
  18. //----------------------------------------------------------------------------
  19. #include "sslp.h"
  20. HANDLE g_hInstance = NULL;
  21. BOOL
  22. WINAPI
  23. DllMain(
  24. HINSTANCE hInstance,
  25. DWORD dwReason,
  26. LPVOID lpReserved)
  27. {
  28. HCRYPTPROV hProv;
  29. BOOL fRet;
  30. NTSTATUS Status;
  31. if(dwReason == DLL_PROCESS_ATTACH)
  32. {
  33. g_hInstance = hInstance;
  34. DisableThreadLibraryCalls( hInstance );
  35. Status = RtlInitializeCriticalSection(&g_InitCritSec);
  36. if(!NT_SUCCESS(Status))
  37. {
  38. return FALSE;
  39. }
  40. // We do nothing during attach, we
  41. // init on first call.
  42. }
  43. else if(dwReason == DLL_PROCESS_DETACH)
  44. {
  45. // We shutdown schannel if it's
  46. // not shut down.
  47. fRet = SchannelShutdown();
  48. RtlDeleteCriticalSection(&g_InitCritSec);
  49. #if DBG
  50. UnloadDebugSupport();
  51. #endif
  52. return fRet;
  53. }
  54. return(TRUE);
  55. }