
我很想知道如何将Keyinformationparameter passing给NtEnumerateKey() 。 当我运行下面的代码时, NtEnumerateKey()返回NTSTATUS = 0xC000000D错误消息“一个无效的parameter passing给服务或函数”。
我正在使用windows 7.尽pipe下面的代码使用了Delphi语言,但您也可以用C语言来回答我的问题。 我的问题不是特定于编程语言。
type KEY_name_informatION = record nameLength: ulONG; name: array[0..254] of WCHAR; end; PKEY_name_informatION = ^KEY_name_informatION; var iNtStatus: LONG; hKeyResult: THandle; KeynameInfo: KEY_name_informatION; iResultLen: ulONG; iNtStatus := NtopenKey(@hKeyResult,(KEY_ENUMERATE_SUB_KEYS) and not SYNCHRONIZE,@rObjAttrs); if hKeyResult = 0 then Exit; iNtStatus := NtEnumerateKey(hKeyResult,Keynameinformation,@KeynameInfo,// I'm asking about this parameter,SizeOf(KEY_name_informatION),// and also this parameter @iResultLen);
更新:奇怪的事情
如果我传递KeyBasicinformation而不是Keynameinformation ,则NtEnumerateKey()将返回STATUS_SUCCESS 。 不是NtEnumerateKey()是否支持Keynameinformation ?
type KEY_BASIC_informatION = record LastWriteTime: LARGE_INTEGER; TitleIndex: ulONG; nameLength: ulONG; name: array[0..254] of WCHAR; end; PKEY_BASIC_informatION = ^KEY_BASIC_informatION; var KeyBasicInfo: KEY_BASIC_informatION; iNtStatus := NtEnumerateKey(hKeyResult,KeyBasicinformation,// Note this! @KeyBasicInfo,// Note this! SizeOf(KEY_BASIC_informatION),// Note this! @iResultLen);
以root身份运行程序时出现奇怪的结果
当程序存在exception时,fwrite()缓冲区中的数据是否会被刷新?
为什么Visual Studio 2010中的ssize_t被定义为无符号?
为什么subprocess和父进程variables的地址是一样的
GDI +双缓冲:backbuffer双色单色
使用C使用strftime()获取缩写的时区
如何从C执行一个命令并终止它
windows本机开发:deBUGgee尝试从system32加载werkernel.sys
embedded式Web控件(IWebbrowser2),embedded式JavaScript的onkeydown和onkeyup不会触发
windows上的微秒分辨率时间戳
如果你看看Zw(Nt for usermode)EnumerateKey的文档,你会看到
NTSTATUS ZwEnumerateKey( _In_ HANDLE KeyHandle,_In_ ulONG Index,_In_ KEY_informatION_CLASS KeyinformationClass,_Out_opt_ PVOID Keyinformation,_In_ ulONG Length,_Out_ PulONG ResultLength );
然后,如果你低头看看KeyinformationClass,你会看到
KeyinformationClass [in] SpecifIEs a KEY_informatION_CLASS enumeration value that determines the type of information to be received by the Keyinformation buffer. Set KeyinformationClass to one of the following values: KeyBasicinformation KeyFullinformation KeyNodeinformation If any value not in this List is specifIEd,the routine returns error code STATUS_INVALID_ParaMETER.
你需要使用其中的3个
总结以上是内存溢出为你收集整理的NtEnumerateKey()的KeyInformation参数全部内容,希望文章能够帮你解决NtEnumerateKey()的KeyInformation参数所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)