merge the formfield patch from ooo-build
[ooovba.git] / sal / inc / systools / win32 / kernel9x.h
blobf191fe7fcd16dba5daace2db2e8373e4b4d80b5a
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: kernel9x.h,v $
10 * $Revision: 1.14 $
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 ************************************************************************/
31 #pragma once
33 #ifndef _WINDOWS_
34 #include <windows.h>
35 #endif
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
41 //------------------------------------------------------------------------
42 // undefine the macros defined in the winbase.h file in order to avoid
43 // warnings because of multiple defines
44 //------------------------------------------------------------------------
46 #ifdef LoadLibraryW
47 #undef LoadLibraryW
48 #endif
50 #ifdef LoadLibraryExW
51 #undef LoadLibraryExW
52 #endif
54 #ifdef GetModuleFileNameW
55 #undef GetModuleFileNameW
56 #endif
58 #ifdef GetLogicalDriveStringsW
59 #undef GetLogicalDriveStringsW
60 #endif
62 #ifdef DeleteFileW
63 #undef DeleteFileW
64 #endif
66 #ifdef CopyFileW
67 #undef CopyFileW
68 #endif
70 #ifdef MoveFileW
71 #undef MoveFileW
72 #endif
74 #ifdef MoveFileExW
75 #undef MoveFileExW
76 #endif
78 #ifdef CreateFileW
79 #undef CreateFileW
80 #endif
82 #ifdef RemoveDirectoryW
83 #undef RemoveDirectoryW
84 #endif
86 #ifdef CreateDirectoryW
87 #undef CreateDirectoryW
88 #endif
90 #ifdef CreateDirectoryExW
91 #undef CreateDirectoryExW
92 #endif
94 #ifdef CreateFileW
95 #undef CreateFileW
96 #endif
98 #ifdef GetLongPathNameW
99 #undef GetLongPathNameW
100 #endif
102 #ifdef GetLocaleInfoW
103 #undef GetLocaleInfoW
104 #endif
106 #ifdef GetFullPathNameW
107 #undef GetFullPathNameW
108 #endif
110 #ifdef CreateProcessW
111 #undef CreateProcessW
112 #endif
114 #ifdef CreateProcessAsUserW
115 #undef CreateProcessAsUserW
116 #endif
118 #ifdef GetEnvironmentVariableW
119 #undef GetEnvironmentVariableW
120 #endif
122 #ifdef GetDriveTypeW
123 #undef GetDriveTypeW
124 #endif
126 #ifdef GetCurrentDirectoryW
127 #undef GetCurrentDirectoryW
128 #endif
130 #ifdef SetCurrentDirectoryW
131 #undef SetCurrentDirectoryW
132 #endif
134 #ifdef GetVolumeInformationW
135 #undef GetVolumeInformationW
136 #endif
139 #ifdef GetDiskFreeSpaceExA
140 #undef GetDiskFreeSpaceExA
141 #endif
143 #ifdef GetDiskFreeSpaceExW
144 #undef GetDiskFreeSpaceExW
145 #endif
147 //------------------------------------------------------------------------
148 // set the compiler directives for the function pointer we declare below
149 // if we build sal or sal will be used as static library we define extern
150 // else sal exports the function pointers from a dll and we use __declspec
151 //------------------------------------------------------------------------
153 #define KERNEL9X_API extern
155 //------------------------------------------------------------------------
156 // declare function pointers to the appropriate kernel functions
157 //------------------------------------------------------------------------
159 //BOOL WINAPI RegisterServiceProcess( DWORD dwProcessID, BOOL fRegister );
161 KERNEL9X_API HMODULE (WINAPI *lpfnLoadLibraryExW ) (
162 LPCWSTR lpLibFileName, // file name of module
163 HANDLE hFile, // reserved, must be NULL
164 DWORD dwFlags // entry-point execution option
167 KERNEL9X_API DWORD (WINAPI *lpfnGetModuleFileNameW ) (
168 HMODULE hModule, // handle to module
169 LPWSTR lpFilename, // file name of module
170 DWORD nSize // size of buffer
173 KERNEL9X_API DWORD (WINAPI *lpfnGetLogicalDriveStringsW ) (
174 DWORD nBufferLength, // size of buffer
175 LPWSTR lpBuffer // drive strings buffer
178 KERNEL9X_API HANDLE ( WINAPI *lpfnCreateFileW )(
179 LPCWSTR lpFileName,
180 DWORD dwDesiredAccess,
181 DWORD dwShareMode,
182 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
183 DWORD dwCreationDisposition,
184 DWORD dwFlagsAndAttributes,
185 HANDLE hTemplateFile
188 KERNEL9X_API DWORD WINAPI GetCanonicalPathNameA(
189 LPCSTR lpszPath, // file name
190 LPSTR lpszCanonicalPath, // path buffer
191 DWORD cchBuffer // size of path buffer
194 KERNEL9X_API DWORD WINAPI GetCanonicalPathNameW(
195 LPCWSTR lpszPath, // file name
196 LPWSTR lpszCanonicalPath, // path buffer
197 DWORD cchBuffer // size of path buffer
200 KERNEL9X_API HANDLE ( WINAPI * lpfnCreateFileW ) (
201 LPCWSTR lpFileName,
202 DWORD dwDesiredAccess,
203 DWORD dwShareMode,
204 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
205 DWORD dwCreationDisposition,
206 DWORD dwFlagsAndAttributes,
207 HANDLE hTemplateFile );
209 KERNEL9X_API BOOL (WINAPI *lpfnDeleteFileW ) (
210 LPCWSTR lpFileName // file name
213 KERNEL9X_API BOOL (WINAPI *lpfnCopyFileW ) (
214 LPCWSTR lpExistingFileName, // file name
215 LPCWSTR lpNewFileName, // new file name
216 BOOL bFailIfExist // operation if file exists
219 KERNEL9X_API BOOL (WINAPI *lpfnMoveFileW ) (
220 LPCWSTR lpExistingFileName, // file name
221 LPCWSTR lpNewFileName // new file name
224 KERNEL9X_API BOOL (WINAPI *lpfnMoveFileExW ) (
225 LPCWSTR lpExistingFileName, // file name
226 LPCWSTR lpNewFileName, // new file name
227 DWORD dwFlags // move options
230 KERNEL9X_API BOOL (WINAPI *lpfnRemoveDirectoryW ) (
231 LPCWSTR lpPathName // directory name
234 KERNEL9X_API BOOL ( WINAPI * lpfnCreateDirectoryW ) (
235 LPCWSTR lpNewDirectory, LPSECURITY_ATTRIBUTES lpSecurityAttributes );
237 KERNEL9X_API BOOL ( WINAPI * lpfnCreateDirectoryExW ) (
238 LPCWSTR lpTemplateDirectory,
239 LPCWSTR lpNewDirectory,
240 LPSECURITY_ATTRIBUTES lpSecurityAttributes );
242 KERNEL9X_API DWORD ( WINAPI * lpfnGetLongPathNameW ) (
243 LPCWSTR lpszShortPath, // file name
244 LPWSTR lpszLongPath, // path buffer
245 DWORD cchBuffer // size of path buffer
248 // GetCanonicalPath is a tool function with no exact counterpart
249 // in the win32 api; we use nevertheless a function pointer
250 // because every variable etc. must root in the Kernel9x.lib else
251 // we loose our AutoSystoolInit object during linking
252 KERNEL9X_API DWORD ( WINAPI * lpfnGetCanonicalPathW ) (
253 LPCWSTR lpszPath, // file name
254 LPWSTR lpszCanonicalPath, // path buffer
255 DWORD cchBuffer // size of path buffer
258 KERNEL9X_API int ( WINAPI* lpfnGetLocaleInfoW ) (
259 LCID Locale, // locale identifier
260 LCTYPE LCType, // information type
261 LPWSTR lpLCData, // information buffer
262 int cchData // size of buffer
265 KERNEL9X_API DWORD ( WINAPI * lpfnGetFullPathNameW )(
266 LPCWSTR lpFileName, // file name
267 DWORD nBufferLength, // size of path buffer
268 LPWSTR lpBuffer, // path buffer
269 LPWSTR *lpFilePart // address of file name in path
272 KERNEL9X_API BOOL ( WINAPI * lpfnCreateProcessW )(
273 LPCWSTR lpApplicationName, // name of executable module
274 LPWSTR lpCommandLine, // command line string
275 LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
276 LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
277 BOOL bInheritHandles, // handle inheritance option
278 DWORD dwCreationFlags, // creation flags
279 LPVOID lpEnvironment, // new environment block
280 LPCWSTR lpCurrentDirectory, // current directory name
281 LPSTARTUPINFOW lpStartupInfo, // startup information
282 LPPROCESS_INFORMATION lpProcessInformation // process information
285 KERNEL9X_API BOOL ( WINAPI * lpfnCreateProcessAsUserW )(
286 HANDLE hToken, // handle to user token
287 LPCWSTR lpApplicationName, // name of executable module
288 LPWSTR lpCommandLine, // command-line string
289 LPSECURITY_ATTRIBUTES lpProcessAttributes, // SD
290 LPSECURITY_ATTRIBUTES lpThreadAttributes, // SD
291 BOOL bInheritHandles, // inheritance option
292 DWORD dwCreationFlags, // creation flags
293 LPVOID lpEnvironment, // new environment block
294 LPCWSTR lpCurrentDirectory, // current directory name
295 LPSTARTUPINFOW lpStartupInfo, // startup information
296 LPPROCESS_INFORMATION lpProcessInformation // process information
299 KERNEL9X_API DWORD ( WINAPI * lpfnGetEnvironmentVariableW )(
300 LPCWSTR lpName, // environment variable name
301 LPWSTR lpBuffer, // buffer for variable value
302 DWORD nSize // size of buffer
306 KERNEL9X_API UINT ( WINAPI * lpfnGetDriveTypeW )(
307 LPCWSTR lpRootPathName // root directory
310 KERNEL9X_API DWORD ( WINAPI * lpfnGetCurrentDirectoryW )(
311 DWORD nBufferLength, // size of directory buffer
312 LPWSTR lpBuffer // directory buffer
315 KERNEL9X_API BOOL ( WINAPI * lpfnSetCurrentDirectoryW )(
316 LPCWSTR lpPathName // new directory name
319 // GetVolumeInformation
320 KERNEL9X_API BOOL ( WINAPI* lpfnGetVolumeInformationW )(
321 LPCWSTR lpRootPathName, // root directory
322 LPWSTR lpVolumeNameBuffer, // volume name buffer
323 DWORD nVolumeNameSize, // length of name buffer
324 LPDWORD lpVolumeSerialNumber, // volume serial number
325 LPDWORD lpMaximumComponentLength, // maximum file name length
326 LPDWORD lpFileSystemFlags, // file system options
327 LPWSTR lpFileSystemName, // file system name buffer
328 DWORD nFileSystemNameSize // length of file system name buffer
331 // GetDiskFreeSpaceExA
332 KERNEL9X_API BOOL (WINAPI *lpfnGetDiskFreeSpaceExA)(
333 LPCSTR lpDirectoryName, // directory name
334 PULARGE_INTEGER lpFreeBytesAvailable, // bytes available to caller
335 PULARGE_INTEGER lpTotalNumberOfBytes, // bytes on disk
336 PULARGE_INTEGER lpTotalNumberOfFreeBytes // free bytes on disk
339 // GetDiskFreeSpaceExW
340 KERNEL9X_API BOOL (WINAPI *lpfnGetDiskFreeSpaceExW)(
341 LPCWSTR lpDirectoryName, // directory name
342 PULARGE_INTEGER lpFreeBytesAvailable, // bytes available to caller
343 PULARGE_INTEGER lpTotalNumberOfBytes, // bytes on disk
344 PULARGE_INTEGER lpTotalNumberOfFreeBytes // free bytes on disk
347 //------------------------------------------------------------------------
348 // redefine the above undefined macros so that the preprocessor replaces
349 // all occurrences of this macros with our function pointer
350 //------------------------------------------------------------------------
352 #define LoadLibraryExW lpfnLoadLibraryExW
353 #define LoadLibraryW(c) LoadLibraryExW(c, NULL, 0)
354 #define GetModuleFileNameW lpfnGetModuleFileNameW
355 #define GetLogicalDriveStringsW lpfnGetLogicalDriveStringsW
356 #define CreateFileW lpfnCreateFileW
357 #define DeleteFileW lpfnDeleteFileW
358 #define CopyFileW lpfnCopyFileW
359 #define MoveFileW lpfnMoveFileW
360 #define MoveFileExW lpfnMoveFileExW
361 #define RemoveDirectoryW lpfnRemoveDirectoryW
362 #define CreateDirectoryW lpfnCreateDirectoryW
363 #define CreateDirectoryExW lpfnCreateDirectoryExW
364 #define GetLongPathNameW lpfnGetLongPathNameW
365 #define GetFullPathNameW lpfnGetFullPathNameW
367 #define GetCanonicalPath lpfnGetCanonicalPathW
368 #define GetLocaleInfoW lpfnGetLocaleInfoW
370 #define CreateProcessW lpfnCreateProcessW
371 #define CreateProcessAsUserW lpfnCreateProcessAsUserW
372 #define GetEnvironmentVariableW lpfnGetEnvironmentVariableW
373 #define GetDriveTypeW lpfnGetDriveTypeW
375 #define GetCurrentDirectoryW lpfnGetCurrentDirectoryW
376 #define SetCurrentDirectoryW lpfnSetCurrentDirectoryW
378 #define GetVolumeInformationW lpfnGetVolumeInformationW
379 #define GetDiskFreeSpaceExA lpfnGetDiskFreeSpaceExA
380 #define GetDiskFreeSpaceExW lpfnGetDiskFreeSpaceExW
382 #ifdef __cplusplus
384 #endif