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.

73 lines
1.7 KiB

  1. /**************************************************************************\
  2. * Module Name: init.cpp
  3. *
  4. * Copyright (c) 1985 - 2000, Microsoft Corporation
  5. *
  6. * Initialization functions for Soft Keyboard Component.
  7. *
  8. * History:
  9. * 28-March-2000 weibz Created
  10. \**************************************************************************/
  11. #include "private.h"
  12. #include "globals.h"
  13. #include "immxutil.h"
  14. #include "osver.h"
  15. #include "commctrl.h"
  16. #include "cuilib.h"
  17. #include "mui.h"
  18. DECLARE_OSVER();
  19. //+---------------------------------------------------------------------------
  20. //
  21. // DllInit
  22. //
  23. // Called on our first CoCreate. Use this function to do initialization that
  24. // would be unsafe during process attach, like anything requiring a LoadLibrary.
  25. //
  26. //----------------------------------------------------------------------------
  27. BOOL DllInit(void)
  28. {
  29. BOOL fRet = TRUE;
  30. EnterCriticalSection(GetServerCritSec());
  31. if (DllRefCount() != 1)
  32. goto Exit;
  33. fRet = TFInitLib();
  34. InitUIFLib();
  35. InitOSVer();
  36. Exit:
  37. LeaveCriticalSection(GetServerCritSec());
  38. return fRet;
  39. }
  40. //+---------------------------------------------------------------------------
  41. //
  42. // DllUninit
  43. //
  44. // Called after the dll ref count drops to zero. Use this function to do
  45. // uninitialization that would be unsafe during process deattach, like
  46. // FreeLibrary calls.
  47. //
  48. //----------------------------------------------------------------------------
  49. void DllUninit(void)
  50. {
  51. EnterCriticalSection(GetServerCritSec());
  52. if (DllRefCount() != 0)
  53. goto Exit;
  54. DoneUIFLib();
  55. TFUninitLib();
  56. MuiFlushDlls(g_hInst);
  57. Exit:
  58. LeaveCriticalSection(GetServerCritSec());
  59. }