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
225cd594
Commit
225cd594
authored
Jun 30, 2004
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Jun 30, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Look up driver info in the registry as well as in system.ini.
parent
02fdba36
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
34 deletions
+37
-34
Makefile.in
dlls/msacm/Makefile.in
+1
-0
internal.c
dlls/msacm/internal.c
+36
-34
No files found.
dlls/msacm/Makefile.in
View file @
225cd594
...
...
@@ -5,6 +5,7 @@ VPATH = @srcdir@
MODULE
=
msacm32.dll
IMPORTS
=
winmm user32 advapi32 kernel32
ALTNAMES
=
msacm.dll
EXTRALIBS
=
$(LIBUNICODE)
SPEC_SRCS16
=
$
(
ALTNAMES:.dll
=
.spec
)
...
...
dlls/msacm/internal.c
View file @
225cd594
...
...
@@ -283,49 +283,51 @@ PWINE_ACMDRIVERID MSACM_RegisterDriver(LPCWSTR pszDriverAlias, LPCWSTR pszFileNa
*/
void
MSACM_RegisterAllDrivers
(
void
)
{
LPWSTR
pszBuffer
;
DWORD
dwBufferLength
;
static
const
WCHAR
msacm32
[]
=
{
'm'
,
's'
,
'a'
,
'c'
,
'm'
,
'3'
,
'2'
,
'.'
,
'd'
,
'l'
,
'l'
,
'\0'
};
static
const
WCHAR
msacmW
[]
=
{
'M'
,
'S'
,
'A'
,
'C'
,
'M'
,
'.'
};
static
const
WCHAR
drv32
[]
=
{
'd'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'3'
,
'2'
,
'\0'
};
static
const
WCHAR
sys
[]
=
{
's'
,
'y'
,
's'
,
't'
,
'e'
,
'm'
,
'.'
,
'i'
,
'n'
,
'i'
,
'\0'
};
static
const
WCHAR
drvkey
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
's'
,
'3'
,
'2'
,
'\0'
};
DWORD
i
,
cnt
=
0
,
bufLen
,
lRet
;
WCHAR
buf
[
2048
],
*
name
,
*
s
;
FILETIME
lastWrite
;
HKEY
hKey
;
/* FIXME: What if the user edits system.ini while the program is running?
* Does Windows handle that? */
if
(
MSACM_pFirstACMDriverID
)
return
;
lRet
=
RegOpenKeyExW
(
HKEY_LOCAL_MACHINE
,
drvkey
,
0
,
KEY_QUERY_VALUE
,
&
hKey
);
if
(
lRet
==
ERROR_SUCCESS
)
{
RegQueryInfoKeyW
(
hKey
,
0
,
0
,
0
,
&
cnt
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
bufLen
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
lRet
=
RegEnumKeyExW
(
hKey
,
i
,
buf
,
&
bufLen
,
0
,
0
,
0
,
&
lastWrite
);
if
(
lRet
!=
ERROR_SUCCESS
)
continue
;
if
(
strncmpiW
(
buf
,
msacmW
,
sizeof
(
msacmW
)
/
sizeof
(
msacmW
[
0
])))
continue
;
if
(
!
(
name
=
strchrW
(
buf
,
'='
)))
continue
;
*
name
=
0
;
MSACM_RegisterDriver
(
buf
,
name
+
1
,
0
);
}
RegCloseKey
(
hKey
);
}
/* FIXME
* What if the user edits system.ini while the program is running?
* Does Windows handle that?
*/
if
(
MSACM_pFirstACMDriverID
)
return
;
/* FIXME: Does not work! How do I determine the section length? */
dwBufferLength
=
1024
;
/* EPP GetPrivateProfileSectionA("drivers32", NULL, 0, "system.ini"); */
pszBuffer
=
(
LPWSTR
)
HeapAlloc
(
MSACM_hHeap
,
0
,
dwBufferLength
*
sizeof
(
WCHAR
));
if
(
GetPrivateProfileSectionW
(
drv32
,
pszBuffer
,
dwBufferLength
,
sys
))
if
(
GetPrivateProfileSectionW
(
drv32
,
buf
,
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]),
sys
))
{
LPWSTR
s
=
pszBuffer
,
s2
;
while
(
*
s
)
{
CharUpperBuffW
(
s
,
6
);
if
(
memcmp
(
s
,
msacmW
,
6
*
sizeof
(
WCHAR
))
==
0
)
{
s2
=
s
;
while
(
*
s2
!=
'\0'
&&
*
s2
!=
'='
)
s2
++
;
if
(
*
s2
)
{
*
s2
=
'\0'
;
MSACM_RegisterDriver
(
s
,
s2
+
1
,
0
);
*
s2
=
'='
;
}
}
s
+=
strlenW
(
s
)
+
1
;
/* Either next char or \0 */
for
(
s
=
buf
;
*
s
;
s
+=
strlenW
(
s
)
+
1
)
{
if
(
strncmpiW
(
s
,
msacmW
,
sizeof
(
msacmW
)
/
sizeof
(
msacmW
[
0
])))
continue
;
if
(
!
(
name
=
strchrW
(
s
,
'='
)))
continue
;
*
name
=
0
;
MSACM_RegisterDriver
(
s
,
name
+
1
,
0
);
*
name
=
'='
;
}
}
HeapFree
(
MSACM_hHeap
,
0
,
pszBuffer
);
MSACM_RegisterDriver
(
msacm32
,
msacm32
,
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