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.

95 lines
3.1 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * WMMALIAS.H
  8. * WOW32 16-bit handle alias support
  9. *
  10. * History:
  11. * Created Sept-1-1992 by Chandan Chauhan (ChandanC)
  12. * Modified 12-May-1992 by Mike Tricker (miketri) to add MultiMedia support
  13. --*/
  14. /* 16-bit handle format
  15. *
  16. * Bits 0 and 1 are always zero (potential compatibility requirement).
  17. * Note however that the macros below treat HASH_BITS as starting at bit
  18. * 0, for simplicity. We just shift the alias left two bits when we're
  19. * done. The actual number of low bits that are reserved is determined
  20. * by RES_BITS.
  21. *
  22. * Of the remaining 14 bits, the next HASH_BITS bits are the hash slot #
  23. * (relative to 0), followed by LIST_BITS bits containing the list slot #
  24. * (relative to 1). List slot is relative to 1 because some portion of
  25. * a valid handle must be non-zero; this is also why LIST_SLOTS contains
  26. * that extra "-1".
  27. */
  28. #define RES_BITS 2
  29. #define HASH_BITS 6
  30. #define HASH_SLOTS (1 << HASH_BITS)
  31. #define HASH_MASK (HASH_SLOTS-1)
  32. #define MASK32(h32) ((INT)(h32))
  33. #define HASH32(h32) (MASK32(h32) & (HASH_SLOTS-1))
  34. #define LIST_BITS (16-RES_BITS-HASH_BITS)
  35. #define LIST_SLOTS ((1 << LIST_BITS) - 1)
  36. #define LIST_MASK (LIST_SLOTS << HASH_BITS)
  37. #define ALIAS_SLOTS 128 // must be a power of 2
  38. /* Class map entry
  39. */
  40. #pragma pack(2)
  41. typedef struct _WCDM { /* wcd */
  42. struct _WCD *pwcdNext; // pointer to next wcd entry
  43. PSZ pszClass; // pointer to local copy of class name
  44. VPSZ vpszMenu; // pointer to original copy of menu name, if any
  45. HAND16 hModule16; // handle of owning module
  46. HAND16 hInst16; // 16-bit hInstance (wndclass16.hInstance)
  47. WORD nWindows; // # of windows in existence based on class
  48. VPWNDPROC vpfnWndProc; // 16-bit window proc address
  49. WORD wStyle; // Class Style bits
  50. } WCD, *PWCD, **PPWCD;
  51. #pragma pack()
  52. /* Handle map entry
  53. */
  54. #pragma pack(2)
  55. typedef struct _HMAP { /* hm */
  56. struct _HMAP *phmNext; // pointer to next hmap entry
  57. HANDLE h32; // 32-bit handle
  58. HAND16 h16; // 16-bit handle
  59. HTASK16 htask16; // 16-bit handle of owning task
  60. INT iClass; // WOW class index
  61. DWORD dwStyle; // style flags (if handle to window)
  62. PWCD pwcd; // WOW class data pointer
  63. VPWNDPROC vpfnWndProc; // associated 16-bit function address
  64. VPWNDPROC vpfnDlgProc; // 16-bit dialog function
  65. } HMAP, *PHMAP, **PPHMAP;
  66. #pragma pack()
  67. /* Handle alias info
  68. */
  69. typedef struct _HINFO { /* hi */
  70. PPHMAP pphmHash; // address of hash table
  71. #ifdef NEWALIAS
  72. PPHMAP pphmAlias; // address of alias table
  73. INT nAliasEntries; // size of alias table, in entries
  74. INT iAliasHint; // next (possibly) free slot in alias table
  75. #endif
  76. } HINFO, *PHINFO, **PPHINFO;
  77. PHMAP FindHMap32(HAND32 h32, PHINFO phi, INT iClass);
  78. PHMAP FindHMap16(HAND16 h16, PHINFO phi);
  79. VOID FreeHMap16(HAND16 h16, PHINFO phi);
  80. PSZ GetHMapNameM(PHINFO phi, INT iClass);