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.

80 lines
1.7 KiB

  1. /*++
  2. Copyright (c) 1991 - 2001 Microsoft Corporation
  3. Module Name:
  4. ### ### #### ##### ## ## #### ##### #####
  5. ## # ### ## # ## ## ### ### ## # ## ## ## ##
  6. ### ## ## ## ## ## ######## ## ## ## ## ##
  7. ### ## ## ## ## ## # ### ## ## ## ## ## ##
  8. ### ####### ## ## ## # # ## ## ##### #####
  9. # ## ## ## ## # ## ## # ## ## ## # ## ##
  10. ### ## ## #### ##### # ## ## #### ## ##
  11. Abstract:
  12. This module contains the basic DLL exports for the
  13. COM interfaces DLL.
  14. Author:
  15. Wesley Witt (wesw) 1-Oct-2001
  16. Environment:
  17. User mode only.
  18. Notes:
  19. --*/
  20. #include "internal.h"
  21. #include <initguid.h>
  22. #include "sacom_i.c"
  23. CComModule _Module;
  24. BEGIN_OBJECT_MAP(ObjectMap)
  25. OBJECT_ENTRY(CLSID_SaNvram, CSaNvram)
  26. OBJECT_ENTRY(CLSID_SaDisplay, CSaDisplay)
  27. OBJECT_ENTRY(CLSID_SaKeypad, CSaKeypad)
  28. END_OBJECT_MAP()
  29. extern "C"
  30. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  31. {
  32. if (dwReason == DLL_PROCESS_ATTACH) {
  33. _Module.Init(ObjectMap, hInstance, &LIBID_SACOMLib);
  34. DisableThreadLibraryCalls(hInstance);
  35. } else if (dwReason == DLL_PROCESS_DETACH) {
  36. _Module.Term();
  37. }
  38. return TRUE;
  39. }
  40. STDAPI DllCanUnloadNow(void)
  41. {
  42. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  43. }
  44. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  45. {
  46. return _Module.GetClassObject(rclsid, riid, ppv);
  47. }
  48. STDAPI DllRegisterServer(void)
  49. {
  50. return _Module.RegisterServer(TRUE);
  51. }
  52. STDAPI DllUnregisterServer(void)
  53. {
  54. return _Module.UnregisterServer(TRUE);
  55. }