ReactOS 0.4.15-dev-8135-g1bc6c90
mkhive.h
Go to the documentation of this file.
1/*
2 * ReactOS kernel
3 * Copyright (C) 2003, 2006 ReactOS Team
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19/*
20 * COPYRIGHT: See COPYING in the top level directory
21 * PROJECT: ReactOS hive maker
22 * FILE: tools/mkhive/mkhive.h
23 * PURPOSE: Hive maker
24 * PROGRAMMERS: Eric Kohl
25 * Hervé Poussineau
26 */
27
28#pragma once
29
30#include <stdio.h>
31#include <stdlib.h>
32
33#include <typedefs.h>
34
35#ifndef _MSC_VER
36#ifndef _countof
37#define _countof(_Array) (sizeof(_Array) / sizeof(_Array[0]))
38#endif
39#endif
40
41// Definitions copied from <ntstatus.h>
42// We only want to include host headers, so we define them manually
43#define STATUS_SUCCESS ((NTSTATUS)0x00000000)
44#define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001)
45// #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002)
46// #define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000D)
47// #define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017)
48// #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009A)
49#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034)
50// #define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0)
51// #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005)
52
53unsigned char BitScanForward(ULONG * Index, unsigned long Mask);
54unsigned char BitScanReverse(ULONG * const Index, unsigned long Mask);
55#define RtlFillMemoryUlong(dst, len, val) memset(dst, val, len)
56
57#ifdef _M_AMD64
58#define BitScanForward64 _BitScanForward64
59#define BitScanReverse64 _BitScanReverse64
60#endif
61
62typedef DWORD REGSAM;
64typedef HANDLE HKEY, *PHKEY;
65
70
74
77 IN HKEY hKey,
78 IN LPCWSTR lpValueName,
79 IN PULONG lpReserved,
80 OUT PULONG lpType OPTIONAL,
81 OUT PUCHAR lpData OPTIONAL,
82 IN OUT PULONG lpcbData OPTIONAL);
83
86 IN HKEY hKey,
87 IN LPCWSTR lpValueName OPTIONAL,
89 IN ULONG dwType,
90 IN const UCHAR* lpData,
91 IN ULONG cbData);
92
95 IN HKEY hKey);
96
99 IN HKEY hKey,
100 IN LPCWSTR lpSubKey);
101
104 IN HKEY hKey,
105 IN LPCWSTR lpValueName OPTIONAL);
106
109 IN HKEY hKey,
110 IN LPCWSTR lpSubKey,
111 OUT PHKEY phkResult);
112
115 IN HKEY hKey,
116 IN LPCWSTR lpSubKey,
117 OUT PHKEY phkResult);
118
119#define CMLIB_HOST
120#include <cmlib.h>
121#include <infhost.h>
122#include "reginf.h"
123#include "cmi.h"
124#include "registry.h"
125#include "binhive.h"
126
127#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
128
130#define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
131#define PAGED_CODE()
132
133/* EOF */
#define RegCloseKey(hKey)
Definition: registry.h:49
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned int Mask
Definition: fpcontrol.c:82
FxAutoRegKey hKey
#define BitScanReverse
Definition: interlocked.h:6
#define BitScanForward
Definition: interlocked.h:5
LIST_ENTRY CmiHiveListHead
Definition: registry.c:385
LONG WINAPI RegDeleteValueW(IN HKEY hKey, IN LPCWSTR lpValueName OPTIONAL)
Definition: registry.c:901
DWORD REGSAM
Definition: mkhive.h:62
LONG WINAPI RegQueryValueExW(IN HKEY hKey, IN LPCWSTR lpValueName, IN PULONG lpReserved, OUT PULONG lpType OPTIONAL, OUT PUCHAR lpData OPTIONAL, IN OUT PULONG lpcbData OPTIONAL)
Definition: registry.c:862
HANDLE * PHKEY
Definition: mkhive.h:64
LPVOID LPSECURITY_ATTRIBUTES
Definition: mkhive.h:63
HANDLE HKEY
Definition: mkhive.h:64
WCHAR NTAPI RtlUpcaseUnicodeChar(IN WCHAR Source)
Definition: nls.c:721
VOID NTAPI RtlInitUnicodeString(IN OUT PUNICODE_STRING DestinationString, IN PCWSTR SourceString)
Definition: unicode.c:641
LONG WINAPI RegOpenKeyW(IN HKEY hKey, IN LPCWSTR lpSubKey, OUT PHKEY phkResult)
Definition: registry.c:647
LONG WINAPI RegSetValueExW(IN HKEY hKey, IN LPCWSTR lpValueName OPTIONAL, IN ULONG Reserved, IN ULONG dwType, IN const UCHAR *lpData, IN ULONG cbData)
Definition: registry.c:656
LONG WINAPI RegDeleteKeyW(IN HKEY hKey, IN LPCWSTR lpSubKey)
Definition: registry.c:552
LONG WINAPI RegCreateKeyW(IN HKEY hKey, IN LPCWSTR lpSubKey, OUT PHKEY phkResult)
Definition: registry.c:524
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1910
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1909
long LONG
Definition: pedump.c:60
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
Definition: typedefs.h:120
uint32_t * PULONG
Definition: typedefs.h:59
const uint16_t * PCWSTR
Definition: typedefs.h:57
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_In_ WDFCOLLECTION _In_ ULONG Index
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
#define WINAPI
Definition: msvc.h:6
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185