Vous voulez voir cette page en français ? Cliquez ici.


or
Sign in to turn on 1-Click ordering.
or
Amazon Prime Free Trial required. Sign up when you check out. Learn More
More Buying Choices
Have one to sell? Sell yours here
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Win32 System Services: The Heart of Windows 98 and Windows 2000 (3rd Edition) [Paperback]

Marshall Brain , Ronald D. Reeves
5.0 out of 5 stars  See all reviews (3 customer reviews)
List Price: CDN$ 51.99
Price: CDN$ 32.75 & FREE Shipping. Details
You Save: CDN$ 19.24 (37%)
o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
Only 1 left in stock (more on the way).
Ships from and sold by Amazon.ca. Gift-wrap available.
Want it delivered Thursday, September 25? Choose One-Day Shipping at checkout.
Join Amazon Student in Canada


Book Description

Dec 1 2000 Microsoft Technologies Series
The quick, easy way to get up-to-speed on the Win32 API -- the best-seller, completely updated!
Covers Windows 2000, NT4, and Windows 98/95!
Detailed chapters on every key topic- processes and threads, security, directories and drives, and many more.
CD-ROM contains all sample code. Fully updated to reflect Win32 enhancements in Windows 2000 and Windows 98, Marshall Brains classic guide remains the most effective way for developers to master Win32 services in real-world application development. Brain introduces Win32 files, directory and drive structure, NT processes and threads, synchronization mechanisms, network communications, Remote Procedure Calls, NT services, NT security, consoles, communications ports, accessing system information, and using DLLs to modularize programs. Each self-contained chapter covers a different API service, with functions demonstrated clearly in code examples (all included on an accompanying CD-ROM). Brain also shows how multiple services can be integrated to create larger, more sophisticated applications.
Marshall Brain is founder and principal of Interface Technologies, Research Triangle, NC. His firm specializes in software training for developers at leading financial companies. He is the author of Developing Professional Applications for Windows 98 and NT Using MFC (Prentice Hall). Ron Reeves is President of Computer Engineering, Inc., a leading consulting and training company based in Howell, MI.

Product Details


Product Description

From the Inside Flap

Preface

The Win32 system services are the innovative, cutting-edge capabilities that make Windows 2000 and Windows 98 interesting and exciting. Amid all of the media attention surrounding Windows 2000 and 98, you have probably heard and read about many of the modern capabilities that these operating systems contain:

  • Processes and threads
  • Synchronization
  • Remote Procedure Calls (RPCs) and DCOM (Distributed COM)
  • Event logging
  • Network communications
  • TCP/IP network communications
  • File mapping and Active Directory
  • Interprocess and Interprocessor communication
  • Compressed file access
  • Network drive- and printer-sharing
  • Serial communications
  • Services (background processing like UNIX daemons)
  • Object and file security

The goal of this book is to show you how to use all of these different services in your own applications. This book contains hundreds of concise, clear, and easy-to-understand example programs and explanations. The examples show you how to access the system services listed above, as well as many others. You can use these examples directly, to understand the concepts. You can also drop the sample code into your own programs and then extend it to give your applications new and useful features.

By learning about the many and varied system services available inside of Windows 2000 and 98, you can make your programs much more interesting to the user. For example, if you learn about threads and then add multiple threads to your applications, the user gets a much smoother interface (see Chapter 6). Your program will also take advantage of multiple processors on machines that have them. If you add network support to your applications, the user is able to access network resources that are unavailable on a single machine (see Chapter 8). If you add modem support, you can use it to let the user dial into a remote system (see Chapter 11). Or you might use a modem to let the user dial a support line or registration system for a product that your company sells.

The goal of this book is to give you a thorough and clear understanding of the system services so that you can take advantage of all of the capabilities that Windows has to offer.

Audience

This book is designed for two types of people. If you are a devoted connoisseur or student of programming, the study of the system functions is interesting in its own right. It's fun to see what functions are available, and to try to think of ways to exploit those capabilities. One way to use this book is to simply browse through it and see what is possible. You can work with the examples and extend them in ways that you find enjoyable.

If, on the other hand, you are a programmer with a deadline, enjoyable entertainment is probably not your goal. You may have looked at the huge number of functions in the Windows API and found it discouraging. Where do you start? What you need is a set of useful examples and clear explanations that quickly solve your specific problems. You will find this book useful because it organizes concepts logically and provides the material that you need to master a specific topic very quickly.

