This book is devoted to the development of applications using the application programming interface of Microsoft operating systems (Windows 9x, Windows XP, Windows 2000 and Windows Server 2003). The focus is on basic system services, including file system management, process and thread management, inter-process communication, network programming, and synchronization. The technique of porting applications written in the Win32 environment to the Win64 environment is considered. All aspects of the system are described in detail Windows Security and her practical application. abundance real examples, also available on the book's Web site, greatly simplifies the assimilation of the material.

The book is aimed at developers and programmers, both highly qualified and beginners, and will also be useful for students of relevant specialties.

Introduction

This book describes how to develop applications using the Application Programming Interface (API) of Microsoft's Windows operating systems, focusing on basic system services, including file system management, process and thread management, interprocess communication, network programming, and synchronization. User interfaces, Windows internals, and I/O drivers are not covered in this book, although these topics are equally important and interesting in their own right. For examples, realistic scenarios were mainly chosen, and therefore many of them can well serve as a basis for building real applications.

The Win32/Win64 APIs, or generically Windows APIs, are supported by Microsoft's family of 32-bit and 64-bit operating systems, which currently includes Windows XP, Windows 2000, and Windows Server 2003. Windows systems NT, Windows Me, Windows 98 and Windows 95; these systems are now considered obsolete, but many of the example programs in this book can run under them. Migration issues from the Win32 platform to the evolving Win64 platform are discussed as needed. Supported as a 64-bit interface in some versions of Windows Server 2003 and Windows XP, Win64 is nearly identical to Win32.

There is no doubt that the Windows API is the most important factor that influences the entire application development process, and in many cases replaces the POSIX API supported by UNIX and Linux operating systems, as it is considered more preferable or at least provides the same capabilities for applications. , focused on desktop and server systems. Therefore, many experienced programmers are interested in learning the Windows API as soon as possible, and this book is designed to promote this.

First of all, I need to tell you what the Windows API is and show you how to use it in real situations, and this story should be as short as possible and not overloaded with unnecessary details. Therefore, this book is not intended to be used as a reference guide, but to get acquainted with the main properties of the most important functions and demonstrate the possibilities of their application in situations practical programming. Armed with this knowledge, the reader will be able to take advantage of the extensive help documentation provided by Microsoft for self-guided in-depth exploration of specific topics, advanced features, and lesser-known features, according to their needs or interests. Personally, with this approach, learning the Windows API was easy for me, and developing Windows programs was a great pleasure, although there were also some unpleasant moments. My impulses of enthusiasm are easily visible in some places of the book, which, in fact, is not surprising. However, this does not at all indicate that I unconditionally agree with the superiority of the Windows API over the API of other operating systems (OS), but hardly anyone will object to the fact that it has a lot of positive qualities.

The authors of many books on Windows devote considerable attention to explaining what processes are, virtual memory, inter-process communication that preempts the scheduler, but does not show how all this is used in real situations. Programmers with experience with UNIX, Linux, IBM MVS, Open VMS and some other operating systems are already familiar with these concepts, and they are only interested in moving on to learning how these features are implemented in Windows as quickly as possible. In addition, most books on Windows give an important place to programming methods based on user interface. In order to focus on only the most important basic capabilities provided by the system, the user interface is not covered in this book, and we will only discuss simple console character I/O.

According to the point of view of this book, Windows is just an API. operating system, which provides a set of well-understood tools. Many programmers, regardless of their level of experience, feel the need for accelerated learning of Windows, and without knowledge of Windows, it is unthinkable to discuss topics such as the Component Object Model (COM) developed by Microsoft. In some respects, Windows systems are superior to other systems, in others they lag or are about the same level. The purpose of this book is to demonstrate how to best use these capabilities in real-world situations to develop useful, high-quality, high-performance applications.

Potential audience

Anyone who wants to quickly learn how to develop applications, regardless of the level of experience.

