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.

100 lines
4.1 KiB

  1. #ifndef __RECOGNIZER__
  2. #define __RECOGNIZER__
  3. #ifndef _WIN64
  4. typedef int HWX_FUNC_1(DWORD);
  5. typedef int HWX_FUNC_2(DWORD, DWORD);
  6. typedef int HWX_FUNC_3(DWORD, DWORD, DWORD);
  7. typedef int HWX_FUNC_4(DWORD, DWORD, DWORD, DWORD);
  8. typedef int HWX_FUNC_5(DWORD, DWORD, DWORD, DWORD, DWORD);
  9. // JRB: Added to support hacked call to HwxGetResults!
  10. typedef int HWX_FUNC_6(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD);
  11. #define CALL_FUNC_1(id, a) ((HWX_FUNC_1 *) g_apfn[(id)])((DWORD) (a))
  12. #define CALL_FUNC_2(id, a, b) ((HWX_FUNC_2 *) g_apfn[(id)])((DWORD) (a), (DWORD) (b))
  13. #define CALL_FUNC_3(id, a, b, c) ((HWX_FUNC_3 *) g_apfn[(id)])((DWORD) (a), (DWORD) (b), (DWORD) (c))
  14. #define CALL_FUNC_4(id, a, b, c, d) ((HWX_FUNC_4 *) g_apfn[(id)])((DWORD) (a), (DWORD) (b), (DWORD) (c), (DWORD) (d))
  15. #define CALL_FUNC_5(id, a, b, c, d, e) ((HWX_FUNC_5 *) g_apfn[(id)])((DWORD) (a), (DWORD) (b), (DWORD) (c), (DWORD) (d), (DWORD) (e))
  16. // JRB: Added to support hacked call to HwxGetResults!
  17. #define CALL_FUNC_6(id, a, b, c, d, e, f) ((HWX_FUNC_6 *) g_apfn[(id)])((DWORD) (a), (DWORD) (b), (DWORD) (c), (DWORD) (d), (DWORD) (e), (DWORD) (f))
  18. #endif
  19. // common to both platforms
  20. typedef int HWX_FUNC(void);
  21. typedef int HWX_FUNC_0(void);
  22. #define CALL_FUNC_0(id) ((HWX_FUNC_0 *) g_apfn[(id)])()
  23. /************************************************************************
  24. *
  25. * These are the additional functions necessary to make porting of HWXTest
  26. * to 64 bit platform successful. Many of the DWORD arguments passed to
  27. * functions above were modified to types such as HANDLE and PVOID because
  28. * 8 byte pointers passed as DWORDs will cause a loss of data.
  29. * August 1, 2000
  30. * modified by Radmila Sarac (rsarac)
  31. *
  32. * each of the functions below has the following naming convention:
  33. * the number in the function name is followed by the first letter
  34. * of return type and first letters of paramteres passed to functions
  35. * which are not DWORDs, where
  36. * I stands for int
  37. * H stands for HANDLE
  38. * P stands for PVOID
  39. *************************************************************************/
  40. typedef HANDLE HWX_FUNC_1H(DWORD);
  41. typedef int HWX_FUNC_1IH(HANDLE);
  42. typedef int HWX_FUNC_2IH(HANDLE, DWORD);
  43. typedef int HWX_FUNC_2IHP(HANDLE, PVOID);
  44. typedef int HWX_FUNC_3IHPP(HANDLE, PVOID, PVOID);
  45. typedef int HWX_FUNC_4IHP(HANDLE, PVOID, DWORD, DWORD);
  46. typedef int HWX_FUNC_5IHP(HANDLE, DWORD, DWORD, DWORD, PVOID);
  47. typedef int HWX_FUNC_6IHPPP(HANDLE, DWORD, DWORD, PVOID, PVOID, PVOID);
  48. #define CALL_FUNC_1H(id, a) ((HWX_FUNC_1H *) g_apfn[(id)])((DWORD) (a))
  49. #define CALL_FUNC_1IH(id, a) ((HWX_FUNC_1IH *) g_apfn[(id)])((HANDLE) (a))
  50. #define CALL_FUNC_2IH(id, a, b) ((HWX_FUNC_2IH *) g_apfn[(id)])((HANDLE) (a), (DWORD) (b))
  51. #define CALL_FUNC_2IHP(id, a, b) ((HWX_FUNC_2IHP *) g_apfn[(id)])((HANDLE) (a), (PVOID) (b))
  52. #define CALL_FUNC_3IHPP(id, a, b, c) ((HWX_FUNC_3IHPP *) g_apfn[(id)])((HANDLE) (a), (PVOID) (b), (PVOID) (c))
  53. #define CALL_FUNC_4IHP(id, a, b, c, d) ((HWX_FUNC_4IHP *) g_apfn[(id)])((HANDLE) (a), (PVOID) (b), (DWORD) (c), (DWORD) (d))
  54. #define CALL_FUNC_5IHP(id, a, b, c, d, e) ((HWX_FUNC_5IHP *) g_apfn[(id)])((HANDLE) (a), (DWORD) (b), (DWORD) (c), (DWORD) (d), (PVOID) (e))
  55. #define CALL_FUNC_6IHPPP(id, a, b, c, d, e, f) ((HWX_FUNC_6IHPPP *) g_apfn[(id)])((HANDLE) (a), (DWORD) (b), (DWORD) (c), (PVOID) (d), (PVOID) (e), (PVOID) (f))
  56. #define HWXCONFIG 0
  57. #define HWXCREATE 1
  58. #define HWXDESTROY 2
  59. #define HWXINPUT 3
  60. #define HWXENDINPUT 4
  61. #define HWXSETGUIDE 5
  62. #define HWXPROCESS 6
  63. #define HWXGETRESULTS 7
  64. #define HWXSETMAX 8
  65. #define HWXSETALPHABET 9
  66. #define HWXSETPARTIAL 10
  67. #define HWXSETCONTEXT 11
  68. #define HWXAVAILABLE 12
  69. #define GETPRIVATERECINFOHRC 13
  70. #define SETPRIVATERECINFOHRC 14
  71. #define HWXALCVALID 15
  72. #define HWXFUNCS 16 // Total number of functions in table
  73. extern BOOL g_bOldAPI; // True is the recog supports the Old API
  74. extern BOOL g_bMultiLing; // True if the recognizer is multilingual
  75. extern HWX_FUNC *g_apfn[HWXFUNCS];
  76. BOOL LoadRecognizer ( wchar_t *pwRecogDLL,
  77. wchar_t *pwLocale,
  78. wchar_t *pwConfigDir
  79. );
  80. BOOL HasPrivateAPI ();
  81. void CloseRecognizer ();
  82. #endif