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
4915c51e
Commit
4915c51e
authored
Jan 21, 2020
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jan 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dmloader: Use wide-char string literals.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1fa427f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
+9
-10
loader.c
dlls/dmloader/loader.c
+4
-4
loader.c
dlls/dmloader/tests/loader.c
+5
-6
No files found.
dlls/dmloader/loader.c
View file @
4915c51e
...
...
@@ -621,7 +621,6 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoad
static
HRESULT
WINAPI
IDirectMusicLoaderImpl_ScanDirectory
(
IDirectMusicLoader8
*
iface
,
REFGUID
rguidClass
,
WCHAR
*
pwzFileExtension
,
WCHAR
*
pwzScanFileName
)
{
IDirectMusicLoaderImpl
*
This
=
impl_from_IDirectMusicLoader8
(
iface
);
static
const
WCHAR
wszAny
[]
=
{
'*'
,
0
};
WIN32_FIND_DATAW
FileData
;
HANDLE
hSearch
;
WCHAR
wszSearchString
[
MAX_PATH
];
...
...
@@ -643,11 +642,12 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 *
p
=
wszSearchString
+
lstrlenW
(
wszSearchString
);
if
(
p
>
wszSearchString
&&
p
[
-
1
]
!=
'\\'
)
*
p
++
=
'\\'
;
*
p
++
=
'*'
;
/* any file */
if
(
lstrcmpW
(
pwzFileExtension
,
wszAny
))
*
p
++
=
'.'
;
/* if we have actual extension, put a dot */
if
(
lstrcmpW
(
pwzFileExtension
,
L"*"
))
*
p
++
=
'.'
;
/* if we have actual extension, put a dot */
lstrcpyW
(
p
,
pwzFileExtension
);
TRACE
(
": search string: %s
\n
"
,
debugstr_w
(
wszSearchString
));
hSearch
=
FindFirstFileW
(
wszSearchString
,
&
FileData
);
if
(
hSearch
==
INVALID_HANDLE_VALUE
)
{
TRACE
(
": no files found
\n
"
);
...
...
dlls/dmloader/tests/loader.c
View file @
4915c51e
...
...
@@ -48,10 +48,10 @@ static void test_directory(void)
{
IDirectMusicLoader8
*
loader
=
NULL
;
HRESULT
hr
;
WCHAR
con
[]
=
{
'c'
,
'o'
,
'n'
,
0
};
WCHAR
con
[]
=
L"con"
;
WCHAR
empty
[]
=
L""
;
WCHAR
invalid_path
[]
=
L"/invalid path"
;
WCHAR
path
[
MAX_PATH
];
WCHAR
empty
[]
=
{
0
};
WCHAR
invalid_path
[]
=
{
'/'
,
'i'
,
'n'
,
'v'
,
'a'
,
'l'
,
'i'
,
'd'
,
' '
,
'p'
,
'a'
,
't'
,
'h'
,
0
};
hr
=
CoCreateInstance
(
&
CLSID_DirectMusicLoader
,
NULL
,
CLSCTX_INPROC
,
&
IID_IDirectMusicLoader8
,
(
void
**
)
&
loader
);
...
...
@@ -477,7 +477,6 @@ static void test_parsedescriptor(void)
DMUS_OBJECTDESC
desc
;
HRESULT
hr
;
DWORD
valid
;
const
WCHAR
s_unam
[]
=
{
'U'
,
'N'
,
'A'
,
'M'
,
'\0'
};
const
FOURCC
alldesc
[]
=
{
FOURCC_RIFF
,
DMUS_FOURCC_CONTAINER_FORM
,
DMUS_FOURCC_CATEGORY_CHUNK
,
FOURCC_LIST
,
...
...
@@ -562,7 +561,7 @@ static void test_parsedescriptor(void)
wine_dbgstr_guid
(
&
desc
.
guidClass
));
ok
(
IsEqualGUID
(
&
desc
.
guidObject
,
&
GUID_NULL
),
"Got object guid %s, expected GUID_NULL
\n
"
,
wine_dbgstr_guid
(
&
desc
.
guidClass
));
ok
(
!
memcmp
(
desc
.
wszName
,
s_unam
,
sizeof
(
s_unam
)
),
"Got name '%s', expected 'UNAM'
\n
"
,
ok
(
!
lstrcmpW
(
desc
.
wszName
,
L"UNAM"
),
"Got name '%s', expected 'UNAM'
\n
"
,
wine_dbgstr_w
(
desc
.
wszName
));
IStream_Release
(
stream
);
...
...
@@ -596,7 +595,7 @@ static void test_parsedescriptor(void)
ok
(
hr
==
S_OK
,
"ParseDescriptor failed: %08x, expected S_OK
\n
"
,
hr
);
valid
=
DMUS_OBJ_OBJECT
|
DMUS_OBJ_CLASS
|
DMUS_OBJ_NAME
|
DMUS_OBJ_CATEGORY
|
DMUS_OBJ_VERSION
;
ok
(
desc
.
dwValidData
==
valid
,
"Got valid data %#x, expected %#x
\n
"
,
desc
.
dwValidData
,
valid
);
ok
(
!
memcmp
(
desc
.
wszName
,
s_unam
,
sizeof
(
s_unam
)
),
"Got name '%s', expected 'UNAM'
\n
"
,
ok
(
!
lstrcmpW
(
desc
.
wszName
,
L"UNAM"
),
"Got name '%s', expected 'UNAM'
\n
"
,
wine_dbgstr_w
(
desc
.
wszName
));
IStream_Release
(
stream
);
...
...
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