Programmers and developers software, who are faced with the task of porting existing applications written, in particular, for UNIX, to any of the Windows platforms. The book demonstrates the comparative capabilities of the functions and programming models associated with using Windows, UNIX, and the C standard library. Each of the common functionality UNIX, including process management, synchronization, file systems and inter-process communication, is considered in terms of Windows.

Readers starting to develop new projects that are not limited in their actions by the need to port existing program codes to other platforms. The book covers many aspects of program design and implementation and demonstrates how to use Windows features to create useful applications and solving common programming problems.

COM and .NET Framework programmers who will find a lot of useful information, facilitating the study of the principles of dynamic link libraries (dynamic link libraries, DLL), thread models and how to use them, interfaces and synchronization.

Students who are undergraduate computer science or who are working on undergraduate theses related to system programming or application development. The book will also be useful to those who study multi-threaded programming or are faced with the need to create network applications. It can also be used as useful addition to sources such as the book by W. Richard Stevens (W. Richard Stevens) Advanced Programming in the UNIX Environment(see bibliography) to allow students to compare Windows features and UNIX. This book will also be of great help to students taking an OS course, as it shows exactly how the basic functionality of an OS of commercial interest is provided.

The only assumption that is implicit in all of the above is the assumption that readers have experience programming in the C language.

Changes in the third edition

Along with a significant update and reorganization from the first two editions, the third edition adds a significant amount of new material. This publication aims to solve the following tasks:

Cover the new features introduced in Windows XP, Windows 2000, and Windows Server 2003, and consider moving to the Win64 platform.

Deprecate material specific to Windows 95, Windows 98, and Windows ME ("Windows 9x" family) as obsolete because currently shipped personal systems Windows XP is installed, and the limitations inherent in Windows 9x have already lost their relevance. In the sample programs, without any reservations, tools are used that are included only in current versions Windows, although some programs will not work on Windows 9x as a result.

Provide more comprehensive coverage of the topic of threading and synchronization, including performance, scalability, and reliability related aspects. Chapter 9, as well as some of the examples in chapter 10, are new.

Highlight the growing impact of Windows 2000 and Windows Server 2003 and the new tools they include on high-performance, scalable, multi-threaded server application capabilities.

Investigate the dependence of the performance of programs on the principles of their construction, paying special attention to multi-threaded programs with synchronization and to the features of the operation of these programs in conditions of symmetrical multiprocessor (Symmetrical Multiprocessor, SMP) systems.

Take into account the comments of readers and students regarding the correction of shortcomings and improving the style of presentation, as well as all their advice and suggestions, both important and the most insignificant.

How this book is organized

The chapters are arranged according to their thematic focus, and therefore the tools necessary for running exclusively single-threaded applications are considered first, then the tools used to manage processes and threads, and only then network programming in a multi-threaded environment are discussed. This organization of the book makes it easy for the reader to follow the logic of the presentation, sequentially moving from file systems to memory management and file mapping, then to processes, threads and synchronization, and then to inter-process and network communication and application security issues. This organization also allows examples to naturally build on as they become more complex, much like a developer does when he first creates a simple prototype and then gradually introduces additional features. Consideration of advanced issues, such as asynchronous I / O and security issues, has been moved to the very end of the book.

Within each chapter, after a brief discussion of individual functionality, such as process control or file display, the most important of the relevant Windows features and their relationship to each other are discussed in detail. The presentation is accompanied by illustrative examples. Only the most significant parts of the program listings are included in the main text; the full texts of the programs, as well as the necessary include files, auxiliary functions, and other code, are given in Appendix A or are available on the book's Web site (http://www.awprofessional.com/titles/0321256190). Whenever features are only supported by current versions of Windows (XP, 2000, and Server 2003) and not supported by earlier versions, such as Windows 9x and Windows NT, which do not include many of the enhanced features, separate disclaimers apply. Each chapter provides a list of additional recommended reading and offers several exercises. Many exercises focus on issues that are important and of some interest but have not been covered in the main text, while other exercises force the reader to delve deeper into topics of a more complex or specialized nature.

