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.

107 lines
3.2 KiB

  1. #include <windows.h>
  2. #include "cfactory.h"
  3. #ifndef UNDER_CE // Cannot override DllMain's prototype
  4. BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwF, LPVOID lpNotUsed);
  5. #else // UNDER_CE
  6. BOOL WINAPI DllMain(HANDLE hInst, DWORD dwF, LPVOID lpNotUsed);
  7. #endif // UNDER_CE
  8. extern HINSTANCE g_hInst = NULL;
  9. #ifndef UNDER_CE // Cannot override DllMain's prototype
  10. BOOL WINAPI DllMain(HINSTANCE hInst, DWORD dwF, LPVOID lpNotUsed)
  11. #else // UNDER_CE
  12. BOOL WINAPI DllMain(HANDLE hInst, DWORD dwF, LPVOID lpNotUsed)
  13. #endif // UNDER_CE
  14. {
  15. UNREFERENCED_PARAMETER(lpNotUsed);
  16. switch (dwF) {
  17. case DLL_PROCESS_ATTACH:
  18. #ifndef UNDER_CE // Windows CE does not support DisableThreadLibraryCalls
  19. DisableThreadLibraryCalls(hInst);
  20. #endif // UNDER_CE
  21. #ifndef UNDER_CE // Cannot override DllMain's prototype
  22. g_hInst = hInst;
  23. CFactory::m_hModule = hInst;
  24. #else // UNDER_CE
  25. g_hInst = (HINSTANCE)hInst;
  26. CFactory::m_hModule = (HMODULE)hInst;
  27. #endif // UNDER_CE
  28. break;
  29. case DLL_PROCESS_DETACH:
  30. #ifdef _DEBUG
  31. OutputDebugString("===== MULTIBOX.DLL DLL_PROCESS_DETACH =====\n");
  32. #endif
  33. g_hInst = NULL;
  34. break;
  35. }
  36. return TRUE;
  37. }
  38. //----------------------------------------------------------------
  39. //IME98A Enhancement:
  40. //----------------------------------------------------------------
  41. //////////////////////////////////////////////////////////////////
  42. // Function : DllCanUnloadNow
  43. // Type : STDAPI
  44. // Purpose :
  45. // Args : None
  46. // Return :
  47. // DATE : Wed Mar 25 14:15:36 1998
  48. //////////////////////////////////////////////////////////////////
  49. STDAPI DllCanUnloadNow()
  50. {
  51. return CFactory::CanUnloadNow() ;
  52. }
  53. //////////////////////////////////////////////////////////////////
  54. // Function : DllGetClassObject
  55. // Type : STDAPI
  56. // Purpose :
  57. // Args :
  58. // : REFCLSID rclsid
  59. // : REFIID riid
  60. // : LPVOID * ppv
  61. // Return :
  62. // DATE : Wed Mar 25 14:17:10 1998
  63. //////////////////////////////////////////////////////////////////
  64. STDAPI DllGetClassObject(REFCLSID rclsid,
  65. REFIID riid,
  66. LPVOID *ppv)
  67. {
  68. return CFactory::GetClassObject(rclsid, riid, ppv);
  69. }
  70. //----------------------------------------------------------------
  71. //
  72. // Server [un]registration exported API
  73. //
  74. //----------------------------------------------------------------
  75. //////////////////////////////////////////////////////////////////
  76. // Function : DllRegisterServer
  77. // Type : STDAPI
  78. // Purpose :
  79. // Args : None
  80. // Return :
  81. // DATE : Wed Mar 25 14:25:39 1998
  82. //////////////////////////////////////////////////////////////////
  83. STDAPI DllRegisterServer()
  84. {
  85. return CFactory::RegisterServer();
  86. }
  87. //////////////////////////////////////////////////////////////////
  88. // Function : DllUnregisterServer
  89. // Type : STDAPI
  90. // Purpose :
  91. // Args : None
  92. // Return :
  93. // DATE : Wed Mar 25 14:26:03 1998
  94. //////////////////////////////////////////////////////////////////
  95. STDAPI DllUnregisterServer()
  96. {
  97. return CFactory::UnregisterServer();
  98. }