Leaked source code of windows server 2003
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.

116 lines
4.6 KiB

  1. /*++ BUILD Version: 0001
  2. *
  3. * WOW v1.0
  4. *
  5. * Copyright (c) 1991, Microsoft Corporation
  6. *
  7. * TDB.H
  8. * 16-bit Kernel Task Data Block
  9. *
  10. * History:
  11. * Created 11-Feb-1992 by Matt Felton (mattfe) - from 16 bit tdb.inc
  12. * 7-apr-1992 mattfe updated to be win 3.1 compatible
  13. *
  14. --*/
  15. /*
  16. * NewExeHdr struct offsets. WOW32 uses these for getting expected winversion
  17. * directly from the exehdr.
  18. *
  19. */
  20. #define NE_LOWINVER_OFFSET 0x3e
  21. #define NE_HIWINVER_OFFSET 0x0c
  22. #define FLAG_NE_PROPFONT 0x2000
  23. /*
  24. * Task Data Block - 16 Bit Kernel Data Structure
  25. *
  26. * Contains all 16 bit task specific data.
  27. *
  28. */
  29. #define numTaskInts 7
  30. #define THUNKELEM 8 // (62*8) = 512-16 (low arena overhead)
  31. #define THUNKSIZE 8
  32. #define TDB_DIR_SIZE 64
  33. #define LFN_DIR_LEN 260
  34. /* XLATOFF */
  35. #pragma pack(2)
  36. /* XLATON */
  37. typedef struct TDB { /* tdb16 */
  38. WORD TDB_next ; // next task in dispatch queue
  39. WORD TDB_taskSP ; // Saved SS:SP for this task
  40. WORD TDB_taskSS ; //
  41. WORD TDB_nEvents ; // Task event counter
  42. BYTE TDB_priority ; // Task priority (0 is highest)
  43. BYTE TDB_thread_ordinal ; // ordinal number of this thread
  44. WORD TDB_thread_next ; // next thread
  45. WORD TDB_thread_tdb ; // the real TDB for this task
  46. WORD TDB_thread_list ; // list of allocated thread structures
  47. WORD TDB_thread_free ; // free list of availble thread structures
  48. WORD TDB_thread_count ; // total count of tread structures
  49. WORD TDB_FCW ; // Floating point control word
  50. BYTE TDB_flags ; // Task flags
  51. BYTE TDB_filler ; // keep word aligned
  52. WORD TDB_ErrMode ; // Error mode for this task
  53. WORD TDB_ExpWinVer ; // Expected Windows version for this task
  54. WORD TDB_Module ; // Task module handle to free in killtask
  55. WORD TDB_pModule ; // Pointer to the module database.
  56. WORD TDB_Queue ; // Task Event Queue pointer
  57. WORD TDB_Parent ; // TDB of the task that started this up
  58. WORD TDB_SigAction ; // Action for app task signal
  59. DWORD TDB_ASignalProc ; // App's Task Signal procedure address
  60. DWORD TDB_USignalProc ; // User's Task Signal procedure address
  61. DWORD TDB_GNotifyProc ; // Task global discard notify proc.
  62. DWORD TDB_INTVECS[numTaskInts] ; // Task specfic harare interrupts
  63. WORD TDB_CompatFlags ; // Compatibility flags
  64. WORD TDB_CompatFlags2 ; // Upper 16 bits
  65. WORD TDB_CompatHandle ; // for dBase bug
  66. WORD TDB_WOWCompatFlagsEx ; // More WOW Compatibility flags
  67. WORD TDB_WOWCompatFlagsEx2 ; // Upper 16 bits
  68. BYTE TDB_Free[3] ; // Filler to keep TDB size unchanged
  69. BYTE TDB_cLibrary ; // tracks add/del of ALL libs in system EMS
  70. DWORD TDB_PHT ; // (HANDLE:OFFSET) to private handle table
  71. WORD TDB_PDB ; // MSDOS Process Data Block (PDB)
  72. DWORD TDB_DTA ; // MSDOS Disk Transfer Address
  73. BYTE TDB_Drive ; // MSDOS current drive
  74. BYTE TDB_Directory[TDB_DIR_SIZE+1] ; // *** not used starting with win95
  75. WORD TDB_Validity ; // initial AX to be passed to a task
  76. WORD TDB_Yield_to ; // DirectedYield arg stored here
  77. WORD TDB_LibInitSeg ; // segment address of libraries to init
  78. WORD TDB_LibInitOff ; // MakeProcInstance thunks live here.
  79. WORD TDB_MPI_Sel ; // Code selector for thunks
  80. WORD TDB_MPI_Thunks[((THUNKELEM*THUNKSIZE)/2)]; //
  81. BYTE TDB_ModName[8] ; // Name of Module.
  82. WORD TDB_sig ; // Signature word to detect bogus code
  83. DWORD TDB_ThreadID ; // 32-Bit Thread ID for this Task (use TDB_Filler Above)
  84. DWORD TDB_hThread ; // 32-bit Thread Handle for this task
  85. WORD TDB_WOWCompatFlags; // WOW Compatibility flags
  86. WORD TDB_WOWCompatFlags2; // WOW Compatibility flags
  87. #ifdef FE_SB
  88. WORD TDB_WOWCompatFlagsJPN; // WOW Compatibility flags for JAPAN
  89. WORD TDB_WOWCompatFlagsJPN2; // WOW Compatibility flags for JAPAN
  90. #endif // FE_SB
  91. DWORD TDB_vpfnAbortProc; // printer AbortProc
  92. BYTE TDB_LFNDirectory[LFN_DIR_LEN]; // Long directory name.
  93. } TDB;
  94. typedef TDB UNALIGNED *PTDB;
  95. // This bit is defined for the TDB_Drive field
  96. #define TDB_DIR_VALID 0x80
  97. #define TDB_SIGNATURE 0x4454
  98. #define TDBF_OS2APP 0x8
  99. #define TDBF_WINOLDAP 0x1
  100. // NOTE TDB_ThreadID MUST be DWORD aligned or else it will fail on MIPS
  101. /* XLATOFF */
  102. #pragma pack()
  103. /* XLATON */