If you are migrating from another operating system to Windows, this book will help you to quickly map your existing knowledge into the Windows framework. See Chapter 1 for a list of the 121 most common programming questions in Windows, as well as for the locations of the sections that contain the answers.

Organization

This book is organized by functional categories. For example, Chapter 2 talks about all of the functions that pertain to file input/output and file handling. Chapter 3 deals with disk drives. Chapter 4 discusses directories. Chapter 5 talks about the next-generation directory services, known as Active Directory in Windows 2000. Chapter 6 talks about processes and threads. You will find that each chapter starts with a general overview of the topic, followed by sections that describe and give examples for subsets of functions.

In many chapters you will find integrating examples that combine different capabilities from several chapters to create larger applications. Many of these larger examples form complete applications that you can use as starting points for new projects of your own.

Philosophy

Several principles guide the content of this book. The first principle is the most important and is therefore used throughout: it is simplicity. There is nothing worse than looking up a function, only to find that its example is embedded within sample code that takes three days to comprehend because it is 28 pages long. In all cases a function is first demonstrated in code that is as simple as possible so that you can extract the essence of each one very quickly. They may then be integrated into larger examples. In many cases you will look at the example code and say to yourself, "This is easy!" That is exactly the intent. If the book makes everything look simple and easy for you, then it has accomplished its goal.

The second principle driving this book is the idea of functional families. Functions in the 32-bit API very rarely exist on their own-it is far more common to find small collections of functions that relate very closely to one another. For example, the ReadFile function reads from a file, but you must open the file with CreateFile before you can read from it and then remember to close it with CloseHandle afterwards (see Chapter 2). These functions belong to a family. In this book you will generally find small groupings of functions described as logical units.

The third principle in this book is that of currency. The Windows API has been around for some time, and when you look at it you will find that there is a certain amount of layering. The documentation will often say things like, "this function is retained for compatibility with version 1.8, but has been superseded by function xyz." This book deals only with the current functions, and leaves the superseded ones to die in peace.

The last principle guiding this book is independence. Each chapter in this book is as stand-alone as possible, so that you can jump around in the book as you please. In cases where material from other chapters is important, you will find references to the related sections.

Prerequisites and Languages

This book makes no assumptions about your former knowledge of systems programming in Windows or in any other system. Its only real assumption is that you know C and/or C++. You will find that the example code can be divided into two categories:

  1. Text examples that run in "console mode." These programs run from the MS-DOS prompt, accept keyboard input, and produce text output. They form the vast majority of the code in this book because they are simple. These programs are C++- compatible, but the only elements really being used from C++ are the I/O stream libraries.
  2. "Windows" programs that use the Windows GUI. These programs use C++ and the Microsoft Foundation Class library (MFC). The book Visual C++: Developing Professional Applications for Windows 98 and NT using MFC, by Marshall Brain and Lance Lovette (ISBN 0-13-085121-3), describes how to create programs with MFC, and will be useful as a tool to help you understand these examples if you are not already familiar with MFC. You can develop C-language Windows programs using only the Win32 API. However, the Visual C++ tools make low-level Win32 programming easier. But to take advantage of the Visual C++ and MFC tools, you should have a good grasp of the underlying Win32 API.

If you are a C programmer with no C++ experience, you will have no trouble understanding the console programs. The only unusual thing you will see is code that looks like this:

char s100;// Prompt the usercout << "Enter a line of text: ";// Read a line of text from the usercin.getline(s,100);// Echo the user's input to stdoutcout << s << endl;

This code declares a character string s, and then uses "cout <<" to output a prompt to the user. The "cin.getline" statement reads a line of text from the user. The final "cout" statement echoes the line. The book Visual C++: Developing Professional Applications in Windows 95 and NT using MFC, by Marshall Brain and Lance Lovette (ISBN 0-13-305145-5), contains an extensive C++ appendix to help you get started with the language if you are interested. It will also help you understand the MFC code.

The Diskette and the On-line Index

The diskette included with this book contains the source code for all of the examples in the book, as well as the source and data for an on-line indexing program. The index is broken down by sections and includes every word found in the manuscript.

