Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
6238adc8
Commit
6238adc8
authored
Apr 22, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 22, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdmo: Fix DMOGetName() error handling and error values.
parent
c954d50b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
21 deletions
+37
-21
dmoreg.c
dlls/msdmo/dmoreg.c
+20
-21
msdmo.c
dlls/msdmo/tests/msdmo.c
+17
-0
No files found.
dlls/msdmo/dmoreg.c
View file @
6238adc8
...
...
@@ -325,38 +325,37 @@ lend:
/***************************************************************
* DMOGetName (MSDMO.@)
*
* Get DM
P
Name from the registry
* Get DM
O
Name from the registry
*/
HRESULT
WINAPI
DMOGetName
(
REFCLSID
clsidDMO
,
WCHAR
szN
ame
[])
HRESULT
WINAPI
DMOGetName
(
REFCLSID
clsidDMO
,
WCHAR
n
ame
[])
{
static
const
INT
max_name_len
=
80
*
sizeof
(
WCHAR
);
DWORD
count
=
max_name_len
;
WCHAR
szguid
[
64
];
HKEY
hrkey
=
0
;
HKEY
hkey
=
0
;
static
const
INT
max_name_len
=
80
;
DWORD
count
;
HKEY
hrkey
,
hkey
;
LONG
ret
;
TRACE
(
"%s
\n
"
,
debugstr_guid
(
clsidDMO
)
);
TRACE
(
"%s
%p
\n
"
,
debugstr_guid
(
clsidDMO
),
name
);
ret
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
KEY_READ
,
&
hrkey
);
if
(
ERROR_SUCCESS
!=
ret
)
goto
lend
;
if
(
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
KEY_READ
,
&
hrkey
))
return
E_FAIL
;
ret
=
RegOpenKeyExW
(
hrkey
,
GUIDToString
(
szguid
,
clsidDMO
),
0
,
KEY_READ
,
&
hkey
);
if
(
ERROR_SUCCESS
!=
ret
)
goto
lend
;
RegCloseKey
(
hrkey
);
if
(
ret
)
return
E_FAIL
;
count
=
max_name_len
*
sizeof
(
WCHAR
);
ret
=
RegQueryValueExW
(
hkey
,
NULL
,
NULL
,
NULL
,
(
LPBYTE
)
szName
,
&
count
);
ret
=
RegQueryValueExW
(
hkey
,
NULL
,
NULL
,
NULL
,
(
LPBYTE
)
name
,
&
count
);
RegCloseKey
(
hkey
);
TRACE
(
" szName=%s
\n
"
,
debugstr_w
(
szName
));
lend:
if
(
hkey
)
RegCloseKey
(
hrkey
);
if
(
hkey
)
RegCloseKey
(
hkey
);
if
(
!
ret
&&
count
>
1
)
{
TRACE
(
"name=%s
\n
"
,
debugstr_w
(
name
));
return
S_OK
;
}
return
HRESULT_FROM_WIN32
(
ret
);
name
[
0
]
=
0
;
return
S_FALSE
;
}
/**************************************************************************
...
...
dlls/msdmo/tests/msdmo.c
View file @
6238adc8
...
...
@@ -25,6 +25,7 @@
DEFINE_GUID
(
GUID_NULL
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
static
const
GUID
GUID_unknowndmo
=
{
0x14d99047
,
0x441f
,
0x4cd3
,{
0xbc
,
0xa8
,
0x3e
,
0x67
,
0x99
,
0xaf
,
0x34
,
0x75
}};
static
const
GUID
GUID_unknowncategory
=
{
0x14d99048
,
0x441f
,
0x4cd3
,{
0xbc
,
0xa8
,
0x3e
,
0x67
,
0x99
,
0xaf
,
0x34
,
0x75
}};
static
const
GUID
GUID_wmp1
=
{
0x13a7995e
,
0x7d8f
,
0x45b4
,{
0x9c
,
0x77
,
0x81
,
0x92
,
0x65
,
0x22
,
0x57
,
0x63
}};
static
void
test_DMOUnregister
(
void
)
{
...
...
@@ -54,7 +55,23 @@ static void test_DMOUnregister(void)
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
}
static
void
test_DMOGetName
(
void
)
{
WCHAR
name
[
80
];
HRESULT
hr
;
hr
=
DMOGetName
(
&
GUID_unknowndmo
,
NULL
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
/* no such DMO */
name
[
0
]
=
'a'
;
hr
=
DMOGetName
(
&
GUID_wmp1
,
name
);
ok
(
hr
==
E_FAIL
,
"got 0x%08x
\n
"
,
hr
);
ok
(
name
[
0
]
==
'a'
,
"got %x
\n
"
,
name
[
0
]);
}
START_TEST
(
msdmo
)
{
test_DMOUnregister
();
test_DMOGetName
();
}
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