Your best source of information and news about secrets , winvista and vista on the internet お客様の最高の秘密の情報源やニュースについては、インターネット上でwinvistaビスタ

Vista ARTICLESビスタの記事 TOP 50トップ50 Vista VIDEOS Vistaの映画 Vista SOFT Vistaのソフト Vista HELP Vistaのヘルプ

In Vista, How Does the FLAGS Switch of REG.EXE Work?でVistaでは、どのようにしてフラグスイッチのreg.exe仕事ですか?


Note: this content originally from 注:このコンテンツを当初から http://mygreenpaste.blogspot.com http://mygreenpaste.blogspot.com . です。 If you are reading it from some other site, please take the time to visit 読んでいる場合は、いくつかの他のサイトから、下記を時間をかけて訪問 My Green Paste, Inc 私の緑の貼り付け、 inc . です。 Thank you. ありがとうございました。


A while back, there was a topic (しばらく先頭では、トピック( Virtual Registry vs. "Real registry"仮想レジストリ対"本物のレジストリ" ) in the )は、 Sysinternals Forums Sysinternalsのフォーラム that brought up the question of how to set the virtualization-related flags of a registry key programmatically in Vista, rather than through the use of the REG.EXE tool's FLAGS switch.の問題をどのように育つの仮想化に関連したフラグを設定するにするには、レジストリキーをプログラムでのVistaのではなく、 reg.exeを使用したツールのフラグのスイッチです。 (For more information on the flags, see (詳細については、フラグを参照してください Mark Russinovichマークrussinovich 's article in TechNet Magazine, " '秒TechNetの雑誌記事で、 " Inside Windows Vista User Account ControlインサイドWindows Vistaのユーザーアカウント制御 "). Even before that topic in the forum, I had wondered how it was done but had not had a chance to explore. It didn't seem that many others were curious about it. That topic had resurrected the idea, but it quickly fell to the bottom of the list. I've finally gotten around to experimenting, and that leads to this write-up. I still don't see much in the way of this discussed anywhere, by searching for terms involved (data types, function param names, etc.), so hopefully this will help someone. (Keep in mind that there very well may be a reason Microsoft hasn't made this available through another, more direct API.) "という。 )フォーラムを参照してもその前に、私は疑問が行われたしかし、どのようにするチャンスを探るまでにはなかった。ていないように見えるが多くの人が好奇心を抱くことです。そのトピックのアイデアが復活、それすばやくリストの下の方に下落しています。策を得た私は最後のテスト、およびこの書き込みアップにつながる。いまだに表示されていないこの議論の邪魔をする多くのどこからでも、関係の用語を検索(データの種類、関数のparam名、等)ので、うまくいけばこれは手伝う。 (非常によくあることに注意してマイクロソフトではない理由かもしれないが、この利用できるほか、他の直接のAPIです。 )


In the referenced topic, I had gotten so far as determining that REG.EXE was doing its work through the use of NtSetInformationKey, an "undocumented" API in NTDLL.DLL.で、参照先のトピックを、私はこれまでに得たとして仕事を果たしていると判断することreg.exeはntsetinformationkeyを使用した、 "不法滞在"のAPIにするntdll.dllのです。


 NTSYSAPI ntsysapi 

NTSTATUS NTSTATUSの

NTAPI ntapi

NtSetInformationKey( ntsetinformationkey (

IN HANDLE KeyHandle,でハンドルkeyhandle 、

IN KEY_SET_INFORMATION_CLASS InformationClass, key_set_information_class informationclassで、

IN PVOID KeyInformationData, pvoid keyinformationdataで、

IN ULONG DataLength ); datalengthの制限) ;


After a bit of plonking around in WinDbg, I've come up with the following following details.の後にビットplonking windbgの周りに、私には、次の次のように来てください。 REG.EXE calls reg.exeの呼び出し NtSetInformationKey ntsetinformationkey , specifying a value of 2 for the InformationClass parameter. 、を指定する値が2をinformationclassパラメータを指定します。 This parameter is of type KEY_SET_INFORMATION_CLASS, which wdm.h tells us is an enum:このパラメータは、タイプkey_set_information_class 、これは、列挙型を教えてくれるwdm.h :


 typedef enum _KEY_SET_INFORMATION_CLASS {列挙型_key_set_information_class ( 

KeyWriteTimeInformation, keywritetimeinformation 、

KeyWow64FlagsInformation, keywow64flagsinformation 、

KeyControlFlagsInformation, keycontrolflagsinformation 、

KeySetVirtualizationInformation, keysetvirtualizationinformation 、

KeySetDebugInformation, keysetdebuginformation 、

MaxKeySetInfoClass // MaxKeySetInfoClass should always be the last enum maxkeysetinfoclass / / maxkeysetinfoclassの最後の列挙型は常に

} KEY_SET_INFORMATION_CLASS; ) key_set_information_class ;


