Changed pidl structure to match the pidl's used in lnk-files.
[wine] / include / winreg.h
1 /*
2  *                              Shell Library definitions
3  */
4 #ifndef __WINE_WINREG_H
5 #define __WINE_WINREG_H
6
7 #include "winbase.h"
8 #include "winnt.h"
9
10 /*
11 #define SHELL_ERROR_SUCCESS           0L
12 #define SHELL_ERROR_BADDB             1L
13 #define SHELL_ERROR_BADKEY            2L
14 #define SHELL_ERROR_CANTOPEN          3L
15 #define SHELL_ERROR_CANTREAD          4L
16 #define SHELL_ERROR_CANTWRITE         5L
17 #define SHELL_ERROR_OUTOFMEMORY       6L
18 #define SHELL_ERROR_INVALID_PARAMETER 7L
19 #define SHELL_ERROR_ACCESS_DENIED     8L
20 */
21
22 #define REG_NONE                0       /* no type */
23 #define REG_SZ                  1       /* string type (ASCII) */
24 #define REG_EXPAND_SZ           2       /* string, includes %ENVVAR% (expanded by caller) (ASCII) */
25 #define REG_BINARY              3       /* binary format, callerspecific */
26 /* YES, REG_DWORD == REG_DWORD_LITTLE_ENDIAN */
27 #define REG_DWORD               4       /* DWORD in little endian format */
28 #define REG_DWORD_LITTLE_ENDIAN 4       /* DWORD in little endian format */
29 #define REG_DWORD_BIG_ENDIAN    5       /* DWORD in big endian format  */
30 #define REG_LINK                6       /* symbolic link (UNICODE) */
31 #define REG_MULTI_SZ            7       /* multiple strings, delimited by \0, terminated by \0\0 (ASCII) */
32 #define REG_RESOURCE_LIST       8       /* resource list? huh? */
33 #define REG_FULL_RESOURCE_DESCRIPTOR    9       /* full resource descriptor? huh? */
34
35 #define HKEY_CLASSES_ROOT       0x80000000
36 #define HKEY_CURRENT_USER       0x80000001
37 #define HKEY_LOCAL_MACHINE      0x80000002
38 #define HKEY_USERS              0x80000003
39 #define HKEY_PERFORMANCE_DATA   0x80000004
40 #define HKEY_CURRENT_CONFIG     0x80000005
41 #define HKEY_DYN_DATA           0x80000006
42
43 #define REG_OPTION_RESERVED             0x00000000
44 #define REG_OPTION_NON_VOLATILE         0x00000000
45 #define REG_OPTION_VOLATILE             0x00000001
46 #define REG_OPTION_CREATE_LINK          0x00000002
47 #define REG_OPTION_BACKUP_RESTORE       0x00000004 /* FIXME */
48 #define REG_OPTION_TAINTED              0x80000000 /* Internal? */
49
50 #define REG_CREATED_NEW_KEY     0x00000001
51 #define REG_OPENED_EXISTING_KEY 0x00000002
52
53 /* For RegNotifyChangeKeyValue */
54 #define REG_NOTIFY_CHANGE_NAME  0x1
55
56 #define KEY_QUERY_VALUE         0x00000001
57 #define KEY_SET_VALUE           0x00000002
58 #define KEY_CREATE_SUB_KEY      0x00000004
59 #define KEY_ENUMERATE_SUB_KEYS  0x00000008
60 #define KEY_NOTIFY              0x00000010
61 #define KEY_CREATE_LINK         0x00000020
62
63 #define KEY_READ                (STANDARD_RIGHTS_READ|  \
64                                  KEY_QUERY_VALUE|       \
65                                  KEY_ENUMERATE_SUB_KEYS|\
66                                  KEY_NOTIFY             \
67                                 )
68 #define KEY_WRITE               (STANDARD_RIGHTS_WRITE| \
69                                  KEY_SET_VALUE|         \
70                                  KEY_CREATE_SUB_KEY     \
71                                 )
72 #define KEY_EXECUTE             KEY_READ
73 #define KEY_ALL_ACCESS          (STANDARD_RIGHTS_ALL|   \
74                                  KEY_READ|KEY_WRITE|    \
75                                  KEY_CREATE_LINK        \
76                                 )
77
78 /* fixme: move it to basetsd.h */
79 typedef ULONG_PTR DWORD_PTR, *PDWORD_PTR;
80 /* end fixme */
81
82 /*
83  *      registry provider structs
84  */
85 typedef struct value_entA 
86 {   LPSTR       ve_valuename;
87     DWORD       ve_valuelen;
88     DWORD_PTR   ve_valueptr;
89     DWORD       ve_type;
90 } VALENTA, *PVALENTA;
91
92 typedef struct value_entW {
93     LPWSTR      ve_valuename;
94     DWORD       ve_valuelen;
95     DWORD_PTR   ve_valueptr;
96     DWORD       ve_type;
97 } VALENTW, *PVALENTW;
98
99
100 /* Used by: ControlService */
101 typedef struct _SERVICE_STATUS {
102     DWORD dwServiceType;
103     DWORD dwCurrentState;
104     DWORD dwControlsAccepted;
105     DWORD dwWin32ExitCode;
106     DWORD dwServiceSpecificExitCode;
107     DWORD dwCheckPoint;
108     DWORD dwWaitHint;
109 } SERVICE_STATUS, *LPSERVICE_STATUS;
110
111 HANDLE32    WINAPI OpenSCManager32A(LPCSTR,LPCSTR,DWORD);
112 HANDLE32    WINAPI OpenSCManager32W(LPCWSTR,LPCWSTR,DWORD);
113 #define     OpenSCManager WINELIB_NAME_AW(OpenSCManager)
114 HANDLE32    WINAPI OpenService32A(HANDLE32,LPCSTR,DWORD);
115 HANDLE32    WINAPI OpenService32W(HANDLE32,LPCWSTR,DWORD);
116 #define     OpenService WINELIB_NAME_AW(OpenService)
117 BOOL32      WINAPI LookupPrivilegeValue32A(LPCSTR,LPCSTR,LPVOID);
118 BOOL32      WINAPI LookupPrivilegeValue32W(LPCWSTR,LPCWSTR,LPVOID);
119 #define     LookupPrivilegeValue WINELIB_NAME_AW(LookupPrivilegeValue)
120 HANDLE32    WINAPI RegisterEventSource32A(LPCSTR,LPCSTR);
121 HANDLE32    WINAPI RegisterEventSource32W(LPCWSTR,LPCWSTR);
122 #define     RegisterEventSource WINELIB_NAME_AW(RegisterEventSource)
123 DWORD       WINAPI RegCreateKeyEx32A(HKEY,LPCSTR,DWORD,LPSTR,DWORD,REGSAM,
124                                      LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
125 DWORD       WINAPI RegCreateKeyEx32W(HKEY,LPCWSTR,DWORD,LPWSTR,DWORD,REGSAM,
126                                      LPSECURITY_ATTRIBUTES,LPHKEY,LPDWORD);
127 #define     RegCreateKeyEx WINELIB_NAME_AW(RegCreateKeyEx)
128 LONG        WINAPI RegSaveKey32A(HKEY,LPCSTR,LPSECURITY_ATTRIBUTES);
129 LONG        WINAPI RegSaveKey32W(HKEY,LPCWSTR,LPSECURITY_ATTRIBUTES);
130 #define     RegSaveKey WINELIB_NAME_AW(RegSaveKey)
131 LONG        WINAPI RegSetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
132 BOOL32      WINAPI CloseServiceHandle(HANDLE32);
133 BOOL32      WINAPI ControlService(HANDLE32,DWORD,LPSERVICE_STATUS);
134 BOOL32      WINAPI DeleteService(HANDLE32);
135 BOOL32      WINAPI DeregisterEventSource(HANDLE32);
136 BOOL32      WINAPI GetFileSecurity32A(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
137 BOOL32      WINAPI GetFileSecurity32W(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,DWORD,LPDWORD);
138 #define     GetFileSecurity WINELIB_NAME_AW(GetFileSecurity)
139 BOOL32      WINAPI GetUserName32A(LPSTR,LPDWORD);
140 BOOL32      WINAPI GetUserName32W(LPWSTR,LPDWORD);
141 #define     GetUserName WINELIB_NAME_AW(GetUserName)
142 BOOL32      WINAPI OpenProcessToken(HANDLE32,DWORD,HANDLE32*);
143 LONG        WINAPI RegConnectRegistry32A(LPCSTR,HKEY,LPHKEY);
144 LONG        WINAPI RegConnectRegistry32W(LPCWSTR,HKEY,LPHKEY);
145 #define     RegConnectRegistry WINELIB_NAME_AW(RegConnectRegistry)
146 DWORD       WINAPI RegEnumKeyEx32A(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPSTR,
147                                    LPDWORD,LPFILETIME);
148 DWORD       WINAPI RegEnumKeyEx32W(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPWSTR,
149                                    LPDWORD,LPFILETIME);
150 #define     RegEnumKeyEx WINELIB_NAME_AW(RegEnumKeyEx)
151 LONG        WINAPI RegGetKeySecurity(HKEY,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR,LPDWORD);
152 LONG        WINAPI RegLoadKey32A(HKEY,LPCSTR,LPCSTR);
153 LONG        WINAPI RegLoadKey32W(HKEY,LPCWSTR,LPCWSTR);
154 #define     RegLoadKey WINELIB_NAME_AW(RegLoadKey)
155 LONG        WINAPI RegNotifyChangeKeyValue(HKEY,BOOL32,DWORD,HANDLE32,BOOL32);
156 DWORD       WINAPI RegOpenKeyEx32W(HKEY,LPCWSTR,DWORD,REGSAM,LPHKEY);
157 DWORD       WINAPI RegOpenKeyEx32A(HKEY,LPCSTR,DWORD,REGSAM,LPHKEY);
158 #define     RegOpenKeyEx WINELIB_NAME_AW(RegOpenKeyEx)
159 DWORD       WINAPI RegQueryInfoKey32W(HKEY,LPWSTR,LPDWORD,LPDWORD,LPDWORD,
160                                       LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
161                                       LPDWORD,LPFILETIME);
162 DWORD       WINAPI RegQueryInfoKey32A(HKEY,LPSTR,LPDWORD,LPDWORD,LPDWORD,
163                                       LPDWORD,LPDWORD,LPDWORD,LPDWORD,LPDWORD,
164                                       LPDWORD,LPFILETIME);
165 #define     RegQueryInfoKey WINELIB_NAME_AW(RegQueryInfoKey)
166 LONG        WINAPI RegReplaceKey32A(HKEY,LPCSTR,LPCSTR,LPCSTR);
167 LONG        WINAPI RegReplaceKey32W(HKEY,LPCWSTR,LPCWSTR,LPCWSTR);
168 #define     RegReplaceKey WINELIB_NAME_AW(RegReplaceKey)
169 LONG        WINAPI RegRestoreKey32A(HKEY,LPCSTR,DWORD);
170 LONG        WINAPI RegRestoreKey32W(HKEY,LPCWSTR,DWORD);
171 #define     RegRestoreKey WINELIB_NAME_AW(RegRestoreKey)
172 LONG        WINAPI RegUnLoadKey32A(HKEY,LPCSTR);
173 LONG        WINAPI RegUnLoadKey32W(HKEY,LPCWSTR);
174 #define     RegUnLoadKey WINELIB_NAME_AW(RegUnLoadKey)
175 BOOL32      WINAPI SetFileSecurity32A(LPCSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
176 BOOL32      WINAPI SetFileSecurity32W(LPCWSTR,SECURITY_INFORMATION,PSECURITY_DESCRIPTOR);
177 #define     SetFileSecurity WINELIB_NAME_AW(SetFileSecurity)
178 BOOL32      WINAPI StartService32A(HANDLE32,DWORD,LPCSTR*);
179 BOOL32      WINAPI StartService32W(HANDLE32,DWORD,LPCWSTR*);
180 #define     StartService WINELIB_NAME_AW(StartService)
181
182 /* Declarations for functions that are the same in Win16 and Win32 */
183
184 DWORD       WINAPI RegCloseKey(HKEY);
185 DWORD       WINAPI RegFlushKey(HKEY);
186
187 DWORD       WINAPI RegCreateKey32A(HKEY,LPCSTR,LPHKEY);
188 DWORD       WINAPI RegCreateKey32W(HKEY,LPCWSTR,LPHKEY);
189 #define     RegCreateKey WINELIB_NAME_AW(RegCreateKey)
190 DWORD       WINAPI RegDeleteKey32A(HKEY,LPCSTR);
191 DWORD       WINAPI RegDeleteKey32W(HKEY,LPWSTR);
192 #define     RegDeleteKey WINELIB_NAME_AW(RegDeleteKey)
193 DWORD       WINAPI RegDeleteValue32A(HKEY,LPSTR);
194 DWORD       WINAPI RegDeleteValue32W(HKEY,LPWSTR);
195 #define     RegDeleteValue WINELIB_NAME_AW(RegDeleteValue)
196 DWORD       WINAPI RegEnumKey32A(HKEY,DWORD,LPSTR,DWORD);
197 DWORD       WINAPI RegEnumKey32W(HKEY,DWORD,LPWSTR,DWORD);
198 #define     RegEnumKey WINELIB_NAME_AW(RegEnumKey)
199 DWORD       WINAPI RegEnumValue32A(HKEY,DWORD,LPSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
200 DWORD       WINAPI RegEnumValue32W(HKEY,DWORD,LPWSTR,LPDWORD,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
201 #define     RegEnumValue WINELIB_NAME_AW(RegEnumValue)
202 DWORD       WINAPI RegOpenKey32A(HKEY,LPCSTR,LPHKEY);
203 DWORD       WINAPI RegOpenKey32W(HKEY,LPCWSTR,LPHKEY);
204 #define     RegOpenKey WINELIB_NAME_AW(RegOpenKey)
205 DWORD       WINAPI RegQueryValue32A(HKEY,LPSTR,LPSTR,LPDWORD);
206 DWORD       WINAPI RegQueryValue32W(HKEY,LPWSTR,LPWSTR,LPDWORD);
207 #define     RegQueryValue WINELIB_NAME_AW(RegQueryValue)
208 DWORD       WINAPI RegQueryValueEx32A(HKEY,LPSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
209 DWORD       WINAPI RegQueryValueEx32W(HKEY,LPWSTR,LPDWORD,LPDWORD,LPBYTE,LPDWORD);
210 #define     RegQueryValueEx WINELIB_NAME_AW(RegQueryValueEx)
211 DWORD       WINAPI RegSetValue32A(HKEY,LPCSTR,DWORD,LPCSTR,DWORD);
212 DWORD       WINAPI RegSetValue32W(HKEY,LPCWSTR,DWORD,LPCWSTR,DWORD);
213 #define     RegSetValue WINELIB_NAME_AW(RegSetValue)
214 DWORD       WINAPI RegSetValueEx32A(HKEY,LPSTR,DWORD,DWORD,LPBYTE,DWORD);
215 DWORD       WINAPI RegSetValueEx32W(HKEY,LPWSTR,DWORD,DWORD,LPBYTE,DWORD);
216 #define     RegSetValueEx WINELIB_NAME_AW(RegSetValueEx)
217
218 #endif  /* __WINE_WINREG_H */