Source code of Windows XP (NT5)
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.

205 lines
4.6 KiB

  1. /*++
  2. Copyright (c) Microsoft Corporation. All rights reserved.
  3. Module Name:
  4. faxdev.h
  5. Abstract:
  6. This file contains the prototypes, etc for the
  7. FAX device provider API.
  8. --*/
  9. #include <commctrl.h>
  10. #ifndef _FAXDEV_
  11. #define _FAXDEV_
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. //
  19. // FAX status constants
  20. //
  21. #define FS_INITIALIZING 0x20000000
  22. #define FS_DIALING 0x20000001
  23. #define FS_TRANSMITTING 0x20000002
  24. #define FS_RECEIVING 0x20000004
  25. #define FS_COMPLETED 0x20000008
  26. #define FS_HANDLED 0x20000010
  27. #define FS_LINE_UNAVAILABLE 0x20000020
  28. #define FS_BUSY 0x20000040
  29. #define FS_NO_ANSWER 0x20000080
  30. #define FS_BAD_ADDRESS 0x20000100
  31. #define FS_NO_DIAL_TONE 0x20000200
  32. #define FS_DISCONNECTED 0x20000400
  33. #define FS_FATAL_ERROR 0x20000800 // see the stringid for the real status
  34. #define FS_NOT_FAX_CALL 0x20001000
  35. #define FS_CALL_DELAYED 0x20002000
  36. #define FS_CALL_BLACKLISTED 0x20004000
  37. #define FS_USER_ABORT 0x20200000
  38. #define FS_ANSWERED 0x20800000
  39. //
  40. // data structures
  41. //
  42. typedef struct _FAX_SEND {
  43. DWORD SizeOfStruct;
  44. LPWSTR FileName;
  45. LPWSTR CallerName;
  46. LPWSTR CallerNumber;
  47. LPWSTR ReceiverName;
  48. LPWSTR ReceiverNumber;
  49. BOOL Branding;
  50. HCALL CallHandle;
  51. DWORD Reserved[3];
  52. } FAX_SEND, *PFAX_SEND;
  53. typedef struct _FAX_RECEIVE {
  54. DWORD SizeOfStruct;
  55. LPWSTR FileName;
  56. LPWSTR ReceiverName;
  57. LPWSTR ReceiverNumber;
  58. DWORD Reserved[4];
  59. } FAX_RECEIVE, *PFAX_RECEIVE;
  60. typedef struct _FAX_DEV_STATUS {
  61. DWORD SizeOfStruct;
  62. DWORD StatusId;
  63. DWORD StringId;
  64. DWORD PageCount;
  65. LPWSTR CSI;
  66. LPWSTR CallerId;
  67. LPWSTR RoutingInfo;
  68. DWORD ErrorCode;
  69. DWORD Reserved[3];
  70. } FAX_DEV_STATUS, *PFAX_DEV_STATUS;
  71. typedef BOOL
  72. (CALLBACK *PFAX_SERVICE_CALLBACK)(
  73. IN HANDLE FaxHandle,
  74. IN DWORD DeviceId,
  75. IN DWORD_PTR Param1,
  76. IN DWORD_PTR Param2,
  77. IN DWORD_PTR Param3
  78. );
  79. typedef void
  80. (CALLBACK *PFAX_LINECALLBACK)(
  81. IN HANDLE FaxHandle,
  82. IN DWORD hDevice,
  83. IN DWORD dwMessage,
  84. IN DWORD_PTR dwInstance,
  85. IN DWORD_PTR dwParam1,
  86. IN DWORD_PTR dwParam2,
  87. IN DWORD_PTR dwParam3
  88. );
  89. BOOL WINAPI
  90. FaxDevInitialize(
  91. IN HLINEAPP LineAppHandle,
  92. IN HANDLE HeapHandle,
  93. OUT PFAX_LINECALLBACK *LineCallbackFunction,
  94. IN PFAX_SERVICE_CALLBACK FaxServiceCallback
  95. );
  96. HRESULT WINAPI FaxDevShutdown(
  97. void
  98. );
  99. BOOL WINAPI
  100. FaxDevVirtualDeviceCreation(
  101. OUT LPDWORD DeviceCount,
  102. OUT LPWSTR DeviceNamePrefix,
  103. OUT LPDWORD DeviceIdPrefix,
  104. IN HANDLE CompletionPort,
  105. IN ULONG_PTR CompletionKey
  106. );
  107. BOOL WINAPI
  108. FaxDevStartJob(
  109. IN HLINE LineHandle,
  110. IN DWORD DeviceId,
  111. OUT PHANDLE FaxHandle,
  112. IN HANDLE CompletionPortHandle,
  113. IN ULONG_PTR CompletionKey
  114. );
  115. BOOL WINAPI
  116. FaxDevEndJob(
  117. IN HANDLE FaxHandle
  118. );
  119. typedef BOOL
  120. (CALLBACK *PFAX_SEND_CALLBACK)(
  121. IN HANDLE FaxHandle,
  122. IN HCALL CallHandle,
  123. IN DWORD Reserved1,
  124. IN DWORD Reserved2
  125. );
  126. BOOL WINAPI
  127. FaxDevSend(
  128. IN HANDLE FaxHandle,
  129. IN PFAX_SEND FaxSend,
  130. IN PFAX_SEND_CALLBACK FaxSendCallback
  131. );
  132. #define FAXDEVRECEIVE_SIZE 4096
  133. BOOL WINAPI
  134. FaxDevReceive(
  135. IN HANDLE FaxHandle,
  136. IN HCALL CallHandle,
  137. IN OUT PFAX_RECEIVE FaxReceive
  138. );
  139. #define FAXDEVREPORTSTATUS_SIZE 4096
  140. BOOL WINAPI
  141. FaxDevReportStatus(
  142. IN HANDLE FaxHandle OPTIONAL,
  143. OUT PFAX_DEV_STATUS FaxStatus,
  144. IN DWORD FaxStatusSize,
  145. OUT LPDWORD FaxStatusSizeRequired
  146. );
  147. BOOL WINAPI
  148. FaxDevAbortOperation(
  149. IN HANDLE FaxHandle
  150. );
  151. BOOL WINAPI
  152. FaxDevConfigure(
  153. OUT HPROPSHEETPAGE *PropSheetPage
  154. );
  155. typedef BOOL (WINAPI *PFAXDEVINITIALIZE) (HLINEAPP,HANDLE,PFAX_LINECALLBACK*,PFAX_SERVICE_CALLBACK);
  156. typedef BOOL (WINAPI *PFAXDEVVIRTUALDEVICECREATION) (LPDWORD,LPWSTR,LPDWORD,HANDLE,ULONG_PTR);
  157. typedef BOOL (WINAPI *PFAXDEVSTARTJOB) (HLINE,DWORD,PHANDLE,HANDLE,ULONG_PTR);
  158. typedef BOOL (WINAPI *PFAXDEVENDJOB) (HANDLE);
  159. typedef BOOL (WINAPI *PFAXDEVSEND) (HANDLE,PFAX_SEND,PFAX_SEND_CALLBACK);
  160. typedef BOOL (WINAPI *PFAXDEVRECEIVE) (HANDLE,HCALL,PFAX_RECEIVE);
  161. typedef BOOL (WINAPI *PFAXDEVREPORTSTATUS) (HANDLE,PFAX_DEV_STATUS,DWORD,LPDWORD);
  162. typedef BOOL (WINAPI *PFAXDEVABORTOPERATION) (HANDLE);
  163. typedef BOOL (WINAPI *PFAXDEVCONFIGURE) (HPROPSHEETPAGE*);
  164. typedef HRESULT (WINAPI * PFAXDEVSHUTDOWN) (void);
  165. #ifdef __cplusplus
  166. }
  167. #endif
  168. #endif