So the 2 for the InformationClass parameter would correspond to KeyControlFlagsInformation. informationclassので、 2は、パラメータはkeycontrolflagsinformationに対応しています。 WDM.H also suggests that this class has a type that one passes for the KeyInformationData parameter - KEY_CONTROL_FLAGS_INFORMATION: wdm.hも示唆して、このクラスには、パスの種類を1つのパラメータをkeyinformationdata -k ey_control_flags_information:


 typedef struct _KEY_CONTROL_FLAGS_INFORMATION {構造体定義typedef _key_control_flags_information ( 

ULONG ControlFlags;制限controlflags ;

} KEY_CONTROL_FLAGS_INFORMATION, *PKEY_CONTROL_FLAGS_INFORMATION; ) key_control_flags_information 、 * pkey_control_flags_information ;


We have a basic idea of how to call NtSetInformationKey now.私たちは、基本的な考え方を今すぐntsetinformationkeyを呼び出す方法です。 But what are the values that the ControlFlags member of KEY_CONTROL_FLAGS_INFORMATION can be set to?しかし、どのような値を示してkey_control_flags_informationのcontrolflagsのメンバーに設定されることですか? It would appear that the following (self-made) enum covers the pertinent flags - at least the ones REG.EXE FLAGS can handle (there may be more):それが表示されることは、次の(自作)列挙型をカバーして適切なフラグ-少なくともものr eg.exeフラグを処理できること(もあるかもしれません) :


 typedef enum _CONTROL_FLAGS {列挙型_control_flags ( 

RegKeyClearFlags = 0, regkeyclearflags = 0 、

RegKeyDontVirtualize = 2, regkeydontvirtualize = 2 、

RegKeyDontSilentFail = 4, regkeydontsilentfail = 4 、

RegKeyRecurseFlag = 8 regkeyrecurseflag = 8

} CONTROL_FLAGS; ) control_flags ;


The control flags are a bitmask, so you can OR them to set more than one.制御フラグは、ビットマスク、またはそれらを設定することができます1つ以上のです。


Now that we have this information, what's left?今すぐに私たちは、この情報については、何の左側のですか? We need to put it all together in a call to NtSetInformationKey.すべての必要性を置くことを私たちに電話をntsetinformationkeyで一緒にします。 So, we need to get a pointer to the function in NTDLL.DLL.そのため、私たちを取得する必要がするntdll.dllの関数へのポインタです。 Then, we can declare a struct of type KEY_CONTROL_FLAGS_INFORMATION, set the ControlFlags member to be what we wish, and open a key to the desired location in the registry, that can be passed to NtSetInformationKey.次に、構造体の種類を宣言することもできますkey_control_flags_information 、 controlflagsのメンバを設定するにはどのよう願って、キーをオープンすると、目的の場所にするには、レジストリ、 ntsetinformationkeyに渡されることができる。 In the end, we wind up with something like the following (error handling has been omitted):での最後に、私たちのように風には、次の(エラー処理され省略された場合) :


 typedef NTSYSAPI NTSTATUS (NTAPI* FuncNtSetInformationKey) ( NTSTATUSの定義typedef ntsysapi ( ntapi * funcntsetinformationkey ) ( 

HANDLE KeyHandle,ハンドルkeyhandle 、

KEY_SET_INFORMATION_CLASS InformationClass, key_set_information_class informationclass 、

PVOID KeyInformationData, pvoid keyinformationdata 、

ULONG DataLength );制限datalength ) ;

//...

