Your best source of information and news about secrets , winvista and windows vista on the internet 최고의 소스의 정보 및 뉴스에 대한 귀하의 비밀, windows 비스타와 인터넷에 winvista

Vista ARTICLES 비스타 관련 기사 TOP 50 상위 50 개 Vista VIDEOS 비스타 영화 Vista SOFT 비스타 소프트 Vista HELP 비스타 도움말

In Vista, How Does the FLAGS Switch of REG.EXE Work? 이 비스타, 어떻게 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. thank you.


A while back, there was a topic ( 잠시 뒤로,가 화제 ( Virtual Registry vs. "Real registry" 가상 레지스트리 대 "실제 레지스트리를" ) in the )의 Sysinternals Forums 제품에 적용 공개 토론 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. 그 성장의 문제를 가상화 - 관련 플래그를 설정하는 방법에 비스타의 프로그래밍 방식으로하는 레지스트리 키를보다는 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 비스타 사용자 계정 제어 "). 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를이 게시판합니다.


 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 ); 이 ulong 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. , informationclass 매개 변수에 지정하는 값 2. 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. 그래서 2에 해당하는가 informationclass 매개 변수를 keycontrolflagsinformation합니다. WDM.H also suggests that this class has a type that one passes for the KeyInformationData parameter - KEY_CONTROL_FLAGS_INFORMATION: wdm.h 또한이 클래스가 유형을 제시하는 하나의 keyinformationdata 매개 변수를 전달합니다 - key_control_flags_information :


 typedef struct _KEY_CONTROL_FLAGS_INFORMATION { 형식 구조체 _key_control_flags_information ( 

ULONG ControlFlags; ulong 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? 하지만 controlflags의 구성원은 무엇입니까 값을 설정할 수있습니다를 key_control_flags_information? 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): 그것은 다음과 같은가 나타납니다 (자기 - 메이드) 열거에서는 적절한 플래그 - 적어도 reg.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. 이 컨트롤 플래그는 비트 마스크, 그래서 그들을 설정하거나 두 개 이상의하실 수있습니다.


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. 그래서, 우리는 우리에 대한 포인터를 함수를 받아야 게시판합니다. 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) ( 형식 ntsysapi ntstatus (ntapi * funcntsetinformationkey) ( 

HANDLE KeyHandle, 핸들 keyhandle,

KEY_SET_INFORMATION_CLASS InformationClass, key_set_information_class informationclass,

PVOID KeyInformationData, pvoid keyinformationdata,

ULONG DataLength ); ulong datalength);

//...

FuncNtSetInformationKey ntsik = (FuncNtSetInformationKey)GetProcAddress( funcntsetinformationkey ntsik = (funcntsetinformationkey) 대해 GetProcAddress (

GetModuleHandle( _T("ntdll.dll") ), "NtSetInformationKey" ); getmodulehandle (_ T ( "게시판")), "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, _ T (이하 "소프트웨어 \ \ 무엇"), 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 비스타 SP1을합니다. I would expect the content here to also apply to Windows Vista (no SP) as well as Windows Server 2008, but... 나는 여기를 예상할의 콘텐츠에도 적용됩니다 windows 비스타 (출발점) windows 서버뿐만 아니라 2008,하지만 ...

Popularity: 5% 인기도 : 5 %


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 제품에 적용 공개 토론 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=""> <acronym title=""> <abbr title=""> <blockquote cite=""> <b> <code> <em> <전 > <strike> '합니다.