winreg.h 8.58 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1
/*
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 * Win32 registry defines (see also winnt.h)
 *
 * Copyright (C) the Wine project
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Alexandre Julliard's avatar
Alexandre Julliard committed
19
 */
20

Alexandre Julliard's avatar
Alexandre Julliard committed
21 22 23
#ifndef __WINE_WINREG_H
#define __WINE_WINREG_H

24 25 26 27
#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */

28 29 30 31 32 33 34
#define HKEY_CLASSES_ROOT       ((HKEY) 0x80000000)
#define HKEY_CURRENT_USER       ((HKEY) 0x80000001)
#define HKEY_LOCAL_MACHINE      ((HKEY) 0x80000002)
#define HKEY_USERS              ((HKEY) 0x80000003)
#define HKEY_PERFORMANCE_DATA   ((HKEY) 0x80000004)
#define HKEY_CURRENT_CONFIG     ((HKEY) 0x80000005)
#define HKEY_DYN_DATA           ((HKEY) 0x80000006)
Alexandre Julliard's avatar
Alexandre Julliard committed
35

36 37 38
/*
 *	registry provider structs
 */
39
typedef struct value_entA
40 41 42 43 44 45 46 47 48 49 50 51 52
{   LPSTR	ve_valuename;
    DWORD	ve_valuelen;
    DWORD_PTR	ve_valueptr;
    DWORD	ve_type;
} VALENTA, *PVALENTA;

typedef struct value_entW {
    LPWSTR	ve_valuename;
    DWORD	ve_valuelen;
    DWORD_PTR	ve_valueptr;
    DWORD	ve_type;
} VALENTW, *PVALENTW;

53
typedef ACCESS_MASK REGSAM;
54

55 56 57 58 59 60 61 62 63 64 65 66
/*
 * InitiateSystemShutdown() reasons
 */
#include <reason.h>

#define REASON_OTHER            (SHTDN_REASON_MAJOR_OTHER | SHTDN_REASON_MINOR_OTHER)
#define REASON_UNKNOWN          SHTDN_REASON_UNKNOWN
#define REASON_LEGACY_API       SHTDN_REASON_LEGACY_API
#define REASON_PLANNED_FLAG     SHTDN_REASON_FLAG_PLANNED

#define MAX_SHUTDOWN_TIMEOUT    (10*365*24*60*60)

67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
/*
 * RegGetValue() restrictions
 */

#define RRF_RT_REG_NONE         (1 << 0)
#define RRF_RT_REG_SZ           (1 << 1)
#define RRF_RT_REG_EXPAND_SZ    (1 << 2)
#define RRF_RT_REG_BINARY       (1 << 3)
#define RRF_RT_REG_DWORD        (1 << 4)
#define RRF_RT_REG_MULTI_SZ     (1 << 5)
#define RRF_RT_REG_QWORD        (1 << 6)
#define RRF_RT_DWORD            (RRF_RT_REG_BINARY | RRF_RT_REG_DWORD)
#define RRF_RT_QWORD            (RRF_RT_REG_BINARY | RRF_RT_REG_QWORD)
#define RRF_NOEXPAND            (1 << 28)
#define RRF_ZEROONFAILURE       (1 << 29)
82

83 84 85 86 87 88 89 90 91
BOOL        WINAPI AbortSystemShutdownA(LPSTR);
BOOL        WINAPI AbortSystemShutdownW(LPWSTR);
#define     AbortSystemShutdown WINELIB_NAME_AW(AbortSystemShutdown)
BOOL        WINAPI InitiateSystemShutdownA(LPSTR,LPSTR,DWORD,BOOL,BOOL);
BOOL        WINAPI InitiateSystemShutdownW(LPWSTR,LPWSTR,DWORD,BOOL,BOOL);
#define     InitiateSystemShutdown WINELIB_NAME_AW(InitiateSystemShutdown);
BOOL        WINAPI InitiateSystemShutdownExA(LPSTR,LPSTR,DWORD,BOOL,BOOL,DWORD);
BOOL        WINAPI InitiateSystemShutdownExW(LPWSTR,LPWSTR,DWORD,BOOL,BOOL,DWORD);
#define     InitiateSystemShutdownEx WINELIB_NAME_AW(InitiateSystemShutdownEx);
92
LONG        WINAPI RegCreateKeyExA(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,
93
                                     LPSECURITY_ATTRIBUTES,PHKEY,LPDWORD);
