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.

90 lines
1.8 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1998, Microsoft Corp. All rights reserved.
  4. //
  5. // FILE
  6. //
  7. // iaspipe.cpp
  8. //
  9. // SYNOPSIS
  10. //
  11. // Implementation of DLL exports for an ATL in proc server.
  12. //
  13. // MODIFICATION HISTORY
  14. //
  15. // 01/28/2000 Original version.
  16. //
  17. ///////////////////////////////////////////////////////////////////////////////
  18. #include <polcypch.h>
  19. #include <pipeline.h>
  20. #include <request.h>
  21. CComModule _Module;
  22. #include <atlimpl.cpp>
  23. BEGIN_OBJECT_MAP(ObjectMap)
  24. OBJECT_ENTRY(__uuidof(Request), Request)
  25. OBJECT_ENTRY(__uuidof(Pipeline), Pipeline)
  26. END_OBJECT_MAP()
  27. //////////
  28. // DLL Entry Point
  29. //////////
  30. BOOL
  31. WINAPI
  32. DllMain(
  33. HINSTANCE hInstance,
  34. DWORD dwReason,
  35. LPVOID /*lpReserved*/
  36. )
  37. {
  38. if (dwReason == DLL_PROCESS_ATTACH)
  39. {
  40. _Module.Init(ObjectMap, hInstance);
  41. DisableThreadLibraryCalls(hInstance);
  42. }
  43. else if (dwReason == DLL_PROCESS_DETACH)
  44. {
  45. _Module.Term();
  46. }
  47. return TRUE;
  48. }
  49. //////////
  50. // Used to determine whether the DLL can be unloaded by OLE
  51. //////////
  52. STDAPI DllCanUnloadNow(void)
  53. {
  54. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  55. }
  56. //////////
  57. // Returns a class factory to create an object of the requested type.
  58. //////////
  59. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  60. {
  61. return _Module.GetClassObject(rclsid, riid, ppv);
  62. }
  63. //////////
  64. // DllRegisterServer - Adds entries to the system registry
  65. //////////
  66. STDAPI DllRegisterServer(void)
  67. {
  68. return _Module.RegisterServer(FALSE);
  69. }
  70. //////////
  71. // DllUnregisterServer - Removes entries from the system registry
  72. //////////
  73. STDAPI DllUnregisterServer(void)
  74. {
  75. return _Module.UnregisterServer();
  76. }