Chapter 1 provides a high-level introduction to the Windows family of operating systems and the Windows APIs. Used as an example simple program demonstrates the main elements of style Windows programming and provides a foundation for implementing advanced Windows features. Win64 and cross-platform software migration issues are discussed first in Chapter 1, explored more fully in Chapter 16, and discussed as needed throughout the rest of the book.

Chapters 2 and 3 cover file systems, console I/O, file locking, and directory management. Chapter 2 also talks about Unicode, the extended character set used by Windows. Relevant illustrative examples cover sequential and direct access to data contained in a file, directory tree traversal, and file archiving. Chapter 3 ends with a discussion program control registry, which has much to do with managing files and directories.

Chapter 4 introduces the reader to Windows exception handling, including Structured Exception Handling (SEH), which will be used extensively throughout the book. In many books, the study of SEH is postponed until the last chapters, however, having become familiar with this tool already at the initial stage, we will be able to use it immediately, which will greatly simplify some programming tasks for us and improve the quality of our programs. In addition, one of the newest features, vector exception handling, is also described here.

Chapter 5 looks at memory management in Windows and shows how file mapping is used not only to simplify programming but also to improve program performance. This chapter also discusses the organization of DLLs.

Chapter 6 provides an introduction to processes, process management, and simple methods sync on Windows. Later in Chapter 7, these concepts are used to describe flow control. The examples in each chapter illustrate the many benefits, including program simplification and performance improvements, that come from using threads and processes.

Chapters 8, 9, and 10 offer an in-depth analysis of one of the most powerful Windows tools- thread synchronization. Synchronization is a complex topic, and therefore these chapters contain numerous examples and descriptions of well-understood models that should help the reader take full advantage of threads to improve programming efficiency and program performance while avoiding many pitfalls. These chapters include new material, covering issues of performance and scalability, which are of particular importance when creating server applications, including those that are supposed to run on SMP systems.

Chapters 11 and 12 are devoted to inter-process and inter-thread communication, as well as network programming. Chapter 11 focuses on features that are part of Windows, namely anonymous pipes, named pipes, and mailboxes. Chapter 12 discusses Windows Sockets (Windows Sockets), which provide the ability to communicate with systems outside of Windows. Windows family, through standard protocols, mainly TCP/IP. And although Windows interface Sockets, strictly speaking, is not part of the Windows API, it is capable of communicating and interacting over networks and the Internet, so the subject matter of this chapter is consistent with the rest of the book. Using the example of a multi-threaded client-server system, it is illustrated how inter-process communication can be provided along with threads.

Chapter 13 shows how way Windows allows you to turn server applications like those created in Chapters 11 and 12 into windows services(Windows Services) that can be managed as back-end servers. Converting a server to a service requires only minor changes to the program.

Chapter 14 shows how to perform asynchronous I/O operations using overlapped I/O, as well as events and completion routines. The same results can be achieved with streams, so examples are given to compare various solutions in terms of simplicity and performance of the respective programs. At the same time, building scalable multi-threaded servers requires the use of completion ports, the use of which is illustrated by the example of servers created in previous chapters. Wait timers are also described, the discussion of which requires the use of concepts introduced earlier in this chapter.

Chapter 15 focuses on Windows object security, using as an example an emulation of a UNIX-style file protection system that requires appropriate permissions to perform certain operations on a file. Additional examples illustrate how processes, threads, and named pipes are protected. Security additions can then be added to the previously discussed examples.

Chapter 16 concludes the main material with a discussion of programming for Win64, as well as ensuring software compatibility with this platform. After that, one of the examples considered earlier is converted to a form that allows the program to be ported to the Win64 platform.

The main material of the book is supplemented by three appendices. Appendix A contains descriptions of the programs available on the book's Web site and recommendations for their use. Appendix B contains several tables that compare Windows functions with equivalent functions provided by UNIX and the C standard library. Appendix C compares the performance of alternative implementations of some of the examples in the main text, allowing the reader to form their own idea of ​​the relative merits. and shortcomings of Windows tools, both basic and advanced, and the tools provided by the C library.

