In Vista, How Does the FLAGS Switch of REG.EXE Work? In Vista, come le bandiere Switch REG.EXE di lavoro? Part 2 Parte 2
Note: this content originally from Nota: questo il contenuto originario di http://mygreenpaste.blogspot.com http://mygreenpaste.blogspot.com . . If you are reading it from some other site, please take the time to visit Se si sta leggendo è da qualche altro sito, si prega di prendere il tempo di visitare My Green Paste, Inc Incolla il mio verde, inc . . Thank you. Grazie.
Previously Precedentemente , I wrote about the FLAGS switch for REG.EXE in Vista and covered a technique that would set the virtualization-related flags of a registry key programmatically. , Ho scritto circa le bandiere passare per REG.EXE in Vista e coperti di una tecnica che impostare la virtualizzazione connesse bandiere di una chiave di registro di programmazione. This post intends to cover the other side - querying for the virtualization-related flags of a registry key. Questo post è intesa a regolare l'altro lato - interrogando per la virtualizzazione connesse bandiere di una chiave di registro. Again, we're dealing with an "undocumented" function in NTDLL.DLL - NtQueryKey: Ancora una volta, stiamo discutendo di una "senza documenti" in funzione ntdll.dll - NtQueryKey:
NTSTATUS NtQueryKey( NTSTATUS NtQueryKey (
IN HANDLE KeyHandle, Gestire in KeyHandle,
IN KEY_INFORMATION_CLASS KeyInformationClass, In KEY_INFORMATION_CLASS KeyInformationClass,
OUT PVOID KeyInformation, OUT PVOID KeyInformation,
IN ULONG Length ULONG in lunghezza
OUT PULONG ResultLength ); OUT PULONG ResultLength);
To retrieve the flags for a key, call NtQueryKey with KeyInformationClass set to 5, which WDM.h tells us is KeyFlagsInformation. Per recuperare il flag per una chiave, chiamata NtQueryKey con KeyInformationClass impostato su 5, che ci dice WDM.h è KeyFlagsInformation.
typedef enum _KEY_INFORMATION_CLASS { typedef enum _KEY_INFORMATION_CLASS (
KeyBasicInformation,
KeyNodeInformation,
KeyFullInformation,
KeyNameInformation,
KeyCachedInformation,
KeyFlagsInformation,
KeyVirtualizationInformation,
MaxKeyInfoClass // MaxKeyInfoClass should always be the last enum MaxKeyInfoClass / / MaxKeyInfoClass dovrebbe sempre essere l'ultima enum
} KEY_INFORMATION_CLASS KEY_INFORMATION_CLASS)
REG.EXE supplies 12 for the value of the Length param, and the last 4 bytes of the buffer (KeyInformation) are modified when NtQueryKey returns. REG.EXE forniture 12 per il valore della lunghezza, parametri, e le ultime 4 byte di buffer (KeyInformation) sono modificati quando NtQueryKey restituisce. This would seem to suggest that the struct to receive the information containing the virtualization flags looks something like: Ciò sembra suggerire che la struct di ricevere l'informazione contenente la virtualizzazione bandiere aspetto:
typedef struct _KEY_FLAGS_INFO { typedef struct (_KEY_FLAGS_INFO
ULONG unknown1; ULONG unknown1;
ULONG unknown2; ULONG unknown2;
ULONG ControlFlags; ULONG ControlFlags;
} KEY_FLAGS_INFO, *PKEY_FLAGS_INFO; KEY_FLAGS_INFO), * PKEY_FLAGS_INFO;
Putting it all together, then, we have something like: Mettere il tutto, poi, abbiamo qualcosa di simile:
typedef NTSYSAPI NTSTATUS (NTAPI* FuncNtQueryKey)( HANDLE KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength ); typedef NTSYSAPI NTSTATUS (NTAPI * FuncNtQueryKey) (MANICO KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Lunghezza, PULONG ResultLength);
// ... / / ...
FuncNtQueryKey ntqk = (FuncNtQueryKey)GetProcAddress( GetModuleHandle( _T("ntdll.dll") ), "NtQueryKey" ); FuncNtQueryKey ntqk = (FuncNtQueryKey) GetProcAddress (GetModuleHandle (_T ( "ntdll.dll")), "NtQueryKey");
KEY_FLAGS_INFO kfi = {0}; KEY_FLAGS_INFO kfi = (0);
HKEY hTheKey = NULL; HKEY hTheKey = NULL;
RegOpenKeyEx( HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Whatever"), 0, KEY_ALL_ACCESS, &hTheKey ); RegOpenKeyEx (HKEY_LOCAL_MACHINE, _T ( "SOFTWARE \ \ Qualunque"), 0, KEY_ALL_ACCESS, & hTheKey);
DWORD dwResultLen = 0; DWORD dwResultLen = 0;
DWORD dwNtqkResult = ntqk( hTheKey , KeyFlagsInformation, &kfi, sizeof( KEY_FLAGS_INFO ), &dwResultLen ); DWORD dwNtqkResult = ntqk (hTheKey, KeyFlagsInformation, & kfi, sizeof (KEY_FLAGS_INFO), e dwResultLen);
RegCloseKey( hTheKey ); RegCloseKey (hTheKey);
hTheKey = NULL; hTheKey = NULL;
The flags (_CONTROL_FLAGS, from Le bandiere (_CONTROL_FLAGS, da Part 1 Parte 1 ) are stored as a bitmask in kfi.ControlFlags. ) Sono conservate come un bitmask in kfi.ControlFlags.
typedef enum _CONTROL_FLAGS { typedef enum _CONTROL_FLAGS (
RegKeyClearFlags = 0, RegKeyClearFlags = 0,
RegKeyDontVirtualize = 2, RegKeyDontVirtualize = 2,
RegKeyDontSilentFail = 4, RegKeyDontSilentFail = 4,
RegKeyRecurseFlag = 8 RegKeyRecurseFlag = 8
} CONTROL_FLAGS; CONTROL_FLAGS);
The code above provides the same information as invoking REG.EXE FLAGS HKLM\Software\Whatever QUERY. Il codice sopra fornisce le stesse informazioni di invocare REG.EXE BANDIERE HKLM \ Software \ Qualunque query.
Again - note that this exploration was done on Windows Vista SP1. Anche in questo caso - di notare che questa esplorazione è stato fatto in Windows Vista SP1. I would expect the content here to also apply to Windows Vista (no SP) as well as Windows Server 2008, but...Popularity: 2% Mi aspetto il contenuto qui per applicarsi anche a Windows Vista (non SP) e Windows Server 2008, ma ... Popularity: 2%
Written by «/\/\Ø|ö±ò\/»®©. Scritto da  «/ \ / \ à ~ |  ¶ à ± à ² \ / »   ® ©. Read more great feeds at is source Per saperne di più grande al feed è fonte WEBSITE SITO WEB
no comments nessun commento . .
Read more articles on Per saperne di più articoli su Sysinternals Forum Sysinternals Forum and e registry virtualization Registro di sistema di virtualizzazione and e reg.exe flags reg.exe bandiere and e NtQueryKey NtQueryKey and e REG_KEY_DONT_VIRTUALIZE REG_KEY_DONT_VIRTUALIZE and e flags bandiere and e vista Vista and e otherSoftware otherSoftware and e REG_KEY_DONT_SILENT_FAIL REG_KEY_DONT_SILENT_FAIL and e reg Reg and e Virtualization Virtualizzazione . .
- [+] Digg [+] Digg : Feature this article : Feature questo articolo
- [+] Del.icio.us [+] Del.icio.us : Bookmark this article : Bookmark questo articolo
- [+] Furl [+] Furl : Bookmark this article : Bookmark questo articolo















