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.

107 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. main.cxx
  5. Abstract:
  6. DLL startup routine.
  7. Author:
  8. Keith Moore (keithmo) 17-Feb-1997
  9. Revision History:
  10. --*/
  11. extern "C" {
  12. #include <nt.h>
  13. #include <ntrtl.h>
  14. #include <nturtl.h>
  15. #include <windows.h>
  16. #include <dbgutil.h>
  17. } // extern "C"
  18. #include <iadmw.h>
  19. #include <icrypt.hxx>
  20. #include <secdat.hxx>
  21. //
  22. // Private globals.
  23. //
  24. extern "C" void InitializeIISRTL2();
  25. extern "C" void TerminateIISRTL2();
  26. //
  27. // Private prototypes.
  28. //
  29. //
  30. // DLL Entrypoint.
  31. //
  32. extern "C" {
  33. BOOL
  34. WINAPI
  35. DllMain(
  36. HINSTANCE hDll,
  37. DWORD dwReason,
  38. LPVOID
  39. )
  40. {
  41. BOOL status = TRUE;
  42. switch( dwReason ) {
  43. case DLL_PROCESS_ATTACH :
  44. INITIALIZE_PLATFORM_TYPE();
  45. // This needs to be called to initialize the Critical Section which
  46. // is used by the CREATE_DEBUG_PRINT_OBJECT
  47. InitializeIISRTL2();
  48. // NOTE: Now you might be wondering why this needs to do an initialize.
  49. // This is because this module links with iisrtl2.lib, not with
  50. // iisrtl.lib and hence not with iisrtl.dll. So in order for tracing
  51. // to get started this needs to do the initialize.
  52. CREATE_DEBUG_PRINT_OBJECT( "admwprox");
  53. LOAD_DEBUG_FLAGS_FROM_REG_STR( "System\\CurrentControlSet\\Services\\iisadmin\\Parameters", 0 );
  54. status = ADM_SECURE_DATA::Initialize( hDll );
  55. ADM_GUID_MAP::Initialize();
  56. DisableThreadLibraryCalls( hDll );
  57. break;
  58. case DLL_PROCESS_DETACH :
  59. ADM_GUID_MAP::Terminate();
  60. ADM_SECURE_DATA::Terminate();
  61. DELETE_DEBUG_PRINT_OBJECT();
  62. // This needs to be called to remove the Critical Section which
  63. // was used by the DELETE_DEBUG_PRINT_OBJECT
  64. TerminateIISRTL2();
  65. break;
  66. }
  67. return status;
  68. } // DLLEntry
  69. } // extern "C"