517925a6b63f0879c15089f19e53dd3a3f1784bb
[reactos.git] / sdk / tools / mkhive / mkhive.h
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
53 unsigned char BitScanForward(ULONG * Index, unsigned long Mask);
54 unsigned 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
62 typedef DWORD REGSAM;
63 typedef LPVOID LPSECURITY_ATTRIBUTES;
64 typedef HANDLE HKEY, *PHKEY;
65
66 VOID NTAPI
67 RtlInitUnicodeString(
68 IN OUT PUNICODE_STRING DestinationString,
69 IN PCWSTR SourceString);
70 WCHAR NTAPI
71 RtlUpcaseUnicodeChar(
72 IN WCHAR Source);
73
74 LONG WINAPI
75 RegQueryValueExW(
76 IN HKEY hKey,
77 IN LPCWSTR lpValueName,
78 IN PULONG lpReserved,
79 OUT PULONG lpType OPTIONAL,
80 OUT PUCHAR lpData OPTIONAL,
81 IN OUT PULONG lpcbData OPTIONAL);
82
83 LONG WINAPI
84 RegSetValueExW(
85 IN HKEY hKey,
86 IN LPCWSTR lpValueName OPTIONAL,
87 IN ULONG Reserved,
88 IN ULONG dwType,
89 IN const UCHAR* lpData,
90 IN ULONG cbData);
91
92 LONG WINAPI
93 RegDeleteKeyW(
94 IN HKEY hKey,
95 IN LPCWSTR lpSubKey);
96
97 LONG WINAPI
98 RegDeleteValueW(
99 IN HKEY hKey,
100 IN LPCWSTR lpValueName OPTIONAL);
101
102 LONG WINAPI
103 RegCreateKeyW(
104 IN HKEY hKey,
105 IN LPCWSTR lpSubKey,
106 OUT PHKEY phkResult);
107
108 LONG WINAPI
109 RegOpenKeyW(
110 IN HKEY hKey,
111 IN LPCWSTR lpSubKey,
112 OUT PHKEY phkResult);
113
114 #define CMLIB_HOST
115 #include <cmlib.h>
116 #include <infhost.h>
117 #include "reginf.h"
118 #include "cmi.h"
119 #include "registry.h"
120 #include "binhive.h"
121
122 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
123
124 extern LIST_ENTRY CmiHiveListHead;
125 #define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
126 #define PAGED_CODE()
127
128 /* EOF */