As you may know, Windows is virtualizing some parts of the registry under 64 bit. So if you try to open, for example, this key : “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90″, from a 32 bit C# application running on a 6
As you may know, Windows is virtualizing some parts of the registry under 64 bit.
So if you try to open, for example, this key : “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\90″, from a 32 bit C# application running on a 64 bit system, you will be redirected to : “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server\90″
Why ? Because Windows uses the Wow6432Node registry entry to present a separate view of HKEY_LOCAL_MACHINE\SOFTWARE for 32 bit applications that runs on a 64 bit systems.
If you want to explicitly open the 64 bit view of the registry, here is what you have to perform :
You are using VS 2010 and version 4.x of the .NET framework
It’s really simple, all you need to do is, instead of doing :
//Will redirect you to the 32 bit view
RegistryKey sqlsrvKey = Registry.LocalMachine.OpenSubKey(
@"SOFTWARE\Microsoft\Microsoft SQL Server\90"
);
do the following :
RegistryKey localMachineX64View = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
RegistryKey sqlsrvKey = localMachineX64View.OpenSubKey(
@"SOFTWARE\Microsoft\Microsoft SQL Server\90"
);
Prior versions of the .NET framework
For the prior versions of the framework, we have to use P/Invoke and call the function RegOpenKeyExW with parameter KEY_WOW64_64KEY
enum
RegWow64Options
{
None = 0,
KEY_WOW64_64KEY = 0x0100,
KEY_WOW64_32KEY = 0x0200
}
enum
RegistryRights
{
ReadKey = 131097,
WriteKey = 131078
}
/// <summary></summary>
/// Open a registry key using the Wow64 node instead of the default 32-bit node.
///
/// <param name="parentKey">Parent key to the key to be opened.
/// <param name="subKeyName">Name of the key to be opened
/// <param name="writable">Whether or not this key is writable
/// <param name="options">32-bit node or 64-bit node
/// <returns></returns>
static
RegistryKey _openSubKey(RegistryKey parentKey,
string
subKeyName,
bool
writable, RegWow64Options options)
{
//Sanity check
if
(parentKey ==
null
|| _getRegistryKeyHandle(parentKey) == IntPtr.Zero)
{
return
null
;
}
//Set rights
int
rights = (
int
)RegistryRights.ReadKey;
if
(writable)
rights = (
int
)RegistryRights.WriteKey;
//Call the native function >.
int
subKeyHandle, result = RegOpenKeyEx(_getRegistryKeyHandle(parentKey), subKeyName, 0, rights | (
int
)options,
out
subKeyHandle);
//If we errored, return null
if
(result != 0)
{
return
null
;
}
//Get the key represented by the pointer returned by RegOpenKeyEx
RegistryKey subKey = _pointerToRegistryKey((IntPtr)subKeyHandle, writable,
false
);
return
subKey;
}
/// <summary></summary>
/// Get a pointer to a registry key.
///
/// <param name="registryKey">Registry key to obtain the pointer of.
/// <returns>Pointer to the given registry key.</returns>
static
IntPtr _getRegistryKeyHandle(RegistryKey registryKey)
{
//Get the type of the RegistryKey
Type registryKeyType =
typeof
(RegistryKey);
//Get the FieldInfo of the 'hkey' member of RegistryKey
System.Reflection.FieldInfo fieldInfo =
registryKeyType.GetField(
"hkey"
, System.Reflection.BindingFlags.NonPublic
| System.Reflection.BindingFlags.Instance);
//Get the handle held by hkey
SafeHandle handle = (SafeHandle)fieldInfo.GetValue(registryKey);
//Get the unsafe handle
IntPtr dangerousHandle = handle.DangerousGetHandle();
return
dangerousHandle;
}
/// <summary></summary>
/// Get a registry key from a pointer.
///
/// <param name="hKey">Pointer to the registry key
/// <param name="writable">Whether or not the key is writable.
/// <param name="ownsHandle">Whether or not we own the handle.
/// <returns>Registry key pointed to by the given pointer.</returns>
static
RegistryKey _pointerToRegistryKey(IntPtr hKey,
bool
writable,
bool
ownsHandle)
{
//Get the BindingFlags for private contructors
System.Reflection.BindingFlags privateConstructors = System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic;
//Get the Type for the SafeRegistryHandle
Type safeRegistryHandleType =
typeof
(Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid).Assembly.GetType(
"Microsoft.Win32.SafeHandles.SafeRegistryHandle"
);
//Get the array of types matching the args of the ctor we want
Type[] safeRegistryHandleCtorTypes =
new
Type[] {
typeof
(IntPtr),
typeof
(
bool
) };
//Get the constructorinfo for our object
System.Reflection.ConstructorInfo safeRegistryHandleCtorInfo = safeRegistryHandleType.GetConstructor(
privateConstructors,
null
, safeRegistryHandleCtorTypes,
null
);
//Invoke the constructor, getting us a SafeRegistryHandle
Object safeHandle = safeRegistryHandleCtorInfo.Invoke(
new
Object[] { hKey, ownsHandle });
//Get the type of a RegistryKey
Type registryKeyType =
typeof
(RegistryKey);
//Get the array of types matching the args of the ctor we want
Type[] registryKeyConstructorTypes =
new
Type[] { safeRegistryHandleType,
typeof
(
bool
) };
//Get the constructorinfo for our object
System.Reflection.ConstructorInfo registryKeyCtorInfo = registryKeyType.GetConstructor(
privateConstructors,
null
, registryKeyConstructorTypes,
null
);
//Invoke the constructor, getting us a RegistryKey
RegistryKey resultKey = (RegistryKey)registryKeyCtorInfo.Invoke(
new
Object[] { safeHandle, writable });
//return the resulting key
return
resultKey;
}
[DllImport(
"advapi32.dll"
, CharSet = CharSet.Auto)]
public
static
extern
int
RegOpenKeyEx(IntPtr hKey,
string
subKey,
int
ulOptions,
int
samDesired,
out
int
phkResult);
Then we can open our registry key like this :
RegistryKey sqlsrvKey = _openSubKey(Registry.LocalMachine,
@"SOFTWARE\Microsoft\Microsoft SQL Server\90"
,
false
, RegWow64Options.KEY_WOW64_64KEY);
As you can see, the framework 4 make our life easier.
Referenced from: http://dotnetgalactics.wordpress.com/2010/05/10/accessing-64-bit-registry-from-a-32-bit-process/

