 |
Win32 System Programming View Larger Image | Johnson Hart Addison-Wesley, Hardcover, 2nd Bk&CD edition, Published September 2000, 507 pages, ISBN 0201703106 | List Price: $59.99 Our Price: $37.95 You Save: $22.04 (37% Off)
| | | Availability: Out-Of-Stock |
Customer Reviews: 1 Average Customer Rating:      Write a Review and tell the world about this title! People who purchase this book frequently purchase: Books on similar topics, in best-seller order:Books from the same publisher, in best-seller order:
"If you are new to the Win32 API, but have programmed for other high-end
operating systems such as UNIX or VMS, thenWin32 System Programming
is the book for you. HIGHLY RECOMMENDED."
--Christopher L.T. Brown,Windows 2000 Magazine
A practical guide to the central features and functions of the Win32 API,Win32
System Programming, Second Edition
, will get you up and running with Windows
NT and Windows 2000. Unlike most Windows programming resources, this book focuses
exclusively on the core system services--file system, memory, processes, communication,
and security--rather than on the more commonly featured graphical user interface
functions. Especially geared for those already familiar with UNIX or other high-end
operating systems, Win32 System Programming, Second Edition, helps you to build
on your knowledge base to learn Win32 features quickly and easily.This new edition has been updated and enhanced with new coverage of network
programming, servers, NT services, thread performance, and synchronization.
It also offers a preview of Win64, the new 64-bit API for Windows 2000. Beginning
with an examination of the features required in a single-process application,
the text gradually progresses to increasingly sophisticated functions relating
to a multithreaded environment. You will find extensive coverage of such critical
Win32 topics as:
- The Win32 file system
- Character I/O and Unicode
- The registry
- Structured exception handling
- Security services
- Memory management and DLLs
- Threads, process management, scheduling, and thread synchronization
- Interprocess communication, featuring pipes and mailslots
- Network programming with sockets
- NT services, including the service control handler, event logging, and debugging
- Asynchronous I/O
- Remote Procedure Calls
- Win64, covering architecture, programming models, data types, and legacy
code migration
Short, practical examples illustrate each topic, and are included on the accompanying
CD-ROM and supporting Web site (http://world.std.com/~jmhart/w32.htm).
The appendixes compare Win32, UNIX, and the C library; and provide performance
measurements and results.
Win32 System Programming, Second Edition,
will give you a solid grounding
in the core operating system functions of the Windows environment, an understanding
of Win64 for Windows 2000, and the know-how you need to put them to work.
Contents
Preface xxi
Chapter 1 Getting Started with Win32 and Win64 1
Operating System Essentials 1
Win32 and Windows 2000, NT, 9x, and CE 4
Win32, Standards, and Open Systems 5
Win32 Principles 7
Getting Ready for Win64 9
The Standard C Library: When to Use It for File Processing 10
What You Need to Use This Book 11
Example: A Simple Sequential File Copy 12
Summary 17
Exercises 19
Chapter 2 Using the Win32 File System and Character I/O 21
The Win32 File Systems 21
File Naming 22
Opening, Reading, Writing, and Closing Files 23
Interlude: Unicode and Generic Characters 29
Unicode Strategies 32
Standard Devices and Console I/O 33
Example: Printing and Prompting 37
Example: Error Processing 39
Example: Copying Multiple Files to Standard Output 40
Example: ASCII to Unicode Conversion 42
File and Directory Management 44
Example: Printing the Current Directory 48
Summary 49
Exercises 50
Chapter 3 Advanced File and Directory Processing, and the Registry 51
The 64-Bit File System 51
File Pointers 52
Getting the File Size 55
Example: Viewing the Tail of a File 56
File Attributes and Directory Processing 58
Example: Listing File Attributes 62
Example: Setting File Times 65
File Processing Strategies 66
File Locking 67
The Registry 72
Registry Management 74
Example: Listing Registry Keys and Contents 78
Summary 81
Exercises 81
Chapter 4 Structured Exception Handling 85
Exceptions and Their Handlers 85
Floating-Point Exceptions 92
Errors and Exceptions 93
Example: Treating Errors as Exceptions 95
Termination Handlers 97
Example: Using Termination Handlers to Improve Program Quality 101
Example: Using a Filter Function 103
Console Control Handlers 106
Example: A Console Control Handler 108
Summary 109
Exercises 109
Chapter 5 Securing Win32 Objects 111
Security Attributes 111
Security Overview: The Security Descriptor 112
Security Identifiers 115
Managing ACLs 117
Example: UNIX-Style Permission for NTFS Files 119
Example: Initializing Security Attributes 121
Reading and Changing Security Descriptors 124
Example: Reading File Permissions 126
Example: Changing File Permissions 128
Overview of Additional Security Features 129
Summary 131
Exercises 132
Chapter 6 Memory Management, Memory-Mapped Files, and DLLs 133
Win32 Memory Management Architecture 134
Heaps 136
Managing Heap Memory 139
Example: Sorting Files with a Binary Search Tree 143
Memory-Mapped Files 148
Example: Sequential File Processing with Mapped Files 154
Example: Sorting a Memory-Mapped File 156
Example: Using Based Pointers 158
Dynamic Link Libraries 162
Example: Explicitly Linking a File Conversion Function 167
The DLL Entry Point 168
Summary 169
Exercises 170
Chapter 7 Process Management 173
Windows Processes and Threads 173
Process Creation 175
Process Identities 181
Duplicating Handles 182
Exiting and Terminating a Process 183
Waiting for a Process to Terminate 185
Environment Blocks and Strings 187
Example: Parallel Pattern Searching 188
Process Execution Times 191
Example: Process Execution Times 192
Generating Console Control Events 194
Example: Simple Job Management 195
Job Objects 203
Summary 204
Exercises 204
Chapter 8 Threads and Scheduling 207
Thread Overview 207
Thread Basics 208
Thread Management 210
Using the C Library in Threads 214
Example: Multithreaded Pattern Searching 215
The Boss/Worker and Other Threading Models 218
Example: Merge-Sort--Divide and Conquer to Exploit SMP 219
Thread Local Storage 224
Process and Thread Priority and Scheduling 225
Thread States 227
Pitfalls and Common Mistakes 229
Timed Waits 230
Fibers 231
Summary 235
Exercises 236
Chapter 9 Thread Synchronization 239
The Need for Thread Synchronization 239
Thread Synchronization Objects 244
The CRITICAL_SECTION Object 244
A CRITICAL_SECTION for Protecting Shared Variables 246
Example: A Simple Producer/Consumer System 248
Mutexes 252
Semaphores 257
Events 259
Example: A Producer/Consumer System 262
Example: Synchronization Performance Impact 266
More Mutex and CRITICAL_SECTION Guidelines 269
More Interlocked Functions 270
Memory Management Performance Considerations 272
Summary 272
Exercises 273
Chapter 10 Advanced Thread Synchronization 275
Mutexes, Events, and the Condition Variable Model 275
Example: A Threshold Barrier Object 281
A Queue Object 284
Example: Using Queues in a Multistage Pipeline 289
Hints for Designing, Debugging, and Testing 296
Summary 298
Exercises 299
Chapter 11 Interprocess Communication 301
Anonymous Pipes 302
Example: I/O Redirection Using an Anonymous Pipe 302
Named Pipes 305
Named Pipe Transaction Functions 311
Example: A Client/Server Command Line Processor 314
Comments on the Client/Server Command Line Processor 320
Mailslots 321
Pipe and Mailslot Creation, Connection, and Naming 324
Example: A Server That Clients Can Locate 325
Comments on Thread Models 327
Summary 328
Exercises 329
Chapter 12 Network Programming with Windows Sockets 331
Windows Sockets 332
Socket Server Functions 334
Socket Client Functions 338
Comparing Named Pipes and Sockets 340
Example: A Socket Message Receive Function 341
Example: A Socket-Based Client 342
Example: A Socket-Based Server with New Features 344
In-Process Services 349
Line-Oriented Messages, DLL Entry Points, and TLS 351
Example: A Thread-Safe DLL for Socket Messages 352
Example: An Alternative Thread-Safe DLL Strategy 356
Datagrams 358
Berkeley vs. Windows Sockets 359
Overlapped I/O with Windows Sockets 360
Windows Sockets 2 360
Summary 360
Exercises 362
Chapter 13 NT Services 365
Writing NT Services--Overview 365
The main () Function 366
The ServiceMain () Functions 367
The Service Control Handler 371
Example: A Service "Wrapper" 372
Managing Windows NT Services 375
Summary: Service Operation and Management 378
Example: A Service Control Shell 379
Sharing Kernel Objects with a Service 382
Event Logging 382
Notes on Debugging a Service 383
Summary 384
Exercises 384
Chapter 14 Asynchronous Input/Output and Completion Ports 385
Overview of Win32 Asynchronous I/O 386
Overlapped I/O 387
Example: Synchronizing on a File Handle 391
Example: File Conversion with Overlapped I/O and Multiple Buffers 391
Extended I/O with Completion Routines 395
Example: File Conversion with Extended I/O 400
Asynchronous I/O with Threads 402
Waitable Timers 403
Example: Using a Waitable Timer 404
I/O Completion Ports 406
Example: A Server Using I/O Completion Ports 410
Summary 413
Exercises 414
Chapter 15 Remote Procedure Calls and COM Overview 417
Remote Procedure Calls 418
Basic RPC Architecture 418
RPC Interface Definitions 420
Example: An Interface Definition 421
Example: An RPC Client 423
Example: An RPC Server 425
A Brief COM and DCOM Overview 427
Summary 431
Exercises 432
Chapter 16 Win64 Programming 433
64-Bit Architecture Overview 433
The Win64 Programming Model 435
The Data Types 436
The Three Win64 Programming Models 439
Legacy Code Migration 440
Appendix A Using the Sample Programs 443
Disc Organization 444
Include File Listings 450
Additional Utility Programs 456
Appendix B Win32, UNIX, and C Library Comparisons 459
Chapters 2 and 3: File and Directory Management 461
Chapter 4: Structured Exception Handling 465
Chapter 5: Securing Win32 Objects 466
Chapter 6: Memory Management, Memory-Mapped Files, and DLLs 468
Chapter 7: Process Management 469
Chapter 8: Threads and Scheduling 471
Chapters 9 and 10: Thread Synchronization 472
Chapter 11: Interprocess Communication 473
Chapter 14: Asynchronous I/O 474
Appendix C Performance Results 475
Test Configurations 475
Performance Measurements 477
Running the Tests 488
Bibliography 489
Index 493
Customer Reviews
Customer Reviews: 1 Average Customer Rating:      Jun 12, 2002     Nawlins Ron from New Orleans Gets skilled nonWindows programmers up to speed This book is cleanly written and no nonsense. I really liked its style and clarity. Not for beginners in programming. It got me up to speed in a hurry. I wish it was longer.
|
 |