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.

61 lines
1.3 KiB

  1. //
  2. // init.cpp
  3. //
  4. #include "private.h"
  5. #include "globals.h"
  6. #include "immxutil.h"
  7. #include "osver.h"
  8. #include "mui.h"
  9. DECLARE_OSVER();
  10. //+---------------------------------------------------------------------------
  11. //
  12. // DllInit
  13. //
  14. // Called on our first CoCreate. Use this function to do initialization that
  15. // would be unsafe during process attach, like anything requiring a LoadLibrary.
  16. //
  17. //----------------------------------------------------------------------------
  18. BOOL DllInit(void)
  19. {
  20. BOOL fRet = TRUE;
  21. EnterCriticalSection(GetServerCritSec());
  22. if (DllRefCount() != 1)
  23. goto Exit;
  24. fRet = TFInitLib();
  25. InitOSVer();
  26. Exit:
  27. LeaveCriticalSection(GetServerCritSec());
  28. return fRet;
  29. }
  30. //+---------------------------------------------------------------------------
  31. //
  32. // DllUninit
  33. //
  34. // Called after the dll ref count drops to zero. Use this function to do
  35. // uninitialization that would be unsafe during process deattach, like
  36. // FreeLibrary calls.
  37. //
  38. //----------------------------------------------------------------------------
  39. void DllUninit(void)
  40. {
  41. EnterCriticalSection(GetServerCritSec());
  42. if (DllRefCount() != 0)
  43. goto Exit;
  44. TFUninitLib();
  45. MuiFlushDlls(g_hInst);
  46. Exit:
  47. LeaveCriticalSection(GetServerCritSec());
  48. }