Comparison with UNIX and the C library

In the course of presenting the material, we compare style and functional features Windows tools and similar tools included in UNIX (Linux) and the ANSI C standard library. As already noted, tables in Appendix B provide a complete list of comparable functions. We thought it would be useful to include this information, since many readers are familiar with UNIX, and the results of comparing both systems with each other will undoubtedly be of interest to them. Those who are not familiar with the UNIX system can safely skip the relevant sections, which are in small print and indented to make them easier to distinguish.

The examples should provide examples of common, most common, and practical use of Windows features.

They should correspond to real situations from the field of programming, which one has to face in the process of software development, consulting and training. Some of my clients and listeners have used the example codes when building their own systems. In my consultations, I often come across program codes similar to those included in this book, and on several occasions I have even been approached with codes taken directly from the first or second editions. (By the way, you can also use the examples from the book in your work, and if you also include thanks to me in the documentation, then I will only be happy.) I often encountered these codes as separate parts of COM or C ++ objects. Examples, taking into account the restrictions on the time of their preparation and the allowable amount of code, are close to "real life" and solve "real" problems.

The examples should highlight the actual behavior and interaction of the functions, which are not always what one would expect after reading the documentation. In this book, both text and examples focus not on the functions themselves, but on how they interact with each other.

Sample code should be built incrementally and extended to add new functionality to a previous solution in a simple and understandable way, and demonstrate alternative implementation techniques.

Many of the examples in the first few chapters implement UNIX commands such as ls, touch, chmod, and sort, thereby presenting Windows functions in a familiar context to some readers while providing a useful set of helper functions. In addition, having different implementations of the same command makes it easier to evaluate the performance benefits of using Windows enhancements. The relevant test results are given in Annex B.

The examples given at the beginning of the book differ, as a rule, in the short length of programs, but as the material becomes more complicated in subsequent chapters, the size of the illustrative program code, if necessary, increases significantly.

In the exercises presented at the end of each chapter, the reader is asked to develop alternative options solutions, explore recommended topics on your own, or explore additional features that, while interesting, can't be covered in detail in this book. Some of the exercises are quite simple, while others may be difficult for you. Often you will also be presented with clearly unsuccessful solutions, because identifying and eliminating errors will provide you with excellent opportunities to hone your skills.

All examples have been debugged and tested under Windows XP, Windows 2000 and Windows Server 2003 operating systems. – Where necessary, testing was carried out under Windows 9x and Windows NT operating systems. And although uniprocessor systems based on Intel processors, most of the programs were also tested on multiprocessor systems. When testing applications with client-server architecture several clients interacting with the server were used simultaneously. However, programs can never be said to be correct or complete and suitable for any purpose. Undoubtedly, even the simplest examples can be flawed and, under certain circumstances, not work at all - such is the fate of almost any software. Therefore, the author will be sincerely grateful to everyone who sends reports about any defects found in the programs, and even better - about errors.

Websites for this book

The book's Web site (http://www.awprofessional.com/titles/0321256190) contains a download containing all programming code and blueprints for all the examples in the book, solutions to some exercises, alternate implementations of some of the examples, directions, and performance test results. This information is periodically updated as necessary to include new material and make necessary corrections.

