reactos/sdk/tools/mkhive/cmi.h
Joachim Henze 4ab44d7a80 [0.4.9][MKHIVE] Fix leaks and Implement RegDeleteKeyW() to mute a compile-time-warning CORE-18031
The motivation to upgrade this host-tool is to fix a compile-time warning:
  [4890/10620] Generating boot/bootdata/...oot/bootdata/system, boot/bootdata/BCD
  Binary hive maker
->RegDeleteKeyW(0x0xcab210, '') is UNIMPLEMENTED!
  [145/10684] Generating boot/bootdata/BCD
  Binary hive maker
  Creating binary hive: /home/jhenze/Release_WorkDir/Repo/output-MinGW-i386/reactos/boot/bootdata/BCD

Thw warning was most likely introduced when we started using mkhive in the hosttools, and is triggered
by livecd.inf having a [DelReg] section.

Warning fixed by implementing RegDeleteKeyW().
It can not delete full trees yet, but we also don't need that for our mkhive-usage yet.

While touching it, do also fix some other minor glitches and leaks.

This is a PARTIAL backport of the 15 commits from 0.4.11-dev, all to mkhive from 2018-10-09 to 2018-10-20 by hbelusca.
2022-01-30 03:25:02 +01:00

58 lines
1.6 KiB
C

/*
* ReactOS kernel
* Copyright (C) 2006 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS hive maker
* FILE: tools/mkhive/cmi.h
* PURPOSE: Registry file manipulation routines
* PROGRAMMER: Hervé Poussineau
*/
#pragma once
#define VERIFY_KEY_CELL(key)
NTSTATUS
CmiInitializeHive(
IN OUT PCMHIVE Hive,
IN PCWSTR Name);
NTSTATUS
CmiCreateSecurityKey(
IN PHHIVE Hive,
IN HCELL_INDEX Cell,
IN PUCHAR Descriptor,
IN ULONG DescriptorLength);
NTSTATUS
CmiAddSubKey(
IN PCMHIVE RegistryHive,
IN HCELL_INDEX ParentKeyCellOffset,
IN PCUNICODE_STRING SubKeyName,
IN BOOLEAN VolatileKey,
OUT HCELL_INDEX *pBlockOffset);
NTSTATUS
CmiAddValueKey(
IN PCMHIVE RegistryHive,
IN PCM_KEY_NODE Parent,
IN PCUNICODE_STRING ValueName,
OUT PCM_KEY_VALUE *pValueCell,
OUT HCELL_INDEX *pValueCellOffset);