Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
87bacf46
Commit
87bacf46
authored
Jul 04, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Jul 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix string conversion bugs.
parent
75d8be03
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
16 deletions
+23
-16
api.c
dlls/avifil32/api.c
+6
-8
avifile.c
dlls/avifil32/avifile.c
+8
-3
wavfile.c
dlls/avifil32/wavfile.c
+9
-5
No files found.
dlls/avifil32/api.c
View file @
87bacf46
...
...
@@ -206,16 +206,15 @@ HRESULT WINAPI AVIFileOpenA(PAVIFILE *ppfile, LPCSTR szFile, UINT uMode,
return
AVIERR_BADPARAM
;
/* convert ASCII string to Unicode and call unicode function */
len
=
lstrlenA
(
szFile
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
NULL
,
0
);
if
(
len
<=
0
)
return
AVIERR_BADPARAM
;
wszFile
=
(
LPWSTR
)
LocalAlloc
(
LPTR
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
wszFile
=
(
LPWSTR
)
LocalAlloc
(
LPTR
,
len
*
sizeof
(
WCHAR
));
if
(
wszFile
==
NULL
)
return
AVIERR_MEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
wszFile
,
len
+
1
);
wszFile
[
len
+
1
]
=
0
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
wszFile
,
len
);
hr
=
AVIFileOpenW
(
ppfile
,
wszFile
,
uMode
,
lpHandler
);
...
...
@@ -1563,16 +1562,15 @@ HRESULT WINAPI AVISaveVA(LPCSTR szFile, CLSID *pclsidHandler,
return
AVIERR_BADPARAM
;
/* convert ASCII string to Unicode and call Unicode function */
len
=
lstrlenA
(
szFile
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
NULL
,
0
);
if
(
len
<=
0
)
return
AVIERR_BADPARAM
;
wszFile
=
(
LPWSTR
)
LocalAlloc
(
LPTR
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
wszFile
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
WCHAR
));
if
(
wszFile
==
NULL
)
return
AVIERR_MEMORY
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
wszFile
,
len
+
1
);
wszFile
[
len
+
1
]
=
0
;
MultiByteToWideChar
(
CP_ACP
,
0
,
szFile
,
-
1
,
wszFile
,
len
);
hr
=
AVISaveVW
(
wszFile
,
pclsidHandler
,
lpfnCallback
,
nStream
,
ppavi
,
plpOptions
);
...
...
dlls/avifil32/avifile.c
View file @
87bacf46
...
...
@@ -47,6 +47,7 @@
#include "avifile_private.h"
#include "extrachunk.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
avifile
);
...
...
@@ -640,7 +641,11 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
MMIO_ALLOCBUF
|
dwMode
);
if
(
This
->
paf
->
hmmio
==
NULL
)
{
/* mmioOpenW not in native DLLs of Win9x -- try mmioOpenA */
LPSTR
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
CHAR
));
LPSTR
szFileName
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
This
->
paf
->
szFileName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
CHAR
));
if
(
szFileName
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -698,13 +703,13 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
assert
(
This
->
paf
!=
NULL
);
if
(
This
->
paf
->
szFileName
!=
NULL
)
{
int
len
=
lstrlenW
(
This
->
paf
->
szFileName
);
int
len
=
lstrlenW
(
This
->
paf
->
szFileName
)
+
1
;
*
ppszFileName
=
(
LPOLESTR
)
GlobalAllocPtr
(
GHND
,
len
*
sizeof
(
WCHAR
));
if
(
*
ppszFileName
==
NULL
)
return
AVIERR_MEMORY
;
memcpy
(
*
ppszFileName
,
This
->
paf
->
szFileName
,
len
*
sizeof
(
WCHAR
)
);
strcpyW
(
*
ppszFileName
,
This
->
paf
->
szFileName
);
}
return
AVIERR_OK
;
...
...
dlls/avifil32/wavfile.c
View file @
87bacf46
...
...
@@ -34,6 +34,7 @@
#include "avifile_private.h"
#include "extrachunk.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
avifile
);
...
...
@@ -583,7 +584,7 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
This
->
uMode
=
dwMode
;
len
=
lstrlenW
(
pszFileName
)
+
1
;
This
->
szFileName
=
(
LPWSTR
)
LocalAlloc
(
LPTR
,
len
*
sizeof
(
WCHAR
));
This
->
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
WCHAR
));
if
(
This
->
szFileName
==
NULL
)
return
AVIERR_MEMORY
;
lstrcpyW
(
This
->
szFileName
,
pszFileName
);
...
...
@@ -592,7 +593,10 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile *iface,
This
->
hmmio
=
mmioOpenW
(
This
->
szFileName
,
NULL
,
MMIO_ALLOCBUF
|
dwMode
);
if
(
This
->
hmmio
==
NULL
)
{
/* mmioOpenW not in native DLLs of Win9x -- try mmioOpenA */
LPSTR
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
CHAR
));
LPSTR
szFileName
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
This
->
szFileName
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
szFileName
=
LocalAlloc
(
LPTR
,
len
*
sizeof
(
CHAR
));
if
(
szFileName
==
NULL
)
return
AVIERR_MEMORY
;
...
...
@@ -659,13 +663,13 @@ static HRESULT WINAPI IPersistFile_fnGetCurFile(IPersistFile *iface,
assert
(
This
->
paf
!=
NULL
);
if
(
This
->
paf
->
szFileName
!=
NULL
)
{
int
len
=
lstrlenW
(
This
->
paf
->
szFileName
);
int
len
=
lstrlenW
(
This
->
paf
->
szFileName
)
+
1
;
*
ppszFileName
=
(
LPOLESTR
)
GlobalAllocPtr
(
GHND
,
len
*
sizeof
(
WCHAR
));
*
ppszFileName
=
GlobalAllocPtr
(
GHND
,
len
*
sizeof
(
WCHAR
));
if
(
*
ppszFileName
==
NULL
)
return
AVIERR_MEMORY
;
memcpy
(
*
ppszFileName
,
This
->
paf
->
szFileName
,
len
*
sizeof
(
WCHAR
)
);
strcpyW
(
*
ppszFileName
,
This
->
paf
->
szFileName
);
}
return
AVIERR_OK
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment