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.

317 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. t30u.c
  5. Abstract:
  6. This is the interface with T.30 DLL
  7. Author:
  8. Rafael Lisitsa (RafaelL) 2-Feb-1996
  9. Revision History:
  10. --*/
  11. #define UNICODE
  12. #define _UNICODE
  13. #define USE_DEBUG_CONTEXT DEBUG_CONTEXT_T30_MAIN
  14. #include "prep.h"
  15. #include "tiff.h"
  16. #include "glbproto.h"
  17. #include "t30gl.h"
  18. ///////////////////////////////////////////////////////////////////////////////////
  19. VOID CALLBACK
  20. T30LineCallBackFunction(
  21. HANDLE hFax,
  22. DWORD hDevice,
  23. DWORD dwMessage,
  24. DWORD_PTR dwInstance,
  25. DWORD_PTR dwParam1,
  26. DWORD_PTR dwParam2,
  27. DWORD_PTR dwParam3
  28. )
  29. {
  30. T30LineCallBackFunctionA(
  31. hFax,
  32. hDevice,
  33. dwMessage,
  34. dwInstance,
  35. dwParam1,
  36. dwParam2,
  37. dwParam3
  38. );
  39. } /* LineCallBackProc */
  40. ///////////////////////////////////////////////////////////////////////////////////
  41. BOOL WINAPI
  42. FaxDevInitialize(
  43. IN HLINEAPP LineAppHandle,
  44. IN HANDLE HeapHandle,
  45. OUT PFAX_LINECALLBACK *LineCallbackFunction,
  46. IN PFAX_SERVICE_CALLBACK FaxServiceCallback
  47. )
  48. {
  49. return(
  50. FaxDevInitializeA(
  51. LineAppHandle,
  52. HeapHandle,
  53. LineCallbackFunction,
  54. FaxServiceCallback
  55. ));
  56. }
  57. ///////////////////////////////////////////////////////////////////////////////////
  58. BOOL WINAPI
  59. FaxDevStartJob(
  60. HLINE LineHandle,
  61. DWORD DeviceId,
  62. PHANDLE pFaxHandle,
  63. HANDLE CompletionPortHandle,
  64. ULONG_PTR CompletionKey
  65. )
  66. {
  67. return(
  68. FaxDevStartJobA(
  69. LineHandle,
  70. DeviceId,
  71. pFaxHandle,
  72. CompletionPortHandle,
  73. CompletionKey
  74. ));
  75. }
  76. ///////////////////////////////////////////////////////////////////////////////////
  77. BOOL WINAPI
  78. FaxDevEndJob(
  79. HANDLE FaxHandle
  80. )
  81. {
  82. return(
  83. FaxDevEndJobA(
  84. FaxHandle
  85. ));
  86. }
  87. ///////////////////////////////////////////////////////////////////////////////////
  88. BOOL WINAPI
  89. FaxDevSend(
  90. IN HANDLE FaxHandle,
  91. IN PFAX_SEND FaxSend,
  92. IN PFAX_SEND_CALLBACK FaxSendCallback
  93. )
  94. {
  95. FAX_SEND_A NewFaxSend;
  96. NewFaxSend.SizeOfStruct = FaxSend->SizeOfStruct;
  97. NewFaxSend.FileName = UnicodeStringToAnsiString (FaxSend->FileName);
  98. NewFaxSend.CallerName = UnicodeStringToAnsiString (FaxSend->CallerName);
  99. NewFaxSend.CallerNumber = UnicodeStringToAnsiString (FaxSend->CallerNumber);
  100. NewFaxSend.ReceiverName = UnicodeStringToAnsiString (FaxSend->ReceiverName);
  101. NewFaxSend.ReceiverNumber = UnicodeStringToAnsiString (FaxSend->ReceiverNumber);
  102. return(
  103. FaxDevSendA(
  104. FaxHandle,
  105. &NewFaxSend,
  106. FaxSendCallback
  107. ));
  108. }
  109. ///////////////////////////////////////////////////////////////////////////////////
  110. BOOL WINAPI
  111. FaxDevReceive(
  112. HANDLE FaxHandle,
  113. HCALL CallHandle,
  114. PFAX_RECEIVE FaxReceive
  115. )
  116. {
  117. FAX_RECEIVE_A NewFaxReceive;
  118. NewFaxReceive.SizeOfStruct = FaxReceive->SizeOfStruct;
  119. NewFaxReceive.FileName = UnicodeStringToAnsiString(FaxReceive->FileName);
  120. NewFaxReceive.ReceiverName = UnicodeStringToAnsiString(FaxReceive->ReceiverName);
  121. NewFaxReceive.ReceiverNumber = UnicodeStringToAnsiString(FaxReceive->ReceiverNumber);
  122. return(
  123. FaxDevReceiveA(
  124. FaxHandle,
  125. CallHandle,
  126. &NewFaxReceive
  127. ));
  128. }
  129. ///////////////////////////////////////////////////////////////////////////////////
  130. BOOL WINAPI
  131. FaxDevReportStatus(
  132. IN HANDLE FaxHandle OPTIONAL,
  133. OUT PFAX_DEV_STATUS FaxStatus,
  134. IN DWORD FaxStatusSize,
  135. OUT LPDWORD FaxStatusSizeRequired
  136. )
  137. {
  138. return(
  139. FaxDevReportStatusA(
  140. FaxHandle,
  141. FaxStatus,
  142. FaxStatusSize,
  143. FaxStatusSizeRequired
  144. ));
  145. }
  146. ///////////////////////////////////////////////////////////////////////////////////
  147. HRESULT WINAPI FaxDevShutdown()
  148. {
  149. return FaxDevShutdownA();
  150. }
  151. ////////////////////////////////////////////////////////////////////////////
  152. BOOL WINAPI
  153. FaxDevAbortOperation(
  154. HANDLE FaxHandle
  155. )
  156. {
  157. return(
  158. FaxDevAbortOperationA(
  159. FaxHandle
  160. ));
  161. }
  162. ////////////////////////////////////////////////////////////////////////////
  163. HANDLE
  164. TiffCreateW(
  165. LPWSTR FileName,
  166. DWORD CompressionType,
  167. DWORD ImageWidth,
  168. DWORD FillOrder,
  169. DWORD HiRes
  170. )
  171. {
  172. return(
  173. TiffCreate(
  174. FileName,
  175. CompressionType,
  176. ImageWidth,
  177. FillOrder,
  178. HiRes
  179. ));
  180. }
  181. HANDLE
  182. TiffOpenW(
  183. LPWSTR FileName,
  184. PTIFF_INFO TiffInfo,
  185. BOOL ReadOnly
  186. )
  187. {
  188. return (
  189. TiffOpen(
  190. FileName,
  191. TiffInfo,
  192. ReadOnly,
  193. FILLORDER_LSB2MSB
  194. ));
  195. }