home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / READ.ME < prev    next >
Encoding:
Text File  |  1992-06-10  |  28.8 KB  |  751 lines

  1. Undocumented Windows Release Notes -- v. 1.00 (June 15, 1992)
  2. -------------------------------------------------------------
  3.  
  4.     This is the READ.ME file for the disk to accompany the book
  5. _Undocumented Windows: A Programmer's Guide to Reserved Windows API
  6. Functions_ by Andrew Schulman, David Maxey, and Matt Pietrek
  7. (Addison-Wesley, 1992, ISBN 0-201-60834-0, 700 pages, $39.95).
  8.  
  9.     This file describes the example programs on the disk, and includes
  10. last-minute corrections and addenda to the book:
  11.  
  12.         1. INCLUDES SOURCE!
  13.         2. Contents of the disk
  14.         3. Building the example programs
  15.         4. Microsoft C/C++ 7.0 instructions
  16.         5. Non-WINIO programs
  17.         6. Differences between book and disk
  18.         7. Corrections to Chapter 5: KERNEL
  19.         8. Corrections to Chapter 6: USER
  20.         9. Corrections to Chapter 8: GDI
  21.  
  22.     The programs on the disk were tested using:
  23.  
  24.         Windows 3.0 Standard and Enhanced mode, retail and debug
  25.         Windows 3.1 Standard and Enhanced mode, retail and debug
  26.  
  27.     Some of the programs were also tested under WIN-OS/2 (Windows 3.0
  28. Standard mode running on OS/2 2.0).
  29.  
  30.     None of the programs will run under Windows 3.0 Real mode.  All
  31. the programs require protected-mode Windows.
  32.  
  33.     The following compilers were used:
  34.  
  35.         Borland C++ 3.0
  36.         Microsoft C 6.0
  37.         Microsoft C/C++ 7.0
  38.     
  39.     Some of the programs on disk contains corrections to the versions
  40. printed in the book.  If you have found a problem in a program
  41. printed in the book, please check this file and the contents of this
  42. disk first.
  43.  
  44.     If you do find any problems in the book or the disk, or have any
  45. questions or suggestions, please contact Andrew Schulman:
  46.  
  47.         CompuServe (CIS): 76320,302
  48.         via Internet:     76320.302@compuserve.com
  49.  
  50.     The authors can also be reached via mail c/o Addison-Wesley, but
  51. electronic mail is greatly prefered and will receive a response,
  52. whereas paper mail may or may not receive a response:
  53.  
  54.         Undocumented Windows
  55.         c/o Addison-Wesley Publishing Co.
  56.         Route 128
  57.         Reading MA 01867
  58.  
  59.  
  60.  
  61. 1. INCLUDES SOURCE!
  62.    ----------------
  63.  
  64.     In several places, the book says that no source is included for
  65. the WINIO library, or for the Windows programs in Chapter 4, because
  66. there's no room.  We forgot we were using PKZIP, and so have plenty
  67. of room!  SOURCE.ZIP contains the source files for:
  68.         
  69.         WINIO library (winio.c, wmhandlr.c, argcargv.c, winheap.c, based.c;
  70.             winheap.c and based.c aren't really used in this book but
  71.             they are part of the library)
  72.         SNOOP (snoop.c, i3handlr.asm, snoop.def)
  73.         WISPY (wispy.c, wispy.def)
  74.         CALLFUNC (callfunc.c)
  75.         EXEUTIL (exeutil.awk)
  76.  
  77.     Actually, what we meant by "no room" is that there's no room in
  78. the book to _explain_ the source.  Right now, you're on your own with
  79. SOURCE.ZIP.  We'll be improving it considerably, adding comments, and
  80. explaining it in detail in a forthcoming book, _The DOS Programmer's
  81. Guide to Windows_.  There will be more utilities in another
  82. forthcoming book, titled something like _Son of Undocumented Windows_
  83. or _Dirty Windows_.  (Hey, if you can come up with a better title,
  84. let us know!)
  85.  
  86.     Use this source code for own experiments.  Like everything else
  87. on this disk, all this material is copyright of the authors.  If you
  88. are interested in redistributing the source, you _must_ contact the
  89. authors at the one of the addresses above.  Of course, you are
  90. invited to incorporate small pieces of code from the book and/or disk
  91. into your program, in binary form.  
  92.  
  93.  
  94. 2. Contents of the disk
  95.    --------------------
  96.  
  97.     The example source code and utility programs for _Undocumented
  98. Windows_ are stored on this disk in .ZIP files.  Each .ZIP file
  99. contains the material for one chapter in the book, with the exception
  100. of WINIO.ZIP which contains the WINIO library used throughout.
  101. PKUNZIP (licensed from PKWARE) is included on the disk to unzip the
  102. files.  
  103.  
  104.     INSTALL.BAT will set up everything in a new directory,
  105. C:\UNDOCWIN, with the following subdirectory structure:
  106.  
  107.         \UNDOCWIN
  108.             \CHAP1
  109.             \CHAP2
  110.             ... etc...
  111.             \WINIO
  112.                 BC
  113.                 MSC6
  114.                 MSC7
  115.             \SOURCE
  116.  
  117.     This requires about two megabytes of free disk space.
  118.  
  119.     To copy only selected files, or to install elsewhere than
  120. C:\UNDOCWIN, edit INSTALL.BAT (hey, this is a book for programmers;
  121. we figure you can edit a batch file).  PKUNZIP can be used to
  122. extract selected files from any of the .ZIPs.
  123.  
  124.     The disk contains the following types of files:
  125.  
  126.     o   General-purpose .H include files such as chap5\handles.h,
  127.         chap6\userobj.h, and chap8\gdiobj.h.  All files have been
  128.         treated with extern "C", so they should work with C++ as
  129.         well as with C.
  130.  
  131.     o   Small-model and medium-model .LIB files for using WINIO
  132.         with Borland C++ 3.0 (should work with 3.1 too), Microsoft
  133.         C 6.0, and Microsoft C/C++ 7.0.  
  134.  
  135.     o   .C files for all the sample programs.
  136.  
  137.     o   .EXE files for utility programs discussed in Chapters 2-4,
  138.         and for the more useful of the sample programs from Chapters
  139.         5-10.  For example, there is ATOMWALK.EXE because that's a
  140.         useful program in its own right, but no GP.EXE because it isn't.
  141.  
  142.  
  143.     The disk contains the following files:
  144.  
  145. read.me         this file
  146. pkunzip.exe     PKWARE's unzip utility
  147. install.bat     user-unfriendly install
  148. chap1.zip       example programs from chapter 1:
  149.                     freeres.c
  150.                     freeres.exe
  151. chap2.zip       utilities and data files from chapter 2:
  152.                     mapwin.exe
  153.                     winfunc.imp
  154.                     win30.imp
  155.                     exedump.exe
  156.                     exeutil.exe
  157.                     winfunc.dat
  158.                     win30.dat
  159.                     win21.dat
  160.                     undocwin.dat
  161. chap3.zip       utilities from chapter 3:
  162.                     resdump.exe
  163.                     extract.exe
  164. chap4.zip       utilities and WINIO examples from chapter 4:
  165.                     callfunc.exe
  166.                     wispy.exe
  167.                     snoop.exe
  168.                     wm_undoc.dat
  169.                     wm_all.dat
  170.                     sh.c
  171.                     sh.exe
  172.                     basemov2.c
  173.                     basemov2.exe
  174.                     taskwlk2.c
  175.                     taskwlk2.exe
  176.                     numtasks.c
  177.                     numtasks.exe
  178. chap5.zip       KERNEL examples from chapter 5:
  179.                     handles.h
  180.                     handles.c
  181.                     testhand.c
  182.                     testhand.exe
  183.                     taskdb.h
  184.                     taskq.h
  185.                     modtable.h
  186.                     psp.h
  187.                     wintask.c
  188.                     wintask.exe
  189.                     winmod.c
  190.                     winmod.exe
  191.                     stealcdr.c
  192.                     stealcdr.exe
  193.                     atomwalk.c
  194.                     atomwalk.exe
  195.                     taskwalk.c
  196.                     taskwalk.exe
  197.                     modwalk.c
  198.                     modwalk.exe
  199.                     basemove.c
  200.                     basemove.exe
  201.                     countmem.c
  202.                     countmem.exe
  203.                     nullseg.c
  204.                     nullseg.exe
  205.                     local.c
  206.                     local.exe
  207.                     kill.c
  208.                     kill.exe
  209.                     gp.c
  210.                     setsbase.c
  211.                     semtest.c
  212.                     thhook.c
  213.                     taskq.c
  214.                     sellimit.c
  215.                     systres.c
  216.                     exeptr.c
  217.                     meminfo.c
  218.                     walksegs.c
  219.                     break.c
  220.                     selarray.c
  221.                     codedat2.c
  222.                     codedata.c
  223. chap6.zip       USER examples from chapter 6:
  224.                     userobj.h
  225.                     userwalk.c
  226.                     userwalk.exe
  227.                     dragdrop.h
  228.                     ddclient.c
  229.                     ddclient.exe
  230.                     ddserver.c
  231.                     ddserver.exe
  232.                     cursicon.h
  233.                     bcstmsg.c
  234.                     cascchld.c
  235.                     checkord.c
  236.                     ciconind.c
  237.                     cpnlinfo.c
  238.                     dtpattrn.c
  239.                     dtwlpapr.c
  240.                     dumpicon.c
  241.                     endmenu.c
  242.                     fillwind.c
  243.                     fprtname.c
  244.                     getnextq.c
  245.                     gridgran.c
  246.                     gtmsevnt.c
  247.                     intwpos.c
  248.                     kbdevent.c
  249.                     oemlayer.c
  250.                     paintrct.c
  251.                     evnthook.asm
  252.                     setehook.c
  253.                     snapwind.c
  254.                     stsystmr.c
  255.                     swtothis.c
  256.                     syserrbx.c
  257.                     tilechld.c
  258.                     xcstods.c
  259. chap7           ** Not present ** Don't be alarmed - there are no
  260.                 utilities or source presented in the Undocumented
  261.                 Windows Messages chapter.
  262. chap8.zip       GDI examples from chapter 8:
  263.                     gdiobj.h
  264.                     gdiwalk.c
  265.                     gdiwalk.exe
  266.                     checkord.c
  267.                     rsin.c
  268.                     fastwfrm.c
  269. chap9.zip       SYSTEM example from chapter 9:
  270.                     systimer.c
  271. chap10.zip      TOOLHELP examples from chapter 10:
  272.                     winwalk.c
  273.                     winwalk.exe
  274.                     th_asm.asm
  275.                     coroner.c
  276.                     coroner.def
  277.                     coroner.mak
  278.                     coroner.rc
  279.                     coroner.ico
  280.                     xcptrept.c
  281.                     coroner.exe
  282.                     coroner.h
  283. winiobc.zip     WINIO libraries, header files, etc. for Borland C++:
  284.                     winio.h
  285.                     wmhandlr.h
  286.                     swindos.lib
  287.                     mwindos.lib
  288.                     windos.def
  289.                     windos.ico
  290.                     windos.rc
  291.                     windos.res
  292.                     winioapp.mak
  293.                     winiobc.bat
  294. winioms6.zip    WINIO libraries, header files, etc. for Microsoft C 6.0:
  295.                     winio.h
  296.                     wmhandlr.h
  297.                     swindos.lib
  298.                     mwindos.lib
  299.                     windos.def
  300.                     windos.res
  301.                     windos.ico
  302.                     windos.rc
  303.                     winioapp.nmk
  304.                     winioms.bat
  305. winioms7.zip    WINIO libraries, header files, etc. for Microsoft C/C++ 7.0:
  306.                     winio.h
  307.                     wmhandlr.h
  308.                     argcargv.c
  309.                     swindos.lib
  310.                     mwindos.lib
  311.                     windos.def
  312.                     windos.res
  313.                     windos.ico
  314.                     windos.rc
  315.                     winioapp.nmk
  316.                     winioms.bat
  317. source.zip      Source code for WINIO, SNOOP, WISPY, CALLFUNC, EXEUTIL:
  318.                     winio.c
  319.                     wmhandlr.c
  320.                     argcargv.c
  321.                     based.c
  322.                     winheap.c
  323.                     callfunc.c
  324.                     wispy.c
  325.                     wispy.def
  326.                     snoop.c
  327.                     snoop.def
  328.                     i3handlr.asm
  329.  
  330.  
  331. 3. Building the example programs
  332.    -----------------------------
  333.  
  334.     Tools are provided to make the building of the example programs
  335. provided on the disk, and programs that you write yourself, as easy
  336. as possible while still leaving open some avenues for customization.
  337.  
  338.     Makefiles are provided for Microsoft C 6.00/7.00 and Borland C++
  339. 3.0. The WINIOMS.BAT file builds a WINIO program using MS C 6.00 via
  340. NMK and the WINIOAPP.NMK makefile (there are different versions for
  341. Microsoft C 6.0 and Microsoft C/C++ 7.0; see below), and WINIOBC.BAT
  342. builds a WINIO program using Borland C++ 3.0 via MAKE and
  343. WINIOAPP.MAK. Usage is the same for all batch files:
  344.  
  345.         WINIOxx app-name [M] [extra-files]
  346.  
  347. where: M specifies build using medium model, rather than small
  348.        extra-files is an optional list of additional component object
  349.             files required to build the program. The object files
  350.             should be specified without the .OBJ extension. 
  351.  
  352.     To build the DumpIcon example in Chapter 6 using Microsoft C
  353. 6.00, for example, you only need to run:
  354.  
  355.         WINIOMS DUMPICON
  356.  
  357.     The resultant small model executable will include debug symbols,
  358. and will have been linked using the default definitions file
  359. WINDOS.DEF.  It will also inlude the default WINIO resource file
  360. WINDOS.RES, which contains only the class icon for WINIO
  361. applications.
  362.  
  363.     Specifying M on the command line after the application name will
  364. cause it to be built using medium model. None of the example programs
  365. on the disk require medium model.
  366.  
  367.     To build the example program in the SetEventHook entry in Chapter
  368. 6, in which the assembler file EVNTHOOK.ASM is an additional
  369. component, using Borland tools, you would type:
  370.  
  371.         WINIOBC SETEHOOK EVNTHOOK 
  372.  
  373.     You can modify the batch files to generate executables without
  374. debug symbols, or you can use a utility such as Borland's TDSTRIP.EXE
  375. that will remove the symbol table from an executable. The utility
  376. program executables on the disk do not contain symbol tables.
  377. However, all the WINIO libraries do.
  378.  
  379.     If you require additional resources within the RES file, or just
  380. wish to use a custom icon for a particular program, create a resource
  381. file with the same name as the program, with a .RES extension. It
  382. will be found and used automatically by the build process. Ensure
  383. that your resource file contains an icon resource with the name
  384. WINIO_ICON, since this will be loaded as the WINIO class icon.
  385.  
  386.     In the same way, if you need to allocate more stack space for a
  387. particular program, or change segment descriptions, or just give it a
  388. specific module name, create a definitions file with the same name as
  389. the program, with a .DEF extension. In the same way as for the
  390. resource file, it will be found and used automatically by the build
  391. process. Ensure that your definitions file contains the entry
  392. WMHANDLER_WNDPROC in the EXPORTS section.
  393.  
  394.     Note that the makefile do not mention either COMMDLG.LIB, used by
  395. WINIO when processing the &File | &Save buffer... menu option, or
  396. TOOLHELP.LIB, used by a number of the sample programs. Both of these
  397. libraries have been integrated into the version of the WINIO
  398. libraries that appear on the disk.
  399.  
  400.     Note also that the makefiles assume a flat directory structure.
  401. They must be edited if the WINDOS libraries and/or header files are
  402. to be kept in a separate directory from the program source files.
  403.  
  404.     If you don't want to use this batch/makefile mechanism, you can
  405. follow the instructions for building WINIO programs that appear in
  406. Appendix A.  It is much simpler to build these (or any!) Windows
  407. programs with Borland C++ than with Microsoft C.  With Borland C++,
  408. all you need is:
  409.  
  410.         bcc -WS -DWINIO -2 foo.c swindos.lib
  411.         rc -t windos.res foo.exe
  412.  
  413.     (The rc -t flag was accidentally dropped from the command line
  414. shown in Appendix A of the book.  This flag makes the executable
  415. protected-mode ONLY, so you don't have to worry about someone trying
  416. to run the program in 3.0 real mode.)
  417.  
  418.     With Microsoft C 6.0 or Microsoft C/C++ 7.0, you will need to
  419. link separately.  Using the WINDOS.DEF file on the disk (note that
  420. some of the many cl switches shown here were omitted from the version
  421. printed in Appendix A of the book):
  422.  
  423.         cl -G2sw -Oais -Zpe -c foo.c
  424.         link /nod foo,,,swindos slibcew libw,windos.def
  425.         rc -t windos.res foo.exe
  426.  
  427.  
  428. 4. Microsoft C/C++ 7.0 instructions
  429.    --------------------------------
  430.  
  431.     There are a few special aspects to building WINIO programs with
  432. Microsoft C/C++ 7.0 (MSC7).  As noted in the book, MSC7 comes with a
  433. QuickWin (QW) library which is somewhat similar to WINIO.  As also
  434. noted, QW is good for porting DOS code to Windows, but not for
  435. building programs that use the Windows API.  One nice thing about QW
  436. is that it does give you main() rather than WinMain().  The problem
  437. is that QW's main() conflicts with WINIO's main().  Since QW's main()
  438. is built right into the MSC7 library (such as SLIBCEW.LIB) that you
  439. link with, we had to resort to a kludge:
  440.  
  441.     When using MSC7 to build WINIO programs, main is defined to be
  442. winio_main.  WINIO.H contains the following:
  443.  
  444.         #if defined(_MSC_VER) && (_MSC_VER >= 700)
  445.         #define main    winio_main
  446.         #endif
  447.  
  448.     Since WINIO.H takes care of this automatically, you simply need to be
  449. aware of this difference when debugging.  Instead of starting at main,
  450. your program will start at winio_main.
  451.  
  452.     Furthermore, you must ensure that WINIO's WinMain() gets linked
  453. instead of QW's.  The file ARGCARGV.C is provided in the MSC7
  454. subdirectory for WINIO.  Compiling and linking with this as will do
  455. the trick.  The batch/makefile mechanism takes care of all this.  If
  456. you are compiling and linking with MSC7 "by hand," then do the
  457. following:
  458.  
  459.         cl -G2sw -Oais -Zpe -c foo.c argcargv.c
  460.         link /nod foo argcargv,,,swindos slibcew libw,windos.def
  461.         rc -t windos.res foo.exe
  462.  
  463.     In addition, we couldn't locate the environ variable in MSC7.
  464. This is probably our own stupidity, in MSC7 you get winio_main(argc,
  465. argv) but NOT winio_main(argc, argv, envp).  Nobody ever uses envp,
  466. so this should be no big deal.
  467.  
  468.  
  469. 5. Non-WINIO programs
  470.    ------------------
  471.  
  472.     A few programs in the book do not use WINIO:
  473.  
  474. Chapter 1 -- FREERES (uses MessageBox)
  475. Chapter 5 -- KILL (a program added at the last minute, it has no output
  476.     at all; it just kills off a specified task)
  477. Chapter 10 -- CORONER (comes with the usual paraphernalia need to build
  478.     a non-WINIO Windows program)
  479.  
  480.  
  481. 6. Differences between book and disk
  482.    ---------------------------------
  483.  
  484.     There are some differences between the sample code printed in the
  485. book and the sample code that appears on this disk.
  486.  
  487.     Source files for the example programs have in almost all cases
  488. been modified to include a header with build instructions, and to
  489. present a uniform "About" box.
  490.  
  491.     A number of changes were made throughout for compatibility with
  492. Microsoft C:
  493.  
  494.     The FP_SEG() and FP_OFF() macros in Microsoft's version of DOS.H
  495. want lvalues.  For example, in CODEDATA.C (Chapter 5), the following:
  496.  
  497.         data_sel = FP_SEG((void far *) data);
  498.  
  499. was changed to:
  500.  
  501.         void far *fpdata = (void far *) data;
  502.         // ...
  503.         data_sel = FP_SEG(fpdata);
  504.  
  505.     Of course, we could also have used SELECTOROF() and OFFSETOF()
  506. (or HIWORD(), LOWORD()) from WINDOWS.H.
  507.  
  508.     Microsoft C does not have the MK_FP() macro.  We could have used
  509. MAKELP() from WINDOWS.H, but to make the code look slightly less alien
  510. to DOS programmers, we wanted MK_FP().  In the book, MK_FP() appears
  511. in almost every file that uses it.  Totally bogus!  We just moved
  512. MK_FP() into WINIO.H:
  513.  
  514.         #ifndef MK_FP
  515.         #define MK_FP(s,o) ((void far *) (((DWORD) (s) << 16) | (o)))
  516.         #endif
  517.  
  518.     Much of the code in Chapter 5 uses function pointer to Windows API
  519. functions that look like this:
  520.  
  521.         DWORD FAR PASCAL (*SomeAPIFunction)(HANDLE h);
  522.  
  523.     Unfortunately, Microsoft C is not happy with this.  It wants the
  524. following (note the location of the opening parenthesis), which does also
  525. work with Borland C++:
  526.  
  527.         DWORD (FAR PASCAL *SomeAPIFunction)(HANDLE h);
  528.  
  529.     Some undocumented Windows API functions that are available both in
  530. the 3.0 and 3.1 versions of Windows itself, are not available in the 3.1
  531. version of the SDK's import library (LIBW.LIB).  Where the source code
  532. printed in the book might have something like:
  533.  
  534.         extern DWORD FAR PASCAL SomeAPIFunction(HANDLE h);
  535.  
  536. this will in some cases have been changed in the source code on disk to:
  537.  
  538.         DWORD (FAR PASCAL *SomeAPIFunction)(HANDLE h);
  539.         // ...
  540.         SomeAPIFunction = GET_PROC("SOMEMODULE", "SOMEAPIFUNCTION");
  541.  
  542. where GET_PROC() is something like:
  543.  
  544.         #define GET_PROC(modname, funcname) \
  545.             GetProcAddress(GetModuleHandle(modname), (funcname))
  546.  
  547.     ANSI C makes SomeAPIFunction(x) equivalent to (*SomeAPIFunction)(x),
  548. so the actual function call does not need to be changed, even when
  549. calling through a function pointer.
  550.  
  551.     Some functions that were undocumented in 3.0 have been documented
  552. in 3.1.  Horray!  Unfortunately, in two cases (SetSelectorBase() and
  553. SetSelectorLimit()), Microsoft thinks these functions have return
  554. values, whereas we think the return values are so useless as to be
  555. void.  Microsoft's WINDOWS.H wins out though, so something printed in 
  556. the book shows:
  557.  
  558.         void FAR PASCAL SetSelectorBase(WORD sel, DWORD base);
  559.         void FAR PASCAL SetSelectorLimit(WORD sel, DWORD limit);
  560.  
  561. this has been changed on disk to:
  562.  
  563.         WORD FAR PASCAL SetSelectorBase(WORD sel, DWORD base);
  564.         WORD FAR PASCAL SetSelectorLimit(WORD sel, DWORD limit);
  565.  
  566.     This way, the program will compile whether you are using a 3.0
  567. or 3.1 version of WINDOWS.H.  Just ignore the return value.
  568.  
  569.  
  570. 7. Corrections to Chapter 5: KERNEL
  571.    --------------------------------
  572.  
  573. Introduction:
  574.     The implementation of hInstance_from_hModule() (usually called
  575.     through the macro GetModuleDgroup()) has been changed:  in the
  576.     text a long way to get an hInstance from an hModule is discussed,
  577.     but then a short way is presented in the code.  The long way
  578.     directly examines the Module Database, whereas the short way
  579.     uses LoadLibrary().  In some last-minute testing, the short way
  580.     just didn't seem as reliable, so HANDLES.C uses the long way.
  581.  
  582. Instance Data (NULL Segment):
  583.     It turns out that Microsoft's name for this is Task Header (see
  584.     the 3.1 SDK _Guide to Programming_, Chapter 16).
  585.  
  586.     The version of the NULLSEG.C sample program on disk has been
  587.     changed from the version printed in the book:  we were
  588.     forgetting to call HandleToSel() on hDgroup; this would cause
  589.     the program to fail under 3.0.
  590.  
  591. KillTask:
  592.     There is no Windows KillTask() function, even though a prototype
  593.     for one appears in WINEXP.H.  The book notes that the ToolHelp
  594.     TerminateApp() function can be used.  A handy sample program,
  595.     KILL.C, appears on the disk along with KILL.EXE; this program is
  596.     just a wrapper around TerminateApp().
  597.  
  598. Task Database:
  599.     As noted in the book, TDB.INC in the 3.1 DDK shows a number of
  600.     fields related to threads. It is not clear whether or not these
  601.     are actually used in Windows.  However, the Task Database bears
  602.     a striking resemblance to the Per-Task Data Area (PTDA) in OS/2
  603.     (see Deitel and Kogan, _The Design of OS/2_, p. 121), so it is
  604.     possible that at one point this structure was shared between
  605.     OS/2 and Windows, thereby explaining the presence of the thread
  606.     fields.  In other words, maybe they're used in OS/2 but not
  607.     in Windows?
  608.  
  609. Task Queue:
  610.     The discussion of the Task Queue indicates that the default number
  611.     of messages held in a Task Queue can be changed with an obscure
  612.     WIN.INI setting.  Unfortunately, we overlooked a _documented_ way
  613.     to resize the Task Queue:  SetMessageQueue().
  614.  
  615.     The status flags shown for offsets 42h and 44h in the Task Queue
  616.     are for 3.0 _only_.  The flags changed for 3.1, and are documented:
  617.     see GetQueueStatus() in the 3.1 SDK and in the 3.1 version of
  618.     WINDOWS.H. For example, where we show QS_PNTWAITING as 0x0010,
  619.     WINDOWS.H shows QS_PAINT as 0x0020.  Ours is accurate for Windows
  620.     3.0, and WINDOWS.H is of course accurate for 3.1.  Interestingly,
  621.     the flags in 3.1 seem mostly to have been shifted left one from 3.0.
  622.  
  623. THHOOK
  624.     The THHOOK.C sample program has been changed.  As noted in the
  625.     book, the SelTableLen and SelTableStart fields are at different
  626.     locations in 3.0 and 3.1.  However, this was not reflected in   
  627.     the THHOOK.C sample program.  At the last minute, these fields
  628.     were removed from THHOOK.C.  See the Selector Table entry in
  629.     Chapter 5 for sample code to access SelTableLen and SelTableStart
  630.     in 3.0 as well as 3.1.
  631.  
  632. WaitEvent/PostEvent:
  633.     The SEMTEST.C sample program has been changed.  The task doing
  634.     WaitEvent() can't yield to other others.  Unfortunately, the
  635.     WINIO puts() function yields.  The task doing WaitEvent() no
  636.     longer calls puts().
  637.  
  638. WinExec:
  639.     The book notes that WinExec() returns an hInstance.  It should
  640.     also have pointed out that often an hTask is more useful than
  641.     an hInstance.  The hInstance returned from WinExec() can be
  642.     turned into an hTask, using the hTask_from_hInstance() function
  643.     from HANDLES.C:
  644.         hTask = hTask_from_hInstance(WinExec("foo.exe", SW_NORMAL));
  645.  
  646.  
  647. 8. Corrections to Chapter 6: USER
  648.    ------------------------------
  649.  
  650. BroadcastMessage:
  651.     This function is _not_ exported in Windows 3.1.
  652.  
  653. Drag and Drop:
  654.     The DDSERVER.C program on disk has been modified slightly to cure 
  655.     a couple of minor bugs.
  656.  
  657.     DDCLIENT.C is slightly changed from the way it appears in the book
  658.     because the DRAGOBJ_ constants (from DRAGDROP.H) have been split out. 
  659.     The DDCLIENT.C in the text incorrectly assumed that DRAGOBJ_PROGRAM, 
  660.     for example, included the DRAGOBJ_EXTERNAL flag.
  661.  
  662. GetQueueStatus:
  663.     This function has been _documented_ in 3.1.  Horray!  However, the
  664.     meaning of the returned flags changed between 3.0 and 3.1.  See
  665.     the discussion of the Task Queue offsets 42h and 44h (Chapter 5) above.
  666.     
  667. __GP:
  668.     For information on the __GP entry exported in the 3.1 version of
  669.     USER, see __GP in Chapter 5 (KERNEL)
  670.  
  671. Keybd_Event:
  672.     The KBDEVENT.C example program now uses GetProcAddress to obtain
  673.     the address of Keybd_Event, instead of trying to find it in the
  674.     import library. Note also that the Alt-Tab keystrokes that it
  675.     generates will switch into, and eventually switch out of a full
  676.     screen DOS app, although it may take many seconds.
  677.  
  678. SetDeskWallpaper:
  679.     The DTWLPAPR.C example program causes a RIP code "Obsolete function
  680.     SetDeskWallpaper() called" to be generated in 3.1 debug version.
  681.     In 3.1 retail, this function performs no action.
  682.  
  683. SetGridGranularity:
  684.     The GRIDGRAN.C example program now stays in a loop prompting for
  685.     and setting grid granularity, instead of exiting after the first time.
  686.  
  687. SetInternalWindowPos/GetInternalWindowPos:
  688.     The INTWPOS.C example program causes a RIP code "Obsolete function
  689.     GetInternalWindowPos() called" to be generated in 3.1 debug version.
  690.     In 3.1 retail, this function works properly.
  691.  
  692.  
  693. 9. Corrections to Chapter 8: GDI
  694.    -----------------------------
  695.  
  696. Introduction:
  697.     The logic of the example code that purports to allow for the
  698.     different sizes of the retail and debug GDI object header structures
  699.     is reversed. The code should instead show:
  700.  
  701.         {
  702.         LPGDIOBJ31DBG lphdr;
  703.         LPDC lpdc;
  704.  
  705.         lphdr = (LPGDIOBJ31DBG) MK_FP(default_gdi_heap_seg, address_of_dc);
  706.  
  707.         if ((GetVersion == 0x0a03) && GetSystemMetrics(SM_DEBUG))
  708.             (BYTE FAR *) lpdc = (BYTE FAR *) lphdr +
  709.                 sizeof(GDIOBJ31DBG) - sizeof(GDIOBJHDR);
  710.         else
  711.             lpdc = (LPDC) lphdr;
  712.  
  713.         /* Use lphdr for access to object header structure fields, and
  714.             lpdc for access to DC fields */
  715.         }
  716.  
  717.     The BITMAPOBJ structure in GDIOBJ.H lists a field 'hdc'. This is
  718.     an error. The field has been renamed h0E for its offset and the fact
  719.     that it contains an unknown global memory handle.
  720.  
  721. BitmapBits:
  722.     The book notes that BitmapBits is not exported in 3.1.  What it
  723.     fails to note is that the entry point used by BitmapBits in 3.0
  724.     -- GDI.46 -- is in 3.1 used (overloaded) by __GP.  Aargh!
  725.  
  726. DeviceColorMatch:
  727.     Apparently, this function has to do with DIBs.  Given an RGB and
  728.     some other parameters, the function tried to find a match to a
  729.     logical palette.  It possibly returns a physical palette index.
  730.  
  731. FixupBogusPublisherMetafile:
  732.     Apparently, the offending Publisher is _not_ Ventura.  It's
  733.     Microsoft Publisher!
  734.  
  735. GetKerningPairs:
  736.     The first argument is an HDC, not an HFONT.
  737.  
  738. __GP:
  739.     For information on the __GP entry exported in the 3.1 version of
  740.     GDI, see __GP in Chapter 5 (KERNEL)
  741.  
  742. LVBUnion:
  743.     This function should be "LVBUnion" not "LvbUnion".  LVB (which
  744.     also appears in the rectLVB field in the DC) apparently stands
  745.     for "logical video buffer."
  746.  
  747. ScaleExt:
  748.     This function is _not_ exported in 3.1.
  749.  
  750. === END ===
  751.