1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: advapi9x.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
40 //------------------------------------------------------------------------
41 // undefine the macros defined in the shlobj.h file in order to avoid
42 // warnings because of multiple defines
43 //------------------------------------------------------------------------
45 // begin obsolete Win32 API functions -->
61 // <-- end obsolete Win32 functions
69 #ifdef RegCreateKeyExW
70 #undef RegCreateKeyExW
78 #ifdef RegQueryValueExW
79 #undef RegQueryValueExW
84 #ifdef RegDeleteValueW
85 #undef RegDeleteValueW
87 #ifdef RegQueryInfoKeyW
88 #undef RegQueryInfoKeyW
91 //------------------------------------------------------------------------
92 // set the compiler directives for the function pointer we declare below
93 // if we build sal or sal will be used as static library we define extern
94 // else sal exports the function pointers from a dll and we use __declspec
95 //------------------------------------------------------------------------
97 #define ADVAPI9X_API extern
99 //------------------------------------------------------------------------
100 // declare function pointers to the appropriate shell functions
101 //------------------------------------------------------------------------
103 ADVAPI9X_API
LONG (WINAPI
* lpfnRegOpenKeyExW
) (
104 HKEY hKey
, // handle to open key
105 LPCWSTR lpSubKey
, // subkey name
106 DWORD ulOptions
, // reserved
107 REGSAM samDesired
, // security access mask
108 PHKEY phkResult
// handle to open key
111 ADVAPI9X_API
LONG (WINAPI
*lpfnRegEnumKeyExW
) (
112 HKEY hKey
, // handle to key to enumerate
113 DWORD dwIndex
, // subkey index
114 LPWSTR lpName
, // subkey name
115 LPDWORD lpcName
, // size of subkey buffer
116 LPDWORD lpReserved
, // reserved
117 LPWSTR lpClass
, // class string buffer
118 LPDWORD lpcClass
, // size of class string buffer
119 PFILETIME lpftLastWriteTime
// last write time
122 ADVAPI9X_API
LONG (WINAPI
*lpfnRegCreateKeyExW
)(
123 HKEY hKey
, // handle to open key
124 LPCWSTR lpSubKey
, // subkey name
125 DWORD Reserved
, // reserved
126 LPWSTR lpClass
, // class string
127 DWORD dwOptions
, // special options
128 REGSAM samDesired
, // desired security access
129 LPSECURITY_ATTRIBUTES lpSecurityAttributes
, // inheritance
130 PHKEY phkResult
, // key handle
131 LPDWORD lpdwDisposition
// disposition value buffer
134 ADVAPI9X_API
LONG (WINAPI
*lpfnRegDeleteKeyW
) (
135 HKEY hKey
, // handle to open key
136 LPCWSTR lpSubKey
// subkey name
139 ADVAPI9X_API
LONG (WINAPI
*lpfnRegEnumValueW
) (
140 HKEY hKey
, // handle to key to query
141 DWORD dwIndex
, // index of value to query
142 LPWSTR lpValueName
, // value buffer
143 LPDWORD lpcValueName
, // size of value buffer
144 LPDWORD lpReserved
, // reserved
145 LPDWORD lpType
, // type buffer
146 LPBYTE lpData
, // data buffer
147 LPDWORD lpcbData
// size of data buffer
150 ADVAPI9X_API
LONG (WINAPI
*lpfnRegQueryValueExW
) (
151 HKEY hKey
, // handle to key
152 LPCWSTR lpValueName
, // value name
153 LPDWORD lpReserved
, // reserved
154 LPDWORD lpType
, // type buffer
155 LPBYTE lpData
, // data buffer
156 LPDWORD lpcbData
// size of data buffer
159 ADVAPI9X_API
LONG (WINAPI
*lpfnRegSetValueExW
)(
160 HKEY hKey
, // handle to key
161 LPCWSTR lpValueName
, // value name
162 DWORD Reserved
, // reserved
163 DWORD dwType
, // value type
164 CONST BYTE
*lpData
, // value data
165 DWORD cbData
// size of value data
168 ADVAPI9X_API
LONG (WINAPI
*lpfnRegDeleteValueW
) (
169 HKEY hKey
, // handle to key
170 LPCWSTR lpValueName
// value name
173 ADVAPI9X_API
LONG (WINAPI
*lpfnRegQueryInfoKeyW
) (
174 HKEY hKey
, // handle to key to query
175 LPWSTR lpClassW
, // address of buffer for class string
176 LPDWORD lpcbClass
, // address of size of class string buffer
177 LPDWORD lpReserved
, // reserved
178 LPDWORD lpcSubKeys
, // address of buffer for number of
180 LPDWORD lpcbMaxSubKeyLen
, // address of buffer for longest subkey
182 LPDWORD lpcbMaxClassLen
, // address of buffer for longest class
184 LPDWORD lpcValues
, // address of buffer for number of value
186 LPDWORD lpcbMaxValueNameLen
, // address of buffer for longest
188 LPDWORD lpcbMaxValueLen
, // address of buffer for longest value
190 LPDWORD lpcbSecurityDescriptor
, // address of buffer for security
192 PFILETIME lpftLastWriteTime
// address of buffer for last write time
195 //------------------------------------------------------------------------
196 // redefine the above undefined macros so that the preprocessor replaces
197 // all occurrences of this macros with our function pointer
198 //------------------------------------------------------------------------
200 #define RegOpenKeyExW lpfnRegOpenKeyExW
201 #define RegEnumKeyExW lpfnRegEnumKeyExW
202 #define RegCreateKeyExW lpfnRegCreateKeyExW
203 #define RegDeleteKeyW lpfnRegDeleteKeyW
204 #define RegEnumValueW lpfnRegEnumValueW
205 #define RegQueryValueExW lpfnRegQueryValueExW
206 #define RegSetValueExW lpfnRegSetValueExW
207 #define RegDeleteValueW lpfnRegDeleteValueW
208 #define RegQueryInfoKeyW lpfnRegQueryInfoKeyW