2 * Copyright 2001 Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "wine/debug.h"
29 #include "avifile_private.h"
31 WINE_DEFAULT_DEBUG_CHANNEL(avifile);
34 /****************************************************************************
35 * string APIs (internal) - Copied from wine/dlls/imm32/string.c
38 INT AVIFILE_strlenAtoW( LPCSTR lpstr )
42 len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, NULL, 0 );
43 return ( len > 0 ) ? (len-1) : 0;
46 INT AVIFILE_strlenWtoA( LPCWSTR lpwstr )
50 len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
51 NULL, 0, NULL, NULL );
52 return ( len > 0 ) ? (len-1) : 0;
55 LPWSTR AVIFILE_strncpyAtoW( LPWSTR lpwstr, LPCSTR lpstr, INT wbuflen )
59 len = MultiByteToWideChar( CP_ACP, 0, lpstr, -1, lpwstr, wbuflen );
65 LPSTR AVIFILE_strncpyWtoA( LPSTR lpstr, LPCWSTR lpwstr, INT abuflen )
69 len = WideCharToMultiByte( CP_ACP, 0, lpwstr, -1,
70 lpstr, abuflen, NULL, NULL );
76 LPWSTR AVIFILE_strdupAtoW( LPCSTR lpstr )
81 len = AVIFILE_strlenAtoW( lpstr );
84 lpwstr = (LPWSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(WCHAR)*(len+1) );
86 (void)AVIFILE_strncpyAtoW( lpwstr, lpstr, len+1 );
92 LPSTR AVIFILE_strdupWtoA( LPCWSTR lpwstr )
97 len = AVIFILE_strlenWtoA( lpwstr );
100 lpstr = (LPSTR)HeapAlloc( AVIFILE_data.hHeap, 0, sizeof(CHAR)*(len+1) );
102 (void)AVIFILE_strncpyWtoA( lpstr, lpwstr, len+1 );