4 * Copyright 2006 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #include "wine/unixlib.h"
28 static inline WCHAR
*strdup_aw( const char *str
)
33 DWORD len
= MultiByteToWideChar( CP_ACP
, 0, str
, -1, NULL
, 0 );
34 if ((ret
= malloc( len
* sizeof(WCHAR
) )))
35 MultiByteToWideChar( CP_ACP
, 0, str
, -1, ret
, len
);
40 static inline WCHAR
*strdup_uw( const char *str
)
45 DWORD len
= MultiByteToWideChar( CP_UTF8
, 0, str
, -1, NULL
, 0 );
46 if ((ret
= malloc( len
* sizeof(WCHAR
) )))
47 MultiByteToWideChar( CP_UTF8
, 0, str
, -1, ret
, len
);
52 static inline char *strdup_wa( const WCHAR
*str
)
57 DWORD len
= WideCharToMultiByte( CP_ACP
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
58 if ((ret
= malloc( len
)))
59 WideCharToMultiByte( CP_ACP
, 0, str
, -1, ret
, len
, NULL
, NULL
);
64 static inline char *strdup_wu( const WCHAR
*str
)
69 DWORD len
= WideCharToMultiByte( CP_UTF8
, 0, str
, -1, NULL
, 0, NULL
, NULL
);
70 if ((ret
= malloc( len
)))
71 WideCharToMultiByte( CP_UTF8
, 0, str
, -1, ret
, len
, NULL
, NULL
);
76 static inline char *strdup_au( const char *src
)
79 WCHAR
*ret
= strdup_aw( src
);
82 dst
= strdup_wu( ret
);
88 static inline char *strdup_ua( const char *src
)
91 WCHAR
*ret
= strdup_uw( src
);
94 dst
= strdup_wa( ret
);
100 extern const char *debugstr_type( unsigned short ) DECLSPEC_HIDDEN
;
102 struct get_searchlist_params
108 struct get_serverlist_params
111 DNS_ADDR_ARRAY
*addrs
;
132 #define RESOLV_CALL( func, params ) WINE_UNIX_CALL( unix_ ## func, params )