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.

452 lines
9.4 KiB

  1. /*++
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name:
  4. wx86ofl.h
  5. Abstract:
  6. Wx86 On-The-Fly declarations/definitions.
  7. Revision History:
  8. 06-Jun-1998 CBiks Created
  9. --*/
  10. #ifndef WX86OFL_INCLUDED
  11. #define WX86OFL_INCLUDED
  12. #if _MSC_VER > 1000
  13. #pragma once
  14. #endif
  15. #ifdef WX86
  16. #include <unknwn.h>
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. // Each successful call to Wx86Load must be matched with a call to
  21. // Wx86Unload()
  22. BOOL Wx86Load();
  23. void Wx86Unload();
  24. // The following functions require wx86.dll to have been loaded
  25. UINT Wx86Callback(PROC pfnCallBack, HWND hwnd, UINT uMsg, LPARAM lParam);
  26. PVOID Wx86ThunkProc(PVOID pvAddress, PVOID pvCBDispatch, BOOL fNativeToX86 );
  27. PVOID Wx86DualThunkProc(PVOID pvAddress, PVOID pvCBDispatch, BOOL fNativeToX86 );
  28. ULONG Wx86EmulateX86(PVOID pvAddress, ULONG nParameters, PULONG Parameters);
  29. ULONGLONG Wx86EmulateX86GetQWord(PVOID pvAddress, ULONG nParameters,
  30. PULONG Parameters);
  31. IUnknown* Wx86ThunkInterface(IUnknown *punk, IID *piid,
  32. BOOLEAN fOutParameter, BOOLEAN fNativeToX86);
  33. void Wx86CheckFreeTempProxy(IUnknown *punk);
  34. IUnknown* Wx86ResolveProxy(IUnknown *punk, BOOLEAN fNativeToX86);
  35. HRESULT Wx86DllGetClassObjectThunk(IID *piid, LPVOID *ppv, HRESULT hr,
  36. BOOLEAN fNativetoX86);
  37. ULONG Wx86ProxyAddRef(IUnknown* punk);
  38. ULONG Wx86ProxyRelease(IUnknown* punk);
  39. // Wx86LoadX86Dll is retained for backward compatibility
  40. HMODULE Wx86LoadX86Dll(LPCWSTR lpLibFileName, DWORD dwFlags);
  41. BOOL Wx86FreeX86Dll(HMODULE hMod);
  42. // Wx86LoadX86Library is ifdef'd for UNICODE and non-UNICODE. This has been
  43. // added for compatibility with other Win32 functions as well as the functions
  44. // below. We cannot reuse the name Wx86LoadX86Dll because it is already defined
  45. // in wx86dll.h and will require cleaning up the code of all apps that use that
  46. // function
  47. //
  48. // At some point, this should be cleaned up and wx86dll.h should be eliminated.
  49. // A clean build will be required then.
  50. HMODULE Wx86LoadX86LibraryA(LPCSTR lpLibFileName, DWORD dwFlags);
  51. #define Wx86LoadX86LibraryW Wx86LoadX86Dll
  52. #ifdef UNICODE
  53. #define Wx86LoadX86Library Wx86LoadX86LibraryW
  54. #else
  55. #define Wx86LoadX86Library Wx86LoadX86LibraryA
  56. #endif // !UNICODE
  57. #define Wx86FreeX86Library Wx86FreeX86Dll
  58. //
  59. // The following functions do not require wx86.dll to be loaded
  60. //
  61. //
  62. // GetModuleHandle returns 0 if a native apps calls it with an x86 dll name.
  63. // This function will return the x86 dll's module handle.
  64. HMODULE Wx86GetX86ModuleHandleA(LPCSTR szDll);
  65. HMODULE Wx86GetX86ModuleHandleW(LPCWSTR szDll);
  66. #ifdef UNICODE
  67. #define Wx86GetX86ModuleHandle Wx86GetX86ModuleHandleW
  68. #else
  69. #define Wx86GetX86ModuleHandle Wx86GetX86ModuleHandleA
  70. #endif // !UNICODE
  71. UINT Wx86GetX86SystemDirectoryA(LPSTR lpBuffer, UINT nSize);
  72. UINT Wx86GetX86SystemDirectoryW(LPWSTR lpBuffer, UINT nSize);
  73. #ifdef UNICODE
  74. #define Wx86GetX86SystemDirectory Wx86GetX86SystemDirectoryW
  75. #else
  76. #define Wx86GetX86SystemDirectory Wx86GetX86SystemDirectoryA
  77. #endif // !UNICODE
  78. BOOL Wx86SuppressHardErrors(BOOL bSuppressHardErrors);
  79. BOOL Wx86IsCallThunked(VOID);
  80. BOOL Wx86UseKnownWx86Dll(BOOL bUseKnownWx86Dll);
  81. //
  82. // Helper functions for Wx86 plugin providers
  83. //
  84. typedef
  85. BOOLEAN
  86. (*WX86ENUMEXPORTCALLBACK)(
  87. PVOID DllBase, // same as DllBase above
  88. PVOID Context, // same as Context above
  89. PCHAR ExportName, // Name of Export (NULL if noname)
  90. ULONG Ordinal // Ordinal of Export
  91. );
  92. BOOL
  93. Wx86EnumExports(
  94. IN PVOID DllBase,
  95. IN PVOID Context,
  96. IN WX86ENUMEXPORTCALLBACK CallBackRtn
  97. );
  98. //
  99. // Registry thunking APIs
  100. //
  101. LONG
  102. Wx86RegCreateKeyA(
  103. HKEY hKey,
  104. LPCSTR lpSubKey,
  105. PHKEY phkResult
  106. );
  107. LONG
  108. Wx86RegCreateKeyW(
  109. HKEY hKey,
  110. LPCWSTR lpSubKey,
  111. PHKEY phkResult
  112. );
  113. LONG
  114. Wx86RegCreateKeyExA(
  115. HKEY hKey,
  116. LPCSTR lpSubKey,
  117. DWORD Reserved,
  118. LPSTR lpClass,
  119. DWORD dwOptions,
  120. REGSAM samDesired,
  121. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  122. PHKEY phkResult,
  123. LPDWORD lpdwDisposition
  124. );
  125. LONG
  126. Wx86RegCreateKeyExW(
  127. HKEY hKey,
  128. LPCWSTR lpSubKey,
  129. DWORD Reserved,
  130. LPWSTR lpClass,
  131. DWORD dwOptions,
  132. REGSAM samDesired,
  133. LPSECURITY_ATTRIBUTES lpSecurityAttributes,
  134. PHKEY phkResult,
  135. LPDWORD lpdwDisposition
  136. );
  137. LONG
  138. Wx86RegDeleteKeyA(
  139. HKEY hKey,
  140. LPCSTR lpKeyName
  141. );
  142. LONG
  143. Wx86RegDeleteKeyW(
  144. HKEY hKey,
  145. LPCWSTR lpKeyName
  146. );
  147. LONG
  148. Wx86RegEnumKeyA(
  149. HKEY hKey,
  150. DWORD dwIndex,
  151. LPSTR lpName,
  152. DWORD cbName
  153. );
  154. LONG
  155. Wx86RegEnumKeyW(
  156. HKEY hKey,
  157. DWORD dwIndex,
  158. LPWSTR lpName,
  159. DWORD cbName
  160. );
  161. LONG
  162. Wx86RegEnumKeyExA(
  163. HKEY hKey,
  164. DWORD dwIndex,
  165. LPSTR lpName,
  166. LPDWORD lpcbName,
  167. LPDWORD lpReserved,
  168. LPSTR lpClass,
  169. LPDWORD lpcbClass,
  170. PFILETIME lpftLastWriteTime
  171. );
  172. LONG
  173. Wx86RegEnumKeyExW(
  174. HKEY hKey,
  175. DWORD dwIndex,
  176. LPWSTR lpName,
  177. LPDWORD lpcbName,
  178. LPDWORD lpReserved,
  179. LPWSTR lpClass,
  180. LPDWORD lpcbClass,
  181. PFILETIME lpftLastWriteTime
  182. );
  183. LONG
  184. Wx86RegOpenKeyA(
  185. HKEY hKey,
  186. LPCSTR lpSubKey,
  187. PHKEY phkResult
  188. );
  189. LONG
  190. Wx86RegOpenKeyW(
  191. HKEY hKey,
  192. LPCWSTR lpSubKey,
  193. PHKEY phkResult
  194. );
  195. LONG
  196. Wx86RegOpenKeyExA(
  197. HKEY hKey,
  198. LPCSTR lpSubKey,
  199. DWORD dwOptions,
  200. REGSAM samDesired,
  201. PHKEY phkResult
  202. );
  203. LONG
  204. Wx86RegOpenKeyExW(
  205. HKEY hKey,
  206. LPCWSTR lpSubKey,
  207. DWORD dwOptions,
  208. REGSAM samDesired,
  209. PHKEY phkResult
  210. );
  211. LONG
  212. Wx86RegQueryValueA(
  213. HKEY hKey,
  214. LPCSTR lpSubKey,
  215. LPSTR lpData,
  216. PLONG lpcbData
  217. );
  218. LONG
  219. Wx86RegQueryValueW(
  220. HKEY hKey,
  221. LPCWSTR lpSubKey,
  222. LPWSTR lpData,
  223. PLONG lpcbData
  224. );
  225. LONG
  226. Wx86RegQueryValueExA(
  227. HKEY hKey,
  228. LPCSTR lpValueName,
  229. LPDWORD lpReserved,
  230. LPDWORD lpdwType,
  231. LPBYTE lpData,
  232. LPDWORD lpcbData
  233. );
  234. LONG
  235. Wx86RegQueryValueExW(
  236. HKEY hKey,
  237. LPCWSTR lpValueName,
  238. LPDWORD lpReserved,
  239. LPDWORD lpdwType,
  240. LPBYTE lpData,
  241. LPDWORD lpcbData
  242. );
  243. LONG
  244. Wx86RegSetValueA(
  245. HKEY hKey,
  246. LPCSTR lpSubKey,
  247. DWORD dwType,
  248. LPCSTR lpData,
  249. DWORD cbData
  250. );
  251. LONG
  252. Wx86RegSetValueW(
  253. HKEY hKey,
  254. LPCWSTR lpSubKey,
  255. DWORD dwType,
  256. LPCWSTR lpData,
  257. DWORD cbData
  258. );
  259. LONG
  260. Wx86RegSetValueExA(
  261. HKEY hKey,
  262. LPCSTR lpValueName,
  263. DWORD Reserved,
  264. DWORD dwType,
  265. CONST BYTE* lpData,
  266. DWORD cbData
  267. );
  268. LONG
  269. Wx86RegSetValueExW(
  270. HKEY hKey,
  271. LPCWSTR lpValueName,
  272. DWORD Reserved,
  273. DWORD dwType,
  274. CONST BYTE* lpData,
  275. DWORD cbData
  276. );
  277. LONG
  278. Wx86RegDeleteValueA(
  279. HKEY hKey,
  280. LPCSTR lpValueName
  281. );
  282. LONG
  283. Wx86RegDeleteValueW(
  284. HKEY hKey,
  285. LPCWSTR lpValueName
  286. );
  287. LONG
  288. Wx86RegEnumValueA(
  289. HKEY hKey,
  290. DWORD dwIndex,
  291. LPSTR lpValueName,
  292. LPDWORD lpcbValueName,
  293. LPDWORD lpReserved,
  294. LPDWORD lpType,
  295. LPBYTE lpData,
  296. LPDWORD lpcbData
  297. );
  298. LONG
  299. Wx86RegEnumValueW(
  300. HKEY hKey,
  301. DWORD dwIndex,
  302. LPWSTR lpValueName,
  303. LPDWORD lpcbValueName,
  304. LPDWORD lpReserved,
  305. LPDWORD lpType,
  306. LPBYTE lpData,
  307. LPDWORD lpcbData
  308. );
  309. LONG
  310. Wx86RegQueryMultipleValuesA(
  311. HKEY hKey,
  312. PVALENTA val_list,
  313. DWORD num_vals,
  314. LPSTR lpValueBuf,
  315. LPDWORD ldwTotsize
  316. );
  317. LONG
  318. Wx86RegQueryMultipleValuesW(
  319. HKEY hKey,
  320. PVALENTW val_list,
  321. DWORD num_vals,
  322. LPWSTR lpValueBuf,
  323. LPDWORD ldwTotsize
  324. );
  325. LONG
  326. Wx86RegCloseKey(
  327. HKEY hKey
  328. );
  329. #if defined(UNICODE)
  330. #define Wx86RegCreateKey Wx86RegCreateKeyA
  331. #define Wx86RegCreateKeyEx Wx86RegCreateKeyExA
  332. #define Wx86RegDeleteKey Wx86RegDeleteKeyA
  333. #define Wx86RegEnumKey Wx86RegEnumKeyA
  334. #define Wx86RegEnumKeyEx Wx86RegEnumKeyExA
  335. #define Wx86RegOpenKey Wx86RegOpenKeyA
  336. #define Wx86RegOpenKeyEx Wx86RegOpenKeyExA
  337. #define Wx86RegQueryValue Wx86RegQueryValueA
  338. #define Wx86RegQueryValueEx Wx86RegQueryValueExA
  339. #define Wx86RegSetValue Wx86RegSetValueA
  340. #define Wx86RegSetValueEx Wx86RegSetValueExA
  341. #define Wx86RegDeleteValue Wx86RegDeleteValueA
  342. #define Wx86RegEnumValue Wx86RegEnumValueA
  343. #define Wx86RegQueryMultipleValues Wx86RegQueryMultipleValuesA
  344. #else
  345. #define Wx86RegCreateKey Wx86RegCreateKeyW
  346. #define Wx86RegCreateKeyEx Wx86RegCreateKeyExW
  347. #define Wx86RegDeleteKey Wx86RegDeleteKeyW
  348. #define Wx86RegEnumKey Wx86RegEnumKeyW
  349. #define Wx86RegEnumKeyEx Wx86RegEnumKeyExW
  350. #define Wx86RegOpenKey Wx86RegOpenKeyW
  351. #define Wx86RegOpenKeyEx Wx86RegOpenKeyExW
  352. #define Wx86RegQueryValue Wx86RegQueryValueW
  353. #define Wx86RegQueryValueEx Wx86RegQueryValueExW
  354. #define Wx86RegSetValue Wx86RegSetValueW
  355. #define Wx86RegSetValueEx Wx86RegSetValueExW
  356. #define Wx86RegDeleteValue Wx86RegDeleteValueW
  357. #define Wx86RegEnumValue Wx86RegEnumValueW
  358. #define Wx86RegQueryMultipleValues Wx86RegQueryMultipleValuesW
  359. #endif
  360. #ifdef __cplusplus
  361. };
  362. #endif
  363. #endif // WX86
  364. #endif // WX86OFL_INCLUDED