热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

WindowsViaC/C++

这个是windows核心编程的第五版,作者JeffreyRichter.非常著名的一本书。写的比较底层。听说windows下编程要先看ptzold,再看
这个是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




推荐阅读
  • 如何在窗口右下角添加调整大小的手柄
    本文探讨了如何在传统MFC/Win32 API编程中实现类似C# WinForms中的SizeGrip功能,即在窗口的右下角显示一个用于调整窗口大小的手柄。我们将介绍具体的实现方法和相关API。 ... [详细]
  • 本文将介绍如何编写一些有趣的VBScript脚本,这些脚本可以在朋友之间进行无害的恶作剧。通过简单的代码示例,帮助您了解VBScript的基本语法和功能。 ... [详细]
  • 本文介绍如何使用Objective-C结合dispatch库进行并发编程,以提高素数计数任务的效率。通过对比纯C代码与引入并发机制后的代码,展示dispatch库的强大功能。 ... [详细]
  • DNN Community 和 Professional 版本的主要差异
    本文详细解析了 DotNetNuke (DNN) 的两种主要版本:Community 和 Professional。通过对比两者的功能和附加组件,帮助用户选择最适合其需求的版本。 ... [详细]
  • Windows服务与数据库交互问题解析
    本文探讨了在Windows 10(64位)环境下开发的Windows服务,旨在定期向本地MS SQL Server (v.11)插入记录。尽管服务已成功安装并运行,但记录并未正确插入。我们将详细分析可能的原因及解决方案。 ... [详细]
  • Explore how Matterverse is redefining the metaverse experience, creating immersive and meaningful virtual environments that foster genuine connections and economic opportunities. ... [详细]
  • Explore a common issue encountered when implementing an OAuth 1.0a API, specifically the inability to encode null objects and how to resolve it. ... [详细]
  • 本文详细介绍如何使用Python进行配置文件的读写操作,涵盖常见的配置文件格式(如INI、JSON、TOML和YAML),并提供具体的代码示例。 ... [详细]
  • Java 中的 BigDecimal pow()方法,示例 ... [详细]
  • 本文详细介绍了如何在Linux系统上安装和配置Smokeping,以实现对网络链路质量的实时监控。通过详细的步骤和必要的依赖包安装,确保用户能够顺利完成部署并优化其网络性能监控。 ... [详细]
  • 本文详细介绍了Java中org.eclipse.ui.forms.widgets.ExpandableComposite类的addExpansionListener()方法,并提供了多个实际代码示例,帮助开发者更好地理解和使用该方法。这些示例来源于多个知名开源项目,具有很高的参考价值。 ... [详细]
  • 使用 Azure Service Principal 和 Microsoft Graph API 获取 AAD 用户列表
    本文介绍了一段通用代码示例,该代码不仅能够操作 Azure Active Directory (AAD),还可以通过 Azure Service Principal 的授权访问和管理 Azure 订阅资源。Azure 的架构可以分为两个层级:AAD 和 Subscription。 ... [详细]
  • CMake跨平台开发实践
    本文介绍如何使用CMake支持不同平台的代码编译。通过一个简单的示例,我们将展示如何编写CMakeLists.txt以适应Linux和Windows平台,并实现跨平台的函数调用。 ... [详细]
  • 本文介绍如何通过Windows批处理脚本定期检查并重启Java应用程序,确保其持续稳定运行。脚本每30分钟检查一次,并在需要时重启Java程序。同时,它会将任务结果发送到Redis。 ... [详细]
  • 本文详细介绍了如何构建一个高效的UI管理系统,集中处理UI页面的打开、关闭、层级管理和页面跳转等问题。通过UIManager统一管理外部切换逻辑,实现功能逻辑分散化和代码复用,支持多人协作开发。 ... [详细]
author-avatar
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有