94
LONG        WINAPI RegCreateKeyExW(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,
95
                                     LPSECURITY_ATTRIBUTES,PHKEY,LPDWORD);
96
#define     RegCreateKeyEx WINELIB_NAME_AW(RegCreateKeyEx)
97
LONG        WINAPI RegDisablePredefinedCache(void);
98 99
LONG        WINAPI RegSaveKeyA(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES);
LONG        WINAPI RegSaveKeyW(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES);
100
#define     RegSaveKey WINELIB_NAME_AW(RegSaveKey)
101
LONG        WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
102 103
LONG        WINAPI RegConnectRegistryA(LPCSTR,HKEY,PHKEY);
LONG        WINAPI RegConnectRegistryW(LPCWSTR,HKEY,PHKEY);
104
#define     RegConnectRegistry WINELIB_NAME_AW(RegConnectRegistry)
105
LONG        WINAPI RegEnumKeyExA(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPSTR,
106
                                   LPDWORD,LPFILETIME);
107
LONG        WINAPI RegEnumKeyExW(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR,
108 109
                                   LPDWORD,LPFILETIME);
#define     RegEnumKeyEx WINELIB_NAME_AW(RegEnumKeyEx)
110
LONG        WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,LPDWORD);
111 112 113
LONG        WINAPI RegGetValueA(HKEY,LPCSTR,LPCSTR,DWORD,LPDWORD,PVOID,LPDWORD);
LONG        WINAPI RegGetValueW(HKEY,LPCWSTR,LPCWSTR,DWORD,LPDWORD,PVOID,LPDWORD);
#define     RegGetValue WINELIB_NAME_AW(RegGetValue)
114 115
LONG        WINAPI RegLoadKeyA(HKEY,LPCSTR,LPCSTR);
LONG        WINAPI RegLoadKeyW(HKEY,LPCWSTR,LPCWSTR);
116
#define     RegLoadKey WINELIB_NAME_AW(RegLoadKey)
117 118 119
LONG        WINAPI RegLoadMUIStringA(HKEY,LPCSTR,LPSTR,DWORD,LPDWORD,DWORD,LPCSTR);
LONG        WINAPI RegLoadMUIStringW(HKEY,LPCWSTR,LPWSTR,DWORD,LPDWORD,DWORD,LPCWSTR);
#define     RegLoadMUIString WINELIB_NAME_AW(RegLoadMUIString)
120
LONG        WINAPI RegNotifyChangeKeyValue(HKEY,BOOL,DWORD,HANDLE,BOOL);
121 122 123
LONG        WINAPI RegOpenCurrentUser(REGSAM,PHKEY);
LONG        WINAPI RegOpenKeyExW(HKEY,LPCWSTR,DWORD,REGSAM,PHKEY);
LONG        WINAPI RegOpenKeyExA(HKEY,LPCSTR,DWORD,REGSAM,PHKEY);
124
#define     RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx)
125
LONG        WINAPI RegOpenUserClassesRoot(HANDLE,DWORD,REGSAM,PHKEY);
126
LONG        WINAPI RegQueryInfoKeyW(HKEY,LPWSTR,LPDWORD,LPDWORD,LPDWORD,
127 128
                                      LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
                                      LPDWORD,LPFILETIME);
129
LONG        WINAPI RegQueryInfoKeyA(HKEY,LPSTR,LPDWORD,LPDWORD,LPDWORD,
130 131 132
                                      LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
                                      LPDWORD,LPFILETIME);
