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.

527 lines
13 KiB

  1. __foldwin32sstuff __foldwin32sstuff;
  2. foldstyleinitialization = true;
  3. enablemapdirect1632 = true;
  4. defaultholdwin16lock = true;
  5. #include "types.thk"
  6. DWORD ThunkMeowSetPSP(DWORD PSPSel) =
  7. DWORD MeowSetPSP(DWORD PSPSel)
  8. {}
  9. DWORD ThunkMeowUniToAnsi(DWORD pSrc, DWORD pDst, DWORD ccnt) =
  10. DWORD MeowUniToAnsi(DWORD pSrc, DWORD pDst, DWORD ccnt)
  11. {}
  12. DWORD ThunkMeowWakeThread(DWORD ptdb) =
  13. DWORD MeowWakeThread(DWORD ptdb)
  14. {}
  15. VOID ProgramResumeTimer(VOID)
  16. {
  17. releasewin16lock = true;
  18. }
  19. BOOL InitK32AfterSysDllsLoaded(VOID)
  20. {
  21. //This is called from SlowBoot after the system dlls have
  22. //been loaded. A good time for kernel32 to get addresses,
  23. //etc. from other system libraries.
  24. //There is only 1 thread when this thunk is called, so
  25. //serialization is irrelevant. Release the Win16Lock so we
  26. //don't trigger an assert in GrabDll.
  27. releasewin16lock = true;
  28. }
  29. bool FullLoRes(VOID)
  30. {
  31. target = LoRes;
  32. // This thunk must *not* release the win16lock.
  33. }
  34. DWORD GetNEPEBuddyFromFileName32( LPSTR lpszFileName)
  35. {
  36. target = GetNEPEBuddyFromFileName;
  37. }
  38. VOID WOAAbort(DWORD pConsole)
  39. {
  40. target = CON_WOAAbort;
  41. releasewin16lock = true;
  42. }
  43. BOOL IsThreadId(DWORD)
  44. {
  45. releasewin16lock = true;
  46. }
  47. VOID HGCleanupDepartingHTask(WORD hTask16)
  48. {
  49. //This is called from inside FreeTDB so we'd best not
  50. //release the Win16Lock (besides, HGCleanupDepartingHTask
  51. //will just grab it again. It's 32-bit code, but it manipulates
  52. //a krnl386 data structure).
  53. }
  54. BOOL SmashEnvironment(LPSTR pchEnv){
  55. releasewin16lock = true;
  56. }
  57. DWORD LoadLibraryEx32W(LPSTR lpFileName, DWORD hFile, DWORD dwFlags)
  58. {
  59. releasewin16lock = true;
  60. target = LoadLibraryExA;
  61. }
  62. BOOL LateBindWin32ThunkPartner(DWORD lpThunkData16,
  63. BOOL fWantExtraLink)
  64. {
  65. releasewin16lock = true;
  66. }
  67. DWORD CallProc32WHelper(DWORD lpParamStack, WORD wSS, BOOL fCSrc)
  68. {
  69. releasewin16lock = true;
  70. }
  71. DWORD CallProc32WFixHelper(DWORD lpParamStack, WORD wSS)
  72. {
  73. releasewin16lock = true;
  74. }
  75. WORD ThunkTheTemplateHandle(DWORD);
  76. BOOL FlatCommonThunkConnect16(LPSTR pszDll16,
  77. LPSTR pszDll32,
  78. DWORD lpThunkLSData16,
  79. LPSTR pszThunkLSData32Name,
  80. DWORD dwReason,
  81. WORD wUsage,
  82. WORD hModule16) =
  83. BOOL FlatCommonThunkConnect16(LPSTR pszDll16,
  84. LPSTR pszDll32,
  85. DWORD lpThunkLSData16,
  86. LPSTR pszThunkLSData32Name,
  87. DWORD dwReason,
  88. WORD wUsage,
  89. WORD hModule16)
  90. {
  91. // Do not, not, NOT release the Win16Lock here!!!
  92. // This gets called as part of a 16-bit library load and
  93. // free.
  94. }
  95. /* Special version of 32-bit LocalAlloc() that doesn't do any
  96. * ganged handle house-cleaning. Used by the ganging code itself
  97. * to prevent unwanted recursion.
  98. */
  99. DWORD LocalAlloc32NG(UINT fuFlags, DWORD dwSize) =
  100. DWORD LocalAllocNG(UINT fuFlags, DWORD dwSize)
  101. {
  102. // Can't release win16lock yet: GlobalAllocGanged preflights, then
  103. // allocs. GlobalAllocGanged() should just allocate first and
  104. // free the block if the database runs out of room. Then it can be
  105. // safely reentered.
  106. }
  107. BOOL SetProcessDword( DWORD dwProcessID, INT dwIndex, DWORD dwValue) =
  108. BOOL SetProcessDword( DWORD dwProcessID, LONG dwIndex, DWORD dwValue)
  109. {
  110. // Can't release win16lock: exported from krnl386 and used by user.
  111. }
  112. DWORD GetProcessDword( DWORD dwProcessID, INT dwIndex) =
  113. DWORD GetProcessDword( DWORD dwProcessID, LONG dwIndex)
  114. {
  115. // Can't release win16lock: exported from krnl386 and used by user.
  116. }
  117. DWORD RegisterServiceProcess( DWORD dwProcessID, DWORD dwServiceType) =
  118. DWORD RegisterServiceProcess( DWORD dwProcessID, DWORD dwServiceType)
  119. {}
  120. VOID IFatalAppExit(WORD dwAction, LPSTR lpMsg) =
  121. VOID FatalAppExitA(DWORD dwAction, LPSTR lpMsg)
  122. {}
  123. DWORD OpenFileEx16And32( LPSTR lpFileName, LPSTR lpReOpenBuff, UINT fuMode, LPSTR BinName, UINT fk16, UINT fWantCompat) =
  124. DWORD OpenFileEx16And32( LPSTR lpFileName, LPSTR lpReOpenBuff, UINT fuMode, LPSTR BinName, UINT fk16, UINT fWantCompat)
  125. {
  126. lpReOpenBuff = inout;
  127. }
  128. BOOL FileTimeToDosDateTime( LPSTR lpFileTime, LPWORD lpFatDate, LPWORD lpFatTime) =
  129. BOOL FileTimeToDosDateTime( LPSTR lpFileTime, LPWORD lpFatDate, LPWORD lpFatTime)
  130. {}
  131. void WinExecWait(DWORD pTDB32) =
  132. void WinExecWait(DWORD pTDB32)
  133. {
  134. }
  135. DWORD WaitForSingleObject(DWORD hObject, DWORD dwTimeout) =
  136. DWORD WaitForSingleObject(DWORD hObject, DWORD dwTimeout)
  137. {
  138. releasewin16lock = true;
  139. }
  140. /*
  141. VOID KernelUninit() =
  142. VOID KernelUninit()
  143. {}
  144. */
  145. BOOL VirtualFree(DWORD lpAddress,
  146. DWORD dwSize,
  147. DWORD dwFreeType) =
  148. BOOL VirtualFree(DWORD lpAddress,
  149. DWORD dwSize,
  150. DWORD dwFreeType)
  151. {
  152. }
  153. DWORD WOACreateConsole(DWORD hVM, WORD hWnd) =
  154. DWORD CON_WOACreateConsole(DWORD hVM, DWORD hWnd)
  155. {
  156. releasewin16lock = true;
  157. }
  158. VOID WOAFullScreen(DWORD pConsole, WORD status) =
  159. VOID CON_WOAFullScreen(DWORD pConsole, WORD status)
  160. {
  161. releasewin16lock = true;
  162. }
  163. VOID WOAGimmeTitle(DWORD pConsole, LPSTR lpBuf) =
  164. VOID CON_WOAGimmeTitle(DWORD pConsole, LPSTR lpBuf)
  165. {
  166. releasewin16lock = true;
  167. }
  168. DWORD WOASpawnConApp(DWORD pConsole) =
  169. DWORD CON_WOASpawnConApp(DWORD pConsole)
  170. {
  171. releasewin16lock = true;
  172. }
  173. VOID WOATerminateProcesses(DWORD pConsole) =
  174. VOID CON_WOATerminateProcesses(DWORD pConsole)
  175. {
  176. releasewin16lock = true;
  177. }
  178. VOID WOADestroyConsole(DWORD pConsole) =
  179. VOID CON_WOADestroyConsole(DWORD pConsole)
  180. {
  181. releasewin16lock = true;
  182. }
  183. DWORD ThunkLocal32Init(DWORD, DWORD, DWORD, DWORD) =
  184. DWORD Local32Init(DWORD, DWORD, DWORD, DWORD)
  185. {}
  186. DWORD ThunkLocal32Alloc(DWORD linHeader,
  187. DWORD dwcbRequest,
  188. INT lMemType,
  189. DWORD dwFlags) =
  190. DWORD Local32Alloc (DWORD linHeader,
  191. DWORD dwcbRequest,
  192. INT lMemType,
  193. DWORD dwFlags)
  194. {}
  195. DWORD ThunkLocal32ReAlloc(DWORD linHeader,
  196. DWORD dwMem,
  197. INT iType,
  198. DWORD dwcbNew,
  199. DWORD dwFlags) =
  200. DWORD Local32ReAlloc (DWORD linHeader,
  201. DWORD dwMem,
  202. INT iType,
  203. DWORD dwcbNew,
  204. DWORD dwFlags)
  205. {}
  206. DWORD ThunkLocal32Translate(DWORD linHeader,
  207. DWORD dwMem,
  208. INT wMemType,
  209. INT wRetType) =
  210. DWORD Local32Translate (DWORD linHeader,
  211. DWORD dwMem,
  212. INT wMemType,
  213. INT wRetType)
  214. {}
  215. DWORD ThunkLocal32SizeThkHlp(DWORD linHeader,
  216. DWORD dwMem,
  217. INT iMemType) =
  218. DWORD Local32Size (DWORD linHeader,
  219. DWORD dwMem,
  220. INT iMemType)
  221. {}
  222. BOOL ThunkLocal32Free(DWORD linHeader,
  223. DWORD dwMem,
  224. INT iType) =
  225. BOOL Local32Free (DWORD linHeader,
  226. DWORD dwMem,
  227. INT iType)
  228. {}
  229. BOOL ThunkLocal32ValidHandle(DWORD linHeader, UINT hMem) =
  230. BOOL Local32ValidHandle(DWORD linHeader, UINT hMem)
  231. {}
  232. /* This thunk is called from inside k16, which does all the pointer thunking
  233. * itself. So we pass pointers as dwords.
  234. */
  235. DWORD CreateProcessFromWinExec(DWORD lpName, DWORD lpCmdTail, DWORD dwCmdShow, DWORD lpCurDir) =
  236. DWORD CreateProcessFromWinExec(DWORD lpName, DWORD lpCmdTail, DWORD dwCmdShow, DWORD lpCurDir)
  237. {
  238. releasewin16lock = true;
  239. }
  240. DWORD ThunkGetProcAddress32(DWORD dwHModule, LPSTR lpProcName) =
  241. DWORD GetProcAddress(DWORD dwHModule, LPSTR lpProcName)
  242. {
  243. releasewin16lock = true;
  244. }
  245. DWORD ThunkLoadLibrary32(LPSTR lpProcName) =
  246. DWORD LoadLibraryA(LPSTR lpProcName)
  247. {
  248. releasewin16lock = true;
  249. }
  250. BOOL ThunkFreeLibrary32(DWORD dwHModule) =
  251. BOOL FreeLibrary(DWORD dwHModule)
  252. {
  253. releasewin16lock = true;
  254. }
  255. VOID FreeInitResources32() =
  256. VOID FreeInitResources()
  257. {}
  258. /* Yes, the return type should really be BOOL but the old internal
  259. * thunk that this thunk replaces treated it as DWORD and exported it
  260. * out of k16. To be compatible, we have to maintain that behavior. Ugh!
  261. */
  262. DWORD ThunkSetW32Event(DWORD dwHEvent) =
  263. DWORD SetEvent(DWORD dwHEvent)
  264. {}
  265. /* Yes, the return type should really be BOOL but the old internal
  266. * thunk that this thunk replaces treated it as DWORD and exported it
  267. * out of k16. To be compatible, we have to maintain that behavior. Ugh!
  268. */
  269. DWORD ThunkResetW32Event(DWORD dwHEvent) =
  270. DWORD ResetEvent(DWORD dwHEvent)
  271. {}
  272. /* K16 calls this thunk and thunks the parameters. We just mode switch.
  273. */
  274. DWORD ThunkCreateW32Event(DWORD, DWORD, DWORD, DWORD) =
  275. DWORD CreateEventA(DWORD, DWORD, DWORD, DWORD)
  276. {}
  277. WORD ThunkGetHModK16FromHModK32(DWORD hmod) =
  278. WORD GetHModK16FromHModK32( DWORD hmod)
  279. {}
  280. DWORD ThunkCreateProcessWin16(DWORD pptdb, DWORD pstib, DWORD Win16Tdb, DWORD lpStartAddr) =
  281. DWORD CreateProcessWin16(DWORD pptdb, DWORD pstib, DWORD Win16Tdb, DWORD lpStartAddr)
  282. {}
  283. /* Special routine called from K16. K16 thunks all the parameters so we
  284. * just provide the mode switch.
  285. */
  286. DWORD ThunkCreateThread16(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD) =
  287. DWORD CreateThread16(DWORD, DWORD, DWORD, DWORD, DWORD, DWORD)
  288. {}
  289. BOOL ThunkTerminateThread(DWORD hThread, DWORD dwExitCode) =
  290. BOOL TerminateThread(DWORD hThread, DWORD dwExitCode)
  291. {}
  292. VOID ThunkExitProcess(UINT uExitCode) =
  293. VOID ExitProcess(UINT uExitCode)
  294. {
  295. releasewin16lock = true;
  296. }
  297. BOOL ThunkTerminateProcess(DWORD hProcess, UINT uExitCode) =
  298. BOOL TerminateProcess(DWORD hProcess, UINT uExitCode)
  299. {
  300. releasewin16lock = true;
  301. }
  302. VOID ThunkCloseDOSHandles() =
  303. VOID CloseDOSHandles()
  304. {}
  305. BOOL ThunkCloseW32Handle(DWORD Handle) =
  306. BOOL CloseHandle(DWORD Handle)
  307. {}
  308. DWORD WaitForMultipleObjectsEx (DWORD cObjects,
  309. LPVOID lphObjects,
  310. DWORD bWaitForAll,
  311. DWORD dwTimeOut,
  312. DWORD bAlertable) =
  313. DWORD WaitForMultipleObjectsEx (DWORD cObjects,
  314. LPVOID lphObjects,
  315. DWORD bWaitForAll,
  316. DWORD dwTimeOut,
  317. DWORD bAlertable)
  318. {
  319. releasewin16lock = true;
  320. }
  321. DWORD ThunkConvertToGlobalHandle(DWORD Handle) =
  322. DWORD ConvertToGlobalHandle(DWORD Handle)
  323. {}
  324. DWORD ThunkGetModuleFileName(DWORD hModule, LPSTR lpFileName, UINT nSize) =
  325. DWORD GetModuleFileNameA (DWORD hModule, LPSTR lpFileName, UINT nSize)
  326. {
  327. releasewin16lock = true;
  328. }
  329. DWORD ThunkMapProcessHandle(DWORD dwHandle) =
  330. DWORD MapProcessHandle(DWORD dwHandle)
  331. {}
  332. DWORD ThunkGetCurrentDirectory(DWORD cch, LPSTR lpBuffer) =
  333. DWORD GetCurrentDirectoryA(DWORD cch, LPSTR lpBuffer)
  334. {}
  335. BOOL NukeProcess(DWORD ppdb, UINT uExitCode, ULONG ulFlags) =
  336. BOOL NukeProcess(DWORD ppdb, UINT uExitCode, ULONG ulFlags)
  337. {
  338. releasewin16lock = true;
  339. }
  340. VOID CreateFaultThread() =
  341. VOID CreateFaultThread()
  342. {}
  343. BOOL GetVersionEx(LPSTR lpBuffer) =
  344. BOOL GetVersionExA(LPSTR lpBuffer)
  345. {}
  346. DWORD FindFirstFile(LPSTR lpszSearchFile, LPSTR lpFindData) =
  347. DWORD FindFirstFileA(LPSTR lpszSearchFile, LPSTR lpFindData)
  348. {}
  349. BOOL FindNextFile(DWORD hFindFile, LPSTR lpFindData) =
  350. BOOL FindNextFileA(DWORD hFindFile, LPSTR lpFindData)
  351. {}
  352. BOOL FindClose(DWORD hFindFile) =
  353. BOOL FindClose(DWORD hFindFile)
  354. {}
  355. BOOL FileTimeToLocalFileTime(LPSTR lpcfiletime, LPSTR lpfiletime) =
  356. BOOL FileTimeToLocalFileTime(LPSTR lpcfiletime, LPSTR lpfiletime)
  357. {}
  358. DWORD SetCurrentDirectory32(LPSTR lpszDir) =
  359. DWORD SetCurrentDirectoryA(LPSTR lpszDir)
  360. {}
  361. DWORD GetCurrentDirectory(DWORD cb, LPSTR lpszDir) =
  362. DWORD GetCurrentDirectoryA(DWORD cb, LPSTR lpszDir)
  363. {}
  364. DWORD GetModuleHandle32(LPSTR lpszModule) =
  365. DWORD GetModuleHandleA(LPSTR lpszModule)
  366. {}
  367. VOID InvalidateNLSCache() =
  368. VOID InvalidateNLSCache()
  369. {}
  370. VOID ISetErrorModeEx(UINT wErrorMode) =
  371. VOID SetErrorMode(UINT wErrorMode)
  372. {}
  373. VOID NotifyDetachFromWin16() =
  374. VOID NotifyDetachFromWin16()
  375. {
  376. releasewin16lock = true;
  377. }
  378. VOID ThunkDeallocOrphanedCrsts() =
  379. VOID ThunkDeallocOrphanedCrsts()
  380. {
  381. }
  382. VOID FaultSave(LPVOID pfaultinfo) =
  383. VOID FaultSave(LPVOID pfaultinfo)
  384. {
  385. }
  386. VOID FaultRestore(LPVOID pfaultinfo) =
  387. VOID FaultRestore(LPVOID pfaultinfo)
  388. {
  389. }
  390. DWORD GetACP()=
  391. DWORD GetACP()
  392. {
  393. }