Update ooo320-m1
[ooovba.git] / sal / inc / systools / win32 / advapi9x.h
blobba11fac68da700101ae604f1d71e053caa8c2606
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: advapi9x.h,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
30 #pragma once
32 #ifndef _WINDOWS_
33 #include <windows.h>
34 #endif
36 #ifdef __cplusplus
37 extern "C"{
38 #endif
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 -->
46 #ifdef RegOpenKey
47 #undef RegOpenKey
48 #endif
49 #ifdef RegEnumKey
50 #undef RegEnumKey
51 #endif
52 #ifdef RegCreateKey
53 #undef RegCreateKey
54 #endif
55 #ifdef RegQueryValue
56 #undef RegQueryValue
57 #endif
58 #ifdef RegSetValue
59 #undef RegSetValue
60 #endif
61 // <-- end obsolete Win32 functions
63 #ifdef RegOpenKeyExW
64 #undef RegOpenKeyExW
65 #endif
66 #ifdef RegEnumKeyExW
67 #undef RegEnumKeyExW
68 #endif
69 #ifdef RegCreateKeyExW
70 #undef RegCreateKeyExW
71 #endif
72 #ifdef RegDeleteKeyW
73 #undef RegDeleteKeyW
74 #endif
75 #ifdef RegEnumValueW
76 #undef RegEnumValueW
77 #endif
78 #ifdef RegQueryValueExW
79 #undef RegQueryValueExW
80 #endif
81 #ifdef RegSetValueExW
82 #undef RegSetValueExW
83 #endif
84 #ifdef RegDeleteValueW
85 #undef RegDeleteValueW
86 #endif
87 #ifdef RegQueryInfoKeyW
88 #undef RegQueryInfoKeyW
89 #endif
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
179 // subkeys
180 LPDWORD lpcbMaxSubKeyLen, // address of buffer for longest subkey
181 // name length
182 LPDWORD lpcbMaxClassLen, // address of buffer for longest class
183 // string length
184 LPDWORD lpcValues, // address of buffer for number of value
185 // entries
186 LPDWORD lpcbMaxValueNameLen, // address of buffer for longest
187 // value name length
188 LPDWORD lpcbMaxValueLen, // address of buffer for longest value
189 // data length
190 LPDWORD lpcbSecurityDescriptor, // address of buffer for security
191 // descriptor length
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
210 #ifdef __cplusplus
212 #endif