这个是windows核心编程的第五版,作者Jeffrey Richter.非常著名的一本书。写的比较底层。
听说windows下编程要先看ptzold,再看win32多线程程序设计,最后看这本书。匆匆的扫了几眼,这本书为什么放在最后呢? 感觉不是那么深呀!而且内容感觉乱乱的!
哈哈,还没看呢,这就下结论了,卑鄙呀!
我想windows下的编程基础还有2本书要看:Windows internals(5th),潘爱民的windows内核原理与实现。老潘的书最后看,源码分析呀!比较难啃。
windows核心编程,不准备很快的看完,慢慢看就好了。
2012.8.22
Introduction
Here is a quick look at what you need to know about 64-bit Windows:
-
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.
-
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.
-
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.
-
Because it is so easy to port 32-bit code, there are already device drivers, tools, and applications available 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 application. However, the good news is that 32-bit Visual Studio does run quite well on 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.
-
There is little new for you to learn. You'll be happy to know that most data types remain 32 bits wide. These includeints,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.
第一章 介绍一些Error返回号
第2章
这章主要介绍字符串的处理和unicode的使用
1. UTF-16虽然不能代表所有字符,但是可以把常用字符包括了,基本够用了,可以节省空间。而且UTF-16 supports surrogates, which are a way of using 32 bits (or 4 bytes) to represent a single character。
2. If you call any Windows function passing it an ANSI string (a string of 1-byte characters), the function first converts the string to Unicode and then passes the Unicode string to the operating system.
3. StrSafe.h中定义安全处理字符串的函数
4. 字符串和字符才考虑Unicode处理
第3章 kernel object
1. kernel objects包括:access token objects, event objects, file objects, file-mapping objects, I/O completion port objects, job objects, mailslot objects, mutex objects, pipe objects, process objects, semaphore objects, thread objects, waitable timer objects, and thread pool worker factory objects
2. 使用Windows核心对象要注意安全
3. kernel object继承是什么东西呀?
4. 进程通信的Mutex等,名字是唯一的,也是是AB使用MutexA通信,则C不能再创建一个MutexA.
有个问题,linux中如何保证这样的变量不重名呢?万一重名了,不就挂掉了?
5. Terminal Services Namespaces
6. If you want to ensure that the kernel object names created by your own applications never conflict with any other application's names or are the subject of hijack attacks, you can define a custom prefix and use it as a private namespace as you do with
Global and
Local. The server process responsible for creating the kernel object defines a
boundary descriptor that protects the namespace name itself.
7. 为什么进程间要共享内核对象呢?
进程之间有时候需要共享某个内核对象,比如两个进程之间可以通过共享同一个文件映射对象来传递数据,或者共享管道内核对象记性进程间通讯,也可能需要共享互斥对象、信标和事件对象进行进程间同步。 先说说什么是内核对象,内核对象是一种特殊的数据结构,进程在使用Create***函数创建内核对象的时候,操作系统以这个内核对象对应的数据结 构在内核中开辟一块内存,这块内存就是内核对象。没一个内核对象都对应着一个唯一的在内核中的内核地址,但是为了安全,这个地址不能直接 给进程使用,因此每一个进程都维护一个独立的内核对象地址和一个代表这个内核地址的句柄的进程句柄表
第一部分完结
2012.9.5