On my personal Web site (http://www.world.std.com/~jmhart/windows.htm) you will find a list of errata found in the book, as well as additional examples, letters from readers, and additional explanations, among many others. . Also included are PowerPoint slides that can be used for non-commercial educational purposes. These slides have already been used by students in many professional courses, but they are also suitable for use in colleges.

As deficiencies and errors are identified and feedback from readers is received, this material will be updated periodically. If you encounter any difficulties with the programs or any other material contained in the book, please visit the indicated sites first, where you may be able to find the necessary explanations or obtain information about the errors discovered so far. If such an attempt to obtain an answer to your question is unsuccessful, please contact me directly at the following address. Email: [email protected]

Thanks

During the preparation of the third edition, many people provided me with effective help, shared advice or simply supported with a kind word, and readers suggested whole line valuable ideas and comments. The author's Web site expresses warm gratitude to all those whose advice and comments found their way into the third edition of the book, while the first two editions contain thanks to those who gave us valuable advice earlier. In addition, wonderful detailed analysis The content of the book has been reviewed in recent reviews by Vagif Abilov, Bill Draper, Horst D. Clausen, Michael Davidson, Daniel Jiang, Eric Landes Landes, Klaus H. Probst, and Douglas Reilly, who took the job much more seriously than formal duties alone would have required; their advice and recommendations deserve the deepest gratitude, and I can only hope that I treated the results of their work with no less attention. Special thanks go to my friends at ArrAy Inc.; I have learned a lot from them.

Anne H. Smith, who did the typesetting, put all her skill, perseverance, and patience into preparing the book for publication; Without her contribution, this book would not have been published. Elissa Armor, who prepared the layouts for the first two editions, laid the groundwork for the current edition, making the transition as smooth as possible.

Chrysta Meadowbrooke, editor of the manuscript, has greatly improved the accuracy, clarity, and coherence of the presentation. Her attentive attitude to the content of the book, sharp questions and insight helped to shed more depth on a number of issues.

The staff at Addison-Wesley Professional showed such professionalism and knowledge that it was a pleasure to work with them. Stephanie Nakib, Editor, and Karen Gettman, Editor-in-Chief, worked on the project from the very beginning, rushed me when needed, cleared any clutter, and made sure I didn't deviate one iota from work schedule. Ebony Haight, Associate Editor, oversaw the entire process, while John Fuller's production team and Patrick Cash-Peterson, Production Coordinator, were led to believe that the production process could not be be connected no difficulty.

This book is dedicated to our beloved Bob and Elizabeth.

Johnson (John) M. Hart (Johnson (John) M. Hart) [email protected] August 2004

From the publisher

You, the reader of this book, are its main critic and commentator. We value your opinion and want to know what we did right, what could have been done better, and what else you would like to see published by us. We are interested to hear any other comments that you would like to express to us.

We are waiting for your comments and look forward to them. You can send us a paper or e-mail, or simply visit our Web server and leave your comments there. In a word, in any way convenient for you, let us know if you like this book or not, and also express your opinion on how to make our books more interesting for you.

When sending a letter or message, do not forget to include the title of the book and its authors, as well as your return address. We will carefully read your opinion and be sure to take it into account when selecting and preparing for publication of subsequent books.

Our coordinates:

Email: [email protected]

WWW: http://www.williamspublishing.com

Information for letters from: Russia: 115419, Moscow, PO Box 783 Ukraine: 03150, Kyiv, PO Box 152


Johnson M. Hart Systems Programming in Windows environment Third Edition

Introduction

This book describes how to develop applications using the Application Programming Interface (API) of Microsoft's Windows operating systems, focusing on basic system services, including file system management, process and thread management, interprocess communication, network programming, and synchronization. User interfaces, Windows internals, and I/O drivers are not covered in this book, although these topics are equally important and interesting in their own right. For examples, realistic scenarios were mainly chosen, and therefore many of them can well serve as a basis for building real applications.

Win32/Win64 APIs, or generically Windows APIs, are supported by Microsoft's family of 32-bit and 64-bit operating systems, which currently includes Windows XP, Windows 2000, and Windows Server 2003. Early members of this family include Windows NT operating systems. , Windows Me, Windows 98 and Windows 95; these systems are now considered obsolete, but many of the example programs in this book can run under them. Migration issues from the Win32 platform to the evolving Win64 platform are discussed as needed. Supported as a 64-bit interface in some versions of Windows Server 2003 and Windows XP, Win64 is nearly identical to Win32.

There is no doubt that the Windows API is the most important factor that influences the entire application development process, and in many cases replaces the POSIX API supported by UNIX and Linux operating systems, as it is considered more preferable or at least provides the same capabilities for applications. , focused on desktop and server systems. Therefore, many experienced programmers are interested in learning the Windows API as soon as possible, and this book is designed to promote this.

First of all, it is necessary to tell you about what the Windows API is and show you how to use it in real situations, and this story should be as concise as possible and not overloaded with unnecessary details. Therefore, this book is not intended to be used as a reference guide, but to introduce you to the basic properties of the most important functions and demonstrate how they can be used in practical programming situations. Armed with this knowledge, the reader will be able to take advantage of the extensive help documentation provided by Microsoft for self-guided in-depth exploration of specific topics, advanced features, and lesser-known features, according to their needs or interests. Personally, with this approach, learning the Windows API was easy for me, and developing Windows programs was a great pleasure, although there were also some unpleasant moments. My impulses of enthusiasm are easily visible in some places of the book, which, in fact, is not surprising. However, this does not at all indicate that I unconditionally agree with the superiority of the Windows API over the API of other operating systems (OS), but hardly anyone will object to the fact that it has a lot of positive qualities.

The authors of many books on Windows spend a lot of time explaining what processes, virtual memory, inter-process communication, preemptive scheduler are, but they do not show how all this is used in real situations. Programmers with experience with UNIX, Linux, IBM MVS, Open VMS and some other operating systems are already familiar with these concepts, and they are only interested in moving on to learning how these features are implemented in Windows as quickly as possible. In addition, most Windows books have a strong focus on user interface programming techniques. In order to focus on only the most important basic features provided by the system, this book does not touch on the user interface, and we limit our discussion to simple console character I/O.

According to the point of view of this book, Windows is just an operating system API that provides a set of well-understood facilities. Many programmers, regardless of their level of experience, feel the need for accelerated learning of Windows, and without knowledge of Windows, it is unthinkable to discuss topics such as the Component Object Model (COM) developed by Microsoft. In some respects, Windows systems are superior to other systems, in others they lag or are about the same level. The purpose of this book is to demonstrate how to best use these capabilities in real-world situations to develop useful, high-quality, high-performance applications.

Johnson M. Hart

System programming in the Windows environment

Third Edition

Introduction

This book describes how to develop applications using the Application Programming Interface (API) of Microsoft's Windows operating systems, focusing on basic system services, including file system management, process and thread management, interprocess communication, network programming, and synchronization. User interfaces, Windows internals, and I/O drivers are not covered in this book, although these topics are equally important and interesting in their own right. For examples, realistic scenarios were mainly chosen, and therefore many of them can well serve as a basis for building real applications.

Win32/Win64 APIs, or generically Windows APIs, are supported by Microsoft's family of 32-bit and 64-bit operating systems, which currently includes Windows XP, Windows 2000, and Windows Server 2003. Early members of this family include Windows NT operating systems. , Windows Me, Windows 98 and Windows 95; these systems are now considered obsolete, but many of the example programs in this book can run under them. Migration issues from the Win32 platform to the evolving Win64 platform are discussed as needed. Supported as a 64-bit interface in some versions of Windows Server 2003 and Windows XP, Win64 is nearly identical to Win32.

There is no doubt that the Windows API is the most important factor that influences the entire application development process, and in many cases replaces the POSIX API supported by UNIX and Linux operating systems, as it is considered more preferable or at least provides the same capabilities for applications. , focused on desktop and server systems. Therefore, many experienced programmers are interested in learning the Windows API as soon as possible, and this book is designed to promote this.

First of all, it is necessary to tell you about what the Windows API is and show you how to use it in real situations, and this story should be as concise as possible and not overloaded with unnecessary details. Therefore, this book is not intended to be used as a reference guide, but to introduce you to the basic properties of the most important functions and demonstrate how they can be used in practical programming situations. Armed with this knowledge, the reader will be able to take advantage of the extensive help documentation provided by Microsoft for self-guided in-depth exploration of specific topics, advanced features, and lesser-known features, according to their needs or interests. Personally, with this approach, learning the Windows API was easy for me, and developing Windows programs was a great pleasure, although there were also some unpleasant moments. My impulses of enthusiasm are easily visible in some places of the book, which, in fact, is not surprising. However, this does not at all indicate that I unconditionally agree with the superiority of the Windows API over the API of other operating systems (OS), but hardly anyone will object to the fact that it has a lot of positive qualities.

The authors of many books on Windows spend a lot of time explaining what processes, virtual memory, inter-process communication, preemptive scheduler are, but they do not show how all this is used in real situations. Programmers with experience with UNIX, Linux, IBM MVS, Open VMS and some other operating systems are already familiar with these concepts, and they are only interested in moving on to learning how these features are implemented in Windows as quickly as possible. In addition, most Windows books have a strong focus on user interface programming techniques. In order to focus on only the most important basic features provided by the system, this book does not touch on the user interface, and we limit our discussion to simple console character I/O.

According to the point of view of this book, Windows is just an operating system API that provides a set of well-understood facilities. Many programmers, regardless of their level of experience, feel the need for accelerated learning of Windows, and without knowledge of Windows, it is unthinkable to discuss topics such as the Component Object Model (COM) developed by Microsoft. In some respects, Windows systems are superior to other systems, in others they lag or are about the same level. The purpose of this book is to demonstrate how to best use these capabilities in real-world situations to develop useful, high-quality, high-performance applications.

Potential audience

Anyone who wants to quickly learn how to develop applications, regardless of the level of experience.

Programmers and software developers who are faced with the task of porting existing applications written specifically for UNIX to any of the Windows platforms. The book demonstrates the relative capabilities of the features and programming models associated with using Windows, UNIX, and the C standard library. Each of the common UNIX features, including process management, synchronization, file systems, and interprocess communication, is discussed in Windows terms.

Readers starting to develop new projects that are not limited in their actions by the need to port existing program codes to other platforms. This book covers many aspects of program design and implementation and demonstrates how to use Windows features to create useful applications and solve common programming problems.

COM and .NET Framework programmers will find a lot of useful information here to help them learn about dynamic link libraries (DLLs), threading models and how to use them, interfaces, and synchronization.

Students who are undergraduate computer science or who are working on undergraduate theses related to system programming or application development. The book will also be useful to those who study multi-threaded programming or are faced with the need to create network applications. It can also be used as a useful supplement to sources such as W. Richard Stevens Advanced Programming in the UNIX Environment(see bibliography), which will allow students to compare the features of Windows and UNIX. This book will also be of great help to students taking an OS course, as it shows exactly how the basic functionality of an OS of commercial interest is provided.

The only assumption that is implicit in all of the above is the assumption that readers have experience programming in the C language.

Changes in the third edition

Along with a significant update and reorganization from the first two editions, the third edition adds a significant amount of new material. This publication aims to solve the following tasks:

Cover the new features introduced in Windows XP, Windows 2000, and Windows Server 2003, and consider moving to the Win64 platform.

Retire Windows 95, Windows 98, and Windows ME-specific material (the "Windows 9x" family) as obsolete because personal systems currently shipped are running Windows XP and the limitations of Windows 9x are no longer valid. The sample programs use, without reservation, tools that are included only in the current Windows versions, although some programs will not work on Windows 9x as a result.

Provide more comprehensive coverage of the topic of threading and synchronization, including performance, scalability, and reliability related aspects. Chapter 9, as well as some of the examples in chapter 10, are new.

Highlight the growing impact of Windows 2000 and Windows Server 2003 and the new tools they include on high-performance, scalable, multi-threaded server application capabilities.

Investigate the dependence of the performance of programs on the principles of their construction, paying special attention to multi-threaded programs with synchronization and to the features of the operation of these programs in conditions of symmetrical multiprocessor (Symmetrical Multiprocessor, SMP) systems.