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.

126 lines
2.6 KiB

  1. /*++
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WRES32.C
  8. * WOW32 16-bit resource support
  9. *
  10. * History:
  11. * Created 11-Mar-1991 by Jeff Parsons (jeffpar)
  12. --*/
  13. #include "precomp.h"
  14. #pragma hdrstop
  15. MODNAME(wres32.c);
  16. HANDLE APIENTRY W32FindResource(HANDLE hModule, LPCSTR lpType, LPCSTR lpName, WORD wLang)
  17. {
  18. PRES p;
  19. //
  20. // If hModule is not ours, then make Win32 call and return the
  21. // result to USER.
  22. //
  23. if (!ISINST16(hModule)) {
  24. return (FindResourceEx(hModule, lpType, lpName, wLang));
  25. }
  26. else {
  27. WOW32ASSERT(GETHMOD16(hModule));
  28. p = FindResource16(GETHMOD16(hModule), (LPSTR)lpName, (LPSTR)lpType);
  29. return HRES32(p);
  30. }
  31. }
  32. HANDLE APIENTRY W32LoadResource(HANDLE hModule, HANDLE hResInfo)
  33. {
  34. PRES p;
  35. //
  36. // If hModule is not ours, then make Win32 call and return the
  37. // result to USER.
  38. //
  39. if (ISINST16(hModule) && ISRES16(hResInfo)) {
  40. WOW32ASSERT(GETHMOD16(hModule));
  41. p = LoadResource16(GETHMOD16(hModule), GETHRES16(hResInfo));
  42. return HRES32(p);
  43. }
  44. else {
  45. return LoadResource(hModule, hResInfo);
  46. }
  47. }
  48. BOOL APIENTRY W32FreeResource(HANDLE hResData, HANDLE hModule)
  49. {
  50. //
  51. // If hModule is not ours, then make Win32 call and return the
  52. // result to USER.
  53. //
  54. if (ISINST16(hModule) && ISRES16(hResData)) {
  55. return FreeResource16(GETHRES16(hResData));
  56. }
  57. else {
  58. return (FreeResource(hResData));
  59. }
  60. }
  61. LPSTR APIENTRY W32LockResource(HANDLE hResData, HANDLE hModule)
  62. {
  63. //
  64. // If hModule is not ours, then make Win32 call and return the
  65. // result to USER.
  66. //
  67. if (ISINST16(hModule) && ISRES16(hResData)) {
  68. return LockResource16(GETHRES16(hResData));
  69. }
  70. else {
  71. return (LockResource(hResData));
  72. }
  73. }
  74. BOOL APIENTRY W32UnlockResource(HANDLE hResData, HANDLE hModule)
  75. {
  76. //
  77. // If hModule is not ours, then make Win32 call and return the
  78. // result to USER.
  79. //
  80. if (ISINST16(hModule) && ISRES16(hResData)) {
  81. return UnlockResource16(GETHRES16(hResData));
  82. }
  83. else {
  84. return (UnlockResource(hResData));
  85. }
  86. }
  87. DWORD APIENTRY W32SizeofResource(HANDLE hModule, HANDLE hResInfo)
  88. {
  89. //
  90. // If hModule is not ours, then make Win32 call and return the
  91. // result to USER.
  92. //
  93. if (ISINST16(hModule) && ISRES16(hResInfo)) {
  94. WOW32ASSERT(GETHMOD16(hModule));
  95. return SizeofResource16(GETHMOD16(hModule), GETHRES16(hResInfo));
  96. }
  97. else {
  98. return (SizeofResource(hModule, hResInfo));
  99. }
  100. }