Leanpub Header

Skip to main content

Windows 10 System Programming, Part 1

Minimum price

$23.95

$37.95

You pay

$37.95

Author earns

$30.36
$

...Or Buy With Credits!

You can get credits with a paid monthly or annual Reader Membership, or you can buy them here.
PDF
EPUB
WEB
804
Readers
591
Pages
122,276Words
About

About

About the Book

Share this book

Author

About the Author

Pavel Yosifovich

Pavel Yosifovich is a renowned author, developer, and expert in Windows Internals, system programming, and software development. With extensive experience in low-level programming, he has authored several highly regarded books, including Windows Internals, Part 1 (7th Edition) and Windows 10 System Programming. His works provide deep insights into Windows architecture, kernel-mode development, and debugging techniques, making them essential resources for developers, security researchers, and IT professionals.

Beyond his books, Pavel is also known for his contributions to the developer community through training, blog posts, tools, and technical talks. He offers in-depth courses on TrainSec, where students can learn Windows Internals, debugging, and system programming directly from his expertise. His writing style balances technical depth with clarity, making complex topics accessible to both beginners and experienced programmers. Pavel’s books and courses serve as authoritative guides for those looking to master Windows and programming.

Leanpub Podcast

Episode 257

An Interview with Pavel Yosifovich

Contents

Table of Contents

Introduction

  1. Who Should Read This Book
  2. What You Should Know to Use This Book
  3. Sample Code

Chapter 1: Foundations

  1. Windows Architecture Overview
  2. Processes
  3. Dynamic Link Libraries
  4. Virtual Memory
  5. Threads
  6. General System Architecture
  7. Windows Application Development
  8. Your First Application
  9. Working with Strings
  10. Strings in the C/C++ Runtime
  11. String Output Parameters
  12. Safe String Functions
  13. 32-bit vs. 64-bit Development
  14. Coding Conventions
  15. C++ Usage
  16. Handling API Errors
  17. Defining Custom Error Codes
  18. The Windows Version
  19. Getting the Windows Version
  20. Exercises
  21. Summary

Chapter 2: Objects and Handles

  1. Kernel Objects
  2. Running a Single Instance Process
  3. Handles
  4. Pseudo Handles
  5. RAII for Handles
  6. Using WIL
  7. Creating Objects
  8. Object Names
  9. Sharing Kernel Objects
  10. Sharing by Name
  11. Sharing by Handle Duplication
  12. Private Object Namespaces
  13. Bonus: WIL Wrappers for Private Namespaces
  14. Other Objects and Handles
  15. User Objects
  16. GDI Objects
  17. Summary

Chapter 3: Processes

  1. Process Basics
  2. Processes in Process Explorer
  3. Process Creation
  4. The main Functions
  5. Process Environment Variables
  6. Creating Processes
  7. Window Stations and Desktops
  8. Handle Inheritance
  9. Process Drive Directories
  10. Process (and Thread) Attributes
  11. Protected and PPL Processes
  12. UWP Processes
  13. Minimal and Pico Processes
  14. Process Termination
  15. Enumerating Processes
  16. Using EnumProcesses
  17. Using the Toolhelp Functions
  18. Using the WTS Functions
  19. Using the Native API
  20. Exercises
  21. Summary

Chapter 4: Jobs

  1. Introduction to Jobs
  2. Creating Jobs
  3. Nested Jobs
  4. Querying Job Information
  5. Job Accounting Information
  6. Querying for Job Process List
  7. Setting Job Limits
  8. CPU Rate Limit
  9. User Interface Limits
  10. Job Notifications
  11. Silos
  12. Exercises
  13. Summary

Chapter 5: Threads Basics

  1. Introduction
  2. Sockets, Cores, and Logical Processors
  3. Creating and Managing Threads
  4. The Primes Counter Application
  5. Running Primes Counter
  6. Terminating Threads
  7. A Thread’s Stack
  8. A Thread’s Name
  9. What About the C++ Standard Library?
  10. Exercises
  11. Summary

