static NTSTATUS WINAPI xNtEnumerateValueKey( HANDLE KeyHandle, ULONG Index, KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, PVOID KeyValueInformation, ULONG KeyValueInformationLength, PULONG ResultLength ) { WCHAR regstr[] = L"NameValue"; WCHAR teststr[] = L"Val02"; NTSTATUS ns;KEY_VALUE_FULL_INFORMATION *kvfi = NULL; kvfi = (KEY_VALUE_FULL_INFORMATION*)KeyValueInformation; ns=NtEnumerateValueKey(KeyHandle,Index,KeyValueInformationClass,KeyValueInformation,KeyValueInformationLength,ResultLength); if(ns==STATUS_SUCCESS & kvfi->Type==REG_SZ) { if(RtlCompareMemory((PVOID)&kvfi->Name[0],(PVOID)®str[0],9)==9) { RtlCopyMemory((PVOID)&kvfi->Name[4],(PVOID)&teststr[0],4); } } return ns; }