includes: Fix alignment for 64-bits
[wine/wine64.git] / dlls / setupapi / setupapi_private.h
blobcaf1d3bfd39a7f28cc8aa1ddcfa191a71d50f8c5
1 /*
2 * Copyright 2001 Andreas Mohr
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef __SETUPAPI_PRIVATE_H
20 #define __SETUPAPI_PRIVATE_H
22 #define COPYFILEDLGORD 1000
23 #define SOURCESTRORD 500
24 #define DESTSTRORD 501
25 #define PROGRESSORD 502
28 #define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles"
29 #define REGPART_RENAME "\\Rename"
30 #define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager"
32 static inline WCHAR *strdupW( const WCHAR *str )
34 WCHAR *ret = NULL;
35 if (str)
37 int len = (lstrlenW(str) + 1) * sizeof(WCHAR);
38 if ((ret = HeapAlloc( GetProcessHeap(), 0, len ))) memcpy( ret, str, len );
40 return ret;
43 static inline char *strdupWtoA( const WCHAR *str )
45 char *ret = NULL;
46 if (str)
48 DWORD len = WideCharToMultiByte( CP_ACP, 0, str, -1, NULL, 0, NULL, NULL );
49 if ((ret = HeapAlloc( GetProcessHeap(), 0, len )))
50 WideCharToMultiByte( CP_ACP, 0, str, -1, ret, len, NULL, NULL );
52 return ret;
55 static inline WCHAR *strdupAtoW( const char *str )
57 WCHAR *ret = NULL;
58 if (str)
60 DWORD len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
61 if ((ret = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) )))
62 MultiByteToWideChar( CP_ACP, 0, str, -1, ret, len );
64 return ret;
67 /* string substitutions */
69 struct inf_file;
70 extern const WCHAR *DIRID_get_string( int dirid );
71 extern unsigned int PARSER_string_substA( const struct inf_file *file, const WCHAR *text,
72 char *buffer, unsigned int size );
73 extern unsigned int PARSER_string_substW( const struct inf_file *file, const WCHAR *text,
74 WCHAR *buffer, unsigned int size );
75 extern const WCHAR *PARSER_get_inf_filename( HINF hinf );
76 extern WCHAR *PARSER_get_src_root( HINF hinf );
77 extern WCHAR *PARSER_get_dest_dir( INFCONTEXT *context );
79 /* support for Ascii queue callback functions */
81 struct callback_WtoA_context
83 void *orig_context;
84 PSP_FILE_CALLBACK_A orig_handler;
87 UINT CALLBACK QUEUE_callback_WtoA( void *context, UINT notification, UINT_PTR, UINT_PTR );
89 /* from msvcrt/sys/stat.h */
90 #define _S_IWRITE 0x0080
91 #define _S_IREAD 0x0100
93 extern OSVERSIONINFOW OsVersionInfo;
95 extern BOOL create_fake_dll( const WCHAR *name, const WCHAR *source );
97 #endif /* __SETUPAPI_PRIVATE_H */