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.

96 lines
1.9 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 <database.h>
  22. #include <localfile.h>
  23. CComModule _Module;
  24. #include <atlimpl.cpp>
  25. BEGIN_OBJECT_MAP(ObjectMap)
  26. OBJECT_ENTRY(__uuidof(Accounting),
  27. IASTL::IASRequestHandlerObject<LocalFile> )
  28. OBJECT_ENTRY(__uuidof(DatabaseAccounting),
  29. IASTL::IASRequestHandlerObject<Database> )
  30. END_OBJECT_MAP()
  31. //////////
  32. // DLL Entry Point
  33. //////////
  34. BOOL
  35. WINAPI
  36. DllMain(
  37. HINSTANCE hInstance,
  38. DWORD dwReason,
  39. LPVOID /*lpReserved*/
  40. )
  41. {
  42. if (dwReason == DLL_PROCESS_ATTACH)
  43. {
  44. _Module.Init(ObjectMap, hInstance);
  45. DisableThreadLibraryCalls(hInstance);
  46. }
  47. else if (dwReason == DLL_PROCESS_DETACH)
  48. {
  49. _Module.Term();
  50. }
  51. return TRUE;
  52. }
  53. //////////
  54. // Used to determine whether the DLL can be unloaded by OLE
  55. //////////
  56. STDAPI DllCanUnloadNow(void)
  57. {
  58. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  59. }
  60. //////////
  61. // Returns a class factory to create an object of the requested type.
  62. //////////
  63. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  64. {
  65. return _Module.GetClassObject(rclsid, riid, ppv);
  66. }
  67. //////////
  68. // DllRegisterServer - Adds entries to the system registry
  69. //////////
  70. STDAPI DllRegisterServer(void)
  71. {
  72. return _Module.RegisterServer(FALSE);
  73. }
  74. //////////
  75. // DllUnregisterServer - Removes entries from the system registry
  76. //////////
  77. STDAPI DllUnregisterServer(void)
  78. {
  79. return _Module.UnregisterServer();
  80. }