当前位置: 首页 > news >正文

注册表操作技巧及键值类型的判断

  在Windows注册表操作的API中,如果参数有"__out_opt LPDWORD pdwType",那么"pdwType"则是保存的为键值的类型。注册表中键值类型的分类:

ValueType
REG_BINARYBinary data in any form.
REG_DWORDA 32-bit number.
REG_DWORD_LITTLE_ENDIANA 32-bit number in little-endian format.

Windows is designed to run on little-endian computer architectures. Therefore, this value is defined as REG_DWORD in the Windows header files.

REG_DWORD_BIG_ENDIANA 32-bit number in big-endian format.

Some UNIX systems support big-endian architectures.

REG_EXPAND_SZA null-terminated string that contains unexpanded references to environment variables (for example, "%PATH%"). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions. To expand the environment variable references, use the ExpandEnvironmentStrings function.
REG_LINKReserved for system use.
REG_MULTI_SZA sequence of null-terminated strings, terminated by an empty string (\0).

The following is an example:

String1\0String2\0String3\0LastString\0\0

The first \0 terminates the first string, the second to the last \0 terminates the last string, and the final \0 terminates the sequence. Note that the final terminator must be factored into the length of the string.

REG_NONENo defined value type.
REG_QWORDA 64-bit number.
REG_QWORD_LITTLE_ENDIANA 64-bit number in little-endian format.

Windows is designed to run on little-endian computer architectures. Therefore, this value is defined as REG_QWORD in the Windows header files.

REG_SZA null-terminated string. This will be either a Unicode or an ANSI string, depending on whether you use the Unicode or ANSI functions.

   而表中第一列的宏的定义在源码头文件中定义如下:

//
//
// Predefined Value Types.
//

#define REG_NONE ( 0 ) // No value type
#define REG_SZ ( 1 ) // Unicode nul terminated string
#define REG_EXPAND_SZ ( 2 ) // Unicode nul terminated string
// (with environment variable references)
#define REG_BINARY ( 3 ) // Free form binary
#define REG_DWORD ( 4 ) // 32-bit number
#define REG_DWORD_LITTLE_ENDIAN ( 4 ) // 32-bit number (same as REG_DWORD)
#define REG_DWORD_BIG_ENDIAN ( 5 ) // 32-bit number
#define REG_LINK ( 6 ) // Symbolic Link (unicode)
#define REG_MULTI_SZ ( 7 ) // Multiple Unicode strings
#define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map
#define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description
#define REG_RESOURCE_REQUIREMENTS_LIST ( 10 )
#define REG_QWORD ( 11 ) // 64-bit number
#define REG_QWORD_LITTLE_ENDIAN ( 11 ) // 64-bit number (same as REG_QWORD)

// end_wdm

  注册表操作技巧请参考下面例子(主要是递归思想, 操作电脑中文件目录也是如此):


 

相关文章:

  • 迎接“云”时代的全面到来
  • QMenu,QT的菜单添加
  • Android开发基本篇(二)
  • Java的主要特性?
  • 为WP7添加动态Tile
  • [zz]Linux性能测试工具Lmbench介绍和使用说明
  • ACL配置
  • Ubuntu下使用虚拟机安装xp系统
  • [转]一个老工程师给年轻人的忠告
  • Oracle官网提供的虚拟机下载,方便测试和开发环境
  • CentOS6.2配置php-cgi错误解决办法
  • 对不含数据源的DataGridView实现自定义排序
  • 明晰单元测试
  • XNA游戏:手势触控
  • 基于corosync和pacemaker实现配置nginx的高可用集群
  • 《网管员必读——网络组建》(第2版)电子课件下载
  • es6--symbol
  • miniui datagrid 的客户端分页解决方案 - CS结合
  • PermissionScope Swift4 兼容问题
  • text-decoration与color属性
  • 包装类对象
  • 大数据与云计算学习:数据分析(二)
  • 前端面试总结(at, md)
  • 深度学习在携程攻略社区的应用
  • 深入浅出webpack学习(1)--核心概念
  • 算法-插入排序
  • 体验javascript之美-第五课 匿名函数自执行和闭包是一回事儿吗?
  • 我看到的前端
  • 扩展资源服务器解决oauth2 性能瓶颈
  • 如何用纯 CSS 创作一个菱形 loader 动画
  • 小白应该如何快速入门阿里云服务器,新手使用ECS的方法 ...
  • # 睡眠3秒_床上这样睡觉的人,睡眠质量多半不好
  • # 透过事物看本质的能力怎么培养?
  • (1)Android开发优化---------UI优化
  • (2)(2.4) TerraRanger Tower/Tower EVO(360度)
  • (3)(3.2) MAVLink2数据包签名(安全)
  • (AtCoder Beginner Contest 340) -- F - S = 1 -- 题解
  • (C#)if (this == null)?你在逗我,this 怎么可能为 null!用 IL 编译和反编译看穿一切
  • (多级缓存)多级缓存
  • (附源码)ssm教材管理系统 毕业设计 011229
  • (三十五)大数据实战——Superset可视化平台搭建
  • .mysql secret在哪_MySQL如何使用索引
  • .Net Core webapi RestFul 统一接口数据返回格式
  • .net(C#)中String.Format如何使用
  • .net快速开发框架源码分享
  • .NET牛人应该知道些什么(2):中级.NET开发人员
  • .NET上SQLite的连接
  • .NET文档生成工具ADB使用图文教程
  • ??在JSP中,java和JavaScript如何交互?
  • [ C++ ] STL---stack与queue
  • [【JSON2WEB】 13 基于REST2SQL 和 Amis 的 SQL 查询分析器
  • [100天算法】-每个元音包含偶数次的最长子字符串(day 53)
  • [Android]一个简单使用Handler做Timer的例子
  • [AX]AX2012 R2 出差申请和支出报告
  • [bzoj1912]异象石(set)