Your best source of information and news about Vista hardware , xp and BIOS on the internet حسابك أفضل مصدر للمعلومات والاخبار عن فيستا المعدات ، إكس بي والسير على شبكة الإنترنت

Vista ARTICLES مقالات فيستا TOP 50 أفضل 50 Spyware Virus فيروس برامج التجسس Vista SOFT ميسر فيستا Vista HELP فيستا مساعدة

In Vista, How Does the FLAGS Switch of REG.EXE Work? في فيستا ، كيف انتقل من أعلام REG.EXE العمل؟ Part 2 جزء 2


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 بلادي الخضراء لصق ، لجنة التفاوض الحكومية الدولية . . Thank you. شكرا لك.

Previously سابقا , 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. لقد كتبت عن أعلام REG.EXE في التحول لفيستا وشملت تقنية من شأنها أن تحدد الافتراضية المتصلة أعلام من مفتاح التسجيل البرنامجية. This post intends to cover the other side - querying for the virtualization-related flags of a registry key. وتعتزم بعد ذلك لتغطية الجانب الآخر -- والاستعلام للالافتراضية المتصلة أعلام من مفتاح التسجيل. Again, we're dealing with an "undocumented" function in NTDLL.DLL - NtQueryKey: مرة أخرى ، أننا نتعامل مع "لا يحملون وثائق" مهمة في NTDLL.DLL -- NtQueryKey :

 NTSTATUS NtQueryKey( NTSTATUS NtQueryKey) 
IN HANDLE KeyHandle, في التعامل مع KeyHandle ،
IN KEY_INFORMATION_CLASS KeyInformationClass, في KEY_INFORMATION_CLASS KeyInformationClass ،
OUT PVOID KeyInformation, خارج PVOID KeyInformation ،
IN ULONG Length في طول ULONG
OUT PULONG ResultLength ); خارج PULONG ResultLength) ؛


To retrieve the flags for a key, call NtQueryKey with KeyInformationClass set to 5, which WDM.h tells us is KeyFlagsInformation. لاستعادة أعلام لرئيسي ، مع NtQueryKey دعوة إلى KeyInformationClass مجموعة 5 ، التي WDM.h يخبرنا هو KeyFlagsInformation.
 typedef enum _KEY_INFORMATION_CLASS { typedef إنجليزي _KEY_INFORMATION_CLASS ( 
KeyBasicInformation, KeyBasicInformation ،
KeyNodeInformation, KeyNodeInformation ،
KeyFullInformation, KeyFullInformation ،
KeyNameInformation, KeyNameInformation ،
KeyCachedInformation, KeyCachedInformation ،
KeyFlagsInformation, KeyFlagsInformation ،
KeyVirtualizationInformation, KeyVirtualizationInformation ،
MaxKeyInfoClass // MaxKeyInfoClass should always be the last enum MaxKeyInfoClass / / MaxKeyInfoClass ينبغي دائما أن يكون الماضي إنجليزي
} 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. 12 لوازم REG.EXE قيمة طول المعلمة ، وآخر 4 بايت الفاصلة (KeyInformation) تعدل عند NtQueryKey العودة. This would seem to suggest that the struct to receive the information containing the virtualization flags looks something like: ويبدو أن هذا يشير إلى أن بنية لاستقبال المعلومات التي تتضمن أعلام الافتراضية تبدو شيئا مثل :
 typedef struct _KEY_FLAGS_INFO { typedef بنية _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: طرح المشروع للجميع معا ، بعد ذلك ، لدينا شيء من هذا القبيل :
 typedef NTSYSAPI NTSTATUS (NTAPI* FuncNtQueryKey)( HANDLE KeyHandle, KEY_INFORMATION_CLASS KeyInformationClass, PVOID KeyInformation, ULONG Length, PULONG ResultLength ); typedef NTSYSAPI NTSTATUS (NTAPI * FuncNtQueryKey) (التعامل مع KeyHandle ، KEY_INFORMATION_CLASS KeyInformationClass ، PVOID KeyInformation ، ULONG الطول ، 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 ( "البرمجيات \ \ مهما") ، 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) ، & dwResultLen) ؛
RegCloseKey( hTheKey ); RegCloseKey (hTheKey) ؛
hTheKey = NULL; hTheKey = NULL ؛


The flags (_CONTROL_FLAGS, from أعلام (_CONTROL_FLAGS ، من Part 1 الجزء 1 ) are stored as a bitmask in kfi.ControlFlags. (يتم تخزين بوصفها bitmask في kfi.ControlFlags.
 typedef enum _CONTROL_FLAGS { typedef إنجليزي _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. المدونة أعلاه يوفر نفس المعلومات التي تطلبها REG.EXE الأعلام HKLM \ برامج \ مهما الاستعلام.

Again - note that this exploration was done on Windows Vista SP1. مرة أخرى -- أن يلاحظ أن هذا كان عمله على استكشاف ويندوز فيستا SP1. I would expect the content here to also apply to Windows Vista (no SP) as well as Windows Server 2008, but...Popularity: 2% أنا أتوقع أن تكون لمضمون هنا تنطبق أيضا على ويندوز فيستا (أي س) وكذلك ويندوز سيرفر 2008 ، ولكن... شعبية : 2 ٪


Written by «/\/\Ø|ö±ò\/»®©. كتبها «/ \ / \ à ~ | ¶ ر مربع كلمة المرور \ /» à ® © ر. Read more great feeds at is source اقرأ المزيد العظيم هو مصدر في يغذي WEBSITE موقع
no comments لا تعليقات . .
Read more articles on اقرأ المزيد المواد المتعلقة Sysinternals Forum Sysinternals المنتدى and و registry virtualization سجل الافتراضية and و reg.exe flags reg.exe أعلام and و NtQueryKey NtQueryKey and و REG_KEY_DONT_VIRTUALIZE REG_KEY_DONT_VIRTUALIZE and و flags أعلام and و vista أفق and و otherSoftware otherSoftware and و REG_KEY_DONT_SILENT_FAIL REG_KEY_DONT_SILENT_FAIL and و reg ريج and و Virtualization الافتراضية . .

Related articles المواد ذات الصلة

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> . يمكنك استخدام هذه العلامات الأقسام المختلفة : <ahref="" title=""> <abbrtitle=""> <acronymtitle=""> <b><blockquotecite=""> <code><em><ط > <strike><strong>.