FuncNtSetInformationKey ntsik = (FuncNtSetInformationKey)GetProcAddress( funcntsetinformationkey ntsik = ( funcntsetinformationkey ) GetProcAddressが(

GetModuleHandle( _T("ntdll.dll") ), "NtSetInformationKey" ); getmodulehandle (ポリシー( " ntdll.dllの" ) ) 、 " ntsetinformationkey " ) ;

KEY_CONTROL_FLAGS_INFORMATION kcfi = {0}; key_control_flags_information kcfi = ( 0 ) ;

kcfi.ControlFlags = RegKeyDontVirtualize | RegKeyRecurseFlag; kcfi.controlflags = regkeydontvirtualize | regkeyrecurseflag ;

HKEY hTheKey = NULL; 、 HKEY hthekey =ヌル;

RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Whatever"), 0, KEY_ALL_ACCESS, &hTheKey ); regopenkeyex ( 。 HKEY_LOCAL_MACHINE 、ポリシー(以下、 "ソフトウェア\ \どんな" ) 、 0 、 key_all_access 、 & hthekey ) ;

ntsik( hTheKey, KeyControlFlagsInformation, &kcfi, sizeof( KEY_CONTROL_FLAGS_INFORMATION ) ); ntsik ( hthekey 、 keycontrolflagsinformation 、 & kcfiとsizeof ( key_control_flags_information ) ) ;

RegCloseKey( hTheKey ); regclosekey ( hthekey ) ;

hTheKey = NULL; hthekey =ヌル;



The code above is the equivalent of invoking REG.EXE FLAGS HKLM\Software\Whatever SET DONT_VIRTUALIZE RECURSE_FLAGS .上記のコードを呼び出すのと同等のフラグreg.exe hklm \ソフトウェア \ dont_virtualize recurse_flagsどのように設定します。 To clear the flags, just set kcfi.ControlFlags to RegKeyClearFlags (same as REG.EXE FLAGS HKLM\Software\Whatever SET) .フラグをクリアして、ちょうどセットkcfi.controlflagsをregkeyclearflags ( reg.exeフラグと同じhklm \ソフトウェア\どのように設定)

Hopefully, this will prove useful to those that have wished to set these flags programmatically.うまくいけば、これはそれらの役に立つことの証明をしてプログラムを希望してこれらのフラグを設定します。 In a future post, I hope to explore querying for these flags, ala REG.EXE FLAGS HKLM\Software\Whatever QUERY .で、将来のポスト、私に希望を探索クエリをこれらのフラグは、 フラグreg.exe hklm \ソフトウェア\どんなクエリです。


Note that this exploration was done on Windows Vista SP1.この探査をやっていたに注意してWindows VistaのSP1をインストールします。 I would expect the content here to also apply to Windows Vista (no SP) as well as Windows Server 2008, but...私は期待してコンテンツにも適用をWindows Vistaにはここを(特検)のWindowsサーバーだけでなく2008年、でも… …

Popularity: 4%人気: 4 %


Written by «/\/\Ø|ö±ò\/»®©. 書かれたâ « / \ / \ ã 〜 | ã ¶ â ± ã ² \ /  » â ® â ©します。 Read more great feeds at is source 続きを読む大きなフィードでは、ソース WEBSITE ウェブサイト
no comments コメントはありません . です。
Read more articles on 続きを読むの記事を flags フラグ and および NtSetInformationKey ntsetinformationkey and および REG_KEY_DONT_VIRTUALIZE reg_key_dont_virtualize and および Sysinternals Forum Sysinternalsのフォーラム and および reg.exe flags reg.exeフラグ and および registry virtualization レジストリの仮想化 and および reg 登録 and および REG_KEY_DONT_SILENT_FAIL reg_key_dont_silent_fail and および Troubleshooting トラブルシューティング and および vista ビスタ and および windbg windbgの and および otherSoftware othersoftware and および registry レジストリ and および Virtualization 仮想化 . です。

No commentsコメントはありません

There are still no comments on this article.上にはまだこの記事はコメントはありません。

Leave your comment...あなたのコメントを残す...

If you want to leave your comment on this article, simply fill out the next form:する場合は、コメントをするこの記事を退出する際に、次のフォームに記入して、単に:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> .これらのXHTMLタグを使用することができます: <aのhref=のtitle= <abbrのtitle= <blockquote cite=""> <acronymのtitle= <b>ダウンロードの<code>の<em> <私>て<strike> <strong>です。