Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers...
[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 * PROGRAMMER: 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 // Definitions copied from <ntstatus.h>
36 // We only want to include host headers, so we define them manually
37 #define STATUS_SUCCESS ((NTSTATUS)0x00000000)
38 #define STATUS_UNSUCCESSFUL ((NTSTATUS)0xC0000001)
39 #define STATUS_NOT_IMPLEMENTED ((NTSTATUS)0xC0000002)
40 #define STATUS_INVALID_PARAMETER ((NTSTATUS)0xC000000D)
41 #define STATUS_NO_MEMORY ((NTSTATUS)0xC0000017)
42 #define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009A)
43 #define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034)
44 #define STATUS_INVALID_PARAMETER_2 ((NTSTATUS)0xC00000F0)
45 #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005)
46
47 unsigned char BitScanForward(ULONG * Index, unsigned long Mask);
48 unsigned char BitScanReverse(ULONG * const Index, unsigned long Mask);
49 #define RtlFillMemoryUlong(dst, len, val) memset(dst, val, len)
50
51 #ifdef _M_AMD64
52 #define BitScanForward64 _BitScanForward64
53 #define BitScanReverse64 _BitScanReverse64
54 #endif
55
56 typedef DWORD REGSAM;
57 typedef LPVOID LPSECURITY_ATTRIBUTES;
58 typedef HANDLE HKEY, *PHKEY;
59
60 VOID NTAPI
61 RtlInitUnicodeString(
62 IN OUT PUNICODE_STRING DestinationString,
63 IN PCWSTR SourceString);
64 WCHAR NTAPI
65 RtlUpcaseUnicodeChar(
66 IN WCHAR Source);
67
68 LONG WINAPI
69 RegQueryValueExW(
70 IN HKEY hKey,
71 IN LPCWSTR lpValueName,
72 IN PULONG lpReserved,
73 OUT PULONG lpType OPTIONAL,
74 OUT PUCHAR lpData OPTIONAL,
75 IN OUT PULONG lpcbData OPTIONAL);
76
77 LONG WINAPI
78 RegSetValueExW(
79 IN HKEY hKey,
80 IN LPCWSTR lpValueName OPTIONAL,
81 IN ULONG Reserved,
82 IN ULONG dwType,
83 IN const UCHAR* lpData,
84 IN ULONG cbData);
85
86 LONG WINAPI
87 RegDeleteKeyW(
88 IN HKEY hKey,
89 IN LPCWSTR lpSubKey);
90
91 LONG WINAPI
92 RegDeleteValueW(
93 IN HKEY hKey,
94 IN LPCWSTR lpValueName OPTIONAL);
95
96 LONG WINAPI
97 RegCreateKeyW(
98 IN HKEY hKey,
99 IN LPCWSTR lpSubKey,
100 OUT PHKEY phkResult);
101
102 LONG WINAPI
103 RegOpenKeyW(
104 IN HKEY hKey,
105 IN LPCWSTR lpSubKey,
106 OUT PHKEY phkResult);
107
108 #define CMLIB_HOST
109 #include <cmlib.h>
110 #include <infhost.h>
111 #include "reginf.h"
112 #include "cmi.h"
113 #include "registry.h"
114 #include "binhive.h"
115
116 #define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\')
117
118 extern LIST_ENTRY CmiHiveListHead;
119 #define ABS_VALUE(V) (((V) < 0) ? -(V) : (V))
120 #define PAGED_CODE()
121
122 /* EOF */