Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 49 of file binhive.c.
Referenced by RegImportSubKey().
{ PVOID DataCell; PWCHAR wName; LONG Error; ULONG DataLength; ULONG i; if (ValueCell->Signature != CM_KEY_VALUE_SIGNATURE) { ERR("Invalid key cell!\n"); return FALSE; } if (ValueCell->Flags & VALUE_COMP_NAME) { wName = MmHeapAlloc ((ValueCell->NameLength + 1)*sizeof(WCHAR)); for (i = 0; i < ValueCell->NameLength; i++) { wName[i] = ((PCHAR)ValueCell->Name)[i]; } wName[ValueCell->NameLength] = 0; } else { wName = MmHeapAlloc (ValueCell->NameLength + sizeof(WCHAR)); memcpy (wName, ValueCell->Name, ValueCell->NameLength); wName[ValueCell->NameLength / sizeof(WCHAR)] = 0; } DataLength = ValueCell->DataLength & REG_DATA_SIZE_MASK; TRACE("ValueName: '%S'\n", wName); TRACE("DataLength: %u\n", DataLength); if (DataLength <= sizeof(HCELL_INDEX) && (ValueCell->DataLength & REG_DATA_IN_OFFSET)) { Error = RegSetValue(Key, wName, ValueCell->Type, (PCHAR)&ValueCell->Data, DataLength); if (Error != ERROR_SUCCESS) { ERR("RegSetValue() failed!\n"); MmHeapFree (wName); return FALSE; } } else { DataCell = (PVOID)HvGetCell (Hive, ValueCell->Data); TRACE("DataCell: %x\n", DataCell); Error = RegSetValue (Key, wName, ValueCell->Type, DataCell, DataLength); if (Error != ERROR_SUCCESS) { ERR("RegSetValue() failed!\n"); MmHeapFree (wName); return FALSE; } } MmHeapFree (wName); return TRUE; }