わいえむねっと

Contents
Categories
Calendar
2024/04
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
Monthly Archives
~2000/01
Recent Entries
RSS1.0
Templates
Information
Processed: 0.036 sec
Chashed: -
DiaryIncludeTest
埋め込みテスト。

2010.01.22
次への布石 その2。
簡易Wikiモジュールを組み込み。

差分表示も一応対応。
差分解析は外部diffに丸投げして実行結果をパースしてるだけですが。


日記の埋め込みとかにも対応。



2005.12.30

※注文しすぎです。


2000.03.06
僕は安藤じゃないです。


2008.02.27
レジストリリダイレクトをねじ伏せるメモ。

Registry changes in x64-based versions of Windows Server 2003 and in Windows XP Professional x64 Edition
http://support.mi​crosoft.co​m/kb/896459
Registry redirection
To support the coexistence of 32-bit and 64-bit COM registration and program states, the WOW64 subsystem presents 32-bit programs by using another view of the registry. The WOW64 subsystem uses registry redirection to intercept registry calls at the bit level. Registry redirection also makes sure that the registry calls are directed to the correct branches in the registry.

When you install a new program or when you run a program on a Windows x64 Edition computer, registry calls made by 64-bit programs access the HKEY_LOCAL_MACHINE\Software registry sub key without redirection. WOW64 intercepts registry calls to HKEY_LOCAL_MACHINE\Software that are made by 32-bit programs, and then redirects them to the HKEY_LOCAL_MACHINE\Software\WOW6432node sub key. By redirecting only the 32-bit program calls, WOW64 makes sure that programs always write to the appropriate registry sub key. Registry redirection does not require program code modification, and this process is transparent to the user.

API対応状況は

RegCreateKeyEx Function (Windows)
http://msdn2.micr​osoft.com/en-us/library/ms724844.a​spx
samDesired
A mask that specifies the access rights for the key. For more information, see Registry Key Security and Access Rights.

Requirements
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

RegOpenKeyEx Function (Windows)
http://msdn2.micr​osoft.com/en-us/library/ms724897.a​spx
samDesired
A mask that specifies the desired access rights to the key. The function fails if the security descriptor of the key does not permit the requested access for the calling process. For more information, see Registry Key Security and Access Rights.

Requirements
Client Requires Windows Vista, Windows XP, or Windows 2000 Professional.
Server Requires Windows Server 2008, Windows Server 2003, or Windows 2000 Server.

Registry Key Security and Access Rights (Windows)
http://msdn2.micr​osoft.com/en-us/library/ms724878.a​spx
KEY_WOW64_32KEY (0x0200) Indicates that an application on 64-bit Windows should operate on the 32-bit registry view. For more information, see Accessing an Alternate Registry View.
This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.

Windows 2000: This flag is not supported.

KEY_WOW64_64KEY (0x0100) Indicates that an application on 64-bit Windows should operate on the 64-bit registry view. For more information, see Accessing an Alternate Registry View.
This flag must be combined using the OR operator with the other flags in this table that either query or access registry values.

Windows 2000: This flag is not supported.

RegDeleteKeyEx Function (Windows)
http://msdn2.micr​osoft.com/en-us/library/ms724847.a​spx
samDesired
An access mask the specifies the platform-specific view of the registry.

Value Meaning
KEY_WOW64_32KEY
0x0200
Delete the key from the 32-bit registry view.

KEY_WOW64_64KEY
0x0100
Delete the key from the 64-bit registry view.

Requirements
Client Requires Windows Vista or Windows XP Professional x64 Edition.
Server Requires Windows Server 2008 or Windows Server 2003 SP1.

となっており、

・RegCreateKeyExやRegOpenKeyExはsamDesiredの指定でリダイレクト回避可能だが、Windows 2000での動作が不定
・RegDeleteKeyExも同様だが、こちらはx64 EditionもしくはWindows Server 2003 SP1以降でないとAPIそのものが未サポート

とりあえず実験。空欄は未確認。

RegCreateKeyExRegCreateKeyEx(KEY_WOW64_64KEY)RegOpenKeyEx(KEY_WOW64_64KEY)
RegSetValueExRegSetValueExRegSetValueExRegDeleteKeyRegDeleteKeyEx(KEY_WOW64_64KEY)
2003(x64)SOFTWARE\Wow6432NodeSOFTWARESOFTWARESOFTWARE\Wow6432NodeSOFTWARE
2003(x32)SOFTWARESOFTWARE SOFTWARE 
XP(x32)SOFTWARESOFTWARE SOFTWARE×
2000SOFTWARESOFTWARE ××

どうもnot supportedなflagはただ無視されるというわけでもないようなので、x64かどうかを判別した上でセットするのが吉。
判別は

IsWow64Process Function (Windows)
http://msdn2.micr​osoft.com/en-us/library/ms684139.a​spx
Determines whether the specified process is running under WOW64.

で。

Requirements
Client Requires Windows Vista or Windows XP SP2.
Server Requires Windows Server 2008 or Windows Server 2003 SP1.

DLL Requires Kernel32.dll.

となっているので、Kernel32.dllをLoadLibraryしてGetProcAddresssすると吉。