Your best source of information and news about hardware , drivers and xp on the internet Su mejor fuente de información y noticias sobre hardware, controladores y xp en el Internet

Vista ARTICLES Vista ARTÍCULOS TOP 50 TAPA 50 Spyware Virus Virus Spyware Vista SOFT Vista SOFT Vista HELP Vista AYUDA

In Vista, How Does the FLAGS Switch of REG.EXE Work? En Vista, ¿Cómo la BANDERAS Reg.exe Switch de trabajo? Part 2 Parte 2


Note: this content originally from Nota: este contenido originario de http://mygreenpaste.blogspot.com http://mygreenpaste.blogspot.com . . If you are reading it from some other site, please take the time to visit Si está leyendo desde algún otro sitio, por favor, tómese el tiempo para visitar My Green Paste, Inc Mi pasta verde, Inc . . Thank you. Gracias.

Previously Anteriormente , 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. , Escribí acerca de la BANDERAS interruptor para Reg.exe en Vista y que abarca una técnica que establezca la virtualización relacionada con las banderas de una clave del Registro programación. This post intends to cover the other side - querying for the virtualization-related flags of a registry key. Este puesto tiene intención de cubrir la otra parte - para la consulta de virtualización relacionados con las banderas de una clave del Registro. Again, we're dealing with an "undocumented" function in NTDLL.DLL - NtQueryKey: Una vez más, estamos tratando con un "indocumentados" en función de Ntdll.dll - NtQueryKey:

 NTSTATUS NtQueryKey( NTSTATUS NtQueryKey ( 
IN HANDLE KeyHandle, En manejar KeyHandle,
IN KEY_INFORMATION_CLASS KeyInformationClass, En KEY_INFORMATION_CLASS KeyInformationClass,
OUT PVOID KeyInformation, PVOID KeyInformation a cabo,
IN ULONG Length ULONG en longitud
OUT PULONG ResultLength ); FUERA PULONG ResultLength);


To retrieve the flags for a key, call NtQueryKey with KeyInformationClass set to 5, which WDM.h tells us is KeyFlagsInformation. Para recuperar las banderas de una clave, llamada NtQueryKey conjunto con KeyInformationClass a 5, que nos dice WDM.h es KeyFlagsInformation.
 typedef enum _KEY_INFORMATION_CLASS { typedef _KEY_INFORMATION_CLASS enum ( 
KeyBasicInformation, KeyBasicInformation,
KeyNodeInformation, KeyNodeInformation,
KeyFullInformation, KeyFullInformation,
KeyNameInformation, KeyNameInformation,
KeyCachedInformation, KeyCachedInformation,
KeyFlagsInformation, KeyFlagsInformation,
KeyVirtualizationInformation, KeyVirtualizationInformation,
MaxKeyInfoClass // MaxKeyInfoClass should always be the last enum MaxKeyInfoClass / / MaxKeyInfoClass debe ser siempre la última 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 suministros 12 para el valor de la longitud parámetro, y los últimos 4 bytes del búfer (KeyInformation) son modificados cuando NtQueryKey retornos. This would seem to suggest that the struct to receive the information containing the virtualization flags looks something like: Esto parece sugerir que la estructura para recibir la información que contenía las banderas de la virtualización se ve algo como esto:
 typedef struct _KEY_FLAGS_INFO { typedef struct (_KEY_FLAGS_INFO 
ULONG unknown1; Unknown1 ULONG;
ULONG unknown2; Unknown2 ULONG;
ULONG ControlFlags; ControlFlags ULONG;
} KEY_FLAGS_INFO, *PKEY_FLAGS_INFO; KEY_FLAGS_INFO) *, PKEY_FLAGS_INFO;


Putting it all together, then, we have something like: Poniendo todo junto, entonces, tenemos algo así como:
 typedef NTSYSAPI NTSTATUS (NTAPI* FuncNtQueryKey)( HANDLE KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength ); typedef NTSYSAPI NTSTATUS (NTAPI * FuncNtQueryKey) (ASAS KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Longitud, 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 FKI = (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 \ \ Sea cual sea"), 0, KEY_ALL_ACCESS, y hTheKey);
DWORD dwResultLen = 0; DwResultLen DWORD = 0;
DWORD dwNtqkResult = ntqk( hTheKey , KeyFlagsInformation, &kfi, sizeof( KEY_FLAGS_INFO ), &dwResultLen ); DWORD dwNtqkResult = ntqk (hTheKey, KeyFlagsInformation, y FKI, sizeof (KEY_FLAGS_INFO), y dwResultLen);
RegCloseKey( hTheKey ); RegCloseKey (hTheKey);
hTheKey = NULL; hTheKey = NULL;


The flags (_CONTROL_FLAGS, from Las banderas (_CONTROL_FLAGS, desde Part 1 Parte 1 ) are stored as a bitmask in kfi.ControlFlags. ) Se almacenan como una máscara de bits en kfi.ControlFlags.
 typedef enum _CONTROL_FLAGS { typedef _CONTROL_FLAGS enum ( 
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. El código anterior ofrece la misma información que la invocación de Reg.exe BANDERAS HKLM \ Software \ Independientemente de la consulta.

Again - note that this exploration was done on Windows Vista SP1. Una vez más - Tenga en cuenta que esta exploración se hizo en 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% Espero que el contenido aquí también se aplican a Windows Vista (no SP), así como Windows Server 2008, pero ... Popularity: 2%


Written by «/\/\Ø|ö±ò\/»®©. Escrito por  «/ \ / \ ~ à |  ¶ à ± à ² \ / »  ®  ©. Read more great feeds at is source Leer más grandes se alimenta en la fuente WEBSITE SITIO WEB
no comments No hay comentarios . .
Read more articles on Leer más artículos sobre Sysinternals Forum Foro de Sysinternals and y registry virtualization Registro de virtualización and y reg.exe flags Reg.exe banderas and y NtQueryKey NtQueryKey and y REG_KEY_DONT_VIRTUALIZE REG_KEY_DONT_VIRTUALIZE and y flags banderas and y vista vista and y otherSoftware otherSoftware and y REG_KEY_DONT_SILENT_FAIL REG_KEY_DONT_SILENT_FAIL and y reg reg and y Virtualization Virtualización . .

Related articles Artículos relacionados

No comments No hay comentarios

There are still no comments on this article. Todavía no hay comentarios sobre este artículo.

Leave your comment... Deja tu comentario ...

If you want to leave your comment on this article, simply fill out the next form: Si quieres dejar tu comentario sobre este artículo, simplemente llene el siguiente formulario:




You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong> . Puede utilizar estas etiquetas XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i > <strike> <strong>.