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.

60 lines
1.4 KiB

  1. //
  2. // init.cpp
  3. //
  4. #include "private.h"
  5. #include "globals.h"
  6. #include "immxutil.h"
  7. #include "cuilib.h"
  8. #include "candutil.h"
  9. #include "candacc.h"
  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. {
  24. fRet = TFInitLib();
  25. InitUIFLib();
  26. InitCandAcc();
  27. }
  28. LeaveCriticalSection(GetServerCritSec());
  29. return fRet;
  30. }
  31. //+---------------------------------------------------------------------------
  32. //
  33. // DllUninit
  34. //
  35. // Called after the dll ref count drops to zero. Use this function to do
  36. // uninitialization that would be unsafe during process deattach, like
  37. // FreeLibrary calls.
  38. //
  39. //----------------------------------------------------------------------------
  40. void DllUninit(void)
  41. {
  42. EnterCriticalSection(GetServerCritSec());
  43. if (DllRefCount() == 0)
  44. {
  45. TFUninitLib();
  46. DoneUIFLib();
  47. DoneCandAcc();
  48. }
  49. LeaveCriticalSection(GetServerCritSec());
  50. }