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
bd1a0a6e
Commit
bd1a0a6e
authored
Apr 10, 1999
by
Eric Pouech
Committed by
Alexandre Julliard
Apr 10, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better error handling ; a few bug fixes ; now OpenDriver16 can load 32
bit drivers. Added stub for GetDriverFlags.
parent
2f5a152e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
26 deletions
+42
-26
winmm.spec
relay32/winmm.spec
+1
-1
driver.c
windows/driver.c
+41
-25
No files found.
relay32/winmm.spec
View file @
bd1a0a6e
...
...
@@ -13,7 +13,7 @@ type win32
10 stdcall DrvOpen(wstr wstr long) OpenDriverW
11 stdcall DrvOpenA(str str long) OpenDriverA
12 stdcall DrvSendMessage(long long long long) SendDriverMessage
13 st
ub
GetDriverFlags
13 st
dcall GetDriverFlags(long)
GetDriverFlags
14 stdcall GetDriverModuleHandle(long) GetDriverModuleHandle
15 stdcall OpenDriver(wstr wstr long) OpenDriverW
16 stdcall OpenDriverA(str str long) OpenDriverA
...
...
windows/driver.c
View file @
bd1a0a6e
...
...
@@ -31,22 +31,21 @@ static LPWINE_DRIVER lpDrvItemList = NULL;
*/
static
void
WINE_UNUSED
DRIVER_LoadStartupDrivers
(
void
)
{
HDRVR16
hDrv
;
char
str
[
256
];
LPSTR
ptr
;
if
(
GetPrivateProfileStringA
(
"drivers"
,
NULL
,
""
,
str
,
sizeof
(
str
),
"SYSTEM.INI"
)
<
2
)
{
ERR
(
driver
,
"Can't find drivers section in system.ini
\n
"
);
return
;
}
for
(
ptr
=
str
;
lstrlenA
(
ptr
)
!=
0
;
ptr
+=
lstrlenA
(
ptr
)
+
1
)
{
TRACE
(
driver
,
"str='%s'
\n
"
,
ptr
);
hDrv
=
OpenDriver16
(
ptr
,
"drivers"
,
0L
);
TRACE
(
driver
,
"hDrv=%04x
\n
"
,
hDrv
);
}
else
{
HDRVR16
hDrv
;
LPSTR
ptr
;
for
(
ptr
=
str
;
lstrlenA
(
ptr
)
!=
0
;
ptr
+=
lstrlenA
(
ptr
)
+
1
)
{
TRACE
(
driver
,
"str='%s'
\n
"
,
ptr
);
hDrv
=
OpenDriver16
(
ptr
,
"drivers"
,
0L
);
TRACE
(
driver
,
"hDrv=%04x
\n
"
,
hDrv
);
}
TRACE
(
driver
,
"end of list !
\n
"
);
}
TRACE
(
driver
,
"end of list !
\n
"
);
return
;
}
/**************************************************************************
...
...
@@ -91,10 +90,10 @@ static LPWINE_DRIVER DRIVER_FindFromHDrvr16(HDRVR16 hDrvr)
for
(
lpDrv
=
lpDrvItemList
;
lpDrv
;
lpDrv
=
lpDrv
->
lpNextItem
)
{
if
(
lpDrv
->
hDriver16
==
hDrvr
)
{
return
lpDrv
;
break
;
}
}
return
NULL
;
return
lpDrv
;
}
/**************************************************************************
...
...
@@ -696,7 +695,7 @@ static HDRVR16 DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam, BOOL bCa
HMODULE16
hModule
;
DRIVERPROC16
lpProc
;
TRACE
(
driver
,
"('%s', %08lX
);
\n
"
,
lpFileName
,
lParam
);
TRACE
(
driver
,
"('%s', %08lX
, %d);
\n
"
,
lpFileName
,
lParam
,
bCallFrom32
);
if
(
lstrlenA
(
lpFileName
)
<
1
)
return
0
;
...
...
@@ -704,14 +703,16 @@ static HDRVR16 DRIVER_TryOpenDriver16(LPCSTR lpFileName, LPARAM lParam, BOOL bCa
lpSFN
=
strrchr
(
lpFileName
,
'\\'
);
lpSFN
=
(
lpSFN
)
?
(
lpSFN
+
1
)
:
lpFileName
;
if
((
hModule
=
LoadModule16
(
lpFileName
,
(
LPVOID
)
-
1
))
!=
0
)
{
if
((
hModule
=
LoadModule16
(
lpFileName
,
(
LPVOID
)
-
1
))
>=
32
)
{
if
((
lpProc
=
(
DRIVERPROC16
)
WIN32_GetProcAddress16
(
hModule
,
"DRIVERPROC"
))
!=
NULL
)
{
lpDrv
=
DRIVER_RegisterDriver16
(
lpSFN
,
hModule
,
lpProc
,
lParam
,
bCallFrom32
);
}
else
{
FreeLibrary16
(
hModule
);
TRACE
(
driver
,
"No DriverProc found
\n
"
);
lpDrv
=
0
;
}
}
else
{
TRACE
(
driver
,
"Unable to load 16 bit module (%s)
\n
"
,
lpFileNam
e
);
TRACE
(
driver
,
"Unable to load 16 bit module (%s)
: %d
\n
"
,
lpFileName
,
hModul
e
);
}
return
lpDrv
?
lpDrv
->
hDriver16
:
0
;
}
...
...
@@ -728,7 +729,7 @@ static HDRVR DRIVER_TryOpenDriver32(LPCSTR lpFileName, LPARAM lParam, BOOL bCall
HMODULE
hModule
;
DRIVERPROC
lpProc
;
TRACE
(
driver
,
"('%s', %08lX
);
\n
"
,
lpFileName
,
lParam
);
TRACE
(
driver
,
"('%s', %08lX
, %d);
\n
"
,
lpFileName
,
lParam
,
bCallFrom32
);
if
(
lstrlenA
(
lpFileName
)
<
1
)
return
0
;
...
...
@@ -740,6 +741,8 @@ static HDRVR DRIVER_TryOpenDriver32(LPCSTR lpFileName, LPARAM lParam, BOOL bCall
if
((
lpProc
=
GetProcAddress
(
hModule
,
"DriverProc"
))
!=
NULL
)
{
lpDrv
=
DRIVER_RegisterDriver32
(
lpSFN
,
hModule
,
lpProc
,
lParam
,
bCallFrom32
);
}
else
{
FreeLibrary
(
hModule
);
lpDrv
=
0
;
TRACE
(
driver
,
"No DriverProc found
\n
"
);
}
}
else
{
...
...
@@ -762,6 +765,9 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP
if
(
lpSectionName
==
NULL
)
{
hDriver
=
DRIVER_TryOpenDriver16
(
lpDriverName
,
lParam
,
FALSE
);
if
(
!
hDriver
)
{
hDriver
=
DRIVER_TryOpenDriver32
(
lpDriverName
,
lParam
,
FALSE
);
}
if
(
!
hDriver
)
{
/* in case hDriver is NULL, search in Drivers32 section */
lpSectionName
=
"Drivers"
;
}
...
...
@@ -774,7 +780,7 @@ HDRVR16 WINAPI OpenDriver16(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lP
}
/**************************************************************************
* OpenDriver
32
A [WINMM.15]
* OpenDriverA [WINMM.15]
* (0,1,DRV_LOAD ,0 ,0)
* (0,1,DRV_ENABLE,0 ,0)
* (0,1,DRV_OPEN ,buf[256],0)
...
...
@@ -820,7 +826,7 @@ HDRVR WINAPI OpenDriverA(LPCSTR lpDriverName, LPCSTR lpSectionName, LPARAM lPara
}
/**************************************************************************
* OpenDriver
32
W [WINMM.15]
* OpenDriverW [WINMM.15]
*/
HDRVR
WINAPI
OpenDriverW
(
LPCWSTR
lpDriverName
,
LPCWSTR
lpSectionName
,
LPARAM
lParam
)
{
...
...
@@ -834,7 +840,7 @@ HDRVR WINAPI OpenDriverW(LPCWSTR lpDriverName, LPCWSTR lpSectionName, LPARAM lPa
}
/**************************************************************************
* CloseDriver [USER.253]
* CloseDriver
16
[USER.253]
*/
LRESULT
WINAPI
CloseDriver16
(
HDRVR16
hDrvr
,
LPARAM
lParam1
,
LPARAM
lParam2
)
{
...
...
@@ -855,7 +861,7 @@ LRESULT WINAPI CloseDriver16(HDRVR16 hDrvr, LPARAM lParam1, LPARAM lParam2)
}
/**************************************************************************
* CloseDriver
32
[WINMM.4]
* CloseDriver [WINMM.4]
*/
LRESULT
WINAPI
CloseDriver
(
HDRVR
hDrvr
,
LPARAM
lParam1
,
LPARAM
lParam2
)
{
...
...
@@ -894,7 +900,16 @@ HMODULE16 WINAPI GetDriverModuleHandle16(HDRVR16 hDrvr)
}
/**************************************************************************
* GetDriverModuleHandle [USER.254]
* GetDriverFlags [WINMM.13]
*/
DWORD
WINAPI
GetDriverFlags
(
HDRVR
hDrvr
)
{
FIXME
(
driver
,
"(%04x); stub!
\n
"
,
hDrvr
);
return
0
;
}
/**************************************************************************
* GetDriverModuleHandle [WINMM.14]
*/
HMODULE
WINAPI
GetDriverModuleHandle
(
HDRVR
hDrvr
)
{
...
...
@@ -950,8 +965,8 @@ BOOL16 WINAPI GetDriverInfo16(HDRVR16 hDrvr, LPDRIVERINFOSTRUCT16 lpDrvInfo)
TRACE
(
driver
,
"(%04x, %p);
\n
"
,
hDrvr
,
lpDrvInfo
);
if
(
lpDrvInfo
==
NULL
||
lpDrvInfo
->
length
!=
sizeof
(
DRIVERINFOSTRUCT16
))
return
FALSE
;
if
(
lpDrvInfo
==
NULL
||
lpDrvInfo
->
length
!=
sizeof
(
DRIVERINFOSTRUCT16
))
return
FALSE
;
lpDrv
=
DRIVER_FindFromHDrvr16
(
hDrvr
);
if
(
lpDrv
!=
NULL
&&
lpDrv
->
hDriver16
==
hDrvr
&&
...
...
@@ -981,7 +996,8 @@ HDRVR16 WINAPI GetNextDriver16(HDRVR16 hDrvr, DWORD dwFlags)
/* FIXME: code was using DRIVER_LoadStartupDrivers(); before ?
* I (EPP) don't quite understand this
*/
if
(
lpDrvItemList
==
NULL
)
return
0
;
if
(
lpDrvItemList
==
NULL
)
return
0
;
}
lpDrv
=
lpDrvItemList
;
if
(
dwFlags
&
GND_REVERSE
)
{
...
...
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