Windows NT 4.0 source code leak
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.

201 lines
2.2 KiB

4 years ago
  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. template.c
  5. Abstract:
  6. This module contains the
  7. Author:
  8. Dan Knudson (DanKn) 05-May-1995
  9. Revision History:
  10. --*/
  11. #include "windows.h"
  12. #include "malloc.h"
  13. #include "string.h"
  14. #include "tapi.h"
  15. #include "trapper.h"
  16. #include "template.h"
  17. HANDLE ghDll;
  18. LOGPROC gpfnLog;
  19. #ifdef WIN32
  20. #define __export
  21. #define __loadds
  22. BOOL
  23. WINAPI
  24. DllMain(
  25. HANDLE hDLL,
  26. DWORD dwReason,
  27. LPVOID lpReserved
  28. )
  29. {
  30. switch (dwReason)
  31. {
  32. case DLL_PROCESS_ATTACH:
  33. ghDll = hDLL;
  34. case DLL_PROCESS_DETACH:
  35. case DLL_THREAD_ATTACH:
  36. case DLL_THREAD_DETACH:
  37. break;
  38. }
  39. return TRUE;
  40. }
  41. #else
  42. int
  43. FAR
  44. PASCAL
  45. LibMain(
  46. HANDLE hInstance,
  47. WORD wDataSegment,
  48. WORD wHeapSize,
  49. LPSTR lpszCmdLine
  50. )
  51. {
  52. ghDll = hInstance;
  53. return TRUE;
  54. }
  55. #endif
  56. VOID
  57. FAR
  58. PASCAL
  59. __loadds
  60. __export
  61. TapiCallback(
  62. DWORD hDevice,
  63. DWORD dwMsg,
  64. DWORD dwCallbackInstance,
  65. DWORD dwParam1,
  66. DWORD dwParam2,
  67. DWORD dwParam3
  68. )
  69. {
  70. (*gpfnLog)(
  71. 3,
  72. "TapiCallback: enter, dwMsg=x%lx, dwCbInst=%ld, dwP1=x%lx",
  73. dwMsg,
  74. dwCallbackInstance,
  75. dwParam1
  76. );
  77. switch (dwMsg)
  78. {
  79. } // switch
  80. }
  81. BOOL
  82. FAR
  83. PASCAL
  84. __export
  85. SuiteInit(
  86. LOGPROC pfnLog
  87. )
  88. {
  89. gpfnLog = pfnLog;
  90. return TRUE;
  91. }
  92. BOOL
  93. FAR
  94. PASCAL
  95. __export
  96. SuiteShutdown(
  97. void
  98. )
  99. {
  100. return TRUE;
  101. }
  102. BOOL
  103. FAR
  104. PASCAL
  105. __export
  106. SuiteAbout(
  107. HWND hwndOwner
  108. )
  109. {
  110. MessageBox (hwndOwner, "xxx", "About the Template Suite", MB_OK);
  111. return TRUE;
  112. }
  113. BOOL
  114. FAR
  115. PASCAL
  116. __export
  117. SuiteConfig(
  118. HWND hwndOwner
  119. )
  120. {
  121. MessageBox (hwndOwner, "xxx", "Template Suite Config", MB_OK);
  122. return TRUE;
  123. }
  124. BOOL
  125. FAR
  126. PASCAL
  127. __export
  128. Test1(
  129. HINSTANCE hAppInst
  130. )
  131. {
  132. (*gpfnLog)(3, "Template: Test1: enter");
  133. (*gpfnLog)(3, "Template: Test1: exit");
  134. }
  135. BOOL
  136. FAR
  137. PASCAL
  138. __export
  139. Test2(
  140. HINSTANCE hAppInst
  141. )
  142. {
  143. (*gpfnLog)(3, "Template: Test2: enter");
  144. (*gpfnLog)(3, "Template: Test2: exit");
  145. }
  146. BOOL
  147. FAR
  148. PASCAL
  149. __export
  150. Test3(
  151. HINSTANCE hAppInst
  152. )
  153. {
  154. (*gpfnLog)(3, "Template: Test3: enter");
  155. (*gpfnLog)(3, "Template: Test3: exit");
  156. }