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.

341 lines
5.4 KiB

  1. /*++
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WKGLOBAL.C
  8. * WOW32 16-bit Kernel API support
  9. *
  10. * History:
  11. * Created 07-Mar-1991 by Jeff Parsons (jeffpar)
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. #include "wkglobal.h"
  16. MODNAME(wkglobal.c);
  17. ULONG FASTCALL WK32GlobalAlloc(PVDMFRAME pFrame)
  18. {
  19. ULONG ul;
  20. register PGLOBALALLOC16 parg16;
  21. GETARGPTR(pFrame, sizeof(GLOBALALLOC16), parg16);
  22. ul = GETHGLOBAL16(GlobalAlloc(
  23. WORD32(parg16->f1),
  24. DWORD32(parg16->f2)
  25. ));
  26. FREEARGPTR(parg16);
  27. RETURN(ul);
  28. }
  29. ULONG FASTCALL WK32GlobalCompact(PVDMFRAME pFrame)
  30. {
  31. ULONG ul;
  32. register PGLOBALCOMPACT16 parg16;
  33. GETARGPTR(pFrame, sizeof(GLOBALCOMPACT16), parg16);
  34. #ifdef API16
  35. ul = GETDWORD16(GlobalCompact(
  36. DWORD32(parg16->f1)
  37. ));
  38. #else
  39. ul = 0;
  40. #endif
  41. FREEARGPTR(parg16);
  42. RETURN(ul);
  43. }
  44. ULONG FASTCALL WK32GlobalFix(PVDMFRAME pFrame)
  45. {
  46. register PGLOBALFIX16 parg16;
  47. GETARGPTR(pFrame, sizeof(GLOBALFIX16), parg16);
  48. #ifdef API16
  49. GlobalFix(
  50. HGLOBAL32(parg16->f1)
  51. );
  52. #endif
  53. FREEARGPTR(parg16);
  54. RETURN(0);
  55. }
  56. ULONG FASTCALL WK32GlobalFlags(PVDMFRAME pFrame)
  57. {
  58. ULONG ul;
  59. register PGLOBALFLAGS16 parg16;
  60. GETARGPTR(pFrame, sizeof(GLOBALFLAGS16), parg16);
  61. ul = GETWORD16(GlobalFlags(
  62. HGLOBAL32(parg16->f1)
  63. ));
  64. FREEARGPTR(parg16);
  65. RETURN(ul);
  66. }
  67. ULONG FASTCALL WK32GlobalFree(PVDMFRAME pFrame)
  68. {
  69. ULONG ul;
  70. register PGLOBALFREE16 parg16;
  71. GETARGPTR(pFrame, sizeof(GLOBALFREE16), parg16);
  72. ul = GETHGLOBAL16(GlobalFree(
  73. HGLOBAL32(parg16->f1)
  74. ));
  75. FREEARGPTR(parg16);
  76. RETURN(ul);
  77. }
  78. ULONG FASTCALL WK32GlobalHandle(PVDMFRAME pFrame)
  79. {
  80. ULONG ul;
  81. register PGLOBALHANDLE16 parg16;
  82. GETARGPTR(pFrame, sizeof(GLOBALHANDLE16), parg16);
  83. #ifdef API16
  84. ul = GETDWORD16(GlobalHandle(
  85. WORD32(parg16->f1)
  86. ));
  87. #else
  88. ul = 0;
  89. #endif
  90. FREEARGPTR(parg16);
  91. RETURN(ul);
  92. }
  93. ULONG FASTCALL WK32GlobalLRUNewest(PVDMFRAME pFrame)
  94. {
  95. ULONG ul;
  96. register PGLOBALLRUNEWEST16 parg16;
  97. GETARGPTR(pFrame, sizeof(GLOBALLRUNEWEST16), parg16);
  98. ul = GETHGLOBAL16(GlobalLRUNewest(
  99. HGLOBAL32(parg16->f1)
  100. ));
  101. FREEARGPTR(parg16);
  102. RETURN(ul);
  103. }
  104. ULONG FASTCALL WK32GlobalLRUOldest(PVDMFRAME pFrame)
  105. {
  106. ULONG ul;
  107. register PGLOBALLRUOLDEST16 parg16;
  108. GETARGPTR(pFrame, sizeof(GLOBALLRUOLDEST16), parg16);
  109. ul = GETHGLOBAL16(GlobalLRUOldest(
  110. HGLOBAL32(parg16->f1)
  111. ));
  112. FREEARGPTR(parg16);
  113. RETURN(ul);
  114. }
  115. ULONG FASTCALL WK32GlobalLock(PVDMFRAME pFrame)
  116. {
  117. ULONG ul;
  118. register PGLOBALLOCK16 parg16;
  119. GETARGPTR(pFrame, sizeof(GLOBALLOCK16), parg16);
  120. ul = GETLPSTRBOGUS(GlobalLock(
  121. HGLOBAL32(parg16->f1)
  122. ));
  123. FREEARGPTR(parg16);
  124. RETURN(ul);
  125. }
  126. ULONG FASTCALL WK32GlobalNotify(PVDMFRAME pFrame)
  127. {
  128. register PGLOBALNOTIFY16 parg16;
  129. GETARGPTR(pFrame, sizeof(GLOBALNOTIFY16), parg16);
  130. // This is a HACK and MUST be fixed, ChandanC, 11/7/91. This function
  131. // has been removed from the system.
  132. // GlobalNotify(
  133. // PROC32(parg16->f1)
  134. // );
  135. FREEARGPTR(parg16);
  136. RETURN(0);
  137. }
  138. ULONG FASTCALL WK32GlobalPageLock(PVDMFRAME pFrame)
  139. {
  140. ULONG ul;
  141. register PGLOBALPAGELOCK16 parg16;
  142. GETARGPTR(pFrame, sizeof(GLOBALPAGELOCK16), parg16);
  143. #ifdef API16
  144. ul = GETWORD16(GlobalPageLock(
  145. HGLOBAL32(parg16->f1)
  146. ));
  147. #else
  148. ul = 0;
  149. #endif
  150. FREEARGPTR(parg16);
  151. RETURN(ul);
  152. }
  153. ULONG FASTCALL WK32GlobalPageUnlock(PVDMFRAME pFrame)
  154. {
  155. ULONG ul;
  156. register PGLOBALPAGEUNLOCK16 parg16;
  157. GETARGPTR(pFrame, sizeof(GLOBALPAGEUNLOCK16), parg16);
  158. #ifdef API16
  159. ul = GETWORD16(GlobalPageUnlock(
  160. HGLOBAL32(parg16->f1)
  161. ));
  162. #else
  163. ul = 0;
  164. #endif
  165. FREEARGPTR(parg16);
  166. RETURN(ul);
  167. }
  168. ULONG FASTCALL WK32GlobalReAlloc(PVDMFRAME pFrame)
  169. {
  170. ULONG ul;
  171. register PGLOBALREALLOC16 parg16;
  172. GETARGPTR(pFrame, sizeof(GLOBALREALLOC16), parg16);
  173. ul = GETHGLOBAL16(GlobalReAlloc(
  174. HGLOBAL32(parg16->f1),
  175. DWORD32(parg16->f2),
  176. WORD32(parg16->f3)
  177. ));
  178. FREEARGPTR(parg16);
  179. RETURN(ul);
  180. }
  181. ULONG FASTCALL WK32GlobalSize(PVDMFRAME pFrame)
  182. {
  183. ULONG ul;
  184. register PGLOBALSIZE16 parg16;
  185. GETARGPTR(pFrame, sizeof(GLOBALSIZE16), parg16);
  186. ul = GETDWORD16(GlobalSize(
  187. HGLOBAL32(parg16->f1)
  188. ));
  189. FREEARGPTR(parg16);
  190. RETURN(ul);
  191. }
  192. ULONG FASTCALL WK32GlobalUnWire(PVDMFRAME pFrame)
  193. {
  194. ULONG ul;
  195. register PGLOBALUNWIRE16 parg16;
  196. GETARGPTR(pFrame, sizeof(GLOBALUNWIRE16), parg16);
  197. #ifdef API16
  198. ul = GETBOOL16(GlobalUnWire(
  199. HGLOBAL32(parg16->f1)
  200. ));
  201. #else
  202. ul = 0;
  203. #endif
  204. FREEARGPTR(parg16);
  205. RETURN(ul);
  206. }
  207. ULONG FASTCALL WK32GlobalUnfix(PVDMFRAME pFrame)
  208. {
  209. ULONG ul;
  210. register PGLOBALUNFIX16 parg16;
  211. GETARGPTR(pFrame, sizeof(GLOBALUNFIX16), parg16);
  212. #ifdef API16
  213. ul = GETBOOL16(GlobalUnfix(
  214. HGLOBAL32(parg16->f1)
  215. ));
  216. #else
  217. ul = 0;
  218. #endif
  219. FREEARGPTR(parg16);
  220. RETURN(ul);
  221. }
  222. ULONG FASTCALL WK32GlobalUnlock(PVDMFRAME pFrame)
  223. {
  224. ULONG ul;
  225. register PGLOBALUNLOCK16 parg16;
  226. GETARGPTR(pFrame, sizeof(GLOBALUNLOCK16), parg16);
  227. ul = GETBOOL16(GlobalUnlock(
  228. HGLOBAL32(parg16->f1)
  229. ));
  230. FREEARGPTR(parg16);
  231. RETURN(ul);
  232. }
  233. ULONG FASTCALL WK32GlobalWire(PVDMFRAME pFrame)
  234. {
  235. ULONG ul;
  236. register PGLOBALWIRE16 parg16;
  237. GETARGPTR(pFrame, sizeof(GLOBALWIRE16), parg16);
  238. #ifdef API16
  239. ul = GETLPSTRBOGUS(GlobalWire(
  240. HGLOBAL32(parg16->f1)
  241. ));
  242. #else
  243. ul = 0;
  244. #endif
  245. FREEARGPTR(parg16);
  246. RETURN(ul);
  247. }