Electronic Review of Computer Books

[ ERCB Home | New | Feature | Brief | DDJ | Letters | Links ]

[an error occurred while processing this directive]

Vital Statistics

Title Win32 System Programming
Author Johnson M. Hart
Publisher Addison-Wesley Publishing Company, Inc.
Reading, Massachusetts
http://www.aw.com
Copyright 1997
ISBN 0-201-63465-1
Pages 361
Media CD-ROM
Price $39.95


Win32 System Programming

In a world with no shortage of Windows books, Win32 System Programming stands out by focusing exclusively on Windows system programming. It covers the "systems" areas of the Win32 API, barely mentioning Graphical User Interface programming at all.

The book is also directed at UNIX (or VMS) programmers. The ideal reader is familiar with the main components of an operating system, without necessarily having Win16 experience. By directing the book to UNIX exiles interested in moving to Windows NT, the author avoids explaining systems concepts in great detail. This is clearly a boon -- and also a bit of a bane at times.

Each chapter describes the API in a specific Win32 system area; all the functions for Win32 file I/O, or for creating and synchronizing threads and processes, followed by examples using the specific API. The examples are heavily UNIX influenced: Win32 implementations of grep, tail, and pwd, for example. They are all in C and are all Win32 console applications.

Win32 System Programming does a good job of integrating topics across chapters. For instance, one example grep program searches multiple files by creating a different process for each file; the chapter on threads modifies the same program to use multiple threads. An appendix has an interesting table of functions that are similar among Win32, UNIX, and ANSI C. Hart also tests his functions for performance. Appendix C gives these results for eight differently configured computer systems, including an Alpha system with four CPUs.

For UNIX programmers, sidebars discuss those UNIX features that are comparable to the API being described. I liked the guidelines given for things such as when to use standard I/O, or when and how to use Unicode. The author sometimes feels the book's Win32 focus requires Win32 to come out on top. The Win32 approach is usually described as being more flexible, secure, or having more features (and a lot more parameters).

The advice is fairly balanced, but newcomers interested in general Windows programming issues might be misdirected. Programming Windows 95 says malloc and free are just fine for Win32 programs (in C anyway). Hart spends a lot of space creating new heaps with HeapCreate and allocating memory with HeapAlloc, and only mentions in a sidebar that most programmers will continue to use malloc, free, and the default heap.

I sometimes wished for a better development of background information. Other advanced books such as Jeffery Richter's Advanced Windows, Third Edition (Microsoft Press, 1997, ISBN 1- 572-31548-2) create a better conceptual framework within which topics can be understood. (See Richter's development of "kernel objects," for example.) When Richter explains Structured Exception Handling (SEH), he traces code fragments to show the flow of the code. The Hart book covers the syntax ground of SEH well, but might leave you wondering about the actual run- time behavior. Chapters 9 to 11 develop a client/server example that's worth studying if you want to see processes, threads, semaphores, mutexes, and named-pipes used together in one big bang.

Notwithstanding its lack of hand holding, you still may find this book worth having on your shelf. After such books as Petzold's and Richter's, Win32 System Programming is certainly worth consulting for a different point of view. It's clearly written, although sometimes dry -- the code illustrates what it intends, and the editing is trustworthy. And, in a world with no shortage of Windows books, that ain't bad.

-- Doug Nickerson (doug_nickerson@onsetcomp.com)


Copyright © 1998 Electronic Review of Computer Books
Created 8/27/1998 / Last modified 8/27/1998 / webmaster@ercb.com