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.

591 lines
9.9 KiB

  1. /************************************************************************
  2. * *
  3. * wx86dll.h -- This module defines Wx86 APIs for x86 emulation *
  4. * *
  5. * Copyright (c) 1990-1999, Microsoft Corp. All rights reserved. *
  6. * *
  7. ************************************************************************/
  8. #ifndef _WX86DLL_
  9. #define _WX86DLL_
  10. #if _MSC_VER > 1000
  11. #pragma once
  12. #endif
  13. #if !defined(_WX86DLLAPI_)
  14. #define WX86DLLAPI DECLSPEC_IMPORT
  15. #else
  16. #define WX86DLLAPI
  17. #endif
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. typedef struct _BopInstr {
  22. BYTE Instr1; // 0xc4c4 - the x86 BOP instruction
  23. BYTE Instr2;
  24. BYTE BopNum;
  25. BYTE Flags;
  26. USHORT ApiNum;
  27. BYTE RetSize;
  28. BYTE ArgSize;
  29. } BOPINSTR;
  30. typedef UNALIGNED BOPINSTR * PBOPINSTR;
  31. typedef
  32. BOOL
  33. (*WX86OFLYINITIALIZE_ROUTINE)(
  34. VOID
  35. );
  36. WX86DLLAPI
  37. BOOL
  38. Wx86OFlyInitialize(
  39. VOID
  40. );
  41. WX86DLLAPI
  42. HMODULE
  43. Wx86LoadX86Dll(
  44. LPCWSTR lpLibFileName,
  45. DWORD dwFlags
  46. );
  47. typedef
  48. HMODULE
  49. (*WX86LOADX86DLL_ROUTINE)(
  50. LPCWSTR lpLibFileName,
  51. DWORD dwFlags
  52. );
  53. WX86DLLAPI
  54. HMODULE
  55. Wx86GetX86DllHandle(
  56. LPCWSTR lpLibFileName
  57. );
  58. typedef
  59. HMODULE
  60. (*WX86GETX86DLLHANDLE_ROUTINE)(
  61. LPCWSTR lpLibFileName
  62. );
  63. WX86DLLAPI
  64. BOOL
  65. Wx86FreeX86Dll(
  66. HMODULE hMod
  67. );
  68. typedef
  69. BOOL
  70. (*WX86FREEX86Dll_ROUTINE)(
  71. HMODULE hMod
  72. );
  73. WX86DLLAPI
  74. BOOL
  75. Wx86Compact(
  76. VOID
  77. );
  78. typedef
  79. BOOL
  80. (*WX86COMPACT_ROUTINE)(
  81. VOID
  82. );
  83. WX86DLLAPI
  84. PVOID
  85. Wx86ThunkProc(
  86. PVOID pvAddress,
  87. PVOID pvCBDispatch,
  88. BOOL fNativeToX86
  89. );
  90. WX86DLLAPI
  91. PVOID
  92. Wx86DualThunkProc(
  93. PVOID pvAddress,
  94. PVOID pvCBDispatch,
  95. BOOL fNativeToX86
  96. );
  97. typedef
  98. PVOID
  99. (*WX86THUNKPROC_ROUTINE)(
  100. PVOID pvAddress,
  101. PVOID pvCBDispatch,
  102. BOOL fNativeToX86
  103. );
  104. typedef
  105. ULONG
  106. (*X86TONATIVETHUNKPROC)(
  107. PVOID pvNativeAddress,
  108. PULONG pBaseArgs,
  109. PULONG pArgCount
  110. );
  111. WX86DLLAPI
  112. ULONG
  113. Wx86ThunkEmulateX86(
  114. ULONG nParameters,
  115. PULONG Parameters
  116. );
  117. typedef
  118. ULONG
  119. (*WX86THUNKEMULATEX86)(
  120. ULONG nParameters,
  121. PULONG Parameters
  122. );
  123. WX86DLLAPI
  124. ULONG
  125. Wx86EmulateX86(
  126. PVOID StartAddress,
  127. ULONG nParameters,
  128. PULONG Parameters
  129. );
  130. typedef
  131. ULONG
  132. (*WX86EMULATEX86)(
  133. PVOID StartAddress,
  134. ULONG nParameters,
  135. PULONG Parameters
  136. );
  137. WX86DLLAPI
  138. IUnknown *
  139. Wx86ThunkInterface(
  140. IUnknown *punk,
  141. IID *piid,
  142. BOOLEAN fOutParameter,
  143. BOOLEAN fNativeToX86
  144. );
  145. typedef
  146. IUnknown *
  147. (*WX86THUNKINTERFACE)(
  148. IUnknown *punk,
  149. IID *piid,
  150. BOOL fOutParameter,
  151. BOOL fNativeToX86
  152. );
  153. WX86DLLAPI
  154. void
  155. Wx86CheckFreeTempProxy(
  156. IUnknown *punk
  157. );
  158. typedef
  159. void
  160. (*WX86CHECKFREETEMPPROXY)(
  161. IUnknown *punk
  162. );
  163. WX86DLLAPI
  164. IUnknown *
  165. Wx86ResolveProxy(
  166. IUnknown *punk,
  167. BOOLEAN fNativeToX86);
  168. typedef
  169. IUnknown *
  170. (*WX86RESOLVEPROXY)(
  171. IUnknown *punk,
  172. BOOLEAN fNativeToX86);
  173. WX86DLLAPI
  174. ULONG
  175. Wx86ProxyAddRef(IUnknown* punk);
  176. typedef
  177. ULONG
  178. (*WX86PROXYADDREF)(
  179. IUnknown *punk);
  180. WX86DLLAPI
  181. ULONG
  182. Wx86ProxyRelease(IUnknown* punk);
  183. typedef
  184. ULONG
  185. (*WX86PROXYRELEASE)(
  186. IUnknown *punk);
  187. WX86DLLAPI
  188. HRESULT
  189. Wx86DllGetClassObjectThunk(
  190. IID *piid,
  191. LPVOID *ppv,
  192. HRESULT hr,
  193. BOOLEAN fNativetoX86);
  194. typedef
  195. HRESULT
  196. (*WX86DLLGETCLASSOBJECTTHUNK)(
  197. IID *piid,
  198. LPVOID *ppv,
  199. HRESULT hr,
  200. BOOLEAN fNativetoX86);
  201. WX86DLLAPI
  202. PVOID *
  203. Wx86InitializeOle(
  204. VOID
  205. );
  206. typedef
  207. PVOID *
  208. (*W86INITIALIZEOLE)(
  209. VOID
  210. );
  211. WX86DLLAPI
  212. void
  213. Wx86DeinitializeOle(
  214. VOID
  215. );
  216. VOID
  217. WX86DEINITIALIZEOLE(
  218. VOID
  219. );
  220. WX86DLLAPI
  221. LONG
  222. Wx86RegCreateKeyA(
  223. HKEY hKey,
  224. LPCSTR lpSubKey,
  225. PHKEY phkResult
  226. );
  227. WX86DLLAPI
  228. LONG
  229. Wx86RegCreateKeyW(
  230. HKEY hKey,
  231. LPCWSTR lpSubKey,
  232. PHKEY phkResult
  233. );
  234. WX86DLLAPI
  235. LONG
  236. Wx86RegCreateKeyExA(
  237. HKEY hKey,
  238. LPCSTR lpSubKey,
  239. DWORD Reserved,
  240. LPSTR lpClass,
  241. DWORD dwOptions,
  242. REGSAM samDesired,
  243. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  244. PHKEY phkResult,
  245. LPDWORD lpdwDisposition
  246. );
  247. WX86DLLAPI
  248. LONG
  249. Wx86RegCreateKeyExW(
  250. HKEY hKey,
  251. LPCWSTR lpSubKey,
  252. DWORD Reserved,
  253. LPWSTR lpClass,
  254. DWORD dwOptions,
  255. REGSAM samDesired,
  256. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  257. PHKEY phkResult,
  258. LPDWORD lpdwDisposition
  259. );
  260. WX86DLLAPI
  261. LONG
  262. Wx86RegDeleteKeyA(
  263. HKEY hKey,
  264. LPCSTR lpKeyName
  265. );
  266. WX86DLLAPI
  267. LONG
  268. Wx86RegDeleteKeyW(
  269. HKEY hKey,
  270. LPCWSTR lpKeyName
  271. );
  272. WX86DLLAPI
  273. LONG
  274. Wx86RegEnumKeyA(
  275. HKEY hKey,
  276. DWORD dwIndex,
  277. LPSTR lpName,
  278. DWORD cbName
  279. );
  280. WX86DLLAPI
  281. LONG
  282. Wx86RegEnumKeyW(
  283. HKEY hKey,
  284. DWORD dwIndex,
  285. LPWSTR lpName,
  286. DWORD cbName
  287. );
  288. WX86DLLAPI
  289. LONG
  290. Wx86RegEnumKeyExA(
  291. HKEY hKey,
  292. DWORD dwIndex,
  293. LPSTR lpName,
  294. LPDWORD lpcbName,
  295. LPDWORD lpReserved,
  296. LPSTR lpClass,
  297. LPDWORD lpcbClass,
  298. PFILETIME lpftLastWriteTime
  299. );
  300. WX86DLLAPI
  301. LONG
  302. Wx86RegEnumKeyExW(
  303. HKEY hKey,
  304. DWORD dwIndex,
  305. LPWSTR lpName,
  306. LPDWORD lpcbName,
  307. LPDWORD lpReserved,
  308. LPWSTR lpClass,
  309. LPDWORD lpcbClass,
  310. PFILETIME lpftLastWriteTime
  311. );
  312. WX86DLLAPI
  313. LONG
  314. Wx86RegOpenKeyA(
  315. HKEY hKey,
  316. LPCSTR lpSubKey,
  317. PHKEY phkResult
  318. );
  319. WX86DLLAPI
  320. LONG
  321. Wx86RegOpenKeyW(
  322. HKEY hKey,
  323. LPCWSTR lpSubKey,
  324. PHKEY phkResult
  325. );
  326. WX86DLLAPI
  327. LONG
  328. Wx86RegOpenKeyExA(
  329. HKEY hKey,
  330. LPCSTR lpSubKey,
  331. DWORD dwOptions,
  332. REGSAM samDesired,
  333. PHKEY phkResult
  334. );
  335. WX86DLLAPI
  336. LONG
  337. Wx86RegOpenKeyExW(
  338. HKEY hKey,
  339. LPCWSTR lpSubKey,
  340. DWORD dwOptions,
  341. REGSAM samDesired,
  342. PHKEY phkResult
  343. );
  344. WX86DLLAPI
  345. LONG
  346. Wx86RegQueryValueA(
  347. HKEY hKey,
  348. LPCSTR lpSubKey,
  349. LPSTR lpData,
  350. PLONG lpcbData
  351. );
  352. WX86DLLAPI
  353. LONG
  354. Wx86RegQueryValueW(
  355. HKEY hKey,
  356. LPCWSTR lpSubKey,
  357. LPWSTR lpData,
  358. PLONG lpcbData
  359. );
  360. WX86DLLAPI
  361. LONG
  362. Wx86RegQueryValueExA(
  363. HKEY hKey,
  364. LPCSTR lpValueName,
  365. LPDWORD lpReserved,
  366. LPDWORD lpdwType,
  367. LPBYTE lpData,
  368. LPDWORD lpcbData
  369. );
  370. WX86DLLAPI
  371. LONG
  372. Wx86RegQueryValueExW(
  373. HKEY hKey,
  374. LPCWSTR lpValueName,
  375. LPDWORD lpReserved,
  376. LPDWORD lpdwType,
  377. LPBYTE lpData,
  378. LPDWORD lpcbData
  379. );
  380. WX86DLLAPI
  381. LONG
  382. Wx86RegSetValueA(
  383. HKEY hKey,
  384. LPCSTR lpSubKey,
  385. DWORD dwType,
  386. LPCSTR lpData,
  387. DWORD cbData
  388. );
  389. WX86DLLAPI
  390. LONG
  391. Wx86RegSetValueW(
  392. HKEY hKey,
  393. LPCWSTR lpSubKey,
  394. DWORD dwType,
  395. LPCWSTR lpData,
  396. DWORD cbData
  397. );
  398. WX86DLLAPI
  399. LONG
  400. Wx86RegSetValueExA(
  401. HKEY hKey,
  402. LPCSTR lpValueName,
  403. DWORD Reserved,
  404. DWORD dwType,
  405. CONST BYTE* lpData,
  406. DWORD cbData
  407. );
  408. WX86DLLAPI
  409. LONG
  410. Wx86RegSetValueExW(
  411. HKEY hKey,
  412. LPCWSTR lpValueName,
  413. DWORD Reserved,
  414. DWORD dwType,
  415. CONST BYTE* lpData,
  416. DWORD cbData
  417. );
  418. WX86DLLAPI
  419. LONG
  420. Wx86RegDeleteValueA(
  421. HKEY hKey,
  422. LPCSTR lpValueName
  423. );
  424. WX86DLLAPI
  425. LONG
  426. Wx86RegDeleteValueW(
  427. HKEY hKey,
  428. LPCWSTR lpValueName
  429. );
  430. WX86DLLAPI
  431. LONG
  432. Wx86RegEnumValueA(
  433. HKEY hKey,
  434. DWORD dwIndex,
  435. LPSTR lpValueName,
  436. LPDWORD lpcbValueName,
  437. LPDWORD lpReserved,
  438. LPDWORD lpType,
  439. LPBYTE lpData,
  440. LPDWORD lpcbData
  441. );
  442. WX86DLLAPI
  443. LONG
  444. Wx86RegEnumValueW(
  445. HKEY hKey,
  446. DWORD dwIndex,
  447. LPWSTR lpValueName,
  448. LPDWORD lpcbValueName,
  449. LPDWORD lpReserved,
  450. LPDWORD lpType,
  451. LPBYTE lpData,
  452. LPDWORD lpcbData
  453. );
  454. WX86DLLAPI
  455. LONG
  456. Wx86RegQueryMultipleValuesA(
  457. HKEY hKey,
  458. PVALENTA val_list,
  459. DWORD num_vals,
  460. LPSTR lpValueBuf,
  461. LPDWORD ldwTotsize
  462. );
  463. WX86DLLAPI
  464. LONG
  465. Wx86RegQueryMultipleValuesW(
  466. HKEY hKey,
  467. PVALENTW val_list,
  468. DWORD num_vals,
  469. LPWSTR lpValueBuf,
  470. LPDWORD ldwTotsize
  471. );
  472. WX86DLLAPI
  473. LONG
  474. Wx86RegCloseKey(
  475. HKEY hKey
  476. );
  477. #ifdef UNICODE
  478. #define Wx86RegCreateKey Wx86RegCreateKeyA
  479. #define Wx86RegCreateKeyEx Wx86RegCreateKeyExA
  480. #define Wx86RegDeleteKey Wx86RegDeleteKeyA
  481. #define Wx86RegEnumKey Wx86RegEnumKeyA
  482. #define Wx86RegEnumKeyEx Wx86RegEnumKeyExA
  483. #define Wx86RegOpenKey Wx86RegOpenKeyA
  484. #define Wx86RegOpenKeyEx Wx86RegOpenKeyExA
  485. #define Wx86RegQueryValue Wx86RegQueryValueA
  486. #define Wx86RegQueryValueEx Wx86RegQueryValueExA
  487. #define Wx86RegSetValue Wx86RegSetValueA
  488. #define Wx86RegSetValueEx Wx86RegSetValueExA
  489. #define Wx86RegDeleteValue Wx86RegDeleteValueA
  490. #define Wx86RegEnumValue Wx86RegEnumValueA
  491. #define Wx86RegQueryMultipleValues Wx86RegQueryMultipleValuesA
  492. #else
  493. #define Wx86RegCreateKey Wx86RegCreateKeyW
  494. #define Wx86RegCreateKeyEx Wx86RegCreateKeyExW
  495. #define Wx86RegDeleteKey Wx86RegDeleteKeyW
  496. #define Wx86RegEnumKey Wx86RegEnumKeyW
  497. #define Wx86RegEnumKeyEx Wx86RegEnumKeyExW
  498. #define Wx86RegOpenKey Wx86RegOpenKeyW
  499. #define Wx86RegOpenKeyEx Wx86RegOpenKeyExW
  500. #define Wx86RegQueryValue Wx86RegQueryValueW
  501. #define Wx86RegQueryValueEx Wx86RegQueryValueExW
  502. #define Wx86RegSetValue Wx86RegSetValueW
  503. #define Wx86RegSetValueEx Wx86RegSetValueExW
  504. #define Wx86RegDeleteValue Wx86RegDeleteValueW
  505. #define Wx86RegEnumValue Wx86RegEnumValueW
  506. #define Wx86RegQueryMultipleValues Wx86RegQueryMultipleValuesW
  507. #endif
  508. #ifdef __cplusplus
  509. }
  510. #endif
  511. #endif // _WX86DLL_