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.

99 lines
2.3 KiB

  1. /////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright (c) 1997 Active Voice Corporation. All Rights Reserved.
  4. //
  5. // Active Agent(r) and Unified Communications(tm) are trademarks of Active Voice Corporation.
  6. //
  7. // Other brand and product names used herein are trademarks of their respective owners.
  8. //
  9. // The entire program and user interface including the structure, sequence, selection,
  10. // and arrangement of the dialog, the exclusively "yes" and "no" choices represented
  11. // by "1" and "2," and each dialog message are protected by copyrights registered in
  12. // the United States and by international treaties.
  13. //
  14. // Protected by one or more of the following United States patents: 5,070,526, 5,488,650,
  15. // 5,434,906, 5,581,604, 5,533,102, 5,568,540, 5,625,676, 5,651,054.
  16. //
  17. // Active Voice Corporation
  18. // Seattle, Washington
  19. // USA
  20. //
  21. /////////////////////////////////////////////////////////////////////////////////////////
  22. ////
  23. // dllmain.c - LibMain and WEP functions
  24. ////
  25. //#if 0
  26. //#include "winlocal.h"
  27. //#else
  28. #ifndef STRICT
  29. #define STRICT
  30. #endif
  31. #include <windows.h>
  32. #include <windowsx.h>
  33. #define DLLEXPORT __declspec(dllexport)
  34. #define DECLARE_HANDLE32 DECLARE_HANDLE
  35. //#endif
  36. // global to keep track of DLL's instance/module handle;
  37. //
  38. HINSTANCE g_hInstLib;
  39. #ifdef _WIN32
  40. BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved);
  41. BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
  42. {
  43. BOOL fSuccess = TRUE;
  44. switch (fdwReason)
  45. {
  46. case DLL_PROCESS_ATTACH:
  47. g_hInstLib = (HINSTANCE) hModule;
  48. break;
  49. case DLL_THREAD_ATTACH:
  50. break;
  51. case DLL_THREAD_DETACH:
  52. break;
  53. case DLL_PROCESS_DETACH:
  54. break;
  55. default:
  56. break;
  57. }
  58. return fSuccess;
  59. }
  60. #else
  61. int CALLBACK LibMain(HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine);
  62. int CALLBACK WEP(int nExitType);
  63. int CALLBACK LibMain(HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine)
  64. {
  65. g_hInstLib = hinst;
  66. if (cbHeapSize != 0)
  67. UnlockData(0);
  68. return 1; // success
  69. }
  70. int CALLBACK WEP(int nExitType)
  71. {
  72. switch (nExitType)
  73. {
  74. case WEP_SYSTEM_EXIT: // system shutdown in progress
  75. case WEP_FREE_DLL: // DLL usage count is zero
  76. default: // undefined
  77. return 1;
  78. }
  79. }
  80. #endif