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.

190 lines
4.6 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1993-1994 Microsoft Corporation
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // init.c
  13. //
  14. // Description:
  15. // This file contains module initialization routines. Note that there
  16. // is no module initialization for Win32.
  17. //
  18. //
  19. //==========================================================================;
  20. #include <windows.h>
  21. #include <windowsx.h>
  22. #include <mmsystem.h>
  23. #include <mmreg.h>
  24. #include <msacm.h>
  25. #include <msacmdrv.h>
  26. #include "codec.h"
  27. #include "debug.h"
  28. #ifndef WIN32
  29. //==========================================================================;
  30. //
  31. // WIN 16 SPECIFIC SUPPORT
  32. //
  33. //==========================================================================;
  34. //--------------------------------------------------------------------------;
  35. //
  36. // int LibMain
  37. //
  38. // Description:
  39. // Library initialization code.
  40. //
  41. // Arguments:
  42. // HINSTANCE hinst: Our module handle.
  43. //
  44. // WORD wDataSeg: Specifies the DS value for this DLL.
  45. //
  46. // WORD cbHeapSize: The heap size from the .def file.
  47. //
  48. // LPSTR pszCmdLine: The command line.
  49. //
  50. // Return (int):
  51. // Returns non-zero if the initialization was successful and 0 otherwise.
  52. //
  53. // History:
  54. // 11/15/92 Created.
  55. //
  56. //--------------------------------------------------------------------------;
  57. int FNGLOBAL LibMain
  58. (
  59. HINSTANCE hinst,
  60. WORD wDataSeg,
  61. WORD cbHeapSize,
  62. LPSTR pszCmdLine
  63. )
  64. {
  65. DbgInitialize(TRUE);
  66. //
  67. // if debug level is 5 or greater, then do a DebugBreak() to debug
  68. // loading of this driver
  69. //
  70. DPF(1, "LibMain(hinst=%.4Xh, wDataSeg=%.4Xh, cbHeapSize=%u, pszCmdLine=%.8lXh)",
  71. hinst, wDataSeg, cbHeapSize, pszCmdLine);
  72. DPF(5, "!*** break for debugging ***");
  73. return (TRUE);
  74. } // LibMain()
  75. //--------------------------------------------------------------------------;
  76. //
  77. // int WEP
  78. //
  79. // Description:
  80. //
  81. //
  82. // Arguments:
  83. // WORD wUselessParam:
  84. //
  85. // Return (int):
  86. //
  87. // History:
  88. // 03/28/93 Created.
  89. //
  90. //--------------------------------------------------------------------------;
  91. EXTERN_C int FNEXPORT WEP
  92. (
  93. WORD wUselessParam
  94. )
  95. {
  96. DPF(1, "WEP(wUselessParam=%u)", wUselessParam);
  97. //
  98. // always return 1.
  99. //
  100. return (1);
  101. } // WEP()
  102. #endif // !WIN32
  103. #ifdef WIN32
  104. //==========================================================================;
  105. //
  106. // WIN 32 SPECIFIC SUPPORT
  107. //
  108. //==========================================================================;
  109. #if (defined(WIN4) && defined(DEBUG))
  110. #if FALSE
  111. //--------------------------------------------------------------------------;
  112. //
  113. // BOOL Gsm610DllMain
  114. //
  115. // Description:
  116. // This is the standard DLL entry point for Win 32.
  117. //
  118. // Arguments:
  119. // HINSTANCE hinst: Our instance handle.
  120. //
  121. // DWORD dwReason: The reason we've been called--process/thread attach
  122. // and detach.
  123. //
  124. // LPVOID lpReserved: Reserved. Should be NULL--so ignore it.
  125. //
  126. // Return (BOOL):
  127. // Returns non-zero if the initialization was successful and 0 otherwise.
  128. //
  129. //--------------------------------------------------------------------------;
  130. BOOL FNEXPORT Gsm610DllMain
  131. (
  132. HINSTANCE hinst,
  133. DWORD dwReason,
  134. LPVOID lpReserved
  135. )
  136. {
  137. switch (dwReason)
  138. {
  139. case DLL_PROCESS_ATTACH:
  140. {
  141. char strModuleFilename[80];
  142. DbgInitialize(TRUE);
  143. GetModuleFileNameA(NULL, (LPSTR) strModuleFilename, 80);
  144. DPF(1, "Gsm610DllMain: DLL_PROCESS_ATTACH: HINSTANCE=%08lx ModuleFilename=%s", hinst, strModuleFilename);
  145. return TRUE;
  146. }
  147. case DLL_PROCESS_DETACH:
  148. DPF(1, "Gsm610DllMain: DLL_PROCESS_DETACH");
  149. return TRUE;
  150. case DLL_THREAD_ATTACH:
  151. DPF(1, "Gsm610DllMain: DLL_THREAD_ATTACH");
  152. return TRUE;
  153. case DLL_THREAD_DETACH:
  154. DPF(1, "Gsm610DllMain: DLL_THREAD_DETACH");
  155. return TRUE;
  156. }
  157. return TRUE;
  158. } // Gsm610DllMain()
  159. #endif
  160. #endif // WIN4 && DEBUG
  161. #endif // WIN32