Version 1.10 January 22, 2008
Version 1.9, May 29, 2007
Version 1.8. December 30, 2005
Version 1.7. October 9, 2005
Version 1.6. September 5, 2005
Version 1.5. August 14, 2005
Version 1.4. June 5, 2005
Version 1.3. April 13, 2005
Version 1.2. November 21, 2004
Version 1.1. September 18, 2004
All the projects have now been updated for the release builds.
Please inform me of any anomalies that you find (jmhart@world.std.com).
These projects can be used with Editions 1 and 2 as well. There has been
some chapter rearrangement, but it is minimal. Users of the older
editions will find a lot of new code, many defect fixes and code
improvements. Also, Visual Studio .NET projects are included along
with Visual C++ Verion 6.0 projects.
Visual Studio 2005 will convert the projects and build them properly.
John
Johnson M. Hart
Author, "Windows System Programming, Third Edition"
Addison-Wesley, 2004
================================================================
CHANGE HISTORY:
Version 1.10 January 22, 2008
1. I added a new project, ThreeStagePthreads, which uses source files in
WindowsSmpEd3\CHAPTR10\ThreeStagePthreads. This is Chapter 10's
ThreeStage program written using the POSIX Pthreads API. It uses
an open source Pthreads Windows libary. The .dll and .lib files are
included under WindowsSmpEd3\CHAPTR10\ThreeStagePthreads.
2. There is a small, but important change to
WindowsSmpEd3\CHAPTR12\SendReceiveSKST.c
to fix a bug in function
BOOL ReceiveCSMessage (REQUEST *pRequest, SOCKET sd)
3. There are several other minor code changes.
NOTE:
- There are projects for Visual Studio 6 and 7. You can easily use
Visual Studio 2005; just open an existing project and convert it.
I have tried several projects without difficulty. I'll try VS 2008
when it becomes available.
- I still find people using VS 6.0, so I'll continue to maintain these
projects.
Version 1.9, May 29, 2007
Minor change to Program 12.4 to free the TLS index
Version 1.8
Minor changes to Program 10.2 (threshhold barrier).
Version 1.7
Fix Chapter 3's lsW.c (Program 3-2); TempPath was never initialized.
Improve Chapter 12's SendReceiveSKHA.c's functions to use
PSOCKET_HANDLE parameters rather than PVOID.
Version 1.6, September 5, 2005
Chapter 3's touch.c and Chapter 9's statsMX.c, statsCS.c, statsIN.c, and
statsNS.c have been updated.
Version 1.5, August 14, 2005
Chapter 10's QueueuObj files (All 7 versions) have been updated
to fix a bug in the q_fill() functions. A comment details the
change, which is trivial but critical.
The projects have
all been rebuilt. There are also some changes in QueueObjSig_noSOAW.c
that fixes a problem that could have caused a hang.
Version 1.4, June 5, 2005
Chapter 3's RecordAccess.c was corrected to perform 64 bit file address
arithmetic correctly.
Several Projects7 projects so that the executables go to the run7 directory.
Version 1.3, April 13, 2005
Chapter 14's atouMT.c multithreaded file processing program (an alternaive to
Windows' asynch I/O has been fixed. The previous severity A bug and its fix are
described in the comments.
There have been a few other minor adjustments.
Version 1.2, November 21, 2004
Chapter 5, randfile.c
The program was changed slightly to assure that a CR, LF sequence
terminates every generated line. This is essential for the operation
of some of the programs, such as sortBT, with files generated by
randfile.
Chapter 13. serviceSK.c IMPORTANT
There were several fairly serious bugs that have been fixed.
For example, the checkpoint was not being updated properly,
and the service was never set to have a "started" status.
I tested the new version using the ServiceShell program, but
you could use the Windows tool as well.
================================================================
NOTES:
1. I will update this material from time to time as bugs or
omissions are found and fixed. Please send me anything you
find, and I'll post the updates as soon as possible.
As always, I'll credit you (with your email address) if
you wish (or, you can be anonymous).
2. This material will be maintained on the AW webite at:
www.awprofessional.com/titles/0321256190. I will also
maintain this information at my personal web site,
http://world.std.com/~jmhart/windows.htm. My personal
site will also contain book errata and a LOT of additional
information and examples developed over the last few years
to support Editions 1 and 2 (some of this material is in
Edition 3).
3. The AW Web site also contains downloadble PowerPoint
slides, suitable for non-commercial use, for example, in
college and graduate courses. NOTE: (Nov 21, 2004): I'll
also make this available on my personal web site.
Please don't hesitate to contact me with any questions, comments,
suggestions, or other remarks. I'll attempt to respond as quickly
as possible. Over the years, I've greatly enjoyed communicating with
readers, and I've received some excellent ideas and suggestions.
---------------------------
DESCRIPTION
This directory (WindowsSmpEd3) contains the source code for all the sample programs
in "Windows System Programming, Third Edition" as well as the
include files, utility functions, and projects. The contents are largely
described in Appendix A and are reviewed here.
A number of programs illustrate additional features and solve specific exercises,
although there are not solutions for all exercises or every alternative
implementation.
All Chapter programs have been tested running under Windows NT5 (XP, 2000,
and 2003) on Intel and AMD systems.
Where appropriate, they have also been tested under Windows 9x (95, 98, Me) and
Windows NT 4. A number of programs will fail on 9x and some may fail on NT4
as these obsolete systems do not have all the features available in NT5.
Where appropriate, the program tests the Windows version and will exit
with an error message if the program cannot run on that version.
The programs have been built and run with and without UNICODE defined
under NT. Under Windows 9x, only the non-Unicode versions will operate.
Nearly all programs compile without warning messages under Microsoft
Visual Studio .NET (VC++ 7) and Visual C++ version 6.0 using warning level 3.
There are a few exceptions, such as warnings about "no return from main
program" when ExitProcess is used. Also, there are some warning about potential data
loss when building under Visual Studio .NET; these warning can be ignored and are
mostly caused by the fact that strlen() and related functions return a size_t
value, which is 64 bits in Win64.
The Visual Studio .NET project versions of the projects are in the directory
"Projects7", and the output is placed in the directory "run7". The executables will
only operate under .NET, as they are in "Common Intermediate Language" (CIL)
(http://www.wordiq.com/definition/CIL). "run7" contains all the DLLs required
to run the examples.
The Visual C++ 6.0 project versions are in the directory "Projects6",
and the output, executable on all Intel x86 Windows platforms, is in "run6".
The Visual C++ generic C library functions are used extensively, as are
compiler-specific keywords such as __try, __except, and __leave. The
multithreaded C run-time library, _beginthreadex, and _endthreadex are essential
throughout.
The projects (in release, not debug, form) and make files are included.
The projects are all very simple, with minimal dependencies, and can also be
created quickly with the desired configuration and as either debug or release
versions.
**** Several readers have requested make files for a variety of reasons.
For example, make files would be convenie