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
70d6d09f
Commit
70d6d09f
authored
May 31, 2019
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devenum: Build with msvcrt.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e432e4c2
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
59 deletions
+56
-59
Makefile.in
dlls/devenum/Makefile.in
+2
-0
createdevenum.c
dlls/devenum/createdevenum.c
+13
-14
devenum_private.h
dlls/devenum/devenum_private.h
+0
-4
mediacatenum.c
dlls/devenum/mediacatenum.c
+34
-34
parsedisplayname.c
dlls/devenum/parsedisplayname.c
+7
-7
No files found.
dlls/devenum/Makefile.in
View file @
70d6d09f
...
...
@@ -2,6 +2,8 @@ MODULE = devenum.dll
IMPORTS
=
strmiids uuid ole32 oleaut32 avicap32 winmm user32 advapi32 dsound msdmo
DELAYIMPORTS
=
msvfw32
EXTRADLLFLAGS
=
-mno-cygwin
C_SRCS
=
\
createdevenum.c
\
devenum_main.c
\
...
...
dlls/devenum/createdevenum.c
View file @
70d6d09f
...
...
@@ -32,7 +32,6 @@
#include "dsound.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "wine/heap.h"
#include "mmddk.h"
...
...
@@ -120,17 +119,17 @@ static HRESULT register_codec(const GUID *class, const WCHAR *name,
if
(
FAILED
(
hr
))
return
hr
;
buffer
=
heap_alloc
((
strlenW
(
deviceW
)
+
CHARS_IN_GUID
+
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
));
buffer
=
heap_alloc
((
lstrlenW
(
deviceW
)
+
CHARS_IN_GUID
+
l
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buffer
)
{
IParseDisplayName_Release
(
parser
);
return
E_OUTOFMEMORY
;
}
strcpyW
(
buffer
,
deviceW
);
StringFromGUID2
(
class
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
strcatW
(
buffer
,
backslashW
);
strcatW
(
buffer
,
name
);
l
strcpyW
(
buffer
,
deviceW
);
StringFromGUID2
(
class
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
l
strcatW
(
buffer
,
backslashW
);
l
strcatW
(
buffer
,
name
);
IParseDisplayName_ParseDisplayName
(
parser
,
NULL
,
buffer
,
&
eaten
,
&
mon
);
IParseDisplayName_Release
(
parser
);
...
...
@@ -454,9 +453,9 @@ static void register_legacy_filters(void)
if
(
FAILED
(
hr
))
continue
;
strcpyW
(
wszRegKey
,
clsidW
);
strcatW
(
wszRegKey
,
backslashW
);
strcatW
(
wszRegKey
,
wszFilterSubkeyName
);
l
strcpyW
(
wszRegKey
,
clsidW
);
l
strcatW
(
wszRegKey
,
backslashW
);
l
strcatW
(
wszRegKey
,
wszFilterSubkeyName
);
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
wszRegKey
,
0
,
KEY_READ
,
&
classkey
)
!=
ERROR_SUCCESS
)
continue
;
...
...
@@ -524,11 +523,11 @@ static BOOL CALLBACK register_dsound_devices(GUID *guid, const WCHAR *desc, cons
if
(
guid
)
{
WCHAR
*
name
=
heap_alloc
(
sizeof
(
defaultW
)
+
strlenW
(
desc
)
*
sizeof
(
WCHAR
));
WCHAR
*
name
=
heap_alloc
(
sizeof
(
defaultW
)
+
l
strlenW
(
desc
)
*
sizeof
(
WCHAR
));
if
(
!
name
)
return
FALSE
;
strcpyW
(
name
,
directsoundW
);
strcatW
(
name
,
desc
);
l
strcpyW
(
name
,
directsoundW
);
l
strcatW
(
name
,
desc
);
hr
=
register_codec
(
&
CLSID_AudioRendererCategory
,
name
,
&
CLSID_DSoundRender
,
name
,
&
prop_bag
);
...
...
@@ -910,9 +909,9 @@ static HRESULT DEVENUM_CreateAMCategoryKey(const CLSID * clsidCategory)
HRESULT
res
=
S_OK
;
HKEY
hkeyDummy
=
NULL
;
strcpyW
(
wszRegKey
,
wszActiveMovieKey
);
l
strcpyW
(
wszRegKey
,
wszActiveMovieKey
);
if
(
!
StringFromGUID2
(
clsidCategory
,
wszRegKey
+
strlenW
(
wszRegKey
),
ARRAY_SIZE
(
wszRegKey
)
-
strlenW
(
wszRegKey
)))
if
(
!
StringFromGUID2
(
clsidCategory
,
wszRegKey
+
lstrlenW
(
wszRegKey
),
ARRAY_SIZE
(
wszRegKey
)
-
l
strlenW
(
wszRegKey
)))
res
=
E_INVALIDARG
;
if
(
SUCCEEDED
(
res
))
...
...
dlls/devenum/devenum_private.h
View file @
70d6d09f
...
...
@@ -40,10 +40,6 @@
#include "olectl.h"
#include "uuids.h"
#ifndef RC_INVOKED
#include "wine/unicode.h"
#endif
/**********************************************************************
* Dll lifetime tracking declaration for devenum.dll
*/
...
...
dlls/devenum/mediacatenum.c
View file @
70d6d09f
...
...
@@ -137,7 +137,7 @@ static HRESULT WINAPI DEVENUM_IPropertyBag_Read(
if
(
This
->
type
==
DEVICE_DMO
)
{
if
(
!
strcmpW
(
pszPropName
,
FriendlyNameW
))
if
(
!
l
strcmpW
(
pszPropName
,
FriendlyNameW
))
{
res
=
DMOGetName
(
&
This
->
clsid
,
name
);
if
(
SUCCEEDED
(
res
))
...
...
@@ -346,25 +346,25 @@ static HRESULT create_PropertyBag(MediaCatMoniker *mon, IPropertyBag **ppBag)
rpb
->
clsid
=
mon
->
clsid
;
else
if
(
rpb
->
type
==
DEVICE_FILTER
)
{
strcpyW
(
rpb
->
path
,
clsidW
);
strcatW
(
rpb
->
path
,
backslashW
);
l
strcpyW
(
rpb
->
path
,
clsidW
);
l
strcatW
(
rpb
->
path
,
backslashW
);
if
(
mon
->
has_class
)
{
StringFromGUID2
(
&
mon
->
class
,
rpb
->
path
+
strlenW
(
rpb
->
path
),
CHARS_IN_GUID
);
strcatW
(
rpb
->
path
,
instanceW
);
strcatW
(
rpb
->
path
,
backslashW
);
StringFromGUID2
(
&
mon
->
class
,
rpb
->
path
+
l
strlenW
(
rpb
->
path
),
CHARS_IN_GUID
);
l
strcatW
(
rpb
->
path
,
instanceW
);
l
strcatW
(
rpb
->
path
,
backslashW
);
}
strcatW
(
rpb
->
path
,
mon
->
name
);
l
strcatW
(
rpb
->
path
,
mon
->
name
);
}
else
if
(
rpb
->
type
==
DEVICE_CODEC
)
{
strcpyW
(
rpb
->
path
,
wszActiveMovieKey
);
l
strcpyW
(
rpb
->
path
,
wszActiveMovieKey
);
if
(
mon
->
has_class
)
{
StringFromGUID2
(
&
mon
->
class
,
rpb
->
path
+
strlenW
(
rpb
->
path
),
CHARS_IN_GUID
);
strcatW
(
rpb
->
path
,
backslashW
);
StringFromGUID2
(
&
mon
->
class
,
rpb
->
path
+
l
strlenW
(
rpb
->
path
),
CHARS_IN_GUID
);
l
strcatW
(
rpb
->
path
,
backslashW
);
}
strcatW
(
rpb
->
path
,
mon
->
name
);
l
strcatW
(
rpb
->
path
,
mon
->
name
);
}
*
ppBag
=
&
rpb
->
IPropertyBag_iface
;
...
...
@@ -705,33 +705,33 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetDisplayName(IMoniker *iface, I
if
(
This
->
type
==
DEVICE_DMO
)
{
buffer
=
CoTaskMemAlloc
((
strlenW
(
deviceW
)
+
strlenW
(
dmoW
)
buffer
=
CoTaskMemAlloc
((
lstrlenW
(
deviceW
)
+
l
strlenW
(
dmoW
)
+
2
*
CHARS_IN_GUID
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buffer
)
return
E_OUTOFMEMORY
;
strcpyW
(
buffer
,
deviceW
);
strcatW
(
buffer
,
dmoW
);
StringFromGUID2
(
&
This
->
clsid
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
StringFromGUID2
(
&
This
->
class
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
l
strcpyW
(
buffer
,
deviceW
);
l
strcatW
(
buffer
,
dmoW
);
StringFromGUID2
(
&
This
->
clsid
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
StringFromGUID2
(
&
This
->
class
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
}
else
{
buffer
=
CoTaskMemAlloc
((
strlenW
(
deviceW
)
+
3
+
(
This
->
has_class
?
CHARS_IN_GUID
:
0
)
+
strlenW
(
This
->
name
)
+
1
)
*
sizeof
(
WCHAR
));
buffer
=
CoTaskMemAlloc
((
l
strlenW
(
deviceW
)
+
3
+
(
This
->
has_class
?
CHARS_IN_GUID
:
0
)
+
l
strlenW
(
This
->
name
)
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
buffer
)
return
E_OUTOFMEMORY
;
strcpyW
(
buffer
,
deviceW
);
l
strcpyW
(
buffer
,
deviceW
);
if
(
This
->
type
==
DEVICE_FILTER
)
strcatW
(
buffer
,
swW
);
l
strcatW
(
buffer
,
swW
);
else
if
(
This
->
type
==
DEVICE_CODEC
)
strcatW
(
buffer
,
cmW
);
l
strcatW
(
buffer
,
cmW
);
if
(
This
->
has_class
)
{
StringFromGUID2
(
&
This
->
class
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
strcatW
(
buffer
,
backslashW
);
StringFromGUID2
(
&
This
->
class
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
l
strcatW
(
buffer
,
backslashW
);
}
strcatW
(
buffer
,
This
->
name
);
l
strcatW
(
buffer
,
This
->
name
);
}
*
ppszDisplayName
=
buffer
;
...
...
@@ -899,12 +899,12 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
pMoniker
->
type
=
DEVICE_FILTER
;
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
l
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
{
IMoniker_Release
(
&
pMoniker
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
}
strcpyW
(
pMoniker
->
name
,
buffer
);
l
strcpyW
(
pMoniker
->
name
,
buffer
);
}
/* then try codecs */
else
if
(
!
(
res
=
RegEnumKeyW
(
This
->
cm_key
,
This
->
cm_index
,
buffer
,
ARRAY_SIZE
(
buffer
))))
...
...
@@ -919,12 +919,12 @@ static HRESULT WINAPI DEVENUM_IEnumMoniker_Next(IEnumMoniker *iface, ULONG celt,
pMoniker
->
type
=
DEVICE_CODEC
;
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
if
(
!
(
pMoniker
->
name
=
CoTaskMemAlloc
((
l
strlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
))))
{
IMoniker_Release
(
&
pMoniker
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
}
strcpyW
(
pMoniker
->
name
,
buffer
);
l
strcpyW
(
pMoniker
->
name
,
buffer
);
}
else
break
;
...
...
@@ -1026,15 +1026,15 @@ HRESULT create_EnumMoniker(REFCLSID class, IEnumMoniker **ppEnumMoniker)
pEnumMoniker
->
cm_index
=
0
;
pEnumMoniker
->
class
=
*
class
;
strcpyW
(
buffer
,
clsidW
);
strcatW
(
buffer
,
backslashW
);
StringFromGUID2
(
class
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
strcatW
(
buffer
,
instanceW
);
l
strcpyW
(
buffer
,
clsidW
);
l
strcatW
(
buffer
,
backslashW
);
StringFromGUID2
(
class
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
l
strcatW
(
buffer
,
instanceW
);
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
pEnumMoniker
->
sw_key
))
pEnumMoniker
->
sw_key
=
NULL
;
strcpyW
(
buffer
,
wszActiveMovieKey
);
StringFromGUID2
(
class
,
buffer
+
strlenW
(
buffer
),
CHARS_IN_GUID
);
l
strcpyW
(
buffer
,
wszActiveMovieKey
);
StringFromGUID2
(
class
,
buffer
+
l
strlenW
(
buffer
),
CHARS_IN_GUID
);
if
(
RegOpenKeyExW
(
HKEY_CURRENT_USER
,
buffer
,
0
,
KEY_ENUMERATE_SUB_KEYS
,
&
pEnumMoniker
->
cm_key
))
pEnumMoniker
->
cm_key
=
NULL
;
...
...
dlls/devenum/parsedisplayname.c
View file @
70d6d09f
...
...
@@ -87,21 +87,21 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayNa
*
ret
=
NULL
;
if
(
eaten
)
*
eaten
=
strlenW
(
name
);
*
eaten
=
l
strlenW
(
name
);
name
=
strchrW
(
name
,
':'
)
+
1
;
name
=
wcschr
(
name
,
':'
)
+
1
;
if
(
!
strncmpW
(
name
,
swW
,
3
))
if
(
!
wcsncmp
(
name
,
swW
,
3
))
{
type
=
DEVICE_FILTER
;
name
+=
3
;
}
else
if
(
!
strncmpW
(
name
,
cmW
,
3
))
else
if
(
!
wcsncmp
(
name
,
cmW
,
3
))
{
type
=
DEVICE_CODEC
;
name
+=
3
;
}
else
if
(
!
strncmpW
(
name
,
dmoW
,
4
))
else
if
(
!
wcsncmp
(
name
,
dmoW
,
4
))
{
type
=
DEVICE_DMO
;
name
+=
4
;
...
...
@@ -141,12 +141,12 @@ static HRESULT WINAPI DEVENUM_IParseDisplayName_ParseDisplayName(IParseDisplayNa
name
+=
CHARS_IN_GUID
;
}
if
(
!
(
mon
->
name
=
CoTaskMemAlloc
((
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
))))
if
(
!
(
mon
->
name
=
CoTaskMemAlloc
((
l
strlenW
(
name
)
+
1
)
*
sizeof
(
WCHAR
))))
{
IMoniker_Release
(
&
mon
->
IMoniker_iface
);
return
E_OUTOFMEMORY
;
}
strcpyW
(
mon
->
name
,
name
);
l
strcpyW
(
mon
->
name
,
name
);
}
mon
->
type
=
type
;
...
...
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