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
830fe630
Commit
830fe630
authored
Mar 06, 2019
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 07, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvfw32: Correctly implement ICINSTALL_DRIVER.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
3ff496b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
48 deletions
+53
-48
msvideo_main.c
dlls/msvfw32/msvideo_main.c
+52
-44
msvfw.c
dlls/msvfw32/tests/msvfw.c
+1
-4
No files found.
dlls/msvfw32/msvideo_main.c
View file @
830fe630
...
...
@@ -108,7 +108,6 @@ struct _reg_driver
DWORD
fccType
;
DWORD
fccHandler
;
DRIVERPROC
proc
;
LPWSTR
name
;
struct
list
entry
;
};
...
...
@@ -336,77 +335,92 @@ BOOL VFWAPI ICInfo(DWORD type, DWORD handler, ICINFO *info)
static
DWORD
IC_HandleRef
=
1
;
/***********************************************************************
*
ICInstall
[MSVFW32.@]
*
ICInstall
[MSVFW32.@]
*/
BOOL
VFWAPI
ICInstall
(
DWORD
fccType
,
DWORD
fccHandler
,
LPARAM
lParam
,
LPSTR
szDesc
,
UINT
wFlags
)
BOOL
VFWAPI
ICInstall
(
DWORD
type
,
DWORD
handler
,
LPARAM
lparam
,
char
*
desc
,
UINT
flags
)
{
reg_driver
*
driver
;
unsigned
len
;
reg_driver
*
driver
;
TRACE
(
"(%s,%s,%p,%p,0x%08x)
\n
"
,
wine_dbgstr_fcc
(
fccType
),
wine_dbgstr_fcc
(
fccHandler
),
(
void
*
)
lParam
,
szDesc
,
wFlags
);
TRACE
(
"type %s, handler %s, lparam %#lx, desc %s, flags %#x.
\n
"
,
wine_dbgstr_fcc
(
type
),
wine_dbgstr_fcc
(
handler
),
lparam
,
debugstr_a
(
desc
),
flags
);
/* Check if a driver is already registered */
LIST_FOR_EACH_ENTRY
(
driver
,
&
reg_driver_list
,
reg_driver
,
entry
)
{
if
(
!
compare_fourcc
(
fccType
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccH
andler
,
driver
->
fccHandler
))
if
(
!
compare_fourcc
(
type
,
driver
->
fccType
)
&&
!
compare_fourcc
(
h
andler
,
driver
->
fccHandler
))
{
return
FALSE
;
}
}
/* Register the driver */
if
(
!
(
driver
=
heap_alloc_zero
(
sizeof
(
*
driver
))))
return
FALSE
;
driver
->
fccType
=
fccType
;
driver
->
fccHandler
=
fccHandler
;
switch
(
wFlags
)
switch
(
flags
)
{
case
ICINSTALL_FUNCTION
:
driver
->
proc
=
(
DRIVERPROC
)
lParam
;
break
;
if
(
!
(
driver
=
heap_alloc_zero
(
sizeof
(
*
driver
))))
return
FALSE
;
driver
->
fccType
=
type
;
driver
->
fccHandler
=
handler
;
driver
->
proc
=
(
DRIVERPROC
)
lparam
;
list_add_tail
(
&
reg_driver_list
,
&
driver
->
entry
);
return
TRUE
;
case
ICINSTALL_DRIVER
:
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
lParam
,
-
1
,
NULL
,
0
);
if
(
!
(
driver
->
name
=
heap_alloc
(
len
*
sizeof
(
WCHAR
))))
{
heap_free
(
driver
);
{
const
char
*
driver
=
(
const
char
*
)
lparam
;
char
value
[
10
];
HKEY
key
;
LONG
res
;
if
(
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
HKLM_DRIVERS32
,
0
,
KEY_SET_VALUE
,
&
key
))
return
FALSE
;
}
MultiByteToWideChar
(
CP_ACP
,
0
,
(
char
*
)
lParam
,
-
1
,
driver
->
name
,
len
);
break
;
fourcc_to_string
(
value
,
type
);
value
[
4
]
=
'.'
;
fourcc_to_string
(
value
+
5
,
handler
);
value
[
9
]
=
0
;
res
=
RegSetValueExA
(
key
,
value
,
0
,
REG_SZ
,
(
const
BYTE
*
)
driver
,
strlen
(
driver
)
+
1
);
RegCloseKey
(
key
);
return
!
res
;
}
default:
ERR
(
"Invalid flags!
\n
"
);
heap_free
(
driver
);
FIXME
(
"Unhandled flags %#x.
\n
"
,
flags
);
return
FALSE
;
}
list_add_tail
(
&
reg_driver_list
,
&
driver
->
entry
);
return
TRUE
;
}
/***********************************************************************
*
ICRemove
[MSVFW32.@]
*
ICRemove
[MSVFW32.@]
*/
BOOL
VFWAPI
ICRemove
(
DWORD
fccType
,
DWORD
fccHandler
,
UINT
wFlags
)
BOOL
VFWAPI
ICRemove
(
DWORD
type
,
DWORD
handler
,
UINT
flags
)
{
reg_driver
*
driver
;
char
value
[
10
];
HKEY
key
;
LONG
res
;
TRACE
(
"(%s,%s,0x%08x)
\n
"
,
wine_dbgstr_fcc
(
fccType
),
wine_dbgstr_fcc
(
fccHandler
),
wFlags
);
TRACE
(
"type %s, handler %s, flags %#x.
\n
"
,
wine_dbgstr_fcc
(
type
),
wine_dbgstr_fcc
(
handler
),
flags
);
LIST_FOR_EACH_ENTRY
(
driver
,
&
reg_driver_list
,
reg_driver
,
entry
)
{
if
(
!
compare_fourcc
(
fccT
ype
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccH
andler
,
driver
->
fccHandler
))
if
(
!
compare_fourcc
(
t
ype
,
driver
->
fccType
)
&&
!
compare_fourcc
(
h
andler
,
driver
->
fccHandler
))
{
list_remove
(
&
driver
->
entry
);
heap_free
(
driver
->
name
);
heap_free
(
driver
);
return
TRUE
;
}
}
if
(
!
RegOpenKeyExA
(
HKEY_LOCAL_MACHINE
,
HKLM_DRIVERS32
,
0
,
KEY_SET_VALUE
,
&
key
))
{
fourcc_to_string
(
value
,
type
);
value
[
4
]
=
'.'
;
fourcc_to_string
(
value
+
5
,
handler
);
value
[
9
]
=
0
;
res
=
RegDeleteValueA
(
key
,
value
);
RegCloseKey
(
key
);
return
!
res
;
}
return
FALSE
;
}
...
...
@@ -452,13 +466,7 @@ HIC VFWAPI ICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
if
(
!
compare_fourcc
(
fccType
,
driver
->
fccType
)
&&
!
compare_fourcc
(
fccHandler
,
driver
->
fccHandler
))
{
if
(
driver
->
proc
)
return
ICOpenFunction
(
driver
->
fccType
,
driver
->
fccHandler
,
wMode
,
driver
->
proc
);
else
{
if
(
!
(
hdrv
=
OpenDriver
(
driver
->
name
,
NULL
,
(
LPARAM
)
&
icopen
)))
return
NULL
;
}
return
ICOpenFunction
(
driver
->
fccType
,
driver
->
fccHandler
,
wMode
,
driver
->
proc
);
}
}
...
...
dlls/msvfw32/tests/msvfw.c
View file @
830fe630
...
...
@@ -373,14 +373,11 @@ static void test_ICInfo(void)
size
=
sizeof
(
buffer
);
res
=
RegQueryValueExA
(
key
,
"wine.test"
,
NULL
,
NULL
,
(
BYTE
*
)
buffer
,
&
size
);
todo_wine
{
ok
(
!
res
,
"Failed to query value, error %d.
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"bogus"
),
"Got unexpected value
\"
%s
\"
.
\n
"
,
buffer
);
}
memset
(
&
info
,
0x55
,
sizeof
(
info
));
info
.
dwSize
=
sizeof
(
info
);
todo_wine
ok
(
ICInfo
(
test_type
,
test_handler
,
&
info
),
"Expected success.
\n
"
);
ok
(
info
.
fccType
==
test_type
,
"Got unexpected type %#x.
\n
"
,
info
.
fccType
);
ok
(
info
.
fccHandler
==
test_handler
,
"Got unexpected handler %#x.
\n
"
,
info
.
fccHandler
);
...
...
@@ -389,10 +386,10 @@ todo_wine
ok
(
info
.
dwVersionICM
==
ICVERSION
,
"Got unexpected ICM version %#x.
\n
"
,
info
.
dwVersionICM
);
ok
(
!
info
.
szName
[
0
],
"Got unexpected name %s.
\n
"
,
wine_dbgstr_w
(
info
.
szName
));
ok
(
!
info
.
szDescription
[
0
],
"Got unexpected name %s.
\n
"
,
wine_dbgstr_w
(
info
.
szDescription
));
todo_wine
ok
(
!
lstrcmpW
(
info
.
szDriver
,
bogusW
),
"Got unexpected driver %s.
\n
"
,
wine_dbgstr_w
(
info
.
szDriver
));
/* Drivers installed after msvfw32 is loaded are not enumerated. */
todo_wine
ok
(
!
ICInfo
(
test_type
,
0
,
&
info
),
"Expected failure.
\n
"
);
ret
=
ICRemove
(
test_type
,
test_handler
,
0
);
...
...
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