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.

74 lines
2.2 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: dllinit.c *
  3. * *
  4. * Contains the DCI library initialization routines. *
  5. * *
  6. * Created: 23-Sep-1994 *
  7. * Author: Andre Vachon [andreva] *
  8. * *
  9. * Copyright (c) 1990,1994 Microsoft Corporation *
  10. \**************************************************************************/
  11. #include <windows.h>
  12. extern CRITICAL_SECTION gcsWinWatchLock;
  13. /******************************Public*Routine******************************\
  14. * DciDllInitialize *
  15. * *
  16. * This is the init procedure for DCIMAN32.dll, which is called each time a *
  17. * new process links to it. *
  18. * *
  19. \**************************************************************************/
  20. BOOLEAN DciDllInitialize(
  21. PVOID pvDllHandle,
  22. ULONG ulReason,
  23. PCONTEXT pcontext)
  24. {
  25. //
  26. // Suppress compiler warnings.
  27. //
  28. pvDllHandle;
  29. pcontext;
  30. //
  31. // Do appropriate attach/detach processing.
  32. //
  33. switch (ulReason)
  34. {
  35. case DLL_PROCESS_ATTACH:
  36. //
  37. // On process attach, initialize the global semaphore.
  38. //
  39. InitializeCriticalSection(&gcsWinWatchLock);
  40. break;
  41. case DLL_PROCESS_DETACH:
  42. //
  43. // On process detach, initialize the global semaphore.
  44. //
  45. DeleteCriticalSection(&gcsWinWatchLock);
  46. break;
  47. case DLL_THREAD_ATTACH:
  48. case DLL_THREAD_DETACH:
  49. //
  50. // Nothing to do yet for thread attach/detach.
  51. //
  52. break;
  53. default:
  54. break;
  55. }
  56. return(TRUE);
  57. }