#define     RegQueryInfoKey WINELIB_NAME_AW(RegQueryInfoKey)
133 134
LONG        WINAPI RegQueryMultipleValuesA(HKEY,PVALENTA,DWORD,LPSTR,LPDWORD);
LONG        WINAPI RegQueryMultipleValuesW(HKEY,PVALENTW,DWORD,LPWSTR,LPDWORD);
135
#define     RegQueryMultipleValues WINELIB_NAME_AW(RegQueryMultipleValues)
136 137
LONG        WINAPI RegReplaceKeyA(HKEY,LPCSTR,LPCSTR,LPCSTR);
LONG        WINAPI RegReplaceKeyW(HKEY,LPCWSTR,LPCWSTR,LPCWSTR);
138
#define     RegReplaceKey WINELIB_NAME_AW(RegReplaceKey)
139 140
LONG        WINAPI RegRestoreKeyA(HKEY,LPCSTR,DWORD);
LONG        WINAPI RegRestoreKeyW(HKEY,LPCWSTR,DWORD);
141
#define     RegRestoreKey WINELIB_NAME_AW(RegRestoreKey)
142 143
LONG        WINAPI RegUnLoadKeyA(HKEY,LPCSTR);
LONG        WINAPI RegUnLoadKeyW(HKEY,LPCWSTR);
144 145 146 147
#define     RegUnLoadKey WINELIB_NAME_AW(RegUnLoadKey)

/* Declarations for functions that are the same in Win16 and Win32 */

148 149
LONG        WINAPI RegCloseKey(HKEY);
LONG        WINAPI RegFlushKey(HKEY);
150

151 152
LONG        WINAPI RegCreateKeyA(HKEY,LPCSTR,PHKEY);
LONG        WINAPI RegCreateKeyW(HKEY,LPCWSTR,PHKEY);
153
#define     RegCreateKey WINELIB_NAME_AW(RegCreateKey)
154 155
LONG        WINAPI RegDeleteKeyA(HKEY,LPCSTR);
LONG        WINAPI RegDeleteKeyW(HKEY,LPCWSTR);
156
#define     RegDeleteKey WINELIB_NAME_AW(RegDeleteKey)
157 158
LONG        WINAPI RegDeleteValueA(HKEY,LPCSTR);
LONG        WINAPI RegDeleteValueW(HKEY,LPCWSTR);
159
#define     RegDeleteValue WINELIB_NAME_AW(RegDeleteValue)
160 161
LONG        WINAPI RegEnumKeyA(HKEY,DWORD,LPSTR,DWORD);
LONG        WINAPI RegEnumKeyW(HKEY,DWORD,LPWSTR,DWORD);
162
#define     RegEnumKey WINELIB_NAME_AW(RegEnumKey)
163 164
LONG        WINAPI RegEnumValueA(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
LONG        WINAPI RegEnumValueW(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
165
#define     RegEnumValue WINELIB_NAME_AW(RegEnumValue)
166 167
LONG        WINAPI RegOpenKeyA(HKEY,LPCSTR,PHKEY);
LONG        WINAPI RegOpenKeyW(HKEY,LPCWSTR,PHKEY);
168
#define     RegOpenKey WINELIB_NAME_AW(RegOpenKey)
169 170
LONG        WINAPI RegQueryValueA(HKEY,LPCSTR,LPSTR,LPLONG);
LONG        WINAPI RegQueryValueW(HKEY,LPCWSTR,LPWSTR,LPLONG);
171
#define     RegQueryValue WINELIB_NAME_AW(RegQueryValue)
172 173
LONG        WINAPI RegQueryValueExA(HKEY,LPCSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
LONG        WINAPI RegQueryValueExW(HKEY,LPCWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
174
#define     RegQueryValueEx WINELIB_NAME_AW(RegQueryValueEx)
175 176
LONG        WINAPI RegSetValueA(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
LONG        WINAPI RegSetValueW(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD);
177
#define     RegSetValue WINELIB_NAME_AW(RegSetValue)
178 179
LONG        WINAPI RegSetValueExA(HKEY,LPCSTR,DWORD,DWORD,CONST BYTE*,DWORD);
LONG        WINAPI RegSetValueExW(HKEY,LPCWSTR,DWORD,DWORD,CONST BYTE*,DWORD);
180 181
#define     RegSetValueEx WINELIB_NAME_AW(RegSetValueEx)

182 183 184 185
#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */

Alexandre Julliard's avatar
Alexandre Julliard committed
186
#endif  /* __WINE_WINREG_H */