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
af671259
Commit
af671259
authored
Dec 29, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msdmo: Use specified category in DMOUnregister().
parent
8fc7e175
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
117 additions
and
23 deletions
+117
-23
configure
configure
+1
-0
configure.ac
configure.ac
+1
-0
dmoreg.c
dlls/msdmo/dmoreg.c
+50
-23
Makefile.in
dlls/msdmo/tests/Makefile.in
+5
-0
msdmo.c
dlls/msdmo/tests/msdmo.c
+60
-0
No files found.
configure
View file @
af671259
...
@@ -17215,6 +17215,7 @@ wine_fn_config_dll msctf enable_msctf clean
...
@@ -17215,6 +17215,7 @@ wine_fn_config_dll msctf enable_msctf clean
wine_fn_config_test dlls/msctf/tests msctf_test
wine_fn_config_test dlls/msctf/tests msctf_test
wine_fn_config_dll msdaps enable_msdaps clean
wine_fn_config_dll msdaps enable_msdaps clean
wine_fn_config_dll msdmo enable_msdmo implib
wine_fn_config_dll msdmo enable_msdmo implib
wine_fn_config_test dlls/msdmo/tests msdmo_test
wine_fn_config_dll msftedit enable_msftedit
wine_fn_config_dll msftedit enable_msftedit
wine_fn_config_dll msg711.acm enable_msg711_acm
wine_fn_config_dll msg711.acm enable_msg711_acm
wine_fn_config_dll msgsm32.acm enable_msgsm32_acm
wine_fn_config_dll msgsm32.acm enable_msgsm32_acm
...
...
configure.ac
View file @
af671259
...
@@ -3039,6 +3039,7 @@ WINE_CONFIG_DLL(msctf,,[clean])
...
@@ -3039,6 +3039,7 @@ WINE_CONFIG_DLL(msctf,,[clean])
WINE_CONFIG_TEST(dlls/msctf/tests)
WINE_CONFIG_TEST(dlls/msctf/tests)
WINE_CONFIG_DLL(msdaps,,[clean])
WINE_CONFIG_DLL(msdaps,,[clean])
WINE_CONFIG_DLL(msdmo,,[implib])
WINE_CONFIG_DLL(msdmo,,[implib])
WINE_CONFIG_TEST(dlls/msdmo/tests)
WINE_CONFIG_DLL(msftedit)
WINE_CONFIG_DLL(msftedit)
WINE_CONFIG_DLL(msg711.acm)
WINE_CONFIG_DLL(msg711.acm)
WINE_CONFIG_DLL(msgsm32.acm)
WINE_CONFIG_DLL(msgsm32.acm)
...
...
dlls/msdmo/dmoreg.c
View file @
af671259
...
@@ -188,7 +188,10 @@ HRESULT WINAPI DMORegister(
...
@@ -188,7 +188,10 @@ HRESULT WINAPI DMORegister(
HKEY
hckey
=
0
;
HKEY
hckey
=
0
;
HKEY
hclskey
=
0
;
HKEY
hclskey
=
0
;
TRACE
(
"%s
\n
"
,
debugstr_w
(
szName
));
TRACE
(
"%s %s %s
\n
"
,
debugstr_w
(
szName
),
debugstr_guid
(
clsidDMO
),
debugstr_guid
(
guidCategory
));
if
(
IsEqualGUID
(
guidCategory
,
&
GUID_NULL
))
return
E_INVALIDARG
;
hres
=
RegCreateKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
NULL
,
hres
=
RegCreateKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
NULL
,
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
hrkey
,
NULL
);
REG_OPTION_NON_VOLATILE
,
KEY_WRITE
,
NULL
,
&
hrkey
,
NULL
);
...
@@ -252,46 +255,70 @@ lend:
...
@@ -252,46 +255,70 @@ lend:
return
hres
;
return
hres
;
}
}
static
HRESULT
unregister_dmo_from_category
(
const
WCHAR
*
dmoW
,
const
WCHAR
*
catW
,
HKEY
categories
)
{
HKEY
catkey
;
LONG
ret
;
ret
=
RegOpenKeyExW
(
categories
,
catW
,
0
,
KEY_WRITE
,
&
catkey
);
if
(
!
ret
)
{
ret
=
RegDeleteKeyW
(
catkey
,
dmoW
);
RegCloseKey
(
catkey
);
}
return
!
ret
?
S_OK
:
S_FALSE
;
}
/***************************************************************
/***************************************************************
* DMOUnregister (MSDMO.@)
* DMOUnregister (MSDMO.@)
*
*
* Unregister a DirectX Media Object.
* Unregister a DirectX Media Object.
*/
*/
HRESULT
WINAPI
DMOUnregister
(
REFCLSID
clsidDMO
,
REFGUID
guidC
ategory
)
HRESULT
WINAPI
DMOUnregister
(
REFCLSID
dmo
,
REFGUID
c
ategory
)
{
{
WCHAR
szguid
[
64
]
;
HKEY
rootkey
=
0
,
categorieskey
=
0
;
HKEY
hrkey
=
0
;
WCHAR
dmoW
[
64
],
catW
[
64
]
;
H
KEY
hckey
=
0
;
H
RESULT
hr
=
S_FALSE
;
LONG
ret
;
LONG
ret
;
GUIDToString
(
szguid
,
clsidDMO
);
TRACE
(
"%s %s
\n
"
,
debugstr_guid
(
dmo
),
debugstr_guid
(
category
)
);
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
szguid
),
guidCategory
);
ret
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
KEY_WRITE
,
&
rootkey
);
if
(
ret
)
return
HRESULT_FROM_WIN32
(
ret
);
ret
=
RegOpenKeyExW
(
HKEY_CLASSES_ROOT
,
szDMORootKey
,
0
,
KEY_WRITE
,
&
hrkey
);
GUIDToString
(
dmoW
,
dmo
);
if
(
ERROR_SUCCESS
!=
ret
)
RegDeleteKeyW
(
rootkey
,
dmoW
);
goto
lend
;
ret
=
RegDeleteKeyW
(
hrkey
,
szguid
);
/* open 'Categories' */
if
(
ERROR_SUCCESS
!=
ret
)
ret
=
RegOpenKeyExW
(
rootkey
,
szDMOCategories
,
0
,
KEY_WRITE
|
KEY_ENUMERATE_SUB_KEYS
,
&
categorieskey
);
RegCloseKey
(
rootkey
);
if
(
ret
)
{
hr
=
HRESULT_FROM_WIN32
(
ret
);
goto
lend
;
goto
lend
;
}
ret
=
RegOpenKeyExW
(
hrkey
,
szDMOCategories
,
0
,
KEY_WRITE
,
&
hckey
);
/* remove from all categories */
if
(
ERROR_SUCCESS
!=
ret
)
if
(
IsEqualGUID
(
category
,
&
GUID_NULL
))
goto
lend
;
{
DWORD
index
=
0
,
len
=
sizeof
(
catW
)
/
sizeof
(
WCHAR
);
ret
=
RegDeleteKeyW
(
hckey
,
szguid
);
while
(
!
RegEnumKeyExW
(
categorieskey
,
index
++
,
catW
,
&
len
,
NULL
,
NULL
,
NULL
,
NULL
))
if
(
ERROR_SUCCESS
!=
ret
)
hr
=
unregister_dmo_from_category
(
dmoW
,
catW
,
categorieskey
);
goto
lend
;
}
else
{
GUIDToString
(
catW
,
category
);
hr
=
unregister_dmo_from_category
(
dmoW
,
catW
,
categorieskey
);
}
lend:
lend:
if
(
hckey
)
if
(
categorieskey
)
RegCloseKey
(
hckey
);
RegCloseKey
(
categorieskey
);
if
(
hrkey
)
RegCloseKey
(
hrkey
);
return
HRESULT_FROM_WIN32
(
ret
)
;
return
hr
;
}
}
...
...
dlls/msdmo/tests/Makefile.in
0 → 100644
View file @
af671259
TESTDLL
=
msdmo.dll
IMPORTS
=
msdmo
C_SRCS
=
\
msdmo.c
dlls/msdmo/tests/msdmo.c
0 → 100644
View file @
af671259
/*
* MSDMO tests
*
* Copyright 2014 Nikolay Sivov for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "initguid.h"
#include "dmo.h"
#include "wine/test.h"
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
void
test_DMOUnregister
(
void
)
{
static
const
WCHAR
testdmoW
[]
=
{
't'
,
'e'
,
's'
,
't'
,
'd'
,
'm'
,
'o'
,
0
};
HRESULT
hr
;
hr
=
DMOUnregister
(
&
GUID_unknowndmo
,
&
GUID_unknowncategory
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
hr
=
DMOUnregister
(
&
GUID_unknowndmo
,
&
GUID_NULL
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
/* can't register for all categories */
hr
=
DMORegister
(
testdmoW
,
&
GUID_unknowndmo
,
&
GUID_NULL
,
0
,
0
,
NULL
,
0
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
hr
=
DMORegister
(
testdmoW
,
&
GUID_unknowndmo
,
&
GUID_unknowncategory
,
0
,
0
,
NULL
,
0
,
NULL
);
if
(
hr
!=
S_OK
)
{
win_skip
(
"Failed to register DMO. Probably user doesn't have persmissions to do so.
\n
"
);
return
;
}
hr
=
DMOUnregister
(
&
GUID_unknowndmo
,
&
GUID_NULL
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
DMOUnregister
(
&
GUID_unknowndmo
,
&
GUID_NULL
);
ok
(
hr
==
S_FALSE
,
"got 0x%08x
\n
"
,
hr
);
}
START_TEST
(
msdmo
)
{
test_DMOUnregister
();
}
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