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.

84 lines
2.4 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: localuiresource.cpp
  4. //
  5. // Synopsis: This file holds the implementation of DLL
  6. // exports
  7. //
  8. // History: 01/15/2001 serdarun Created
  9. //
  10. // Copyright (C) 2000-2001 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //#--------------------------------------------------------------
  14. // Note: Proxy/Stub Information
  15. // To build a separate proxy/stub DLL,
  16. // run nmake -f localuiresourceps.mk in the project directory.
  17. #include "stdafx.h"
  18. #include "resource.h"
  19. #include <initguid.h>
  20. #include "localuiresource.h"
  21. #include "localuiresource_i.c"
  22. #include "ResCtrl.h"
  23. #include "TextResCtrl.h"
  24. CComModule _Module;
  25. BEGIN_OBJECT_MAP(ObjectMap)
  26. OBJECT_ENTRY(CLSID_ResCtrl, CResCtrl)
  27. OBJECT_ENTRY(CLSID_TextResCtrl, CTextResCtrl)
  28. END_OBJECT_MAP()
  29. /////////////////////////////////////////////////////////////////////////////
  30. // DLL Entry Point
  31. extern "C"
  32. BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID /*lpReserved*/)
  33. {
  34. if (dwReason == DLL_PROCESS_ATTACH)
  35. {
  36. _Module.Init(ObjectMap, hInstance, &LIBID_LOCALUIRESOURCELib);
  37. DisableThreadLibraryCalls(hInstance);
  38. }
  39. else if (dwReason == DLL_PROCESS_DETACH)
  40. _Module.Term();
  41. return TRUE; // ok
  42. }
  43. /////////////////////////////////////////////////////////////////////////////
  44. // Used to determine whether the DLL can be unloaded by OLE
  45. STDAPI DllCanUnloadNow(void)
  46. {
  47. return (_Module.GetLockCount()==0) ? S_OK : S_FALSE;
  48. }
  49. /////////////////////////////////////////////////////////////////////////////
  50. // Returns a class factory to create an object of the requested type
  51. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  52. {
  53. return _Module.GetClassObject(rclsid, riid, ppv);
  54. }
  55. /////////////////////////////////////////////////////////////////////////////
  56. // DllRegisterServer - Adds entries to the system registry
  57. STDAPI DllRegisterServer(void)
  58. {
  59. // registers object, typelib and all interfaces in typelib
  60. return _Module.RegisterServer(TRUE);
  61. }
  62. /////////////////////////////////////////////////////////////////////////////
  63. // DllUnregisterServer - Removes entries from the system registry
  64. STDAPI DllUnregisterServer(void)
  65. {
  66. return _Module.UnregisterServer(TRUE);
  67. }