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.

88 lines
1.8 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WPARAM.H
  8. * WOW32 16-bit handle alias support
  9. *
  10. * History:
  11. --*/
  12. typedef enum ParamMode {
  13. PARAM_NONE,
  14. PARAM_16,
  15. PARAM_32
  16. } ParamMode;
  17. /*
  18. * FindParamMap
  19. *
  20. * lpFindParam is for wparam.c use (set to NULL)
  21. *
  22. * lParam is either 16-bit or 32-bit memory pointer
  23. *
  24. * fMode is either param_16 or param_32
  25. *
  26. */
  27. DWORD FindParamMap(VOID* lpFindParam, DWORD lParam, UINT fMode);
  28. PVOID AddParamMap(DWORD dwPtr32, DWORD dwPtr16);
  29. BOOL DeleteParamMap(DWORD lParam, UINT fMode, BOOL* pfFreePtr);
  30. DWORD GetParam16(DWORD dwParam32);
  31. BOOL W32CheckThunkParamFlag(void);
  32. VOID FreeParamMap(HAND16 htask16);
  33. BOOL SetParamRefCount(DWORD dwParam, UINT fMode, DWORD dwRefCount);
  34. // Add dwPtr16 mapping for a parameter, which is allocated
  35. // size of the buffer is cbExtra and 32-bit pointer to the buffer
  36. // is returned
  37. PVOID AddParamMapEx(DWORD dwPtr16, DWORD cbExtra);
  38. // Update node when pointer is suspect to have been moved
  39. // returns updated pointer (32-bit)
  40. PVOID ParamMapUpdateNode(DWORD dwPtr, UINT fMode, VOID* lpn);
  41. VOID InitParamMap(VOID);
  42. ///////////////////////////////////////////////////////////////
  43. //
  44. // This is rather fast and dirty heap allocator
  45. //
  46. typedef struct tagBlkHeader *PBLKHEADER;
  47. typedef struct tagBlkHeader {
  48. PBLKHEADER pNext;
  49. DWORD dwSize; // block size
  50. } BLKHEADER, *PBLKHEADER;
  51. typedef struct tagBlkCache {
  52. LPBYTE pCache;
  53. #ifdef DEBUG
  54. PBLKHEADER pCacheHead;
  55. #endif
  56. PBLKHEADER pCacheFree;
  57. DWORD dwCacheSize;
  58. DWORD dwFlags;
  59. } BLKCACHE, *PBLKCACHE;
  60. LPVOID CacheBlockAllocate (PBLKCACHE pc, DWORD dwSize);
  61. VOID CacheBlockFree (PBLKCACHE pc, LPVOID lpv);
  62. VOID CacheBlockInit (PBLKCACHE pc, DWORD dwCacheSize);
  63. /////////////////////////////////////////////////////////////////
  64.