To use the index, follow the directions in the README file on the disk to compile the program. When you run the index, you will see a display that contains an edit area, three buttons (Help, Search and Quit), and a list area. Any words that you type in the edit area are used to search for appropriate sections. For example, if you want to find out how to create a DLL entry point, you would type "DLL entry point" in the edit area. Press the "Search" button to begin the search. The index program will list all sections that contain all three of those words. Enter as many words as you like to home in on what you want. Word matching is exact and case-insensitive. If a word does not appear in the book, the program will tell you.

There are many cases where an exact match does not work well. For example, there may be a section that contains "thread" and "create" but not "creating" and "threads," so if you enter the line "creating threads" on the edit line you get no matches. You can use the "*" wild card character at the end of a word to solve this problem. For example, by entering "creat*" the system will use OR to gather together all words with the root "creat" ("create," "creates," "creation," etc.). You may want to get in the habit of using the wild card character at the end of all words: "creat* thread*," for example. This often yields more helpful results.

If an obvious word seems to be missing from the index, try to find it in the book to make sure you are spelling it correctly. For example, "resize" is spelled "re-size" in the book, and you need to spell it the same way.

Contents of the Book

Each chapter in this book talks about a different service in the 32-bit API. Chapter 1 contains a list of the 121 most common questions about the system services, and it will help you to quickly find material that interests you. The list below summarizes the different chapters in the book to help you with browsing.

  • Chapter 1 is an introduction. It contains a list of the 121 most common programming questions about the Windows system services. This list will serve as a good road map for you. The chapter also contains general information that is useful throughout the book.
  • Chapter 2 discusses files. It shows you how to open, read, and write files, how to read from compressed files, how to map files into memory, and so on. The 32-bit API contains quite a few interesting file capabilities.
  • Chapter 3 introduces the drive structure of Windows. You will learn how to query the drives on your local machine, as well as how to query and connect to drives on the network.
  • Chapter 4 discusses the directory structure. It shows you how to create and traverse directory trees.
  • Chapter 5 talks about the next-generation directory structure of Windows 2000. It shows you how to create and use this new directory capability. It also gives suggestions on when to use this active-directory capability.
  • Chapter 6 offers a complete introduction to processes and threads in the Windows environment. You will see how to multi-thread your own applications, as well as MFC applications. There is also a discussion of processes, interprocess communication, and inheritance.
  • Chapter 7 discusses Windows synchronization mechanisms. Critical sections, mutexes, semaphores and events help you write multi-threaded code that does not step on itself. The chapter introduces you to general synchronization principles and bugs, and shows solutions to a number of standard problems. It also shows you how to incorporate synchronization mechanisms into an MFC program without stalling its event loop.
  • Chapter 8 talks about network communications. Windows contains two different native technologies for communicating over a network: mailslots and named pipes. Windows also supports UPD and TCP packets on TCP/IP networks. The latter capabilities let you intercommunicate with UNIX and other TCP/IP machines. The chap-ter includes a complete introduction to network principles and terminology.
  • Chapter 9 intoduces Remote Procedure Calls, or RPCs. An RPC lets you make a function call that is transmitted over a network and executed on another machine. This chapter contains a complete introduction to the hows and whys of RPCs, as well as design principles to keep in mind when creating client/server systems with RPCs. It contains examples of auto, implicit, explicit, and context binding, and also shows how to incorporate RPCs into MFC programs.
  • Chapter 10 discusses Distributed COM (DCOM). This chapter shows how DCOM objects are created and distributed to create a distributed network.
  • Chapter 11 talks about communications ports in Windows systems. It shows you how to access both the serial and parallel ports, and demonstrates a simple terminal emulator and bulletin board system.
  • Chapter 12 discusses Windows 2000 services. These are background processes that start at boot time and run regardless of who is logged in, just like daemons in UNIX. This chapter shows you how to create your own services and install them in NT's service manager. It also shows you how to place RPC servers into services so they run continuously.
  • Chapter 13 offers a complete introduction to the Windows 2000 security system. This system is uniform across all NT objects, so you will learn how to secure files, registry keys, pipes, semaphores, and so on. It teaches you everything you need to know to create and modify access control lists and security descriptors.
  • Chapter 14 discusses consoles, which you will use when you want to create text-based programs in Windows. For example, if you want to create a terminal emulator, consoles offer an easy way to handle the keyboard input and character output for the emulator.
  • Chapter 15 talks about Microsoft Management Console (MMC). It will demonstrate the possibilities, and methods for using ATL (Active Template Library) to do Snap-ins.
  • Chapter 16 shows you how to access system information, and how to log users off and shut down or reboot the system. For example, this chapter shows you how to determine how many CPUs a system contains, or how many buttons there are on the mouse.
  • Chapter 17 shows you how to modularize your programs using dynamic link libraries (DLLs). Windows can be thought of as an extensible operating system because of DLLs. A programmer can easily add capabilities that others can use by creating a DLL and publishing its interface. Windows itself places much of its functionality in DLLs.
  • Chapter 18 discusses some of the basics of the Component Object Model (COM). This will prepare us for the discussion in Chapter 19, of COM+ and Windows 2000.
  • Chapter 19 discusses the new COM+ and Windows 2000. This will prepare us for the discussion about Windows 2000 Distributed Network Architecture (DNA), which follows this chapter.
  • Chapter 20 discusses Windows 2000 Distributed Network Architecture (DNA). It covers the possibilities and gives a three-tiered architecture example.
  • Chapter 21 contains short discussions and examples on six miscellaneous topics: the registry, the event log, the Windows time model, error handling, structured exception handling, and the memory model.
  • Appendix A shows you how to compile the different types of code found in the book.
  • Appendix B contains information on contacting the authors via E-mail to ask questions and obtain free supplements and updates to this book.
