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.

84 lines
2.1 KiB

  1. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
  2. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
  3. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
  4. // PARTICULAR PURPOSE.
  5. //
  6. // Copyright 1998 - 2003 Microsoft Corporation. All Rights Reserved.
  7. //
  8. // FILE: dllentry.cpp
  9. //
  10. //
  11. // PURPOSE: Source module for DLL entry function(s).
  12. //
  13. //
  14. // Functions:
  15. //
  16. // DllMain
  17. //
  18. //
  19. // PLATFORMS: Windows 2000, Windows XP, Windows Server 2003
  20. //
  21. //
  22. #include "precomp.h"
  23. #include "oemui.h"
  24. #include "fusutils.h"
  25. #include "debug.h"
  26. // StrSafe.h needs to be included last
  27. // to disallow bad string functions.
  28. #include <STRSAFE.H>
  29. // Need to export these functions as c declarations.
  30. extern "C" {
  31. ///////////////////////////////////////////////////////////
  32. //
  33. // DLL entry point
  34. //
  35. BOOL WINAPI DllMain(HINSTANCE hInst, WORD wReason, LPVOID lpReserved)
  36. {
  37. switch(wReason)
  38. {
  39. case DLL_PROCESS_ATTACH:
  40. VERBOSE(DLLTEXT("Process attach.\r\n"));
  41. // Store the module handle in case we need it later.
  42. ghInstance = hInst;
  43. // NOTE: We don't create an Activation Context on module load,
  44. // but on need of an Avtivation Context; the first time
  45. // GetMyActivationContext() or CreateMyActivationContext() is called.
  46. break;
  47. case DLL_THREAD_ATTACH:
  48. VERBOSE(DLLTEXT("Thread attach.\r\n"));
  49. break;
  50. case DLL_PROCESS_DETACH:
  51. VERBOSE(DLLTEXT("Process detach.\r\n"));
  52. // Release the Activation Context if we created one somewhere
  53. // by calling GetMyActivationContext() or CreateMyActivationContext();
  54. if(INVALID_HANDLE_VALUE != ghActCtx)
  55. {
  56. ReleaseActCtx(ghActCtx);
  57. ghActCtx = INVALID_HANDLE_VALUE;
  58. }
  59. break;
  60. case DLL_THREAD_DETACH:
  61. VERBOSE(DLLTEXT("Thread detach.\r\n"));
  62. break;
  63. }
  64. return TRUE;
  65. }
  66. } // extern "C" closing bracket