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.

2036 lines
57 KiB

  1. /* CFaxApiFunctionInfo class implementation file. */
  2. #include "StdAfx.h"
  3. #include "function.h"
  4. #include "param.h"
  5. extern "C" {
  6. #include "winfax.h"
  7. }
  8. /*
  9. * CFaxApiFunctionInfo
  10. *
  11. * Purpose:
  12. * This function constructs a CFaxApiFunctionInfo object.
  13. *
  14. * Arguments:
  15. * None
  16. *
  17. * Returns:
  18. * None
  19. *
  20. */
  21. CFaxApiFunctionInfo::CFaxApiFunctionInfo()
  22. {
  23. m_pvReturnValue = (void *) NULL;
  24. }
  25. /*
  26. * CFaxApiFunctionInfo
  27. *
  28. * Purpose:
  29. * This function constructs a CFaxApiFunctionInfo object and
  30. * inititalzes the function name member.
  31. *
  32. * Arguments:
  33. * rcsFunctionName - a reference to a CString that contains the
  34. * Fax API Function name.
  35. * rcsFunctionPrototype - a reference to a CString that contains
  36. * the function prototype
  37. * rcsReturnType - a reference to a CString that contains the
  38. * type of the return value
  39. * rcsReturnValueDescription - a reference to a CString that contains
  40. * a textual description of the return value
  41. *
  42. * Returns:
  43. * None
  44. *
  45. */
  46. CFaxApiFunctionInfo::CFaxApiFunctionInfo( const CString & rcsFunctionName,
  47. const CString & rcsFunctionPrototype,
  48. const CString & rcsReturnType,
  49. const CString & rcsReturnValueDescription,
  50. const CString & rcsRemarks )
  51. {
  52. m_csFunctionName = rcsFunctionName;
  53. m_eFunctionIndex = GetFunctionIndexEnum( rcsFunctionName );
  54. m_csFunctionPrototype = rcsFunctionPrototype;
  55. m_csReturnType = rcsReturnType;
  56. m_csReturnValueDescription = rcsReturnValueDescription;
  57. m_csRemarks = rcsRemarks;
  58. m_pvReturnValue = AllocateStorageForReturnValue( rcsReturnType );
  59. /* Initialize the CFaxApiFunctionParameterInfo object member. */
  60. m_cParameterInfo.InitParameterInfoMember( rcsFunctionName );
  61. }
  62. /*
  63. * ~CFaxApiFunctionInfo
  64. *
  65. * Purpose:
  66. * This function destroys a CFaxApiFunctionInfo object.
  67. *
  68. * Arguments:
  69. * None
  70. *
  71. * Returns:
  72. * None
  73. *
  74. */
  75. CFaxApiFunctionInfo::~CFaxApiFunctionInfo()
  76. {
  77. if ( m_pvReturnValue != (void *) NULL )
  78. {
  79. delete m_pvReturnValue;
  80. }
  81. }
  82. /*
  83. * AllocateStorageForReturnValue
  84. *
  85. * Purpose:
  86. * This function allocates (via the new operator) storage for
  87. * The Fax API function's return value.
  88. *
  89. * Arguments:
  90. * rcsReturnType - a reference to a CString that contains the
  91. * type of the return value.
  92. *
  93. * Returns:
  94. * a pointer to the storage for the Fax API function return value.
  95. *
  96. */
  97. void * CFaxApiFunctionInfo::AllocateStorageForReturnValue( const CString & rcsReturnType )
  98. {
  99. void * pvReturnValue;
  100. /* At this time (6/03/97) there are two return types for all Fax API */
  101. /* functions: BOOL and VOID. */
  102. if ( rcsReturnType.Compare( (LPCTSTR) TEXT("BOOL") ) == 0 )
  103. {
  104. /* The return type is BOOL. */
  105. pvReturnValue = (void *) new BOOL;
  106. }
  107. else
  108. {
  109. if ( rcsReturnType.CompareNoCase( (LPCTSTR) TEXT("VOID") ) == 0 )
  110. {
  111. /* The return type is VOID. */
  112. pvReturnValue = (void *) NULL;
  113. }
  114. else
  115. {
  116. /* The return type is not recognized. */
  117. CString csMessage;
  118. csMessage.Format( TEXT("%s is an unrecognized datatype in AllocateStorageForReturnValue"),
  119. rcsReturnType );
  120. AfxMessageBox( csMessage );
  121. }
  122. }
  123. return ( pvReturnValue );
  124. }
  125. /*
  126. * SetFunctionName
  127. *
  128. * Purpose:
  129. * This function sets the m_csFunctionName member of a
  130. * CFaxApiFunctionInfo object.
  131. *
  132. * Arguments:
  133. * rcsFunctionName - a reference to a CString that contains the
  134. * function name.
  135. *
  136. * Returns:
  137. * None
  138. *
  139. */
  140. void CFaxApiFunctionInfo::SetFunctionName( CString & rcsFunctionName )
  141. {
  142. m_csFunctionName = rcsFunctionName;
  143. }
  144. /*
  145. * GetFunctionName
  146. *
  147. * Purpose:
  148. * This function retrieves the contents of the m_csFunctionName
  149. * member of a CFaxApiFunctionInfo object.
  150. *
  151. * Arguments:
  152. * None
  153. *
  154. * Returns:
  155. * A reference to a CString which contains the function name
  156. *
  157. */
  158. CString & CFaxApiFunctionInfo::GetFunctionName()
  159. {
  160. return ( (CString &) m_csFunctionName );
  161. }
  162. /*
  163. * GetFunctionPrototype
  164. *
  165. * Purpose:
  166. * This function retrieves the contents of the m_csFunctionPrototype
  167. * member of a CFaxApiFunctionInfo object.
  168. *
  169. * Arguments:
  170. * None
  171. *
  172. * Returns:
  173. * A reference to a CString which contains the function prototype
  174. *
  175. */
  176. CString & CFaxApiFunctionInfo::GetFunctionPrototype()
  177. {
  178. return ( (CString &) m_csFunctionPrototype );
  179. }
  180. /*
  181. * GetFunctionReturnValueDescription
  182. *
  183. * Purpose:
  184. * This function retrieves the contents of the m_csReturnValueDescription
  185. * member of a CFaxApiFunctionInfo object.
  186. *
  187. * Arguments:
  188. * None
  189. *
  190. * Returns:
  191. * A reference to a CString which contains the textual description
  192. * of the value returned by a Fax API function.
  193. *
  194. */
  195. CString & CFaxApiFunctionInfo::GetReturnValueDescription()
  196. {
  197. return ( (CString &) m_csReturnValueDescription );
  198. }
  199. /*
  200. * GetRemarks
  201. *
  202. * Purpose:
  203. * This function retrieves the contents of the m_csRemarks member of
  204. * the CFaxApiFunctionInfo object.
  205. *
  206. * Arguments:
  207. * None
  208. *
  209. * Returns:
  210. * A reference to a CString which contains the "remarks" for a Fax API
  211. * function.
  212. *
  213. */
  214. CString & CFaxApiFunctionInfo::GetRemarks()
  215. {
  216. return ( (CString &) m_csRemarks );
  217. }
  218. /*
  219. * GetParameterName
  220. *
  221. * Purpose:
  222. * This function retrieves the name of a parameter for a Fax API function.
  223. *
  224. * Arguments:
  225. * xParameterIndex = the index to the parameter name
  226. * rcsParameterName - a reference to a CString to receive the parameter
  227. * name.
  228. *
  229. * Returns:
  230. * None
  231. *
  232. */
  233. void CFaxApiFunctionInfo::GetParameterName( int xParameterIndex, CString & rcsParameterName )
  234. {
  235. rcsParameterName = m_cParameterInfo.GetParameterName( xParameterIndex );
  236. }
  237. /*
  238. * GetNumberOfParameters
  239. *
  240. * Purpose:
  241. * This functions retrieves the number of parameters listed int the
  242. * m_cParameterInfo member of the CFaxApiFuntionInfo object.
  243. *
  244. * Arguments:
  245. * None
  246. *
  247. * Returns:
  248. * The number of parameters
  249. *
  250. */
  251. int CFaxApiFunctionInfo::GetNumberOfParameters()
  252. {
  253. int xNumberOfParameters;
  254. xNumberOfParameters = m_cParameterInfo.GetNumberOfParameters();
  255. return ( xNumberOfParameters );
  256. }
  257. /*
  258. * GetParameterValuePointer
  259. *
  260. * Purpose:
  261. * This function retrieves a pointer to the storage for the parameter
  262. * value member of the CFaxApiFunctionParameterInfo obmect member of
  263. * the CFaxApiFunctionInfo object.
  264. *
  265. * Arguments:
  266. * xParameterIndex = the index into the CPtrArray object to the element
  267. * that points to the storage for the parameerd value.
  268. *
  269. * Returns:
  270. * a pointer to the storage for the parameter value.
  271. *
  272. */
  273. void * CFaxApiFunctionInfo::GetParameterValuePointer( int xParameterIndex )
  274. {
  275. void * pvParameterValue;
  276. pvParameterValue = m_cParameterInfo.GetParameterValuePointer( xParameterIndex );
  277. return ( pvParameterValue );
  278. }
  279. /*
  280. * FormatParameterValueForOutput
  281. *
  282. * Purpose:
  283. * This function prepares a CString representation of the parameter
  284. * value whose index is xParameterIndex.
  285. *
  286. * Arguments:
  287. * xParameterIndex = the index to the parameter value to be output.
  288. * rcsParameterValue - a reference to the CString to receive the string
  289. * representation of th parameter value.
  290. *
  291. * Returns:
  292. * None
  293. *
  294. */
  295. void CFaxApiFunctionInfo::FormatParameterValueForOutput( int xParameterIndex, CString & rcsParameterValue )
  296. {
  297. m_cParameterInfo.FormatParameterValueForOutput( xParameterIndex, rcsParameterValue );
  298. }
  299. /*
  300. * StoreParameterValue
  301. *
  302. * Purpose:
  303. * This function stores the value contained in a CSting in the storage
  304. * location for the parameter value indexed by xParameterIndex.
  305. *
  306. * Arguments:
  307. * xParameterIndex - the index to the pointer to the storage for a
  308. * parameer value.
  309. * rcsParameterValue - a reference to a CString that contains a
  310. * representation of the value to be stored.
  311. *
  312. * Returns:
  313. * TRUE - indicates success
  314. * FALSE - indicates failure
  315. *
  316. */
  317. BOOL CFaxApiFunctionInfo::StoreParameterValue( int xParameterIndex, const CString & rcsParameterValue )
  318. {
  319. BOOL fReturnValue;
  320. fReturnValue = m_cParameterInfo.StoreParameterValue( xParameterIndex,
  321. (CString &) rcsParameterValue );
  322. return ( fReturnValue );
  323. }
  324. /*
  325. * GetMaxParamValueStringLength
  326. *
  327. * Purpose:
  328. * This function computer the maximum number of characters that
  329. * may be required to represent a data entity.
  330. *
  331. * Arguments:
  332. * xParameterIndex = the index into the m_cParameterInfo data member
  333. *
  334. * Returns:
  335. * The maximum number of characters that may be required to represent
  336. * the parameter whose index is xParameterIndex.
  337. *
  338. * Note:
  339. * Two characters are required to represent a byte.
  340. *
  341. */
  342. int CFaxApiFunctionInfo::GetMaxParamValueStringLength( int xParameterIndex )
  343. {
  344. int xMaxParamValueStringLength;
  345. eParamType eParameterType;
  346. eParameterType = m_cParameterInfo.GetParameterTypeEnum( xParameterIndex );
  347. switch ( eParameterType )
  348. {
  349. case eBOOL:
  350. xMaxParamValueStringLength = 2 * (int) sizeof( BOOL );
  351. break;
  352. case eDWORD:
  353. xMaxParamValueStringLength = 2 * (int) sizeof( DWORD );
  354. break;
  355. case eHANDLE:
  356. xMaxParamValueStringLength = 2 * (int) sizeof( HANDLE );
  357. break;
  358. case eHDC:
  359. xMaxParamValueStringLength = 2 * (int) sizeof( HDC );
  360. break;
  361. case ePHDC:
  362. xMaxParamValueStringLength = 2 * (int) sizeof( HDC * );
  363. break;
  364. case eLPBYTE:
  365. xMaxParamValueStringLength = 2 * (int) sizeof( LPBYTE );
  366. break;
  367. case ePLPBYTE:
  368. xMaxParamValueStringLength = 2 * (int) sizeof( LPBYTE * );
  369. break;
  370. case eLPDWORD:
  371. xMaxParamValueStringLength = 2 * (int) sizeof( LPDWORD );
  372. break;
  373. case eLPHANDLE:
  374. xMaxParamValueStringLength = 2 * (int) sizeof( LPHANDLE );
  375. break;
  376. case eLPSTR:
  377. /* Strings are a special case defined by MAX_PARAM_VALUE_STRING_LENGTH. */
  378. xMaxParamValueStringLength = MAX_PARAM_VALUE_STRING_LENGTH;
  379. break;
  380. case eLPVOID:
  381. xMaxParamValueStringLength = 2 * (int) sizeof( LPVOID );
  382. break;
  383. case eLPWSTR:
  384. /* Strings are a special case defined by MAX_PARAM_VALUE_STRING_LENGTH. */
  385. xMaxParamValueStringLength = MAX_PARAM_VALUE_STRING_LENGTH;
  386. break;
  387. case ePFAX_CONFIGURATIONA:
  388. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_CONFIGURATIONA );
  389. break;
  390. case ePPFAX_CONFIGURATIONA:
  391. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_CONFIGURATIONA * );
  392. break;
  393. case ePFAX_CONFIGURATIONW:
  394. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_CONFIGURATIONW );
  395. break;
  396. case ePPFAX_CONFIGURATIONW:
  397. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_CONFIGURATIONW * );
  398. break;
  399. case ePFAX_COVERPAGE_INFOA:
  400. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_COVERPAGE_INFOA );
  401. break;
  402. case ePFAX_COVERPAGE_INFOW:
  403. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_COVERPAGE_INFOW );
  404. break;
  405. case ePFAX_JOB_PARAMA:
  406. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_JOB_PARAMA );
  407. break;
  408. case ePFAX_JOB_PARAMW:
  409. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_JOB_PARAMW );
  410. break;
  411. case ePFAX_PRINT_INFOA:
  412. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_PRINT_INFOA );
  413. break;
  414. case ePFAX_PRINT_INFOW:
  415. xMaxParamValueStringLength = 2 * (int) sizeof( PFAX_PRINT_INFOW );
  416. break;
  417. default:
  418. xMaxParamValueStringLength = 0;
  419. }
  420. return ( xMaxParamValueStringLength );
  421. }
  422. /*
  423. * GetParameterTypeEnum
  424. *
  425. * Purpose:
  426. * This function retrieves the enum that indicates the type of the
  427. * parameter.
  428. *
  429. * Arguments:
  430. * xParameter index - the index to the parameter
  431. *
  432. * Returns:
  433. * the enum that indicates the data type of the paraameter indexed
  434. * by xParameterIndex.
  435. *
  436. */
  437. eParamType CFaxApiFunctionInfo::GetParameterTypeEnum( int xParameterIndex )
  438. {
  439. eParamType eParameterType;
  440. eParameterType = m_cParameterInfo.GetParameterTypeEnum( xParameterIndex );
  441. return ( eParameterType );
  442. }
  443. /*
  444. * GetParameterTypeString
  445. *
  446. * Purpose:
  447. * This functio retrieves a string that indicates the type of the
  448. * parameter.
  449. *
  450. * Arguments:
  451. * xParameter index - the index to the parameter
  452. *
  453. * Returns:
  454. * the CString that indicates the data type of the paraameter indexed
  455. * by xParameterIndex.
  456. *
  457. */
  458. CString CFaxApiFunctionInfo::GetParameterTypeString( int xParameterIndex )
  459. {
  460. CString csParameterType;
  461. csParameterType = m_cParameterInfo.GetParameterTypeString( xParameterIndex );
  462. return ( csParameterType );
  463. }
  464. /*
  465. * GetParameterDescription
  466. *
  467. * Purpose:
  468. * This function retrieves the description of a parameter to a
  469. * Fax API function.
  470. *
  471. * Arguments:
  472. * xParameter index - the index to the parameter
  473. *
  474. * Returns:
  475. * A CString that contains the description of a parameter to a
  476. * Fax API function.
  477. *
  478. */
  479. CString CFaxApiFunctionInfo::GetParameterDescription( int xParameterIndex )
  480. {
  481. CString csParameterDescription;
  482. csParameterDescription = m_cParameterInfo.GetParameterDescription( xParameterIndex );
  483. return ( csParameterDescription );
  484. }
  485. /*
  486. * FormatReturnValueForOutput
  487. *
  488. * Purpose:
  489. * This function formats the return value for the selected function
  490. * for output.
  491. *
  492. * Arguments:
  493. * rcsReturnValue - a reference to a CString to receive the formatted
  494. * representation of the return value.
  495. *
  496. * Returns:
  497. * None
  498. *
  499. */
  500. void CFaxApiFunctionInfo::FormatReturnValueForOutput( CString & rcsReturnValue )
  501. {
  502. /* At this time (6/03/97) there are two return types for all Fax API */
  503. /* functions: BOOL and VOID. */
  504. if ( m_csReturnType.Compare( (LPCTSTR) TEXT("BOOL") ) == 0 )
  505. {
  506. /* The return type is BOOL. */
  507. BOOL * pfReturnValue;
  508. pfReturnValue = (BOOL *) m_pvReturnValue;
  509. if ( *pfReturnValue == (BOOL) FALSE )
  510. {
  511. rcsReturnValue = (CString) TEXT("FALSE");
  512. }
  513. else
  514. {
  515. rcsReturnValue = (CString) TEXT("TRUE");
  516. }
  517. }
  518. else
  519. {
  520. if ( m_csReturnType.CompareNoCase( (LPCTSTR) TEXT("VOID") ) == 0 )
  521. {
  522. /* The return type is VOID. */
  523. rcsReturnValue = (CString) TEXT("void");
  524. }
  525. else
  526. {
  527. /* The return type is not recognized. */
  528. CString csMessage;
  529. csMessage.Format( TEXT("%s is an unrecognized datatype in FormatReturnTypeForOutput"),
  530. m_csReturnType );
  531. AfxMessageBox( csMessage );
  532. }
  533. }
  534. }
  535. /*
  536. * Execute
  537. *
  538. * Purpose:
  539. * This function executes the selected Fax API function and updates
  540. * output edit control and the return value edit control.
  541. *
  542. * Arguments:
  543. * None
  544. *
  545. * Returns:
  546. * None
  547. *
  548. */
  549. void CFaxApiFunctionInfo::Execute()
  550. {
  551. switch ( m_eFunctionIndex )
  552. {
  553. case eFaxAbort:
  554. {
  555. void * pvParameterValue1;
  556. void * pvParameterValue2;
  557. pvParameterValue1 = GetParameterValuePointer( 0 );
  558. pvParameterValue2 = GetParameterValuePointer( 1 );
  559. BOOL fReturnValue;
  560. fReturnValue = FaxAbort( (HANDLE) *((HANDLE *)pvParameterValue1),
  561. (DWORD) *((DWORD * )pvParameterValue2) );
  562. *((BOOL *) m_pvReturnValue) = fReturnValue;
  563. }
  564. break;
  565. case eFaxClose:
  566. {
  567. void * pvParameterValue;
  568. pvParameterValue = GetParameterValuePointer( 0 );
  569. BOOL fReturnValue;
  570. fReturnValue = FaxClose( (HANDLE) *((HANDLE *)pvParameterValue) );
  571. *((BOOL *) m_pvReturnValue) = fReturnValue;
  572. }
  573. break;
  574. case eFaxConnectFaxServerA:
  575. {
  576. void * pvParameterValue0;
  577. void * pvParameterValue1;
  578. pvParameterValue0 = GetParameterValuePointer ( 0 );
  579. pvParameterValue1 = GetParameterValuePointer ( 1 );
  580. BOOL fReturnValue;
  581. fReturnValue = FaxConnectFaxServerA( (LPSTR) *((LPSTR *) pvParameterValue0),
  582. (LPHANDLE) *((LPHANDLE *) pvParameterValue1) );
  583. *((BOOL *) m_pvReturnValue) = fReturnValue;
  584. }
  585. break;
  586. case eFaxConnectFaxServerW:
  587. {
  588. void * pvParameterValue0;
  589. void * pvParameterValue1;
  590. pvParameterValue0 = GetParameterValuePointer ( 0 );
  591. pvParameterValue1 = GetParameterValuePointer ( 1 );
  592. BOOL fReturnValue;
  593. fReturnValue = FaxConnectFaxServerW( (LPWSTR) *((LPWSTR *) pvParameterValue0),
  594. (LPHANDLE) *((LPHANDLE *) pvParameterValue1) );
  595. *((BOOL *) m_pvReturnValue) = fReturnValue;
  596. }
  597. break;
  598. case eFaxEnableRoutingMethodA:
  599. {
  600. void * pvParameterValue0;
  601. void * pvParameterValue1;
  602. void * pvParameterValue2;
  603. pvParameterValue0 = GetParameterValuePointer ( 0 );
  604. pvParameterValue1 = GetParameterValuePointer ( 1 );
  605. pvParameterValue2 = GetParameterValuePointer ( 2 );
  606. BOOL fReturnValue;
  607. fReturnValue = FaxEnableRoutingMethodA( (HANDLE) *((HANDLE *) pvParameterValue0),
  608. (LPSTR) *((LPSTR *) pvParameterValue1),
  609. (BOOL) *((BOOL *) pvParameterValue2) );
  610. *((BOOL *) m_pvReturnValue) = fReturnValue;
  611. }
  612. break;
  613. case eFaxEnableRoutingMethodW:
  614. {
  615. void * pvParameterValue0;
  616. void * pvParameterValue1;
  617. void * pvParameterValue2;
  618. pvParameterValue0 = GetParameterValuePointer ( 0 );
  619. pvParameterValue1 = GetParameterValuePointer ( 1 );
  620. pvParameterValue2 = GetParameterValuePointer ( 2 );
  621. BOOL fReturnValue;
  622. fReturnValue = FaxEnableRoutingMethodW( (HANDLE) *((HANDLE *) pvParameterValue0),
  623. (LPWSTR) *((LPWSTR *) pvParameterValue1),
  624. (BOOL) *((BOOL *) pvParameterValue2) );
  625. *((BOOL *) m_pvReturnValue) = fReturnValue;
  626. }
  627. break;
  628. case eFaxEnumJobsA:
  629. {
  630. void * pvParameterValue0;
  631. void * pvParameterValue1;
  632. void * pvParameterValue2;
  633. pvParameterValue0 = GetParameterValuePointer ( 0 );
  634. pvParameterValue1 = GetParameterValuePointer ( 1 );
  635. pvParameterValue2 = GetParameterValuePointer ( 2 );
  636. BOOL fReturnValue;
  637. fReturnValue = FaxEnumJobsA( (HANDLE) *((HANDLE *) pvParameterValue0),
  638. (PFAX_JOB_ENTRYA *) *((PFAX_JOB_ENTRYA * *) pvParameterValue1),
  639. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  640. *((BOOL *) m_pvReturnValue) = fReturnValue;
  641. }
  642. break;
  643. case eFaxEnumJobsW:
  644. {
  645. void * pvParameterValue0;
  646. void * pvParameterValue1;
  647. void * pvParameterValue2;
  648. pvParameterValue0 = GetParameterValuePointer ( 0 );
  649. pvParameterValue1 = GetParameterValuePointer ( 1 );
  650. pvParameterValue2 = GetParameterValuePointer ( 2 );
  651. BOOL fReturnValue;
  652. fReturnValue = FaxEnumJobsW( (HANDLE) *((HANDLE *) pvParameterValue0),
  653. (PFAX_JOB_ENTRYW *) *((PFAX_JOB_ENTRYW * *) pvParameterValue1),
  654. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  655. *((BOOL *) m_pvReturnValue) = fReturnValue;
  656. }
  657. break;
  658. case eFaxEnumPortsA:
  659. {
  660. void * pvParameterValue0;
  661. void * pvParameterValue1;
  662. void * pvParameterValue2;
  663. pvParameterValue0 = GetParameterValuePointer ( 0 );
  664. pvParameterValue1 = GetParameterValuePointer ( 1 );
  665. pvParameterValue2 = GetParameterValuePointer ( 2 );
  666. BOOL fReturnValue;
  667. fReturnValue = FaxEnumPortsA( (HANDLE) *((HANDLE *) pvParameterValue0),
  668. (PFAX_PORT_INFOA *) *((PFAX_PORT_INFOA * *) pvParameterValue1),
  669. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  670. *((BOOL *) m_pvReturnValue) = fReturnValue;
  671. }
  672. break;
  673. case eFaxEnumPortsW:
  674. {
  675. void * pvParameterValue0;
  676. void * pvParameterValue1;
  677. void * pvParameterValue2;
  678. pvParameterValue0 = GetParameterValuePointer ( 0 );
  679. pvParameterValue1 = GetParameterValuePointer ( 1 );
  680. pvParameterValue2 = GetParameterValuePointer ( 2 );
  681. BOOL fReturnValue;
  682. fReturnValue = FaxEnumPortsW( (HANDLE) *((HANDLE *) pvParameterValue0),
  683. (PFAX_PORT_INFOW *) *((PFAX_PORT_INFOW * *) pvParameterValue1),
  684. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  685. *((BOOL *) m_pvReturnValue) = fReturnValue;
  686. }
  687. break;
  688. case eFaxEnumRoutingMethodsA:
  689. {
  690. void * pvParameterValue0;
  691. void * pvParameterValue1;
  692. void * pvParameterValue2;
  693. pvParameterValue0 = GetParameterValuePointer ( 0 );
  694. pvParameterValue1 = GetParameterValuePointer ( 1 );
  695. pvParameterValue2 = GetParameterValuePointer ( 2 );
  696. BOOL fReturnValue;
  697. fReturnValue = FaxEnumRoutingMethodsA( (HANDLE) *((HANDLE *) pvParameterValue0),
  698. (PFAX_ROUTING_METHODA *) *((PFAX_ROUTING_METHODA * *) pvParameterValue1),
  699. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  700. *((BOOL *) m_pvReturnValue) = fReturnValue;
  701. }
  702. break;
  703. case eFaxEnumRoutingMethodsW:
  704. {
  705. void * pvParameterValue0;
  706. void * pvParameterValue1;
  707. void * pvParameterValue2;
  708. pvParameterValue0 = GetParameterValuePointer ( 0 );
  709. pvParameterValue1 = GetParameterValuePointer ( 1 );
  710. pvParameterValue2 = GetParameterValuePointer ( 2 );
  711. BOOL fReturnValue;
  712. fReturnValue = FaxEnumRoutingMethodsW( (HANDLE) *((HANDLE *) pvParameterValue0),
  713. (PFAX_ROUTING_METHODW *) *((PFAX_ROUTING_METHODW * *) pvParameterValue1),
  714. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  715. *((BOOL *) m_pvReturnValue) = fReturnValue;
  716. }
  717. break;
  718. case eFaxFreeBuffer:
  719. {
  720. void * pvParameterValue;
  721. pvParameterValue = GetParameterValuePointer( 0 );
  722. FaxFreeBuffer( (LPVOID) *((LPVOID *)pvParameterValue) );
  723. }
  724. break;
  725. case eFaxGetConfigurationA:
  726. {
  727. void * pvParameterValue0;
  728. void * pvParameterValue1;
  729. pvParameterValue0 = GetParameterValuePointer ( 0 );
  730. pvParameterValue1 = GetParameterValuePointer ( 1 );
  731. BOOL fReturnValue;
  732. fReturnValue = FaxGetConfigurationA( (HANDLE) *((HANDLE *) pvParameterValue0),
  733. (PFAX_CONFIGURATIONA *) *((PFAX_CONFIGURATIONA * *) pvParameterValue1) );
  734. *((BOOL *) m_pvReturnValue) = fReturnValue;
  735. }
  736. break;
  737. case eFaxGetConfigurationW:
  738. {
  739. void * pvParameterValue0;
  740. void * pvParameterValue1;
  741. pvParameterValue0 = GetParameterValuePointer ( 0 );
  742. pvParameterValue1 = GetParameterValuePointer ( 1 );
  743. BOOL fReturnValue;
  744. fReturnValue = FaxGetConfigurationW( (HANDLE) *((HANDLE *) pvParameterValue0),
  745. (PFAX_CONFIGURATIONW *) *((PFAX_CONFIGURATIONW * *) pvParameterValue1) );
  746. *((BOOL *) m_pvReturnValue) = fReturnValue;
  747. }
  748. break;
  749. case eFaxGetDeviceStatusA:
  750. {
  751. void * pvParameterValue0;
  752. void * pvParameterValue1;
  753. pvParameterValue0 = GetParameterValuePointer ( 0 );
  754. pvParameterValue1 = GetParameterValuePointer ( 1 );
  755. BOOL fReturnValue;
  756. fReturnValue = FaxGetDeviceStatusA( (HANDLE) *((HANDLE *) pvParameterValue0),
  757. (PFAX_DEVICE_STATUSA *) *((PFAX_DEVICE_STATUSA * *) pvParameterValue1) );
  758. *((BOOL *) m_pvReturnValue) = fReturnValue;
  759. }
  760. break;
  761. case eFaxGetDeviceStatusW:
  762. {
  763. void * pvParameterValue0;
  764. void * pvParameterValue1;
  765. pvParameterValue0 = GetParameterValuePointer ( 0 );
  766. pvParameterValue1 = GetParameterValuePointer ( 1 );
  767. BOOL fReturnValue;
  768. fReturnValue = FaxGetDeviceStatusW( (HANDLE) *((HANDLE *) pvParameterValue0),
  769. (PFAX_DEVICE_STATUSW *) *((PFAX_DEVICE_STATUSW * *) pvParameterValue1) );
  770. *((BOOL *) m_pvReturnValue) = fReturnValue;
  771. }
  772. break;
  773. case eFaxGetJobA:
  774. {
  775. void * pvParameterValue0;
  776. void * pvParameterValue1;
  777. void * pvParameterValue2;
  778. pvParameterValue0 = GetParameterValuePointer ( 0 );
  779. pvParameterValue1 = GetParameterValuePointer ( 1 );
  780. pvParameterValue2 = GetParameterValuePointer ( 2 );
  781. BOOL fReturnValue;
  782. fReturnValue = FaxGetJobA( (HANDLE) *((HANDLE *) pvParameterValue0),
  783. (DWORD) *((DWORD *) pvParameterValue1),
  784. (PFAX_JOB_ENTRYA *) *((PFAX_JOB_ENTRYA * *) pvParameterValue2) );
  785. *((BOOL *) m_pvReturnValue) = fReturnValue;
  786. }
  787. break;
  788. case eFaxGetJobW:
  789. {
  790. void * pvParameterValue0;
  791. void * pvParameterValue1;
  792. void * pvParameterValue2;
  793. pvParameterValue0 = GetParameterValuePointer ( 0 );
  794. pvParameterValue1 = GetParameterValuePointer ( 1 );
  795. pvParameterValue2 = GetParameterValuePointer ( 2 );
  796. BOOL fReturnValue;
  797. fReturnValue = FaxGetJobW( (HANDLE) *((HANDLE *) pvParameterValue0),
  798. (DWORD) *((DWORD *) pvParameterValue1),
  799. (PFAX_JOB_ENTRYW *) *((PFAX_JOB_ENTRYW * *) pvParameterValue2) );
  800. *((BOOL *) m_pvReturnValue) = fReturnValue;
  801. }
  802. break;
  803. case eFaxGetLoggingCategoriesA:
  804. {
  805. void * pvParameterValue0;
  806. void * pvParameterValue1;
  807. void * pvParameterValue2;
  808. pvParameterValue0 = GetParameterValuePointer ( 0 );
  809. pvParameterValue1 = GetParameterValuePointer ( 1 );
  810. pvParameterValue2 = GetParameterValuePointer ( 2 );
  811. BOOL fReturnValue;
  812. fReturnValue = FaxGetLoggingCategoriesA( (HANDLE) *((HANDLE *) pvParameterValue0),
  813. (PFAX_LOG_CATEGORY *) *((PFAX_LOG_CATEGORY * *) pvParameterValue1),
  814. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  815. *((BOOL *) m_pvReturnValue) = fReturnValue;
  816. }
  817. break;
  818. case eFaxGetLoggingCategoriesW:
  819. {
  820. void * pvParameterValue0;
  821. void * pvParameterValue1;
  822. void * pvParameterValue2;
  823. pvParameterValue0 = GetParameterValuePointer ( 0 );
  824. pvParameterValue1 = GetParameterValuePointer ( 1 );
  825. pvParameterValue2 = GetParameterValuePointer ( 2 );
  826. BOOL fReturnValue;
  827. fReturnValue = FaxGetLoggingCategoriesW( (HANDLE) *((HANDLE *) pvParameterValue0),
  828. (PFAX_LOG_CATEGORY *) *((PFAX_LOG_CATEGORY * *) pvParameterValue1),
  829. (LPDWORD) *((LPDWORD *) pvParameterValue2) );
  830. *((BOOL *) m_pvReturnValue) = fReturnValue;
  831. }
  832. break;
  833. case eFaxGetPageData:
  834. {
  835. void * pvParameterValue0;
  836. void * pvParameterValue1;
  837. void * pvParameterValue2;
  838. void * pvParameterValue3;
  839. void * pvParameterValue4;
  840. void * pvParameterValue5;
  841. pvParameterValue0 = GetParameterValuePointer ( 0 );
  842. pvParameterValue1 = GetParameterValuePointer ( 1 );
  843. pvParameterValue2 = GetParameterValuePointer ( 2 );
  844. pvParameterValue3 = GetParameterValuePointer ( 3 );
  845. pvParameterValue4 = GetParameterValuePointer ( 4 );
  846. pvParameterValue5 = GetParameterValuePointer ( 5 );
  847. BOOL fReturnValue;
  848. fReturnValue = FaxGetPageData( (HANDLE) *((HANDLE *) pvParameterValue0),
  849. (DWORD) *((DWORD *) pvParameterValue1),
  850. (LPBYTE *) *((LPBYTE * *) pvParameterValue2),
  851. (LPDWORD) *((LPDWORD *) pvParameterValue3),
  852. (LPDWORD) *((LPDWORD *) pvParameterValue4),
  853. (LPDWORD) *((LPDWORD *) pvParameterValue5) );
  854. *((BOOL *) m_pvReturnValue) = fReturnValue;
  855. }
  856. break;
  857. case eFaxGetPortA:
  858. {
  859. void * pvParameterValue0;
  860. void * pvParameterValue1;
  861. pvParameterValue0 = GetParameterValuePointer ( 0 );
  862. pvParameterValue1 = GetParameterValuePointer ( 1 );
  863. BOOL fReturnValue;
  864. fReturnValue = FaxGetPortA( (HANDLE) *((HANDLE *) pvParameterValue0),
  865. (PFAX_PORT_INFOA *) *((PFAX_PORT_INFOA * *) pvParameterValue1) );
  866. *((BOOL *) m_pvReturnValue) = fReturnValue;
  867. }
  868. break;
  869. case eFaxGetPortW:
  870. {
  871. void * pvParameterValue0;
  872. void * pvParameterValue1;
  873. pvParameterValue0 = GetParameterValuePointer ( 0 );
  874. pvParameterValue1 = GetParameterValuePointer ( 1 );
  875. BOOL fReturnValue;
  876. fReturnValue = FaxGetPortW( (HANDLE) *((HANDLE *) pvParameterValue0),
  877. (PFAX_PORT_INFOW *) *((PFAX_PORT_INFOW * *) pvParameterValue1) );
  878. *((BOOL *) m_pvReturnValue) = fReturnValue;
  879. }
  880. break;
  881. case eFaxGetRoutingInfoA:
  882. {
  883. void * pvParameterValue0;
  884. void * pvParameterValue1;
  885. void * pvParameterValue2;
  886. void * pvParameterValue3;
  887. pvParameterValue0 = GetParameterValuePointer ( 0 );
  888. pvParameterValue1 = GetParameterValuePointer ( 1 );
  889. pvParameterValue2 = GetParameterValuePointer ( 2 );
  890. pvParameterValue3 = GetParameterValuePointer ( 3 );
  891. BOOL fReturnValue;
  892. fReturnValue = FaxGetRoutingInfoA( (HANDLE) *((HANDLE *) pvParameterValue0),
  893. (LPSTR) *((LPSTR *) pvParameterValue1),
  894. (LPBYTE *) *((LPDWORD *) pvParameterValue2),
  895. (LPDWORD) *((LPDWORD *) pvParameterValue3) );
  896. *((BOOL *) m_pvReturnValue) = fReturnValue;
  897. }
  898. break;
  899. case eFaxGetRoutingInfoW:
  900. {
  901. void * pvParameterValue0;
  902. void * pvParameterValue1;
  903. void * pvParameterValue2;
  904. void * pvParameterValue3;
  905. pvParameterValue0 = GetParameterValuePointer ( 0 );
  906. pvParameterValue1 = GetParameterValuePointer ( 1 );
  907. pvParameterValue2 = GetParameterValuePointer ( 2 );
  908. pvParameterValue3 = GetParameterValuePointer ( 3 );
  909. BOOL fReturnValue;
  910. fReturnValue = FaxGetRoutingInfoW( (HANDLE) *((HANDLE *) pvParameterValue0),
  911. (LPWSTR) *((LPWSTR *) pvParameterValue1),
  912. (LPBYTE *) *((LPDWORD *) pvParameterValue2),
  913. (LPDWORD) *((LPDWORD *) pvParameterValue3) );
  914. *((BOOL *) m_pvReturnValue) = fReturnValue;
  915. }
  916. break;
  917. case eFaxInitializeEventQueue:
  918. {
  919. void * pvParameterValue0;
  920. void * pvParameterValue1;
  921. void * pvParameterValue2;
  922. void * pvParameterValue3;
  923. void * pvParameterValue4;
  924. pvParameterValue0 = GetParameterValuePointer ( 0 );
  925. pvParameterValue1 = GetParameterValuePointer ( 1 );
  926. pvParameterValue2 = GetParameterValuePointer ( 2 );
  927. pvParameterValue3 = GetParameterValuePointer ( 3 );
  928. pvParameterValue4 = GetParameterValuePointer ( 4 );
  929. BOOL fReturnValue;
  930. fReturnValue = FaxInitializeEventQueue( (HANDLE) *((HANDLE *) pvParameterValue0),
  931. (HANDLE) *((HANDLE *) pvParameterValue1),
  932. (DWORD) *((DWORD *) pvParameterValue2),
  933. (HWND) *((HWND *) pvParameterValue3),
  934. (ULONG_PTR) *((ULONG_PTR *) pvParameterValue4) );
  935. *((BOOL *) m_pvReturnValue) = fReturnValue;
  936. }
  937. break;
  938. case eFaxOpenPort:
  939. {
  940. void * pvParameterValue0;
  941. void * pvParameterValue1;
  942. void * pvParameterValue2;
  943. void * pvParameterValue3;
  944. pvParameterValue0 = GetParameterValuePointer ( 0 );
  945. pvParameterValue1 = GetParameterValuePointer ( 1 );
  946. pvParameterValue2 = GetParameterValuePointer ( 2 );
  947. pvParameterValue3 = GetParameterValuePointer ( 3 );
  948. BOOL fReturnValue;
  949. fReturnValue = FaxOpenPort( (HANDLE) *((HANDLE *) pvParameterValue0),
  950. (DWORD) *((DWORD *) pvParameterValue1),
  951. (DWORD) *((DWORD *) pvParameterValue2),
  952. (LPHANDLE) *((LPHANDLE *) pvParameterValue3) );
  953. *((BOOL *) m_pvReturnValue) = fReturnValue;
  954. }
  955. break;
  956. case eFaxPrintCoverPageA:
  957. {
  958. void * pvParameterValue0;
  959. void * pvParameterValue1;
  960. pvParameterValue0 = GetParameterValuePointer ( 0 );
  961. pvParameterValue1 = GetParameterValuePointer ( 1 );
  962. BOOL fReturnValue;
  963. fReturnValue = FaxPrintCoverPageA( (PFAX_CONTEXT_INFOA) *((PFAX_CONTEXT_INFOA *) pvParameterValue0),
  964. (PFAX_COVERPAGE_INFOA) *((PFAX_COVERPAGE_INFOA *) pvParameterValue1) );
  965. *((BOOL *) m_pvReturnValue) = fReturnValue;
  966. }
  967. break;
  968. case eFaxPrintCoverPageW:
  969. {
  970. void * pvParameterValue0;
  971. void * pvParameterValue1;
  972. pvParameterValue0 = GetParameterValuePointer ( 0 );
  973. pvParameterValue1 = GetParameterValuePointer ( 1 );
  974. BOOL fReturnValue;
  975. fReturnValue = FaxPrintCoverPageW( (PFAX_CONTEXT_INFOW) *((PFAX_CONTEXT_INFOW *) pvParameterValue0),
  976. (PFAX_COVERPAGE_INFOW) *((PFAX_COVERPAGE_INFOW *) pvParameterValue1) );
  977. *((BOOL *) m_pvReturnValue) = fReturnValue;
  978. }
  979. break;
  980. case eFaxSendDocumentA:
  981. {
  982. void * pvParameterValue0;
  983. void * pvParameterValue1;
  984. void * pvParameterValue2;
  985. void * pvParameterValue3;
  986. void * pvParameterValue4;
  987. pvParameterValue0 = GetParameterValuePointer ( 0 );
  988. pvParameterValue1 = GetParameterValuePointer ( 1 );
  989. pvParameterValue2 = GetParameterValuePointer ( 2 );
  990. pvParameterValue3 = GetParameterValuePointer ( 3 );
  991. pvParameterValue4 = GetParameterValuePointer ( 4 );
  992. BOOL fReturnValue;
  993. fReturnValue = FaxSendDocumentA( (HANDLE) *((HANDLE *) pvParameterValue0),
  994. (LPSTR) *((LPSTR *) pvParameterValue1),
  995. (PFAX_JOB_PARAMA) *((PFAX_JOB_PARAMA *) pvParameterValue2),
  996. ( PFAX_COVERPAGE_INFOA) *(( PFAX_COVERPAGE_INFOA *) pvParameterValue3),
  997. (LPDWORD) *((LPDWORD *) pvParameterValue4) );
  998. *((BOOL *) m_pvReturnValue) = fReturnValue;
  999. }
  1000. break;
  1001. case eFaxSendDocumentW:
  1002. {
  1003. void * pvParameterValue0;
  1004. void * pvParameterValue1;
  1005. void * pvParameterValue2;
  1006. void * pvParameterValue3;
  1007. void * pvParameterValue4;
  1008. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1009. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1010. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1011. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1012. pvParameterValue4 = GetParameterValuePointer ( 4 );
  1013. BOOL fReturnValue;
  1014. fReturnValue = FaxSendDocumentW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1015. (LPWSTR) *((LPWSTR *) pvParameterValue1),
  1016. (PFAX_JOB_PARAMW) *((PFAX_JOB_PARAMW *) pvParameterValue2),
  1017. (PFAX_COVERPAGE_INFOW) *(( PFAX_COVERPAGE_INFOW *) pvParameterValue3),
  1018. (LPDWORD) *((LPDWORD *) pvParameterValue4) );
  1019. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1020. }
  1021. break;
  1022. case eFaxSetConfigurationA:
  1023. {
  1024. void * pvParameterValue0;
  1025. void * pvParameterValue1;
  1026. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1027. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1028. BOOL fReturnValue;
  1029. fReturnValue = FaxSetConfigurationA( (HANDLE) *((HANDLE *) pvParameterValue0),
  1030. (PFAX_CONFIGURATIONA) *((PFAX_CONFIGURATIONA *) pvParameterValue1) );
  1031. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1032. }
  1033. break;
  1034. case eFaxSetConfigurationW:
  1035. {
  1036. void * pvParameterValue0;
  1037. void * pvParameterValue1;
  1038. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1039. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1040. BOOL fReturnValue;
  1041. fReturnValue = FaxSetConfigurationW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1042. (PFAX_CONFIGURATIONW) *((PFAX_CONFIGURATIONW *) pvParameterValue1) );
  1043. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1044. }
  1045. break;
  1046. case eFaxSetJobA:
  1047. {
  1048. void * pvParameterValue0;
  1049. void * pvParameterValue1;
  1050. void * pvParameterValue2;
  1051. void * pvParameterValue3;
  1052. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1053. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1054. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1055. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1056. BOOL fReturnValue;
  1057. fReturnValue = FaxSetJobA( (HANDLE) *((HANDLE *) pvParameterValue0),
  1058. (DWORD) *((DWORD *) pvParameterValue1),
  1059. (DWORD) *((DWORD *) pvParameterValue2),
  1060. (PFAX_JOB_ENTRYA) *((PFAX_JOB_ENTRYA *) pvParameterValue3) );
  1061. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1062. }
  1063. break;
  1064. case eFaxSetJobW:
  1065. {
  1066. void * pvParameterValue0;
  1067. void * pvParameterValue1;
  1068. void * pvParameterValue2;
  1069. void * pvParameterValue3;
  1070. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1071. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1072. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1073. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1074. BOOL fReturnValue;
  1075. fReturnValue = FaxSetJobW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1076. (DWORD) *((DWORD *) pvParameterValue1),
  1077. (DWORD) *((DWORD *) pvParameterValue2),
  1078. (PFAX_JOB_ENTRYW) *((PFAX_JOB_ENTRYW *) pvParameterValue3) );
  1079. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1080. }
  1081. break;
  1082. case eFaxSetLoggingCategoriesA:
  1083. {
  1084. void * pvParameterValue0;
  1085. void * pvParameterValue1;
  1086. void * pvParameterValue2;
  1087. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1088. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1089. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1090. BOOL fReturnValue;
  1091. fReturnValue = FaxSetLoggingCategoriesA( (HANDLE) *((HANDLE *) pvParameterValue0),
  1092. (PFAX_LOG_CATEGORY) *((PFAX_LOG_CATEGORY *) pvParameterValue1),
  1093. (DWORD) *((DWORD *) pvParameterValue2) );
  1094. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1095. }
  1096. break;
  1097. case eFaxSetLoggingCategoriesW:
  1098. {
  1099. void * pvParameterValue0;
  1100. void * pvParameterValue1;
  1101. void * pvParameterValue2;
  1102. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1103. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1104. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1105. BOOL fReturnValue;
  1106. fReturnValue = FaxSetLoggingCategoriesW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1107. (PFAX_LOG_CATEGORY) *((PFAX_LOG_CATEGORY *) pvParameterValue1),
  1108. (DWORD) *((DWORD *) pvParameterValue2) );
  1109. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1110. }
  1111. break;
  1112. case eFaxSetPortA:
  1113. {
  1114. void * pvParameterValue0;
  1115. void * pvParameterValue1;
  1116. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1117. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1118. BOOL fReturnValue;
  1119. fReturnValue = FaxSetPortA( (HANDLE) *((HANDLE *) pvParameterValue0),
  1120. (PFAX_PORT_INFOA) *((PFAX_PORT_INFOA *) pvParameterValue1) );
  1121. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1122. }
  1123. break;
  1124. case eFaxSetPortW:
  1125. {
  1126. void * pvParameterValue0;
  1127. void * pvParameterValue1;
  1128. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1129. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1130. BOOL fReturnValue;
  1131. fReturnValue = FaxSetPortW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1132. (PFAX_PORT_INFOW) *((PFAX_PORT_INFOW *) pvParameterValue1) );
  1133. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1134. }
  1135. break;
  1136. case eFaxSetRoutingInfoA:
  1137. {
  1138. void * pvParameterValue0;
  1139. void * pvParameterValue1;
  1140. void * pvParameterValue2;
  1141. void * pvParameterValue3;
  1142. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1143. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1144. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1145. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1146. BOOL fReturnValue;
  1147. fReturnValue = FaxSetRoutingInfoA( (HANDLE) *((HANDLE *) pvParameterValue0),
  1148. (LPSTR) *((LPSTR *) pvParameterValue1),
  1149. (LPBYTE) *((LPBYTE *) pvParameterValue2),
  1150. (DWORD) *((DWORD *) pvParameterValue3) );
  1151. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1152. }
  1153. break;
  1154. case eFaxSetRoutingInfoW:
  1155. {
  1156. void * pvParameterValue0;
  1157. void * pvParameterValue1;
  1158. void * pvParameterValue2;
  1159. void * pvParameterValue3;
  1160. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1161. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1162. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1163. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1164. BOOL fReturnValue;
  1165. fReturnValue = FaxSetRoutingInfoW( (HANDLE) *((HANDLE *) pvParameterValue0),
  1166. (LPWSTR) *((LPWSTR *) pvParameterValue1),
  1167. (LPBYTE) *((LPBYTE *) pvParameterValue2),
  1168. (DWORD) *((DWORD *) pvParameterValue3) );
  1169. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1170. }
  1171. break;
  1172. case eFaxStartPrintJobA:
  1173. {
  1174. void * pvParameterValue0;
  1175. void * pvParameterValue1;
  1176. void * pvParameterValue2;
  1177. void * pvParameterValue3;
  1178. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1179. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1180. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1181. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1182. BOOL fReturnValue;
  1183. fReturnValue = FaxStartPrintJobA( (LPSTR) *((LPSTR *) pvParameterValue0),
  1184. (PFAX_PRINT_INFOA) *((PFAX_PRINT_INFOA *) pvParameterValue1),
  1185. (LPDWORD) *((LPDWORD *) pvParameterValue2),
  1186. (PFAX_CONTEXT_INFOA ) *((PFAX_CONTEXT_INFOA *) pvParameterValue3) );
  1187. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1188. }
  1189. break;
  1190. case eFaxStartPrintJobW:
  1191. {
  1192. void * pvParameterValue0;
  1193. void * pvParameterValue1;
  1194. void * pvParameterValue2;
  1195. void * pvParameterValue3;
  1196. pvParameterValue0 = GetParameterValuePointer ( 0 );
  1197. pvParameterValue1 = GetParameterValuePointer ( 1 );
  1198. pvParameterValue2 = GetParameterValuePointer ( 2 );
  1199. pvParameterValue3 = GetParameterValuePointer ( 3 );
  1200. BOOL fReturnValue;
  1201. fReturnValue = FaxStartPrintJobW( (LPWSTR) *((LPWSTR *) pvParameterValue0),
  1202. (PFAX_PRINT_INFOW) *((PFAX_PRINT_INFOW *) pvParameterValue1),
  1203. (LPDWORD) *((LPDWORD *) pvParameterValue2),
  1204. (PFAX_CONTEXT_INFOW) *((PFAX_CONTEXT_INFOW *) pvParameterValue3) );
  1205. *((BOOL *) m_pvReturnValue) = fReturnValue;
  1206. }
  1207. break;
  1208. }
  1209. }
  1210. /*
  1211. * GetFunctionIndexEnum
  1212. *
  1213. * Purpose:
  1214. * This function returns the eFunctionIndex value that represents the
  1215. * Fax Api function whose name is in rcsFunctionName.
  1216. *
  1217. * Arguments:
  1218. * rcsFunctionName - a reference to a CString that contains the name
  1219. * of a Fax Api function.
  1220. *
  1221. * Returns:
  1222. * The eFunctionIndex value that represents a Fax Api function.
  1223. *
  1224. * Note:
  1225. * This function uses "goto" statements to preclude execution of comparisons
  1226. * that are guaranteed to fail.
  1227. *
  1228. */
  1229. eFunctionIndex CFaxApiFunctionInfo::GetFunctionIndexEnum( const CString & rcsFunctionName )
  1230. {
  1231. eFunctionIndex eReturnValue;
  1232. /* Note: a "switch" statement cannot be used here because rcsFunctionName */
  1233. /* is not an integral type and is an illegal switch expression. */
  1234. if ( rcsFunctionName.Compare( TEXT("FaxAbort") ) == 0 )
  1235. {
  1236. eReturnValue = eFaxAbort;
  1237. goto ExitGetFunctionIndexEnum;
  1238. }
  1239. if ( rcsFunctionName.Compare( TEXT("FaxClose") ) == 0 )
  1240. {
  1241. eReturnValue = eFaxClose;
  1242. goto ExitGetFunctionIndexEnum;
  1243. }
  1244. if ( rcsFunctionName.Compare( TEXT("FaxConnectFaxServerA") ) == 0 )
  1245. {
  1246. eReturnValue = eFaxConnectFaxServerA;
  1247. goto ExitGetFunctionIndexEnum;
  1248. }
  1249. if ( rcsFunctionName.Compare( TEXT("FaxConnectFaxServerW") ) == 0 )
  1250. {
  1251. eReturnValue = eFaxConnectFaxServerW;
  1252. goto ExitGetFunctionIndexEnum;
  1253. }
  1254. if ( rcsFunctionName.Compare( TEXT("FaxEnableRoutingMethodA") ) == 0 )
  1255. {
  1256. eReturnValue = eFaxEnableRoutingMethodA;
  1257. goto ExitGetFunctionIndexEnum;
  1258. }
  1259. if ( rcsFunctionName.Compare( TEXT("FaxEnableRoutingMethodW") ) == 0 )
  1260. {
  1261. eReturnValue = eFaxEnableRoutingMethodW;
  1262. goto ExitGetFunctionIndexEnum;
  1263. }
  1264. if ( rcsFunctionName.Compare( TEXT("FaxEnumJobsA") ) == 0 )
  1265. {
  1266. eReturnValue = eFaxEnumJobsA;
  1267. goto ExitGetFunctionIndexEnum;
  1268. }
  1269. if ( rcsFunctionName.Compare( TEXT("FaxEnumJobsW") ) == 0 )
  1270. {
  1271. eReturnValue = eFaxEnumJobsW;
  1272. goto ExitGetFunctionIndexEnum;
  1273. }
  1274. if ( rcsFunctionName.Compare( TEXT("FaxEnumPortsA") ) == 0 )
  1275. {
  1276. eReturnValue = eFaxEnumPortsA;
  1277. goto ExitGetFunctionIndexEnum;
  1278. }
  1279. if ( rcsFunctionName.Compare( TEXT("FaxEnumPortsW") ) == 0 )
  1280. {
  1281. eReturnValue = eFaxEnumPortsW;
  1282. goto ExitGetFunctionIndexEnum;
  1283. }
  1284. if ( rcsFunctionName.Compare( TEXT("FaxEnumRoutingMethodsA") ) == 0 )
  1285. {
  1286. eReturnValue = eFaxEnumRoutingMethodsA;
  1287. goto ExitGetFunctionIndexEnum;
  1288. }
  1289. if ( rcsFunctionName.Compare( TEXT("FaxEnumRoutingMethodsW") ) == 0 )
  1290. {
  1291. eReturnValue = eFaxEnumRoutingMethodsW;
  1292. goto ExitGetFunctionIndexEnum;
  1293. }
  1294. if ( rcsFunctionName.Compare( TEXT("FaxFreeBuffer") ) == 0 )
  1295. {
  1296. eReturnValue = eFaxFreeBuffer;
  1297. goto ExitGetFunctionIndexEnum;
  1298. }
  1299. if ( rcsFunctionName.Compare( TEXT("FaxGetConfigurationA") ) == 0 )
  1300. {
  1301. eReturnValue = eFaxGetConfigurationA;
  1302. goto ExitGetFunctionIndexEnum;
  1303. }
  1304. if ( rcsFunctionName.Compare( TEXT("FaxGetConfigurationW") ) == 0 )
  1305. {
  1306. eReturnValue = eFaxGetConfigurationW;
  1307. goto ExitGetFunctionIndexEnum;
  1308. }
  1309. if ( rcsFunctionName.Compare( TEXT("FaxGetDeviceStatusA") ) == 0 )
  1310. {
  1311. eReturnValue = eFaxGetDeviceStatusA;
  1312. goto ExitGetFunctionIndexEnum;
  1313. }
  1314. if ( rcsFunctionName.Compare( TEXT("FaxGetDeviceStatusW") ) == 0 )
  1315. {
  1316. eReturnValue = eFaxGetDeviceStatusW;
  1317. goto ExitGetFunctionIndexEnum;
  1318. }
  1319. if ( rcsFunctionName.Compare( TEXT("FaxGetJobA") ) == 0 )
  1320. {
  1321. eReturnValue = eFaxGetJobA;
  1322. goto ExitGetFunctionIndexEnum;
  1323. }
  1324. if ( rcsFunctionName.Compare( TEXT("FaxGetJobW") ) == 0 )
  1325. {
  1326. eReturnValue = eFaxGetJobW;
  1327. goto ExitGetFunctionIndexEnum;
  1328. }
  1329. if ( rcsFunctionName.Compare( TEXT("FaxGetLoggingCategoriesA") ) == 0 )
  1330. {
  1331. eReturnValue = eFaxGetLoggingCategoriesA;
  1332. goto ExitGetFunctionIndexEnum;
  1333. }
  1334. if ( rcsFunctionName.Compare( TEXT("FaxGetLoggingCategoriesW") ) == 0 )
  1335. {
  1336. eReturnValue = eFaxGetLoggingCategoriesW;
  1337. goto ExitGetFunctionIndexEnum;
  1338. }
  1339. #ifdef ELIMINATED_FROM_API
  1340. if ( rcsFunctionName.Compare( TEXT("FaxGetPageData") ) == 0 )
  1341. {
  1342. eReturnValue = eFaxGetPageData;
  1343. goto ExitGetFunctionIndexEnum;
  1344. }
  1345. #endif // ELIMINATED_FROM_API
  1346. if ( rcsFunctionName.Compare( TEXT("FaxGetPortA") ) == 0 )
  1347. {
  1348. eReturnValue = eFaxGetPortA;
  1349. goto ExitGetFunctionIndexEnum;
  1350. }
  1351. if ( rcsFunctionName.Compare( TEXT("FaxGetPortW") ) == 0 )
  1352. {
  1353. eReturnValue = eFaxGetPortW;
  1354. goto ExitGetFunctionIndexEnum;
  1355. }
  1356. if ( rcsFunctionName.Compare( TEXT("FaxGetRoutingInfoA") ) == 0 )
  1357. {
  1358. eReturnValue = eFaxGetRoutingInfoA;
  1359. goto ExitGetFunctionIndexEnum;
  1360. }
  1361. if ( rcsFunctionName.Compare( TEXT("FaxGetRoutingInfoW") ) == 0 )
  1362. {
  1363. eReturnValue = eFaxGetRoutingInfoW;
  1364. goto ExitGetFunctionIndexEnum;
  1365. }
  1366. if ( rcsFunctionName.Compare( TEXT("FaxInitializeEventQueue") ) == 0 )
  1367. {
  1368. eReturnValue = eFaxInitializeEventQueue;
  1369. goto ExitGetFunctionIndexEnum;
  1370. }
  1371. #ifdef ELIMINATED_FROM_API
  1372. if ( rcsFunctionName.Compare( TEXT("FaxOpenJob") ) == 0 )
  1373. {
  1374. eReturnValue = eFaxOpenJob;
  1375. goto ExitGetFunctionIndexEnum;
  1376. }
  1377. #endif // ELIMINATED_FROM_API
  1378. if ( rcsFunctionName.Compare( TEXT("FaxOpenPort") ) == 0 )
  1379. {
  1380. eReturnValue = eFaxOpenPort;
  1381. goto ExitGetFunctionIndexEnum;
  1382. }
  1383. if ( rcsFunctionName.Compare( TEXT("FaxPrintCoverPageA") ) == 0 )
  1384. {
  1385. eReturnValue = eFaxPrintCoverPageA;
  1386. goto ExitGetFunctionIndexEnum;
  1387. }
  1388. if ( rcsFunctionName.Compare( TEXT("FaxPrintCoverPageW") ) == 0 )
  1389. {
  1390. eReturnValue = eFaxPrintCoverPageW;
  1391. goto ExitGetFunctionIndexEnum;
  1392. }
  1393. if ( rcsFunctionName.Compare( TEXT("FaxReceiveDocumentA") ) == 0 )
  1394. {
  1395. eReturnValue = eFaxReceiveDocumentA;
  1396. goto ExitGetFunctionIndexEnum;
  1397. }
  1398. if ( rcsFunctionName.Compare( TEXT("FaxReceiveDocumentW") ) == 0 )
  1399. {
  1400. eReturnValue = eFaxReceiveDocumentW;
  1401. goto ExitGetFunctionIndexEnum;
  1402. }
  1403. if ( rcsFunctionName.Compare( TEXT("FaxSendDocumentA") ) == 0 )
  1404. {
  1405. eReturnValue = eFaxSendDocumentA;
  1406. goto ExitGetFunctionIndexEnum;
  1407. }
  1408. if ( rcsFunctionName.Compare( TEXT("FaxSendDocumentW") ) == 0 )
  1409. {
  1410. eReturnValue = eFaxSendDocumentW;
  1411. goto ExitGetFunctionIndexEnum;
  1412. }
  1413. if ( rcsFunctionName.Compare( TEXT("FaxSetConfigurationA") ) == 0 )
  1414. {
  1415. eReturnValue = eFaxSetConfigurationA;
  1416. goto ExitGetFunctionIndexEnum;
  1417. }
  1418. if ( rcsFunctionName.Compare( TEXT("FaxSetConfigurationW") ) == 0 )
  1419. {
  1420. eReturnValue = eFaxSetConfigurationW;
  1421. goto ExitGetFunctionIndexEnum;
  1422. }
  1423. if ( rcsFunctionName.Compare( TEXT("FaxSetJobA") ) == 0 )
  1424. {
  1425. eReturnValue = eFaxSetJobA;
  1426. goto ExitGetFunctionIndexEnum;
  1427. }
  1428. if ( rcsFunctionName.Compare( TEXT("FaxSetJobW") ) == 0 )
  1429. {
  1430. eReturnValue = eFaxSetJobW;
  1431. goto ExitGetFunctionIndexEnum;
  1432. }
  1433. if ( rcsFunctionName.Compare( TEXT("FaxSetLoggingCategoriesA") ) == 0 )
  1434. {
  1435. eReturnValue = eFaxSetLoggingCategoriesA;
  1436. goto ExitGetFunctionIndexEnum;
  1437. }
  1438. if ( rcsFunctionName.Compare( TEXT("FaxSetLoggingCategoriesW") ) == 0 )
  1439. {
  1440. eReturnValue = eFaxSetLoggingCategoriesW;
  1441. goto ExitGetFunctionIndexEnum;
  1442. }
  1443. if ( rcsFunctionName.Compare( TEXT("FaxSetPortA") ) == 0 )
  1444. {
  1445. eReturnValue = eFaxSetPortA;
  1446. goto ExitGetFunctionIndexEnum;
  1447. }
  1448. if ( rcsFunctionName.Compare( TEXT("FaxSetPortW") ) == 0 )
  1449. {
  1450. eReturnValue = eFaxSetPortW;
  1451. goto ExitGetFunctionIndexEnum;
  1452. }
  1453. if ( rcsFunctionName.Compare( TEXT("FaxSetRoutingInfoA") ) == 0 )
  1454. {
  1455. eReturnValue = eFaxSetRoutingInfoA;
  1456. goto ExitGetFunctionIndexEnum;
  1457. }
  1458. if ( rcsFunctionName.Compare( TEXT("FaxSetRoutingInfoW") ) == 0 )
  1459. {
  1460. eReturnValue = eFaxSetRoutingInfoW;
  1461. goto ExitGetFunctionIndexEnum;
  1462. }
  1463. if ( rcsFunctionName.Compare( TEXT("FaxStartPrintJobA") ) == 0 )
  1464. {
  1465. eReturnValue = eFaxStartPrintJobA;
  1466. goto ExitGetFunctionIndexEnum;
  1467. }
  1468. if ( rcsFunctionName.Compare( TEXT("FaxStartPrintJobW") ) == 0 )
  1469. {
  1470. eReturnValue = eFaxStartPrintJobW;
  1471. goto ExitGetFunctionIndexEnum;
  1472. }
  1473. else
  1474. {
  1475. eReturnValue = eIllegalFunctionIndex; // The function name was not
  1476. // in the list above
  1477. }
  1478. ExitGetFunctionIndexEnum:
  1479. return ( eReturnValue );
  1480. }