Contacting the Author: Questions, Comments, and Version Changes

One thing about Microsoft is that it never stands still for very long. Its compilers and libraries are constantly changing. One of the goals for this book is that its code be as compatible as possible with existing and future releases of Microsoft compiler products. Another goal is to give you "investment-grade" knowledge—knowledge that does not lose its value over time, and that is transferable between as many different platforms as possible.

As things change, however, you need a way to get updates and corrections. You may also have questions, comments or suggestions for improving this book. If so, we would like to hear from you. You can use our free E-mail information server to get updates and supplements to this book. You can also send questions and comments via E-mail or U.S. mail. Please see Appendix B for instructions.

From the Back Cover

  • The Win32 best-seller, fully updated for Windows 2000 and Windows 98!
  • Master every key Win32 system service
  • Processes, threads, synchronization, and much more
  • Includes extensive coverage of network programming
  • The #1 guide to Win32 system services, totally updated!
  • Includes hundreds of proven code examples —
  • Comprehensive coverage of RPCs and other network programming topics
  • Processes, threads, and synchronization — in depth
  • Expert techniques for effective large-scale development
  • Leveraging Windows 2000's security capabilities

Get up-to-speed on the Win32 API, fast!

The #1 best-seller — now completely updated!

For years, Marshall Brain's Win32 System Services has been the world's #1 resource for Windows developers seeking to master Win32 services in real-world application development. Now, this worldwide bestseller has been fully updated to reflect the latest Win32 enhancements in Windows 2000 and Windows 98!

Each self-contained chapter covers a different API service: Win32 files, directory and drive structure, processes and threads, synchronization mechanisms, network communications, Remote Procedure Calls, security, consoles, communications ports, accessing system information, using DLLs to modularize programs, and much more.

You'll find practical guidance on when to use each service, today's best techniques for integrating services into complex, enterprise-class applications, and extensive proven code examples. Whether you're an experienced Windows developer seeking to deepen your system programming skills, or you're porting applications from other environments, Win32 System Services - The Heart of Windows 98 and Windows 2000, Third Edition will be your most valuable resource.


Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Reviews

