Windows Via C/Cpp:Overview2

Love:
Language never scale,but architecture does.
Date:
2011_10_24
By:
HYP(my name first letter makes it)
Sentences:
Originally Adapted From: 《Windows via C/C++ ,Fifth Edition》
Although this book does not cover  some Windows concept--such as the Component Object Model
(COM)--COM is built on top of basic building blocks such as processes,threads,memory management,DLLs,thread local storage,Unicode,and so on.
If you know these basic building blocks,
understanding COM is just a matter of understanding how the building blocks are used.
I have great sympathy for people who attempt to jump ahead in learning COM's architecture.
They have a long road ahead and are bound to have gaping holes in their language,which is
bound to negatively affect their code and their software development schedules.


The Microsoft .NET Framework's common language runtime(CLR) is another technology not specifically
addressed in this book.(However,it is addressed in my other book:CLR via C#,Jeffrey Richter).
However,the CLR is implemented as a COM object in a dynamic-link library(DLL) that loads in a process and
uses threads to execute code that manipulates Unicode strings that are managed in memory.
So again,the basic building blocks presented in this book will help developers writing managed code.
In addition,by way of the CLR's Platform Invocation(P/Invoke) techonology,
you can call into the various Windows'APIs presented throughout this book.

So that's what this book is all about:
the basic Windows building blocks that every Windows developer (at least in my opinion)should be intimately aware of.
As each block is discussed,i also describe how the system uses these blocks and how your own applications can best take advantage of these blocks.
In many chapters,i show you how to create building blocks of  your own.
These building blocks,typically implemented as generic functions or C++ classes,
group a set of Windows building blocks together to create a whole that is much greater than the sum of its parts.

by me:
[
TAG001:
cover,这个用法是很好的哇。“涉及,关乎到”。...does not cover some Windows concepts.
]
[
TAG002:
COM--the abbreviation of the Component Object Model.wow,it is real a beauty name o。(in chinese ,it means “组件对象模型”)
abbreviation  [əbri:vi'eiʃən] 
n. 缩写
]
[
TAG003:
……is built on top of ...在……的基础上建立的。。
COM is built on top of basic buildiing blocks..oyeah,real nice words and sentence。
]
[
TAG004:
matter  ['mætə]     
n. U物质;麻烦,毛病;C事情,问题;内容,素材
vi. 有关系,要紧
好句子:
If you know these basic building blocks,
understanding COM is just a matter of understanding how the building blocks are used.
a matter of doing sth.是一件……的事情。
]
[
TAG005:
sympathy  ['simpəθi]    
n. 同情,赞同,同感,慰问,吊唁
And other custom basic useful usage of SYMPATHY:

He is overflowing with sympathy.
他充满同情之心。
We extended our sympathy to the family.
我们向那家人表示同情。
I have no sympathy with your silly ideas.
我不赞成你那愚蠢的主意。
Your praise and sympathy upheld me greatly.
你的称赞和同情给予我很大的鼓励。
He has sympathy with his ill friend.
他同情他病中的友人。
]
[
TAG006:
to jump ahead in learning COM's architecture.
gap  [gæp]   
n. 间距

n. 通用汇编程序

n. 缝隙,缺口,间断

n. 差距,差额

vt. 打开缺口,造成缝隙

vi. 豁开
They have a long road ahead and are bound to have gaping holes in their language,which is
bound to negatively affect their code and their software development schedules.
(
I HAVE TO SAY ,YEAH,THIS SENTENCE IS REALLY THE TRUTH WHICH ACTUALLY TELLS THE SITUATION OF ME DURING MY DEVELOPMENT.
LEARN SOMETHING FORM IT .
)

negatively  ['negətivli]    
adv. 否定地;消极地;阴性

]
[
TAG007:
CLR :is the abbreviation form of Common Language Runtime。
equate to chinese words“通用语言运行时”
]
[
TAG008:
specifically  [spi'sifikli]      
ad. 特别地,具体地

address  [ə'dres]    
n.
v. 地址,写地址;致词,演说,对…说话;引导,引见,调用
n. 地址,(Internet中有三种地址表示形式。E-Mail地址、IP或Internet地址,以及硬件或MAC地址)
CUSTOMAL PHRASES:
inaugural address
就职演说,开幕词
form of address
头衔,称号
keynote address
n.政治性集会中之政策演讲
public address system
扩音装置
return address
v.[计]寄信人地址
CUSTOMAL USAGES:
I often get letters that addressed to my namesake David.
我经常收到寄给和我同名的David的信
They left the hotel and did not leave a forwarding address.
他们离开饭店时没有留下邮件的转递地址。
Be sure to put down the address of the receiver clearly.
注意要把收信人的地址写清。
The Queen addressed the crowd.
女王向群众发表了讲话。
The card was wrongly addressed to our old home.
那张明信片误写了我们的旧地址。
]
[
TAG009:
In additon.
by way of
In addition,by way of the CLR's Platform Invocation(P/Invoke) techonology,
you can call into the various Windows'APIs presented throughout this book.

So that's what this book is all about:
intimately  ['intimitli] adv. 亲切地,亲密地,个人性地
CUSTOMAL USAGES:
The rise of the city is intimately associated with the transition from handicraft to machine industry 
城市的兴起是同手工业向机器生产的过渡密切相关的。
The history of anthrax is intimately associated with the history of bacteriology and infectious disease 
炭疽病的历史与细菌学和传染病学的历史是密切相关的。
Only someone knowing the terrain intimately could have picked his way through all that underbrush 
只有熟知这一带地势的人才能择路穿行那片矮树林。
]
[
TAG010:
generic functions..是泛型函数的意思吗。。。
在C#中,有generic method,means 泛型方法。
just please see this site:http://msdn.microsoft.com/en-us/library/twcad0zb%28v=vs.80%29.aspx

These building blocks,typically implemented as generic functions or C++ classes,
group a set of Windows building blocks together to create a whole that is much greater than the sum of its parts.
最后的总结之句,写的很精彩。
a set of
group …… together to do

]
###############################################################################################
Sentences:
64-BIT WINDOWS
 
 Microsoft has been shipping 32-bit versions of Windows that support the x86 CPU architecture for many years.
 Today,Microsoft also offers 64-bit versions of Windows that support the x66 and IA-64 CPU architectures.
 Machines based on these 64-bit CPU architectures are fast gaining acceptance.In fact,in the very near future,
 it is expected that all desktop and server machines will contain 64-bit CPUS.
 Because of this,Microsoft has stated that Windows Server 2008 will be the last 32-bit version of Windows ever!
 For developers,now is the time to focus on making sure your applications run correctly on 64-bit Windows.
 To this end,this book includes solid coverage of what you need to know to have your applications  run on
 64-bit Windows(as well as 32-bit Windows).

 Here is a quick look at what you need to knw about 64-bit Windows:
 a)The 64-bit Windows kernel is a port of the 32-bit Windows kernel.
 This means that all the details and intricacies that you've learned about 32-bit
 Windows still apply in the 64-bit world.In fact,Microsoft has modified the 32-bit Windows
 source code so that it can be compiled to produce a 32-bit or a 64-bit system.They have just one source-code base,
 so new features and bug fixes are simultaneously applied to both systems.
 b)Because the kernels use the same code and underlying concepts,the Windows API is identical on both platforms.
 This means that you do not have to redesign or reimplement your application to work on 64-bit windows.
You can simply make slight modifications to your source code and then rebuild.
 c)For backward compatibility,64-bit Windows can execute 32-bit applications.However ,your application's performance will
 improve if the application is built as a true 64-bit application..
 d)Because it is so easy to port 32-bit code,there are already device drivers,tools,and applications availabe for 64-bit Windows.
 Unfortunately,Visual Studio is a native 32-bit application and Microsoft seems to be in no hurry to port it to be a native
 64-bit Windows;it just has a limited address space for its own data structures.And Visual Studio does allow you to debug a
 64-bit application.
 d)
 There is little new for you to learn.You will be happy to know that most data types remain 32 bits wide.
 These include ints,dwords,longs,bools ,and so on.In fact,you mostly just need to worry about pointers and handles,
 since they are now 64-bit values.

 Because Microsoft offers so much information on how to modify your existing source code to be 64-bit ready,
 i will not go into those details in this book.
 However,i thought about 64-bit Windows as i wrote each chapter.
 Where appropriate,i have included information specific to 64-bit Windows.
 In addtion,i have compiled and tested all the sample aplications in this book for 64-bit Windows.
 SO,if you follow the sample applications in this book and do as i've done,
 you should have no trouble creating a single source-code base that you can easily compile for 32-bit or 64-bit Windows.


 ##############################################################################################
 WHAT'S NEW IN THE FIFTH EDITION?
 
 In the past,this book has been titled Advanced Windows NT,Advanced Windows,and Programming Applications for Microsoft Windows.
 In keeping with tradition,this edition of the book has gotten a new title:Windows via c/c++.
 This new title indicates that the book is for C and C++ programmers wanting to understand Windows.
 This new edition covers more than 170 new functions and Windows features that have been introduced in Windows XP,
 Windows Vista,and Windows Server2008.

 Some chapters have been completely rewritten--such as Chapter 11,which explains how the new thread pool API should be used.
 Existing chapters have been greatly enhanced to present new features.
 For example ,Chapter 4 now includes coverage of User Account Control and Chapter 8 now covers new synchronization mechanisms
 (interlocked Singly-Linked List,Slim Reader-Writer Locks,and condition variables).

 I also give much more coverage of how the C/C++ run-time library interacts with the operating system--particularly on
 enhancing security as well as exception handling.
 Last but not least,two new chapters have been added to explain how I/O operations work and to dig into the new Windows
 Error Reporting system that changes the way you must think about application error reporting and application recovery.


 In addtion to the new organization and greater depth,i added a ton of new content.
 Here is a partial list of enhancements made for this editon:
    a)New Windows Vista and Windows Server2008 features
       Of course,the book would not be a true revision unless it covered new features offered in Windows XP,Windows Vista,
       Windows Server 2008,and the C/C++ run-time library.This edition has new information on the secure string functions,
       the kernel object changes(such as namespaces and boundary descriptors),thread and process attribute lists,thread and
       I/O priority scheduling,synchronous I/O cancellation,vectored exception handling,and more.

    b)64-bit Windows support
        The text addresses 64-bit Windows-specific issues;all sample applications have been built and tested on 64-bit Windows.

    c)Use of C++
       The sample applications use C++ and reauire fewer lines of code,and their logic is easier to follow and understand.

    d)Reusable code
       Whenever possible,i created the source code to be generic and reusable.
       This should allow you to take individual functions or entire C++ classes and drop them into your own applications with little or no modification.
       The use of C++ made reusability much easier.

    e)The ProcessInfo utility
       This particular sample application from the earlier editons has been enhanced to show the process owner,command line,and UAC-related details.

    f)The LockCop utility
       This sample application is new.It shows which processes ares running on the system.
       Once you select a process,this utility lists the threads of the process and,for each,on which kind of synchronization mechanism it is blocked--with deadlocks explicityly pointed out.
    g)API hooking
        I present updated C++ classes that make it trivial to Hook APIs in one or all modules of a process.
        My code even traps run-time calls to LoadLibrary and GetProcAddress so that your API hooks are enforced..

    h)Structured exception handling improvements
        I have rewritten and reorganized much of the structured exception handling material.
        I have more information on unhandled exceptions,and i've added coverage on customizing Windows Error Reporting to fulfill your needs.


##########################################
Code Samples and System Requirements.

 The sample applications presented throughout this book can be downloaded from the book's companion content Web page at
 http://www.xxxxxx.com
 To build the applications,you 'll need Visual Studio 2005 (or later),the Microsoft Platform SDK for Windows Vista and Windows Server2008(
 which comes with some versions of Visual Studio).
 In addtion ,to run the applications,you 'll need a computer(or virtual machine) with Windows Vista(or later)installed.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值