Book description
Master the intricacies of application development with unmanaged C++ code—straight from the experts. Jeffrey Richter’s classic book is now fully revised for Windows XP, Windows Vista, and Windows Server 2008. You get in-depth, comprehensive guidance, advanced techniques, and extensive code samples to help you program Windows–based applications.
Discover how to:
Architect and implement your applications for both 32-bit and 64-bit Windows
Create and manipulate processes and jobs
Schedule, manage, synchronize and destroy threads
Perform asynchronous and synchronous device I/O operations with the I/O completion port
Allocate memory using various techniques including virtual memory, memory-mapped files, and heaps
Manipulate the default committed physical storage of thread stacks
Build DLLs for delay-loading, API hooking, and process injection
Using structured exception handling, Windows Error Recovery, and Application Restart services
Table of contents
-
Windows® via C/C++, Fifth Edition
- Acknowledgments
- Introduction
-
I. Required Reading
- 1. Error Handling
-
2. Working with Characters and Strings
- Character Encodings
- ANSI and Unicode Character and String Data Types
- Unicode and ANSI Functions in Windows
- Unicode and ANSI Functions in the C Run-Time Library
- Secure String Functions in the C Run-Time Library
- Why You Should Use Unicode
- How We Recommend Working with Characters and Strings
- Translating Strings Between Unicode and ANSI
- 3. Kernel Objects
-
II. Getting Work Done
- 4. Processes
- 5. Jobs
- 6. Thread Basics
- 7. Thread Scheduling, Priorities, and Affinities
- 8. Thread Synchronization in User Mode
- 9. Thread Synchronization with Kernel Objects
-
10. Synchronous and Asynchronous Device I/O
- Opening and Closing Devices
- Working with File Devices
- Performing Synchronous Device I/O
- Basics of Asynchronous Device I/O
- Receiving Completed I/O Request Notifications
- 11. The Windows Thread Pool
- 12. Fibers
-
III. Memory Management
- 13. Windows Memory Architecture
- 14. Exploring Virtual Memory
-
15. Using Virtual Memory in Your Own Applications
- Reserving a Region in an Address Space
- Committing Storage in a Reserved Region
- Reserving a Region and Committing Storage Simultaneously
- When to Commit Physical Storage
- Decommitting Physical Storage and Releasing a Region
- Changing Protection Attributes
- Resetting the Contents of Physical Storage
- Address Windowing Extensions
- 16. A Thread’s Stack
-
17. Memory-Mapped Files
- Memory-Mapped Executables and DLLs
- Memory-Mapped Data Files
-
Using Memory-Mapped Files
- Step 1: Creating or Opening a File Kernel Object
- Step 2: Creating a File-Mapping Kernel Object
- Step 3: Mapping the File’s Data into the Process’ Address Space
- Step 4: Unmapping the File’s Data from the Process’ Address Space
- Steps 5 and 6: Closing the File-Mapping Object and the File Object
- The File Reverse Sample Application
- Processing a Big File Using Memory-Mapped Files
- Memory-Mapped Files and Coherence
- Specifying the Base Address of a Memory-Mapped File
- Implementation Details of Memory-Mapped Files
- Using Memory-Mapped Files to Share Data Among Processes
- Memory-Mapped Files Backed by the Paging File
- Sparsely Committed Memory-Mapped Files
- 18. Heaps
-
IV. Dynamic-Link Libraries
- 19. DLL Basics
- 20. DLL Advanced Techniques
- 21. Thread-Local Storage
- 22. DLL Injection and API Hooking
-
V. Structured Exception Handling
- 23. Termination Handlers
- 24. Exception Handlers and Software Exceptions
-
25. Unhandled Exceptions, Vectored Exception Handling, and C++ Exceptions
-
Inside the UnhandledExceptionFilter Function
- Action #1: Allowing Write Access to a Resource and Continuing Execution
- Action #2: Notifying a Debugger of the Unhandled Exception
- Action #3: Notifying Your Globally Set Filter Function
- Action #4: Notifying a Debugger of the Unhandled Exception (Again)
- Action #5: Silently Terminating the Process
- UnhandledExceptionFilter and WER Interactions
- Just-in-Time Debugging
- The Spreadsheet Sample Application
- Vectored Exception and Continue Handlers
- C++ Exceptions vs. Structured Exceptions
- Exceptions and the Debugger
-
Inside the UnhandledExceptionFilter Function
-
26. Error Reporting and Application Recovery
- The Windows Error Reporting Console
- Programmatic Windows Error Reporting
- Customizing All Problem Reports Within a Process
-
Creating and Customizing a Problem Report
- Creating a Custom Problem Report: WerReportCreate
- Setting Report Parameters: WerReportSetParameter
- Adding a Minidump File to the Report: WerReportAddDump
- Adding Arbitrary Files to the Report: WerReportAddFile
- Modifying Dialog Box Strings: WerReportSetUIOption
- Submitting a Problem Report: WerReportSubmit
- Closing a Problem Report: WerReportCloseHandle
- The Customized WER Sample Application
- Automatic Application Restart and Recovery
-
VI. Appendixes
-
A. The Build Environment
-
The CmnHdr.h Header File
- Microsoft Windows Version Build Option
- Unicode Build Option
- Windows Definitions and Warning Level 4
- The pragma message Helper Macro
- The chINRANGE Macro
- The chBEGINTHREADEX Macro
- DebugBreak Improvement for x86 Platforms
- Creating Software Exception Codes
- The chMB Macro
- The chASSERT and chVERIFY Macros
- The chHANDLE_DLGMSG Macro
- The chSETDLGICONS Macro
- Forcing the Linker to Look for a (w)WinMain Entry-Point Function
- Support XP-Theming of the User Interface with pragma
-
The CmnHdr.h Header File
- B. Message Crackers, Child Control Macros, and API Macros
-
A. The Build Environment
- C. About the Authors
- Index
Product information
- Title: Windows® via C/C++, Fifth Edition
- Author(s):
- Release date: November 2007
- Publisher(s): Microsoft Press
- ISBN: 9780735639904
You might also like
book
Ethical Hacking
A crash course in modern hacking techniques, Ethical Hacking is already being used to prepare the …
book
The Ghidra Book
The result of more than a decade of research and development within the NSA, the Ghidra …
book
Windows System Programming, Fourth Edition
“If you’re writing a native Win32 program or just want to know what the OS is …
book
The IDA Pro Book, 2nd Edition
IDA Pro is a commercial disassembler and debugger used by reverse engineers to dissect compiled computer …