4 star
0
3 star
0
2 star
0
1 star
0
5.0 out of 5 stars
5.0 out of 5 stars
Most helpful customer reviews
Format:Paperback
I can't say enough good things about this book. But let me try.
If you want to understand how 98/NT/Win2K works under the covers, read this book. Brain and Reeves 'break it down' for you in simple language and C code that works.
If you hate Windows and think Unix is the only true OS, read this book. You'll still like Unix better, but you'll appreciate how truly wonderful Win32 is.
If you need to write code for the Win32 platform, especially server code, read this book. I bought this book when I needed to learn how to write NT services. An hour later I had my first service running.
I also learned how to write threaded code using this book.
Don't wait another moment. Buy this book now. You'll keep it at your side and use it all the time.
This is a classic work on par with Stevens' TCP/IP books.
I only wish Brain wrote a book for every subject that I needed to learn. Oh, wait, he has...
Was this review helpful to you?
5.0 out of 5 stars I must have book on programming for Windows Dec 28 2002
By A Customer
Format:Paperback
Unlike most books out there that mainly talk about GUI programming, this book focuses on all those functions that your Computer Science instructor (who probably loves Java because they lack the capacity to learn anything about Win32 or MFC) never taught at your C++ courses, such as getting a directory listing, creating and installing your own services, killing processes, creating threads, and a really simplified but yet awesome lesson on network programming. All source code is simplified by using the simple <iostream> class and main(), so you can easily see what is going on, and keeping the entire source code down to less than a page.
Was this review helpful to you?
5.0 out of 5 stars great book Sept. 4 2001
Format:Paperback
i have all my life,worked in the unix environment and but lately my work pushed me to get into the world of microsoft, one can expect my first reaction to this , but after reading this boook i have started to hate microsoft less. guys must read.
Was this review helpful to you?
Most Helpful Customer Reviews on Amazon.com (beta)
Amazon.com: 4.5 out of 5 stars  8 reviews
17 of 18 people found the following review helpful
5.0 out of 5 stars If you code to the NT/Win2K platform: READ THIS BOOK March 1 2001
By Matthew Grimm - Published on Amazon.com
Format:Paperback
I can't say enough good things about this book. But let me try.
If you want to understand how 98/NT/Win2K works under the covers, read this book. Brain and Reeves 'break it down' for you in simple language and C code that works.
If you hate Windows and think Unix is the only true OS, read this book. You'll still like Unix better, but you'll appreciate how truly wonderful Win32 is.
If you need to write code for the Win32 platform, especially server code, read this book. I bought this book when I needed to learn how to write NT services. An hour later I had my first service running.
I also learned how to write threaded code using this book.
Don't wait another moment. Buy this book now. You'll keep it at your side and use it all the time.
This is a classic work on par with Stevens' TCP/IP books.
I only wish Brain wrote a book for every subject that I needed to learn. Oh, wait, he has...
4 of 4 people found the following review helpful
5.0 out of 5 stars I must have book on programming for Windows Dec 28 2002
By A Customer - Published on Amazon.com
Format:Paperback
Unlike most books out there that mainly talk about GUI programming, this book focuses on all those functions that your Computer Science instructor (who probably loves Java because they lack the capacity to learn anything about Win32 or MFC) never taught at your C++ courses, such as getting a directory listing, creating and installing your own services, killing processes, creating threads, and a really simplified but yet awesome lesson on network programming. All source code is simplified by using the simple <iostream> class and main(), so you can easily see what is going on, and keeping the entire source code down to less than a page.
2 of 2 people found the following review helpful
5.0 out of 5 stars I like the author's name ! :-) Oct. 2 2007
By Malleus Maleficarum - Published on Amazon.com
Format:Paperback
No less than five stars can be given!

PS. On a serious note, this is a good book. In a concise and always-to-the-point manner it covers a multitude of frequently happening systems-programming scenarios (with lots of sample code). It's almost like an intelligently written reference combined with a readable programmer's guide. For an initial in-depth study Richter's books are better, but this one is good to scan through once and keep it within reach. You will use it all the time (I do, and I have all editions of it). Whenever you, sort of, know what you need but don't quite remember the exact how-tos, this book will give you a quick and exact answer.

Bottom line: unequivocally worth having.

PPS. I was motivated by Mr Rothwell's review to post this; his review, I think, is unfair: the problem he experienced is due to a manufacturing defect and has nothing to do with the book's value (btw, my copies, all editions, have all been printed OK, so it _is_ possible to get a well-made copy). Mr Rothwell should have simply returned his book to Amazon for exchange or refund instead of knocking down a book he, by his own admission, hasn't even read.
2 of 2 people found the following review helpful
5.0 out of 5 stars Still Practical April 24 2008
By tterb45 - Published on Amazon.com
Format:Paperback|Verified Purchase
In spite of being an older book, this material is easy to follow and still works.
5.0 out of 5 stars Still relevant today June 30 2014
By KG - Published on Amazon.com
Format:Paperback|Verified Purchase
This is what .NET was written with, native window calls. It is still very relevant, and a good book for Native C++ developers. Of course, the timing of this book there wasn't any .NET. I would recommend this to anybody who has native code.
Search Customer Reviews
Only search this product's reviews

Look for similar items by category


Feedback