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.

224 lines
3.5 KiB

  1. /*++
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WKLOCAL.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. MODNAME(wklocal.c);
  16. ULONG FASTCALL WK32LocalAlloc(PVDMFRAME pFrame)
  17. {
  18. ULONG ul;
  19. register PLOCALALLOC16 parg16;
  20. GETARGPTR(pFrame, sizeof(LOCALALLOC16), parg16);
  21. ul = GETHLOCAL16(LocalAlloc(
  22. WORD32(parg16->f1),
  23. WORD32(parg16->f2)
  24. ));
  25. FREEARGPTR(parg16);
  26. RETURN(ul);
  27. }
  28. ULONG FASTCALL WK32LocalCompact(PVDMFRAME pFrame)
  29. {
  30. ULONG ul;
  31. register PLOCALCOMPACT16 parg16;
  32. GETARGPTR(pFrame, sizeof(LOCALCOMPACT16), parg16);
  33. ul = GETWORD16(LocalCompact(
  34. WORD32(parg16->f1)
  35. ));
  36. FREEARGPTR(parg16);
  37. RETURN(ul);
  38. }
  39. ULONG FASTCALL WK32LocalFlags(PVDMFRAME pFrame)
  40. {
  41. ULONG ul;
  42. register PLOCALFLAGS16 parg16;
  43. GETARGPTR(pFrame, sizeof(LOCALFLAGS16), parg16);
  44. ul = GETWORD16(LocalFlags(
  45. HLOCAL32(parg16->f1)
  46. ));
  47. FREEARGPTR(parg16);
  48. RETURN(ul);
  49. }
  50. ULONG FASTCALL WK32LocalFree(PVDMFRAME pFrame)
  51. {
  52. ULONG ul;
  53. register PLOCALFREE16 parg16;
  54. GETARGPTR(pFrame, sizeof(LOCALFREE16), parg16);
  55. ul = GETHLOCAL16(LocalFree(
  56. HLOCAL32(parg16->f1)
  57. ));
  58. FREEARGPTR(parg16);
  59. RETURN(ul);
  60. }
  61. ULONG FASTCALL WK32LocalHandle(PVDMFRAME pFrame)
  62. {
  63. ULONG ul;
  64. register PLOCALHANDLE16 parg16;
  65. GETARGPTR(pFrame, sizeof(LOCALHANDLE16), parg16);
  66. ul = GETHLOCAL16(LocalHandle(
  67. (LPSTR) WORD32(parg16->f1)
  68. ));
  69. FREEARGPTR(parg16);
  70. RETURN(ul);
  71. }
  72. ULONG FASTCALL WK32LocalInit(PVDMFRAME pFrame)
  73. {
  74. ULONG ul;
  75. register PLOCALINIT16 parg16;
  76. GETARGPTR(pFrame, sizeof(LOCALINIT16), parg16);
  77. #ifdef API16
  78. ul = GETBOOL16(LocalInit(
  79. WORD32(parg16->f1),
  80. WORD32(parg16->f2),
  81. WORD32(parg16->f3)
  82. ));
  83. #else
  84. ul = 0;
  85. #endif
  86. FREEARGPTR(parg16);
  87. RETURN(ul);
  88. }
  89. ULONG FASTCALL WK32LocalLock(PVDMFRAME pFrame)
  90. {
  91. ULONG ul;
  92. register PLOCALLOCK16 parg16;
  93. GETARGPTR(pFrame, sizeof(LOCALLOCK16), parg16);
  94. ul = GETNPSTRBOGUS(LocalLock(
  95. HLOCAL32(parg16->f1)
  96. ));
  97. FREEARGPTR(parg16);
  98. RETURN(ul);
  99. }
  100. ULONG FASTCALL WK32LocalNotify(PVDMFRAME pFrame)
  101. {
  102. ULONG ul;
  103. register PLOCALNOTIFY16 parg16;
  104. GETARGPTR(pFrame, sizeof(LOCALNOTIFY16), parg16);
  105. #ifdef API16
  106. ul = GETPROC16(LocalNotify(
  107. PROC32(parg16->f1)
  108. ));
  109. #else
  110. ul = 0;
  111. #endif
  112. FREEARGPTR(parg16);
  113. RETURN(ul);
  114. }
  115. ULONG FASTCALL WK32LocalReAlloc(PVDMFRAME pFrame)
  116. {
  117. ULONG ul;
  118. register PLOCALREALLOC16 parg16;
  119. GETARGPTR(pFrame, sizeof(LOCALREALLOC16), parg16);
  120. ul = GETHLOCAL16(LocalReAlloc(
  121. HLOCAL32(parg16->f1),
  122. WORD32(parg16->f2),
  123. WORD32(parg16->f3)
  124. ));
  125. FREEARGPTR(parg16);
  126. RETURN(ul);
  127. }
  128. ULONG FASTCALL WK32LocalShrink(PVDMFRAME pFrame)
  129. {
  130. ULONG ul;
  131. register PLOCALSHRINK16 parg16;
  132. GETARGPTR(pFrame, sizeof(LOCALSHRINK16), parg16);
  133. ul = GETWORD16(LocalShrink(
  134. HLOCAL32(parg16->f1),
  135. WORD32(parg16->f2)
  136. ));
  137. FREEARGPTR(parg16);
  138. RETURN(ul);
  139. }
  140. ULONG FASTCALL WK32LocalSize(PVDMFRAME pFrame)
  141. {
  142. ULONG ul;
  143. register PLOCALSIZE16 parg16;
  144. GETARGPTR(pFrame, sizeof(LOCALSIZE16), parg16);
  145. ul = GETWORD16(LocalSize(
  146. HLOCAL32(parg16->f1)
  147. ));
  148. FREEARGPTR(parg16);
  149. RETURN(ul);
  150. }
  151. ULONG FASTCALL WK32LocalUnlock(PVDMFRAME pFrame)
  152. {
  153. ULONG ul;
  154. register PLOCALUNLOCK16 parg16;
  155. GETARGPTR(pFrame, sizeof(LOCALUNLOCK16), parg16);
  156. ul = GETBOOL16(LocalUnlock(
  157. HLOCAL32(parg16->f1)
  158. ));
  159. FREEARGPTR(parg16);
  160. RETURN(ul);
  161. }