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
25 #define COPYFILEDLGORD 1000
26 #define SOURCESTRORD 500
27 #define DESTSTRORD 501
28 #define PROGRESSORD 502
30 #define IDPROMPTFORDISK 1001
31 #define IDC_FILENEEDED 503
33 #define IDC_COPYFROM 505
35 #define IDC_RUNDLG_BROWSE 507
37 #define IDS_PROMPTDISK 508
38 #define IDS_UNKNOWN 509
39 #define IDS_COPYFROM 510
42 #define REG_INSTALLEDFILES "System\\CurrentControlSet\\Control\\InstalledFiles"
43 #define REGPART_RENAME "\\Rename"
44 #define REG_VERSIONCONFLICT "Software\\Microsoft\\VersionConflictManager"
46 #define PNF_HEADER L"Wine PNF header\n"
48 extern HINSTANCE SETUPAPI_hInstance DECLSPEC_HIDDEN
;
50 static inline void * __WINE_ALLOC_SIZE(2) heap_realloc_zero(void *mem
, size_t len
)
52 return HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, mem
, len
);
55 static inline WCHAR
*strdupW( const WCHAR
*str
)
60 int len
= (lstrlenW(str
) + 1) * sizeof(WCHAR
);
61 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
))) memcpy( ret
, str
, len
);
66 static inline char *strdupWtoA( const WCHAR
*str
)
71 DWORD len
= WideCharToMultiByte( CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
72 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
)))
73 WideCharToMultiByte( CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
78 static inline WCHAR
*strdupAtoW( const char *str
)
83 DWORD len
= MultiByteToWideChar( CP_ACP
, 0, str
, -1, NULL
, 0 );
84 if ((ret
= HeapAlloc( GetProcessHeap(), 0, len
* sizeof(WCHAR
) )))
85 MultiByteToWideChar( CP_ACP
, 0, str
, -1, ret
, len
);
90 /* exported functions not in public headers */
92 void WINAPI
MyFree( void *mem
);
93 void * WINAPI
MyMalloc( DWORD size
) __WINE_ALLOC_SIZE(1) __WINE_DEALLOC(MyFree
) __WINE_MALLOC
;
94 void * WINAPI
MyRealloc( void *src
, DWORD size
) __WINE_ALLOC_SIZE(2) __WINE_DEALLOC(MyFree
);
95 WCHAR
* WINAPI
MultiByteToUnicode( const char *str
, UINT code_page
) __WINE_DEALLOC(MyFree
) __WINE_MALLOC
;
96 char * WINAPI
UnicodeToMultiByte( const WCHAR
*str
, UINT code_page
) __WINE_DEALLOC(MyFree
) __WINE_MALLOC
;
98 /* string substitutions */
101 extern const WCHAR
*DIRID_get_string( int dirid
) DECLSPEC_HIDDEN
;
102 extern const WCHAR
*PARSER_get_inf_filename( HINF hinf
) DECLSPEC_HIDDEN
;
103 extern WCHAR
*PARSER_get_dest_dir( INFCONTEXT
*context
) DECLSPEC_HIDDEN
;
105 /* support for ANSI queue callback functions */
107 struct callback_WtoA_context
110 PSP_FILE_CALLBACK_A orig_handler
;
113 UINT CALLBACK
QUEUE_callback_WtoA( void *context
, UINT notification
, UINT_PTR
, UINT_PTR
) DECLSPEC_HIDDEN
;
115 extern OSVERSIONINFOW OsVersionInfo DECLSPEC_HIDDEN
;
117 extern BOOL
create_fake_dll( const WCHAR
*name
, const WCHAR
*source
) DECLSPEC_HIDDEN
;
118 extern void cleanup_fake_dlls(void) DECLSPEC_HIDDEN
;
120 #endif /* __SETUPAPI_PRIVATE_H */