2 * Windows APIs that are different for each system.
3 * We use pointers to the entry points so that a
4 * single binary will run on all Windows systems.
9 Copyright (C) 2000-2003 Kern Sibbald and John Walker
11 This program is free software; you can redistribute it and/or
12 modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of
14 the License, or (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public
22 License along with this program; if not, write to the Free
23 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
30 #if defined(HAVE_WIN32)
31 /* Commented out native.h include statement, which is not distributed with the
32 * free version of VC++, and which is not used in bacula. */
33 /*#if !defined(HAVE_MINGW) // native.h not present on mingw
38 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
41 typedef BOOL (WINAPI * t_OpenProcessToken)(HANDLE, DWORD, PHANDLE);
42 typedef BOOL (WINAPI * t_AdjustTokenPrivileges)(HANDLE, BOOL,
43 PTOKEN_PRIVILEGES, DWORD, PTOKEN_PRIVILEGES, PDWORD);
44 typedef BOOL (WINAPI * t_LookupPrivilegeValue)(LPCTSTR, LPCTSTR, PLUID);
46 extern t_OpenProcessToken p_OpenProcessToken;
47 extern t_AdjustTokenPrivileges p_AdjustTokenPrivileges;
48 extern t_LookupPrivilegeValue p_LookupPrivilegeValue;
51 typedef int (__cdecl * t_wunlink) (const wchar_t *);
52 typedef int (__cdecl * t_wmkdir) (const wchar_t *);
53 typedef int (__cdecl * t_wopen) (const wchar_t *, int, ...);
55 extern t_wunlink p_wunlink;
56 extern t_wmkdir p_wmkdir;
57 extern t_wopen p_wopen;
59 typedef BOOL (WINAPI * t_GetFileAttributesExA)(LPCSTR, GET_FILEEX_INFO_LEVELS,
61 typedef BOOL (WINAPI * t_GetFileAttributesExW)(LPCWSTR, GET_FILEEX_INFO_LEVELS,
64 typedef DWORD (WINAPI * t_GetFileAttributesA)(LPCSTR);
65 typedef DWORD (WINAPI * t_GetFileAttributesW)(LPCWSTR);
66 typedef BOOL (WINAPI * t_SetFileAttributesA)(LPCSTR, DWORD);
67 typedef BOOL (WINAPI * t_SetFileAttributesW)(LPCWSTR, DWORD);
69 typedef HANDLE (WINAPI * t_CreateFileA) (LPCSTR, DWORD ,DWORD, LPSECURITY_ATTRIBUTES,
70 DWORD , DWORD, HANDLE);
71 typedef HANDLE (WINAPI * t_CreateFileW) (LPCWSTR, DWORD ,DWORD, LPSECURITY_ATTRIBUTES,
72 DWORD , DWORD, HANDLE);
74 typedef BOOL (WINAPI * t_SetProcessShutdownParameters)(DWORD, DWORD);
75 typedef BOOL (WINAPI * t_BackupRead)(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
76 typedef BOOL (WINAPI * t_BackupWrite)(HANDLE,LPBYTE,DWORD,LPDWORD,BOOL,BOOL,LPVOID*);
78 typedef int (WINAPI * t_WideCharToMultiByte) (UINT CodePage, DWORD , LPCWSTR, int,
79 LPSTR, int, LPCSTR, LPBOOL);
81 typedef int (WINAPI * t_MultiByteToWideChar) (UINT, DWORD, LPCSTR, int, LPWSTR, int);
83 typedef HANDLE (WINAPI * t_FindFirstFileA) (LPCSTR, LPWIN32_FIND_DATAA);
84 typedef HANDLE (WINAPI * t_FindFirstFileW) (LPCWSTR, LPWIN32_FIND_DATAW);
86 typedef BOOL (WINAPI * t_FindNextFileA) (HANDLE, LPWIN32_FIND_DATAA);
87 typedef BOOL (WINAPI * t_FindNextFileW) (HANDLE, LPWIN32_FIND_DATAW);
89 typedef BOOL (WINAPI * t_SetCurrentDirectoryA) (LPCSTR);
90 typedef BOOL (WINAPI * t_SetCurrentDirectoryW) (LPCWSTR);
92 typedef DWORD (WINAPI * t_GetCurrentDirectoryA) (DWORD, LPSTR);
93 typedef DWORD (WINAPI * t_GetCurrentDirectoryW) (DWORD, LPWSTR);
95 extern t_GetFileAttributesA p_GetFileAttributesA;
96 extern t_GetFileAttributesW p_GetFileAttributesW;
98 extern t_GetFileAttributesExA p_GetFileAttributesExA;
99 extern t_GetFileAttributesExW p_GetFileAttributesExW;
101 extern t_SetFileAttributesA p_SetFileAttributesA;
102 extern t_SetFileAttributesW p_SetFileAttributesW;
104 extern t_CreateFileA p_CreateFileA;
105 extern t_CreateFileW p_CreateFileW;
106 extern t_SetProcessShutdownParameters p_SetProcessShutdownParameters;
107 extern t_BackupRead p_BackupRead;
108 extern t_BackupWrite p_BackupWrite;
110 extern t_WideCharToMultiByte p_WideCharToMultiByte;
111 extern t_MultiByteToWideChar p_MultiByteToWideChar;
113 extern t_FindFirstFileA p_FindFirstFileA;
114 extern t_FindFirstFileW p_FindFirstFileW;
116 extern t_FindNextFileA p_FindNextFileA;
117 extern t_FindNextFileW p_FindNextFileW;
119 extern t_SetCurrentDirectoryA p_SetCurrentDirectoryA;
120 extern t_SetCurrentDirectoryW p_SetCurrentDirectoryW;
122 extern t_GetCurrentDirectoryA p_GetCurrentDirectoryA;
123 extern t_GetCurrentDirectoryW p_GetCurrentDirectoryW;
126 #endif /* __WINAPI_H */