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.

78 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: dll.cpp
  8. //
  9. // Core entry points for the DLL
  10. //
  11. //--------------------------------------------------------------------------
  12. #include "aclpriv.h"
  13. /*----------------------------------------------------------------------------
  14. / Globals
  15. /----------------------------------------------------------------------------*/
  16. HINSTANCE hModule = NULL;
  17. HINSTANCE g_hGetUserLib = NULL;
  18. UINT UM_SIDLOOKUPCOMPLETE = 0;
  19. UINT g_cfDsSelectionList = 0;
  20. UINT g_cfSidInfoList = 0;
  21. /*-----------------------------------------------------------------------------
  22. / DllMain
  23. / -------
  24. / Main entry point. We are passed reason codes and assored other
  25. / information when loaded or closed down.
  26. /
  27. / In:
  28. / hInstance = our instance handle
  29. / dwReason = reason code
  30. / pReserved = depends on the reason code.
  31. /
  32. / Out:
  33. / -
  34. /----------------------------------------------------------------------------*/
  35. STDAPI_(BOOL)
  36. DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*pReserved*/)
  37. {
  38. switch (dwReason)
  39. {
  40. case DLL_PROCESS_ATTACH:
  41. hModule = hInstance;
  42. DebugProcessAttach();
  43. TraceSetMaskFromRegKey(HKEY_LOCAL_MACHINE, TEXT("Software\\Microsoft\\Windows NT\\CurrentVersion\\AclUI"));
  44. #ifndef DEBUG
  45. DisableThreadLibraryCalls(hInstance);
  46. #endif
  47. SHFusionInitializeFromModuleID(hInstance, SHFUSION_DEFAULT_RESOURCE_ID);
  48. RegisterCheckListWndClass();
  49. UM_SIDLOOKUPCOMPLETE = RegisterWindowMessage(TEXT("ACLUI SID Lookup Complete"));
  50. #if(_WIN32_WINNT >= 0x0500)
  51. g_cfDsSelectionList = RegisterClipboardFormat(CFSTR_DSOP_DS_SELECTION_LIST);
  52. #endif
  53. g_cfSidInfoList = RegisterClipboardFormat(CFSTR_ACLUI_SID_INFO_LIST);
  54. break;
  55. case DLL_PROCESS_DETACH:
  56. FreeSidCache();
  57. if (g_hGetUserLib)
  58. FreeLibrary(g_hGetUserLib);
  59. SHFusionUninitialize();
  60. DebugProcessDetach();
  61. break;
  62. case DLL_THREAD_DETACH:
  63. DebugThreadDetach();
  64. break;
  65. }
  66. return TRUE;
  67. }