pr的全称是“Adobe Premiere Pro”;pr是由Adobe公司开发的一款视频编辑软件,有着较好的兼容性,并且可以与Adobe公司推出的其他软件相互协作,广泛应用于广告制作和电视节目制作中。

pr有音轨但没有声音解决方法:1、在PR应用中,将素材拖入时间轴;2、在编辑菜单中,打开首选项;3、在首选项窗口中,打开音频硬件项目栏,找到默认输出选项框;4、在选项框中,找到扬声器选项,点击确定按钮;5、回到PR应用中,在视频预览窗口中,进行播放,就会有声音播出。

pr文件的压缩类型不受支持的原因及解决办法:1、精简版pr把许多视频编码器精简掉了,重新安装使用完整版Premiere;2、视频编码不规范导致的,可以通过格式工厂,将视频转换成WMV格式即可。

1bit等于八分之一个字节。二进制数系统中,每个0或1就是一个位(bit),位是数据存储的最小单位;每8个位(bit,简写为b)组成一个字节(Byte),因此“1字节(Byte)=8位(bit)”。在多数的计算机系统中,一个字节是一个8位(bit)长的数据单位,大多数的计算机用一个字节表示一个字符、数字或其他字符。

pr字幕逐字出现的方法:1、创建字幕轨道;2、添加字幕文本;3、调整持续时间;4、逐字出现效果;5、调整动画效果;6、调整字幕的位置和透明度;7、预览和导出视频。

pr编译影片时出错的解决办法:1、在电脑上打开premiere后期剪辑软件,然后在项目设置的右侧菜单栏中,选择“常规”;2、进入到premiere的常规设置窗口,选择“仅Mercury Playback Engine软件”;3、点击“确认”即可解决pr编译影片时出错问题。

pr是Public Relations的缩写,是一种重要的组织管理工具,旨在通过建立和维护良好的关系来提高组织的声誉和信任度。它需要透明度、真实性和一致性,同时需要与新媒体和社交媒体紧密结合。通过有效的pr实践,组织可以获得更广泛的认可和支持,提高其竞争力和可持续发展能力。

pr素材拖不到时间轴上解决方法:1、格式不兼容,需要确认PR素材所支持的格式,并将其转换为软件支持的格式;2、版权问题,使用经过授权的素材或联系版权持有者获取使用许可;3、软件问题,更新软件或使用其他受支持的软件来尝试将素材拖放到时间轴上;4、文件损坏,检查素材文件是否完整,并尝试重新下载或恢复丢失的文件。


热AI工具

Undresser.AI Undress
人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover
用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool
免费脱衣服图片

Clothoff.io
AI脱衣机

AI Hentai Generator
免费生成ai无尽的。

热门文章

热工具

DVWA
Damn Vulnerable Web App (DVWA) 是一个PHP/MySQL的Web应用程序,非常容易受到攻击。它的主要目标是成为安全专业人员在合法环境中测试自己的技能和工具的辅助工具,帮助Web开发人员更好地理解保护Web应用程序的过程,并帮助教师/学生在课堂环境中教授/学习Web应用程序安全。DVWA的目标是通过简单直接的界面练习一些最常见的Web漏洞,难度各不相同。请注意,该软件中

Atom编辑器mac版下载
最流行的的开源编辑器

Dreamweaver Mac版
视觉化网页开发工具

PhpStorm Mac 版本
最新(2018.2.1 )专业的PHP集成开发工具

SecLists
SecLists是最终安全测试人员的伙伴。它是一个包含各种类型列表的集合,这些列表在安全评估过程中经常使用,都在一个地方。SecLists通过方便地提供安全测试人员可能需要的所有列表,帮助提高安全测试的效率和生产力。列表类型包括用户名、密码、URL、模糊测试有效载荷、敏感数据模式、Web shell等等。测试人员只需将此存储库拉到新的测试机上,他就可以访问到所需的每种类型的列表。