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
4ffc5ed5
Commit
4ffc5ed5
authored
Oct 07, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Oct 08, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avifil32: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9c517a3d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
18 deletions
+8
-18
api.c
dlls/avifil32/api.c
+6
-13
avifile.c
dlls/avifil32/avifile.c
+2
-5
No files found.
dlls/avifil32/api.c
View file @
4ffc5ed5
...
...
@@ -994,11 +994,7 @@ HRESULT WINAPI AVIBuildFilterA(LPSTR szFilter, LONG cbFilter, BOOL fSaving)
*/
HRESULT
WINAPI
AVIBuildFilterW
(
LPWSTR
szFilter
,
LONG
cbFilter
,
BOOL
fSaving
)
{
static
const
WCHAR
all_files
[]
=
{
'*'
,
'.'
,
'*'
,
0
,
0
};
static
const
WCHAR
szClsid
[]
=
{
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
szExtensionFmt
[]
=
{
';'
,
'*'
,
'.'
,
'%'
,
's'
,
0
};
static
const
WCHAR
szAVIFileExtensions
[]
=
{
'A'
,
'V'
,
'I'
,
'F'
,
'i'
,
'l'
,
'e'
,
'\\'
,
'E'
,
'x'
,
't'
,
'e'
,
'n'
,
's'
,
'i'
,
'o'
,
'n'
,
's'
,
0
};
static
const
WCHAR
all_files
[]
=
L"*.*
\0
"
;
AVIFilter
*
lp
;
WCHAR
szAllFiles
[
40
];
...
...
@@ -1030,7 +1026,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
* First filter is named "All multimedia files" and its filter is a
* collection of all possible extensions except "*.*".
*/
if
(
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
szAVIFileExtensions
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
if
(
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
L"AVIFile
\\
Extensions"
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
lp
);
return
AVIERR_ERROR
;
}
...
...
@@ -1065,7 +1061,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
}
/* append extension to the filter */
wsprintfW
(
szValue
,
szExtensionFmt
,
szFileExt
);
wsprintfW
(
szValue
,
L";*.%s"
,
szFileExt
);
if
(
lp
[
i
].
szExtensions
[
0
]
==
0
)
lstrcatW
(
lp
[
i
].
szExtensions
,
szValue
+
1
);
else
...
...
@@ -1080,7 +1076,7 @@ HRESULT WINAPI AVIBuildFilterW(LPWSTR szFilter, LONG cbFilter, BOOL fSaving)
RegCloseKey
(
hKey
);
/* 2. get descriptions for the CLSIDs and fill out szFilter */
if
(
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
szClsid
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
if
(
RegOpenKeyW
(
HKEY_CLASSES_ROOT
,
L"CLSID"
,
&
hKey
)
!=
ERROR_SUCCESS
)
{
HeapFree
(
GetProcessHeap
(),
0
,
lp
);
return
AVIERR_ERROR
;
}
...
...
@@ -1254,9 +1250,6 @@ static BOOL AVISaveOptionsFmtChoose(HWND hWnd)
static
void
AVISaveOptionsUpdate
(
HWND
hWnd
)
{
static
const
WCHAR
szVideoFmt
[]
=
{
'%'
,
'l'
,
'd'
,
'x'
,
'%'
,
'l'
,
'd'
,
'x'
,
'%'
,
'd'
,
0
};
static
const
WCHAR
szAudioFmt
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
's'
,
0
};
WCHAR
szFormat
[
128
];
AVISTREAMINFOW
sInfo
;
LPVOID
lpFormat
;
...
...
@@ -1283,7 +1276,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
LPBITMAPINFOHEADER
lpbi
=
lpFormat
;
ICINFO
icinfo
;
wsprintfW
(
szFormat
,
szVideoFmt
,
lpbi
->
biWidth
,
wsprintfW
(
szFormat
,
L"%ldx%ldx%d"
,
lpbi
->
biWidth
,
lpbi
->
biHeight
,
lpbi
->
biBitCount
);
if
(
lpbi
->
biCompression
!=
BI_RGB
)
{
...
...
@@ -1320,7 +1313,7 @@ static void AVISaveOptionsUpdate(HWND hWnd)
if
(
acmFormatTagDetailsW
(
NULL
,
&
aftd
,
ACM_FORMATTAGDETAILSF_FORMATTAG
)
==
S_OK
)
{
if
(
acmFormatDetailsW
(
NULL
,
&
afd
,
ACM_FORMATDETAILSF_FORMAT
)
==
S_OK
)
wsprintfW
(
szFormat
,
szAudioFmt
,
afd
.
szFormat
,
aftd
.
szFormatTag
);
wsprintfW
(
szFormat
,
L"%s %s"
,
afd
.
szFormat
,
aftd
.
szFormatTag
);
}
}
}
...
...
dlls/avifil32/avifile.c
View file @
4ffc5ed5
...
...
@@ -1714,9 +1714,6 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
break
;
case
ckidSTREAMHEADER
:
{
static
const
WCHAR
streamTypeFmt
[]
=
{
'%'
,
'4'
,
'.'
,
'4'
,
'h'
,
's'
,
0
};
static
const
WCHAR
streamNameFmt
[]
=
{
'%'
,
's'
,
' '
,
'%'
,
's'
,
' '
,
'#'
,
'%'
,
'd'
,
0
};
AVIStreamHeader
streamHdr
;
WCHAR
szType
[
25
];
UINT
count
;
...
...
@@ -1754,7 +1751,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
else
if
(
streamHdr
.
fccType
==
streamtypeAUDIO
)
LoadStringW
(
AVIFILE_hModule
,
IDS_AUDIO
,
szType
,
ARRAY_SIZE
(
szType
));
else
wsprintfW
(
szType
,
streamTypeFmt
,
(
char
*
)
&
streamHdr
.
fccType
);
wsprintfW
(
szType
,
L"%4.4hs"
,
(
char
*
)
&
streamHdr
.
fccType
);
/* get count of this streamtype up to this stream */
count
=
0
;
...
...
@@ -1766,7 +1763,7 @@ static HRESULT AVIFILE_LoadFile(IAVIFileImpl *This)
memset
(
pStream
->
sInfo
.
szName
,
0
,
sizeof
(
pStream
->
sInfo
.
szName
));
/* FIXME: avoid overflow -- better use wsnprintfW, which doesn't exists ! */
wsprintfW
(
pStream
->
sInfo
.
szName
,
streamNameFmt
,
wsprintfW
(
pStream
->
sInfo
.
szName
,
L"%s %s #%d"
,
AVIFILE_BasenameW
(
This
->
szFileName
),
szType
,
count
);
}
break
;
...
...
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