Chapter 6: Thread Scheduling

  1. Priorities
  2. Scheduling Basics
  3. Single CPU Scheduling
  4. The Quantum
  5. Processor Groups
  6. Multiprocessor Scheduling
  7. Affinity
  8. CPU Sets vs. Hard Affinity
  9. System CPU Sets
  10. Revised Scheduling Algorithm
  11. Observing Scheduling
  12. General Scheduling
  13. Hard Affinity
  14. CPU Sets
  15. Background Mode
  16. Priority Boosts
  17. Completing I/O Operations
  18. Foreground Process
  19. GUI Thread Wakeup
  20. Starvation Avoidance
  21. Other Aspects of Scheduling
  22. Suspend and Resume
  23. Suspending and Resuming a Process
  24. Sleeping and Yielding
  25. Summary

Chapter 7: Thread Synchronization (Intra-Process)

  1. Synchronization Basics
  2. Atomic Operations
  3. The Simple Increment Application
  4. The Interlocked Family of Functions
  5. Critical Sections
  6. Locks and RAII
  7. Deadlocks
  8. The MD5 Calculator Application
  9. Calculating MD5 Hash
  10. The Hash Cache
  11. Image Loads Notifications
  12. Event Parsing
  13. Putting it All Together
  14. Reader Writer Locks
  15. RAII Wrappers
  16. MD5 Calculator 2
  17. Condition Variables
  18. The Queue Demo Application
  19. Waiting on Address
  20. Synchronization Barriers
  21. What About the C++ Standard Library?
  22. Exercises
  23. Summary

Chapter 8: Thread Synchronization (Inter-Process)

  1. Dispatcher Objects
  2. Succeeding a Wait
  3. The Mutex
  4. The Mutex Demo Application
  5. Abandoned Mutex
  6. The Semaphore
  7. The Queue Demo Application
  8. The Event
  9. Working with Events
  10. The Waitable Timer
  11. Other Wait Functions
  12. Waiting in Alertable State
  13. Waiting on GUI Threads
  14. Waiting for an Idle GUI Thread
  15. Signaling and Waiting Atomically
  16. Exercises
  17. Summary

Chapter 9: Thread Pools

  1. Why Use a Thread Pool?
  2. Thread Pool Work Callbacks
  3. The Simple Work Application
  4. Controlling a Work Item
  5. The MD5 Calculator Application
  6. Thread Pool Wait Callbacks
  7. Thread Pool Timer Callbacks
  8. The Simple Timer Sample
  9. Thread Pool I/O Callbacks
  10. Thread Pool Instance Operations
  11. The Callback Environment
  12. Private Thread Pools
  13. Cleanup Groups
  14. Exercises
  15. Summary

Chapter 10: Advanced Threading

  1. Thread Local Storage
  2. Dynamic TLS
  3. Static TLS
  4. Remote Threads
  5. The Breakin Application
  6. Thread Enumeration
  7. The thlist Application
  8. Caches and Cache Lines
  9. Wait Chain Traversal
  10. The Deadlock Detector Application
  11. Asynchronous WCT Sessions
  12. User Mode Scheduling
  13. Init Once Initialization
  14. Debugging Multithreaded Applications
  15. Breakpoints
  16. Parallel Stacks
  17. Parallel Watch
  18. Thread Names
  19. Exercises
  20. Summary

Chapter 11: File and Device I/O

  1. The I/O System
  2. The CreateFile Function
  3. Working with Symbolic Links
  4. Path Length
  5. Directories
  6. Files
  7. Setting File Information
  8. Synchronous I/O
  9. Asynchronous I/O
  10. ReadFileEx and WriteFileEx
  11. Manually Queued APC
  12. I/O Completion Ports
  13. The Bulk Copy Application
  14. Using the Thread Pool for I/O Completion
  15. The Bulk Copy 2 Application
  16. I/O Cancellation
  17. Devices
  18. Pipes and Mailslots
  19. Pipes
  20. Transactional NTFS
  21. File Search and Enumeration
  22. NTFS Streams
  23. Summary

Chapter 12: Memory Management Fundamentals

  1. Basic Concepts
  2. Process Address Space
  3. Page States
  4. Address Space Layout
  5. 32-bit Systems
  6. 64-bit Systems
  7. Address Space Usage
  8. Memory Counters
  9. Memory Compression
  10. Process Memory Counters
  11. Process Memory Map
  12. Page Protection
  13. Enumerating Address Space Regions
  14. The Simple VMMap Application
  15. More Address Space Information
  16. Sharing Memory
  17. Page Files
  18. WOW64
  19. WOW64 Redirections
  20. Virtual Address Translation
  21. Summary

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub