没有合适的资源?快使用搜索试试~ 我知道了~
Windows Via C/C++,Fifth Edition .pdf
5星 · 超过95%的资源 需积分: 10 31 下载量 92 浏览量
2013-08-14
14:17:23
上传
评论
收藏 7.14MB PDF 举报
温馨提示
试读
739页
Windows Via C/C++,Fifth Edition .pdf
资源推荐
资源详情
资源评论
Windows via C/C++, Fifth Edition by Jeffrey Richter and Christophe Nasarre
Windows via C/C++, Fifth Edition by Jeffrey Richter and Christophe Nasarre
Windows via C/C++, Fifth Edition .....................................................................................................................................................7
List of Figures ......................................................................................................................................................................... 10
List of Tables .......................................................................................................................................................................... 12
Introduction ........................................................................................................................................................................... 14
Overview ........................................................................................................................................................................ 14
64-Bit Windows ............................................................................................................................................................. 15
What's New in the Fifth Edition ..................................................................................................................................... 16
Code Samples and System Requirements ..................................................................................................................... 17
Support for This Book .................................................................................................................................................... 17
Part I: Required Reading ........................................................................................................................................................ 18
Chapter 1: Error Handling ...................................................................................................................................... 19
Overview ........................................................................................................................................................ 19
Defining Your Own Error Codes ..................................................................................................................... 23
The ErrorShow Sample Application ............................................................................................................... 24
Chapter 2: Working with Characters and Strings ................................................................................................... 26
Overview ........................................................................................................................................................ 26
Character Encodings ...................................................................................................................................... 27
ANSI and Unicode Character and String Data Types ...................................................................................... 29
Unicode and ANSI Functions in Windows ...................................................................................................... 31
Unicode and ANSI Functions in the C Run-Time Library ................................................................................ 33
Secure String Functions in the C Run-Time Library ........................................................................................ 34
Why You Should Use Unicode ........................................................................................................................ 42
How We Recommend Working with Characters and Strings ......................................................................... 42
Translating Strings Between Unicode and ANSI ............................................................................................. 43
Chapter 3: Kernel Objects ...................................................................................................................................... 49
Overview ........................................................................................................................................................ 49
What Is a Kernel Object? ............................................................................................................................... 50
A Process' Kernel Object Handle Table .......................................................................................................... 54
Sharing Kernel Objects Across Process Boundaries ....................................................................................... 59
Part II: Getting Work Done .................................................................................................................................................... 79
Chapter 4: Processes.............................................................................................................................................. 80
Overview ........................................................................................................................................................ 80
Writing Your First Windows Application ........................................................................................................ 81
The CreateProcess Function .......................................................................................................................... 99
Terminating a Process .................................................................................................................................. 114
Child Processes ............................................................................................................................................ 117
When Administrator Runs as a Standard User ............................................................................................ 120
Chapter 5: Jobs .................................................................................................................................................... 134
Overview ...................................................................................................................................................... 134
Placing Restrictions on a Job's Processes..................................................................................................... 138
Placing a Process in a Job ............................................................................................................................. 145
Terminating All Processes in a Job ............................................................................................................... 146
Job Notifications .......................................................................................................................................... 149
The Job Lab Sample Application .................................................................................................................. 152
Windows via C/C++, Fifth Edition by Jeffrey Richter and Christophe Nasarre
Chapter 6: Thread Basics ..................................................................................................................................... 154
Overview ...................................................................................................................................................... 154
When to Create a Thread ............................................................................................................................. 155
When Not to Create a Thread ...................................................................................................................... 158
Writing Your First Thread Function .............................................................................................................. 159
The CreateThread Function ......................................................................................................................... 160
Terminating a Thread ................................................................................................................................... 163
Some Thread Internals ................................................................................................................................. 165
C/C++ Run-Time Library Considerations ...................................................................................................... 168
Gaining a Sense of One's Own Identity........................................................................................................ 177
Chapter 7: Thread Scheduling, Priorities, and Affinities ...................................................................................... 180
Overview ...................................................................................................................................................... 180
Suspending and Resuming a Thread ............................................................................................................ 181
Suspending and Resuming a Process ........................................................................................................... 183
Sleeping ....................................................................................................................................................... 184
Switching to Another Thread ....................................................................................................................... 185
Switching to Another Thread on a Hyper-Threaded CPU ............................................................................ 185
A Thread's Execution Times ......................................................................................................................... 186
Putting the CONTEXT in Context .................................................................................................................. 190
Thread Priorities .......................................................................................................................................... 194
An Abstract View of Priorities ...................................................................................................................... 195
Programming Priorities ................................................................................................................................ 198
Affinities ....................................................................................................................................................... 210
Chapter 8: Thread Synchronization in User Mode ............................................................................................... 214
Overview ...................................................................................................................................................... 214
Atomic Access: The Interlocked Family of Functions ................................................................................... 215
Cache Lines .................................................................................................................................................. 220
Advanced Thread Synchronization .............................................................................................................. 222
Critical Sections ............................................................................................................................................ 224
Slim Reader-Writer Locks ............................................................................................................................. 230
Condition Variables ...................................................................................................................................... 233
Chapter 9: Thread Synchronization with Kernel Objects ..................................................................................... 246
Overview ...................................................................................................................................................... 246
Wait Functions ............................................................................................................................................. 248
Successful Wait Side Effects ......................................................................................................................... 250
Event Kernel Objects .................................................................................................................................... 252
Waitable Timer Kernel Objects .................................................................................................................... 260
Semaphore Kernel Objects .......................................................................................................................... 266
Mutex Kernel Objects .................................................................................................................................. 268
A Handy Thread Synchronization Object Chart ........................................................................................... 278
Other Thread Synchronization Functions .................................................................................................... 280
Chapter 10: Synchronous and Asynchronous Device I/O .................................................................................... 290
Overview ...................................................................................................................................................... 290
Opening and Closing Devices ....................................................................................................................... 291
Windows via C/C++, Fifth Edition by Jeffrey Richter and Christophe Nasarre
Working with File Devices ............................................................................................................................ 300
Performing Synchronous Device I/O ............................................................................................................ 303
Basics of Asynchronous Device I/O .............................................................................................................. 306
Receiving Completed I/O Request Notifications .......................................................................................... 310
Chapter 11: The Windows Thread Pool ............................................................................................................... 336
Overview ...................................................................................................................................................... 336
Scenario 1: Call a Function Asynchronously ................................................................................................ 337
Scenario 2: Call a Function at a Timed Interval ............................................................................................ 343
Scenario 3: Call a Function When a Single Kernel Object Becomes Signaled .............................................. 348
Scenario 4: Call a Function When Asynchronous I/O Requests Complete .................................................. 351
Callback Termination Actions....................................................................................................................... 352
Chapter 12: Fibers ................................................................................................................................................ 358
Overview ...................................................................................................................................................... 358
Working with Fibers ..................................................................................................................................... 359
Part III: Memory Management ............................................................................................................................................ 365
Chapter 13: Windows Memory Architecture ....................................................................................................... 366
Overview ...................................................................................................................................................... 366
A Process' Virtual Address Space ................................................................................................................. 367
How a Virtual Address Space Is Partitioned ................................................................................................. 367
Regions in an Address Space ....................................................................................................................... 371
Committing Physical Storage Within a Region ............................................................................................. 372
Physical Storage and the Paging File ............................................................................................................ 374
Protection Attributes ................................................................................................................................... 377
Bringing It All Home ..................................................................................................................................... 380
The Importance of Data Alignment ............................................................................................................. 389
Chapter 14: Exploring Virtual Memory ................................................................................................................ 393
Virtual Memory Status ................................................................................................................................. 402
Memory Management on NUMA Machines ............................................................................................... 403
Determining the State of an Address Space ................................................................................................ 406
Chapter 15: Using Virtual Memory in Your Own Applications ............................................................................. 415
Overview ...................................................................................................................................................... 415
Reserving a Region in an Address Space ...................................................................................................... 416
Committing Storage in a Reserved Region................................................................................................... 418
Reserving a Region and Committing Storage Simultaneously ..................................................................... 419
When to Commit Physical Storage............................................................................................................... 420
Decommitting Physical Storage and Releasing a Region ............................................................................. 422
Changing Protection Attributes ................................................................................................................... 430
Resetting the Contents of Physical Storage ................................................................................................. 431
Chapter 16: A Thread's Stack ............................................................................................................................... 444
Overview ...................................................................................................................................................... 444
The C/C++ Run-Time Library's Stack-Checking Function ............................................................................. 448
The Summation Sample Application ............................................................................................................ 450
Chapter 17: Memory-Mapped Files ..................................................................................................................... 455
Overview ...................................................................................................................................................... 455
Windows via C/C++, Fifth Edition by Jeffrey Richter and Christophe Nasarre
Memory-Mapped Executables and DLLs ..................................................................................................... 456
Memory-Mapped Data Files ........................................................................................................................ 466
Using Memory-Mapped Files ...................................................................................................................... 468
Processing a Big File Using Memory-Mapped Files ..................................................................................... 483
Memory-Mapped Files and Coherence ....................................................................................................... 484
Specifying the Base Address of a Memory-Mapped File ............................................................................. 485
Implementation Details of Memory-Mapped Files ..................................................................................... 486
Using Memory-Mapped Files to Share Data Among Processes ................................................................... 487
Memory-Mapped Files Backed by the Paging File ....................................................................................... 489
Sparsely Committed Memory-Mapped Files ............................................................................................... 493
Chapter 18: Heaps ............................................................................................................................................... 506
Overview ...................................................................................................................................................... 506
A Process' Default Heap ............................................................................................................................... 507
Reasons to Create Additional Heaps ............................................................................................................ 508
How to Create an Additional Heap .............................................................................................................. 511
Miscellaneous Heap Functions .................................................................................................................... 519
Part IV: Dynamic-Link Libraries ............................................................................................................................................ 522
Chapter 19: DLL Basics ......................................................................................................................................... 523
Overview ...................................................................................................................................................... 523
DLLs and a Process' Address Space .............................................................................................................. 524
The Overall Picture ...................................................................................................................................... 526
Chapter 20: DLL Advanced Techniques ................................................................................................................ 537
The DLL's Entry-Point Function .................................................................................................................... 544
Delay-Loading a DLL ..................................................................................................................................... 552
Function Forwarders .................................................................................................................................... 562
Known DLLs .................................................................................................................................................. 564
DLL Redirection ............................................................................................................................................ 565
Rebasing Modules ........................................................................................................................................ 566
Binding Modules .......................................................................................................................................... 572
Chapter 21: Thread-Local Storage ....................................................................................................................... 575
Overview ...................................................................................................................................................... 575
Dynamic TLS ................................................................................................................................................. 576
Static TLS ...................................................................................................................................................... 579
Chapter 22: DLL Injection and API Hooking ......................................................................................................... 581
Overview ...................................................................................................................................................... 581
DLL Injection: An Example ........................................................................................................................... 582
Injecting a DLL Using the Registry ................................................................................................................ 584
Injecting a DLL Using Windows Hooks ......................................................................................................... 585
Injecting a DLL Using Remote Threads ........................................................................................................ 597
Injecting a DLL with a Trojan DLL ................................................................................................................. 608
Injecting a DLL as a Debugger ...................................................................................................................... 608
Injecting Code with CreateProcess .............................................................................................................. 609
API Hooking: An Example............................................................................................................................. 610
Part V: Structured Exception Handling ................................................................................................................................ 630
剩余738页未读,继续阅读
资源评论
- chill632014-07-08很不错的资料哦 只是不是界面 是操作系统
- Coursera2014-01-06非常强悍,强力推荐 http://download.csdn.net/detail/bbairabbit/5600829
eiurijkajk
- 粉丝: 0
- 资源: 64
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 论文(最终)_20240430235101.pdf
- 基于python编写的Keras深度学习框架开发,利用卷积神经网络CNN,快速识别图片并进行分类
- 最全空间计量实证方法(空间杜宾模型和检验以及结果解释文档).txt
- 5uonly.apk
- 蓝桥杯Python组的历年真题
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 2023-04-06-项目笔记 - 第一百十九阶段 - 4.4.2.117全局变量的作用域-117 -2024.04.30
- 前端开发技术实验报告:内含4四实验&实验报告
- Highlight Plus v20.0.1
- 林周瑜-论文.docx
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功