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.

124 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 1994-2000 Microsoft Corporation
  3. Module Name:
  4. wx86.h
  5. Abstract:
  6. Public exports, defines for wx86.dll
  7. Author:
  8. 10-Jan-1995 Jonle,Created
  9. Revision History:
  10. 24-Aug-1999 [askhalid] isolated some definition from wow64
  11. and define some proxy and wrapper functions.
  12. --*/
  13. #include <wow64.h>
  14. #if !defined(_WX86CPUAPI_)
  15. #define WX86CPUAPI DECLSPEC_IMPORT
  16. #else
  17. #define WX86CPUAPI
  18. #endif
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. typedef struct _ConfigVariable {
  23. LIST_ENTRY ConfigEntry;
  24. DWORD Data;
  25. UNICODE_STRING Name;
  26. WCHAR Buffer[1];
  27. } CONFIGVAR, *PCONFIGVAR;
  28. PCONFIGVAR
  29. Wx86FetchConfigVar(
  30. PWSTR VariableName
  31. );
  32. VOID
  33. Wx86RaiseStatus(
  34. NTSTATUS Status
  35. );
  36. void
  37. Wx86RaiseInterrupt(
  38. ULONG IntNum,
  39. ULONG EipVal,
  40. ULONG EspVal,
  41. BOOL bParameter,
  42. ULONG Parameter
  43. );
  44. VOID
  45. Wx86FreeConfigVar(
  46. PCONFIGVAR ConfigVar
  47. );
  48. #define BOPFL_ENDCODE 0x01
  49. typedef struct _BopInstr {
  50. BYTE Instr1; // 0xc4c4 - the x86 BOP instruction
  51. BYTE Instr2;
  52. BYTE BopNum;
  53. BYTE Flags;
  54. USHORT ApiNum;
  55. BYTE RetSize;
  56. BYTE ArgSize;
  57. } BOPINSTR;
  58. typedef UNALIGNED BOPINSTR * PBOPINSTR;
  59. void
  60. Wx86DispatchBop(
  61. PBOPINSTR Bop
  62. );
  63. /////////////////////////////////
  64. #define ProxyGetCurrentThreadId() \
  65. HandleToUlong(NtCurrentTeb()->ClientId.UniqueThread)
  66. #define ProxyDebugBreak() \
  67. DbgBreakPoint()
  68. BOOL ProxyIsProcessorFeaturePresent (DWORD feature);
  69. VOID ProxyRaiseException(
  70. IN DWORD dwExceptionCode,
  71. IN DWORD dwExceptionFlags,
  72. IN DWORD nNumberOfArguments,
  73. IN CONST ULONG_PTR *lpArguments
  74. );
  75. WX86CPUAPI DWORD GetEdi(PVOID CpuContext);
  76. WX86CPUAPI VOID SetEdx(PVOID CpuContext, DWORD val);
  77. WX86CPUAPI VOID SetEdi(PVOID CpuContext, DWORD val);
  78. WX86CPUAPI DWORD GetEfl(PVOID CpuContext);
  79. WX86CPUAPI VOID SetEfl(PVOID CpuContext, DWORD val);
  80. WX86CPUAPI DWORD GetEsp(PVOID CpuContext);
  81. WX86CPUAPI VOID SetEip(PVOID CpuContext, DWORD val);
  82. WX86CPUAPI VOID SetEsp(PVOID CpuContext, DWORD val);
  83. WX86CPUAPI DWORD GetEip(PVOID CpuContext);
  84. DWORD ProxyWowDispatchBop(
  85. ULONG ServiceNumber,
  86. PVOID Context32,
  87. PULONG ArgBase
  88. );
  89. double Proxylog10( double x );
  90. double Proxyatan2( double y, double x );
  91. #ifdef __cplusplus
  92. }
  93. #endif