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.

569 lines
12 KiB

  1. __foldwin32sstuff __foldwin32sstuff;
  2. foldstyleinitialization = true;
  3. enablemapdirect3216 = true;
  4. flatthunks = true;
  5. #include "types.thk"
  6. VOID FreeCB(WORD wSel);
  7. VOID UTProcessExit(WORD hUTState);
  8. BOOL UTRegisterInt(DWORD hInst32,
  9. LPSTR lpszDll16,
  10. LPSTR lpszInitFunc,
  11. LPSTR lpszThunkFunc,
  12. LPDWORD ppfnThunk32Func,
  13. DWORD Callback,
  14. DWORD lpvData,
  15. DWORD pfnAllocLSCallback,
  16. DWORD pfnUTLSThkTemplate)
  17. {
  18. }
  19. VOID UTUnregisterInt(DWORD hInst32,
  20. DWORD pfnFreeLSCallback);
  21. DWORD UTThunkLSHelper(DWORD lp16Target, DWORD lpvParam, DWORD dwParam, LPVOID lpTransList);
  22. VOID SSChk(VOID);
  23. VOID FreeLibrary16ByName(LPSTR);
  24. // Special yield for thread 1 during termination
  25. VOID Yield16(VOID)
  26. {}
  27. //// We will not thunk any pointers here. It's more efficient to access them
  28. //// flatly from the 16-bit side.
  29. //BOOL WOWCallback16ExHelper(DWORD vmpfn16, DWORD cbArgs, DWORD pArgs, DWORD pdwRetCode);
  30. //// Daytona Generic Thunk api.
  31. //DWORD WOWCallback16(DWORD pfn16, DWORD dwParam)
  32. //{
  33. // target = Callback8;
  34. //}
  35. // WOW NT Yield functions.
  36. VOID WOWYield16(VOID)
  37. {
  38. target = Yield;
  39. }
  40. VOID WOWDirectedYield16(WORD hTask16)
  41. {
  42. target = DirectedYield;
  43. }
  44. // WOW NT global memory management
  45. WORD WOWGlobalAlloc16(WORD wFlags, DWORD cb);
  46. WORD WOWGlobalFree16(WORD hMem) // Yes, we do not thunk the return pointer.
  47. {
  48. target = GlobalFree;
  49. }
  50. DWORD WOWGlobalLock16(WORD hMem)
  51. {
  52. target = GlobalLock;
  53. }
  54. BOOL WOWGlobalUnlock16(WORD hMem)
  55. {
  56. target = GlobalUnlock;
  57. }
  58. DWORD WOWGlobalAllocLock16(WORD wFlags, DWORD cb, WORD *phMem);
  59. WORD WOWGlobalUnlockFree16(DWORD vpMem);
  60. DWORD WOWGlobalLockSize16(WORD hMem, DWORD *pcb);
  61. // Has to be INT to accomodate -1 error return
  62. INT TCD_Enum(WORD hModule, LPVOID lpBuffer, UINT wLimit);
  63. VOID TCD_UnregisterPDB32(DWORD pdb32);
  64. UINT FakeThunkTheTemplateHandle(DWORD lp32Template);
  65. WORD GrowMBABlock(WORD gHnd, DWORD dwNewHalfSize, DWORD dwOldHalfSize, WORD hModule) =
  66. DWORD GrowMBABlock(WORD gHnd, DWORD dwNewHalfSize, DWORD dwOldHalfSize, WORD hModule)
  67. {
  68. faulterrorcode = 0;
  69. }
  70. DWORD SegCommonThunkAttach32(LPSTR pszDll16,
  71. LPSTR pszDll32,
  72. LPSTR lpThunkLSData32,
  73. LPSTR pszThunkLSData16Name) =
  74. DWORD SegCommonThunkAttach32(LPSTR pszDll16,
  75. LPSTR pszDll32,
  76. LPSTR lpThunkLSData32,
  77. LPSTR pszThunkLSData16Name)
  78. {
  79. faulterrorcode = 0;
  80. }
  81. VOID SegCommonThunkDetach32(LPSTR pszDll16,
  82. LPSTR pszDll32) =
  83. VOID SegCommonThunkDetach32(LPSTR pszDll16,
  84. LPSTR pszDll32)
  85. {
  86. faulterrorcode = 0;
  87. }
  88. /* Internal routine for consistency-checking the handle group manager's
  89. * data structures.
  90. */
  91. void CheckHGHeap() =
  92. void CheckHGHeap()
  93. {
  94. faulterrorcode = 0;
  95. }
  96. /* Internal routine for nuking a handle group.
  97. */
  98. void GlobalNukeGroup(WORD wGroup) =
  99. void GlobalNukeGroup(WORD wGroup)
  100. {
  101. faulterrorcode = 0;
  102. }
  103. void GlobalFix( UINT sel) =
  104. void GlobalFix16( UINT sel)
  105. {
  106. faulterrorcode = 0;
  107. }
  108. void GlobalUnfix( UINT sel) =
  109. void GlobalUnfix16( UINT sel)
  110. {
  111. faulterrorcode = 0;
  112. }
  113. void GlobalWire( UINT sel) =
  114. void GlobalWire16( UINT sel)
  115. {
  116. faulterrorcode = 0;
  117. }
  118. void GlobalUnWire( UINT sel) =
  119. void GlobalUnWire16( UINT sel)
  120. {
  121. faulterrorcode = 0;
  122. }
  123. UINT LoadLibrary16( LPSTR pszModName)
  124. {
  125. faulterrorcode = 0;
  126. }
  127. void FreeLibrary( UINT hInst) =
  128. void FreeLibrary16( UINT hInst)
  129. {
  130. faulterrorcode = 0;
  131. }
  132. /*
  133. * ThkGetProcAddress calls GetProcAddress and then touches the
  134. * entry point so it gets faulted in from 16-bit code.
  135. */
  136. DWORD ThkGetProcAddress( UINT hInst, LPSTR pszProcName) =
  137. DWORD GetProcAddress16( UINT hInst, LPSTR pszProcName)
  138. {
  139. faulterrorcode = 0;
  140. }
  141. UINT ThunkInitLSWorker16( UINT sel);
  142. UINT IFreeSelector( UINT sel) =
  143. UINT FreeSelector16( UINT sel)
  144. {
  145. faulterrorcode = 0;
  146. }
  147. DWORD ThkInitWin32Task() =
  148. DWORD ThkInitWin32Task()
  149. {
  150. faulterrorcode = 0;
  151. }
  152. UINT ThkCreateTask( UINT selPSP, DWORD pTDB, UINT selTib) =
  153. UINT ThkCreateTask( UINT selPSP, DWORD pTDB, UINT selTib)
  154. {
  155. faulterrorcode = 0;
  156. }
  157. UINT ThkDeleteTask( UINT hTaskK16) =
  158. UINT ThkDeleteTask( UINT hTaskK16)
  159. {
  160. faulterrorcode = 0;
  161. }
  162. VOID SetTaskName16(WORD htask, LPSTR lpstr) =
  163. VOID SetTaskName16(DWORD htask, LPSTR lpstr)
  164. {
  165. }
  166. LPSTR GetTaskName16(WORD htask, LPSTR lpstr) =
  167. LPSTR GetTaskName16(DWORD htask, LPSTR lpstr)
  168. {
  169. faulterrorcode = 0;
  170. }
  171. LPSTR GetModuleName16(WORD cs, LPSTR lpstr, LPWORD lpwSegNum) =
  172. LPSTR GetModuleName16(DWORD cs, LPSTR lpstr, LPWORD lpwSegNum)
  173. {
  174. faulterrorcode = 0;
  175. }
  176. DWORD GetWinFlags( ) =
  177. DWORD GetWinFlags( )
  178. {
  179. faulterrorcode = 0;
  180. }
  181. WORD GetProductName(LPSTR, WORD) =
  182. DWORD GetProductName(LPSTR, DWORD)
  183. {
  184. }
  185. WORD GetModuleFileName( WORD, LPSTR, WORD) =
  186. DWORD PrivateGetModuleFileName(DWORD, LPSTR, DWORD)
  187. {
  188. faulterrorcode = 0;
  189. }
  190. WORD
  191. WinExecEnv(
  192. LPSTR lpCmdLine,
  193. WORD nCmdShow,
  194. WORD wSegEnv
  195. )
  196. {
  197. faulterrorcode = 0;
  198. }
  199. HANDLE GlobalAlloc(UINT dwFlags, DWORD dwBytes) =
  200. HANDLE GlobalAlloc16(UINT dwFlags, DWORD dwBytes)
  201. {
  202. faulterrorcode = 0;
  203. }
  204. HANDLE GlobalReAlloc(HANDLE hMem, DWORD dwBytes, UINT dwFlags) =
  205. HANDLE GlobalReAlloc16(HANDLE hMem, DWORD dwBytes, UINT dwFlags)
  206. {
  207. faulterrorcode = 0;
  208. }
  209. HANDLE GlobalFree( HANDLE hMem) =
  210. HANDLE GlobalFree16( HANDLE hMem)
  211. {
  212. faulterrorcode = 0;
  213. }
  214. BOOL GlobalUnlock( HANDLE hMem) =
  215. BOOL GlobalUnlock16( HANDLE hMem)
  216. {
  217. faulterrorcode = 0;
  218. }
  219. UINT GlobalFlags( HANDLE hMem) =
  220. UINT GlobalFlags16( HANDLE hMem)
  221. {
  222. faulterrorcode = 0;
  223. }
  224. DWORD GlobalSize( HANDLE hMem) =
  225. DWORD GlobalSize16( HANDLE hMem)
  226. {
  227. faulterrorcode = 0;
  228. }
  229. HANDLE GlobalHandle( UINT sel ) =
  230. HANDLE GlobalHandle16( UINT sel )
  231. {
  232. faulterrorcode = 0;
  233. }
  234. /* Profile apis */
  235. /* BUGBUG [KevinR] 12-Mar-1993
  236. * Win32s implements natively in combo\base.c
  237. * We should follow suit?
  238. */
  239. /* We thunk to IGetProfileString to skip the k16 validation layer.
  240. * This is because Win32 GetProfileString allows a NULL lpAppName case
  241. * that Win16 doesn't.
  242. */
  243. WORD IGetProfileString(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpDefault, LPSTR lpReturnedString, WORD nSize) =
  244. DWORD GetProfileStringA(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpDefault, LPSTR lpReturnedString, DWORD nSize)
  245. {
  246. faulterrorcode = 0;
  247. }
  248. BOOL WriteProfileString(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpString) =
  249. BOOL WriteProfileStringA(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpString)
  250. {
  251. faulterrorcode = 0;
  252. }
  253. /* We thunk to IGetPrivateProfileString to skip the k16 validation layer.
  254. * This is because Win32 GetPrivateProfileString allows a NULL lpAppName case
  255. * that Win16 doesn't.
  256. */
  257. WORD IGetPrivateProfileString(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpDefault, LPSTR lpReturnedString, WORD nSize, LPSTR lpFile) =
  258. DWORD GetPrivateProfileString32A(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpDefault, LPSTR lpReturnedString, DWORD nSize, LPSTR lpFile)
  259. {
  260. faulterrorcode = 0;
  261. }
  262. BOOL WritePrivateProfileString(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpString, LPSTR lpFile) =
  263. BOOL WritePrivateProfileString32A(LPSTR lpAppName, LPSTR lpKeyName, LPSTR lpString, LPSTR lpFile)
  264. {
  265. faulterrorcode = 0;
  266. }
  267. UINT GetPrivateProfileSection(LPSTR lpszSection, LPSTR lpszReturnBuffer, UINT cchBuffer, LPSTR lpszFile) =
  268. DWORD GetPrivateProfileSection32A(LPSTR lpszSection, LPSTR lpszReturnBuffer, DWORD cchBuffer, LPSTR lpszFile)
  269. {
  270. faulterrorcode = 0;
  271. }
  272. BOOL WritePrivateProfileSection(LPSTR lpszSection, LPSTR lpszReturnBuffer, LPSTR lpszFile) =
  273. BOOL WritePrivateProfileSection32A(LPSTR lpszSection, LPSTR lpszReturnBuffer, LPSTR lpszFile)
  274. {
  275. faulterrorcode = 0;
  276. }
  277. UINT GetProfileSection(LPSTR lpszSection, LPSTR lpszReturnBuffer, UINT cchBuffer) =
  278. DWORD GetProfileSectionA(LPSTR lpszSection, LPSTR lpszReturnBuffer, DWORD cchBuffer)
  279. {
  280. faulterrorcode = 0;
  281. }
  282. BOOL WriteProfileSection(LPSTR lpszSection, LPSTR lpszReturnBuffer ) =
  283. BOOL WriteProfileSectionA(LPSTR lpszSection, LPSTR lpszReturnBuffer )
  284. {
  285. faulterrorcode = 0;
  286. }
  287. /* Yes, I double-checked k16. The return type *is* BOOL. */
  288. BOOL GetPrivateProfileStruct(LPSTR lpszSection, LPSTR szKey, LPSTR lpStruct, UINT uSizeStruct, LPSTR szFile) =
  289. BOOL GetPrivateProfileStruct32A(LPSTR lpszSection, LPSTR szKey, LPSTR lpStruct, UINT uSizeStruct, LPSTR szFile)
  290. {
  291. szFile = passifhinull;
  292. faulterrorcode = 0;
  293. }
  294. BOOL WritePrivateProfileStruct(LPSTR lpszSection, LPSTR szKey, LPSTR lpStruct, UINT wSizeStruct, LPSTR szFile) =
  295. BOOL WritePrivateProfileStruct32A(LPSTR lpszSection, LPSTR szKey, LPSTR lpStruct, UINT wSizeStruct, LPSTR szFile)
  296. {
  297. lpStruct = passifhinull;
  298. szFile = passifhinull;
  299. faulterrorcode = 0;
  300. }
  301. WORD GetPrivateProfileSectionNames(LPSTR lpszReturnBuffer, UINT cchBuffer, LPSTR lpszFile) =
  302. DWORD GetPrivateProfileSectionNames32A(LPSTR lpszReturnBuffer, DWORD cchBuffer, LPSTR lpszFile)
  303. {
  304. faulterrorcode = 0;
  305. }
  306. /*
  307. * global atom apis
  308. */
  309. WORD GlobalAddAtom( LPSTR lpsz) =
  310. DWORD GlobalAddAtomA( LPSTR lpsz)
  311. {
  312. faulterrorcode = 0;
  313. }
  314. WORD GlobalFindAtom( LPSTR lpsz) =
  315. DWORD GlobalFindAtomA( LPSTR lpsz)
  316. {
  317. faulterrorcode = 0;
  318. }
  319. WORD GlobalDeleteAtom( WORD atom) =
  320. DWORD GlobalDeleteAtom( DWORD atom)
  321. {
  322. faulterrorcode = 0;
  323. }
  324. WORD GlobalGetAtomName( WORD atom, LPSTR lpBuff, WORD cbSize) =
  325. DWORD GlobalGetAtomNameA( DWORD atom, LPSTR lpBuff, DWORD cbSize)
  326. {
  327. faulterrorcode = 0;
  328. }
  329. /*
  330. * Directory APIs
  331. */
  332. WORD GetWindowsDirectory(LPSTR lpBuffer, WORD nSize) =
  333. DWORD GetWindowsDirectoryA(LPSTR lpBuffer, DWORD nSize)
  334. {
  335. faulterrorcode = 0;
  336. }
  337. WORD GetSystemDirectory(LPSTR lpBuffer, WORD nSize) =
  338. DWORD GetSystemDirectoryA(LPSTR lpBuffer, DWORD nSize)
  339. {
  340. faulterrorcode = 0;
  341. }
  342. UINT SetErrorMode16(UINT fuErrorMode) =
  343. UINT SetErrorMode16(UINT fuErrorMode)
  344. {
  345. faulterrorcode = 0;
  346. }
  347. WORD GetErrorMode() =
  348. DWORD GetErrorMode()
  349. {
  350. faulterrorcode = 0;
  351. }
  352. SHORT OpenFile(LPSTR lpFileName, LPSTR lpReOpenBuff, WORD wStyle)=
  353. LONG ThkOpenFile(LPSTR lpFileName, LPSTR lpReOpenBuff, DWORD wStyle)
  354. {
  355. faulterrorcode = 0;
  356. }
  357. BOOL ExecConsoleAgent() =
  358. BOOL ExecConsoleAgent()
  359. {
  360. faulterrorcode = 0;
  361. }
  362. BOOL IsDriveCDRom(WORD wDriveNum) =
  363. BOOL IsDriveCDRom(WORD wDriveNum)
  364. {
  365. faulterrorcode = 0;
  366. }
  367. LPSTR GlobalLock( HANDLE hMem) =
  368. LPSTR GlobalLock16( HANDLE hMem)
  369. {
  370. faulterrorcode = 0;
  371. }
  372. WORD Win32AddAtom( LPSTR lpsz) =
  373. DWORD AddAtomA( LPSTR lpsz)
  374. {
  375. faulterrorcode = 0;
  376. }
  377. WORD Win32FindAtom( LPSTR lpsz) =
  378. DWORD FindAtomA( LPSTR lpsz)
  379. {
  380. faulterrorcode = 0;
  381. }
  382. WORD Win32DeleteAtom( WORD atom) =
  383. DWORD DeleteAtom( DWORD atom)
  384. {
  385. faulterrorcode = 0;
  386. }
  387. WORD Win32GetAtomName( WORD atom, LPSTR lpBuff, WORD cbSize) =
  388. DWORD GetAtomNameA( DWORD atom, LPSTR lpBuff, DWORD cbSize)
  389. {
  390. faulterrorcode = 0;
  391. }
  392. BOOL Win32InitAtomTable(WORD cTableEntries) =
  393. BOOL InitAtomTable(DWORD cTableEntries)
  394. {
  395. faulterrorcode = 0;
  396. }
  397. DWORD CommConfigThk( DWORD dwId, LPSTR pszLibName, LPSTR pszProcName,
  398. LPSTR pszFriendlyDeviceName, LPSTR pCommConfig,
  399. LPSTR pdwSize, DWORD dwSizeOrHwnd) =
  400. DWORD CommConfigThk( DWORD dwId, LPSTR pszLibName, LPSTR pszProcName,
  401. LPSTR pszFriendlyDeviceName, LPSTR pCommConfig,
  402. LPSTR pdwSize, DWORD dwSizeOrHwnd)
  403. {
  404. faulterrorcode = 0;
  405. }
  406. VOID PK16FNF(PVOID)
  407. {}
  408. BOOL SetVolumeLabel( LPSTR pszRootPathName, LPSTR pszVolumeName) =
  409. BOOL SetVolumeLabel16( LPSTR pszRootPathName, LPSTR pszVolumeName)
  410. {
  411. faulterrorcode = 0;
  412. }
  413. BOOL GetFastQueue() =
  414. BOOL GetFastQueue()
  415. {
  416. faulterrorcode = 0;
  417. }
  418. VOID DispatchRITInput() =
  419. VOID DispatchRITInput()
  420. {
  421. faulterrorcode = 0;
  422. }
  423. VOID DiagOutput( LPSTR psz ) =
  424. VOID DiagOutput16( LPSTR psz )
  425. {
  426. faulterrorcode = 0;
  427. }
  428. VOID TerminateZombie( WORD wpspsel ) =
  429. VOID TerminateZombie( WORD wpspsel )
  430. {
  431. }