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.

93 lines
1.7 KiB

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