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.

98 lines
2.0 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1997.
  5. //
  6. // File: libmain.cxx
  7. //
  8. // Contents: LibMain for adsiis.dll
  9. //
  10. // Functions: LibMain, DllGetClassObject
  11. //
  12. // History: 25-Oct-94 KrishnaG Created.
  13. //
  14. //----------------------------------------------------------------------------
  15. #include "schema.h"
  16. #define DEFAULT_TRACE_FLAGS (DEBUG_ERROR)
  17. #include "dbgutil.h"
  18. #pragma hdrstop
  19. #ifdef _NO_TRACING_
  20. DECLARE_DEBUG_PRINTS_OBJECT()
  21. DECLARE_DEBUG_VARIABLE();
  22. #endif
  23. //+---------------------------------------------------------------------------
  24. //
  25. // Function: DllMain
  26. //
  27. // Synopsis: entry point for NT - post .546
  28. //
  29. //----------------------------------------------------------------------------
  30. BOOL
  31. DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
  32. {
  33. switch (dwReason)
  34. {
  35. case DLL_PROCESS_ATTACH:
  36. #ifdef _NO_TRACING_
  37. CREATE_DEBUG_PRINT_OBJECT("iisschema");
  38. SET_DEBUG_FLAGS(DEBUG_ERROR);
  39. #endif
  40. break;
  41. case DLL_PROCESS_DETACH:
  42. #ifdef _NO_TRACING_
  43. DELETE_DEBUG_PRINT_OBJECT();
  44. #endif
  45. break;
  46. default:
  47. break;
  48. }
  49. return TRUE;
  50. }
  51. //+------------------------------------------------------------------------
  52. //
  53. // Function: DllRegisterServer
  54. //
  55. // Synopsis: Register registry keys for adsiis
  56. //
  57. // Arguments: None
  58. //
  59. //-------------------------------------------------------------------------
  60. STDAPI DllRegisterServer(
  61. )
  62. {
  63. HRESULT hr = E_FAIL;
  64. HRESULT hrCoInit = CoInitialize(NULL);
  65. if( SUCCEEDED(hrCoInit) )
  66. {
  67. hr = StoreSchema();
  68. CoUninitialize();
  69. }
  70. return hr;
  71. }
  72. //+------------------------------------------------------------------------
  73. //
  74. // Function: DllUnregisterServer
  75. //
  76. // Synopsis: Register registry keys for adsiis
  77. //
  78. // Arguments: None
  79. //
  80. //+------------------------------------------------------------------------
  81. STDAPI DllUnregisterServer(void) {
  82. return NOERROR;
  83. }