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
40443725
Commit
40443725
authored
Nov 14, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved winedos loading functionality to dlls/kernel/instr.c and get rid
of msdos/dpmi.c.
parent
3f1498fc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
78 additions
and
133 deletions
+78
-133
Makefile.in
dlls/kernel/Makefile.in
+0
-2
device.c
dlls/kernel/device.c
+4
-13
instr.c
dlls/kernel/instr.c
+71
-11
kernel_private.h
dlls/kernel/kernel_private.h
+2
-11
vxd.c
dlls/kernel/vxd.c
+1
-2
miscemu.h
include/miscemu.h
+0
-6
dpmi.c
msdos/dpmi.c
+0
-88
No files found.
dlls/kernel/Makefile.in
View file @
40443725
...
...
@@ -25,7 +25,6 @@ C_SRCS = \
$(TOPOBJDIR)
/files/smb.c
\
$(TOPOBJDIR)
/misc/options.c
\
$(TOPOBJDIR)
/misc/registry.c
\
$(TOPOBJDIR)
/msdos/dpmi.c
\
atom.c
\
change.c
\
comm.c
\
...
...
@@ -99,7 +98,6 @@ SUBDIRS = tests
EXTRASUBDIRS
=
\
$(TOPOBJDIR)
/files
\
$(TOPOBJDIR)
/misc
\
$(TOPOBJDIR)
/msdos
\
messages
\
nls
...
...
dlls/kernel/device.c
View file @
40443725
...
...
@@ -42,7 +42,6 @@
#include "winioctl.h"
#include "winnt.h"
#include "msdos.h"
#include "miscemu.h"
#include "kernel_private.h"
#include "wine/server.h"
#include "wine/debug.h"
...
...
@@ -509,15 +508,9 @@ static BOOL DeviceIo_IFSMgr(DWORD dwIoControlCode, LPVOID lpvInBuffer, DWORD cbI
win32apieq_2_CONTEXT
(
pIn
,
&
cxt
);
if
(
dwIoControlCode
==
IFS_IOCTL_21
)
{
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
&
cxt
,
0x21
);
}
else
{
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
&
cxt
,
0x2f
);
}
INSTR_CallBuiltinHandler
(
&
cxt
,
0x21
);
else
INSTR_CallBuiltinHandler
(
&
cxt
,
0x2f
);
CONTEXT_2_win32apieq
(
&
cxt
,
pOut
);
...
...
@@ -676,9 +669,7 @@ static BOOL DeviceIo_VWin32(DWORD dwIoControlCode,
break
;
}
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
&
cxt
,
intnum
);
INSTR_CallBuiltinHandler
(
&
cxt
,
intnum
);
CONTEXT_2_DIOCRegs
(
&
cxt
,
pOut
);
}
break
;
...
...
dlls/kernel/instr.c
View file @
40443725
...
...
@@ -37,8 +37,6 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
int
);
WINE_DECLARE_DEBUG_CHANNEL
(
io
);
#ifdef __i386__
/* macros to set parts of a DWORD */
#define SET_LOWORD(dw,val) ((dw) = ((dw) & 0xffff0000) | LOWORD(val))
#define SET_LOBYTE(dw,val) ((dw) = ((dw) & 0xffffff00) | LOBYTE(val))
...
...
@@ -67,6 +65,33 @@ inline static void *get_stack( CONTEXT86 *context )
}
static
void
(
WINAPI
*
DOS_EmulateInterruptPM
)(
CONTEXT86
*
context
,
BYTE
intnum
);
static
void
(
WINAPI
*
DOS_CallBuiltinHandler
)(
CONTEXT86
*
context
,
BYTE
intnum
);
static
DWORD
(
WINAPI
*
DOS_inport
)(
int
port
,
int
size
);
static
void
(
WINAPI
*
DOS_outport
)(
int
port
,
int
size
,
DWORD
val
);
static
void
init_winedos
(
void
)
{
static
HMODULE
module
;
if
(
module
)
return
;
module
=
LoadLibraryA
(
"winedos.dll"
);
if
(
!
module
)
{
ERR
(
"could not load winedos.dll, DOS subsystem unavailable
\n
"
);
module
=
(
HMODULE
)
1
;
/* don't try again */
return
;
}
#define GET_ADDR(func) DOS_##func = (void *)GetProcAddress(module, #func);
GET_ADDR
(
inport
);
GET_ADDR
(
outport
);
GET_ADDR
(
EmulateInterruptPM
);
GET_ADDR
(
CallBuiltinHandler
);
#undef GET_ADDR
}
/***********************************************************************
* INSTR_ReplaceSelector
*
...
...
@@ -339,7 +364,8 @@ static DWORD INSTR_inport( WORD port, int size, CONTEXT86 *context )
{
DWORD
res
=
~
0U
;
if
(
Dosvm
.
inport
||
DPMI_LoadDosSystem
())
res
=
Dosvm
.
inport
(
port
,
size
);
if
(
!
DOS_inport
)
init_winedos
();
if
(
DOS_inport
)
res
=
DOS_inport
(
port
,
size
);
if
(
TRACE_ON
(
io
))
{
...
...
@@ -370,7 +396,8 @@ static DWORD INSTR_inport( WORD port, int size, CONTEXT86 *context )
*/
static
void
INSTR_outport
(
WORD
port
,
int
size
,
DWORD
val
,
CONTEXT86
*
context
)
{
if
(
Dosvm
.
outport
||
DPMI_LoadDosSystem
())
Dosvm
.
outport
(
port
,
size
,
val
);
if
(
!
DOS_outport
)
init_winedos
();
if
(
DOS_outport
)
DOS_outport
(
port
,
size
,
val
);
if
(
TRACE_ON
(
io
))
{
...
...
@@ -689,14 +716,11 @@ DWORD INSTR_EmulateInstruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
case
0xcd
:
/* int <XX> */
if
(
IS_SELECTOR_SYSTEM
(
context
->
SegCs
))
break
;
/* don't emulate it in 32-bit code */
if
(
!
Dosvm
.
EmulateInterruptPM
&&
!
DPMI_LoadDosSystem
())
{
ERR
(
"could not initialize interrupt handling
\n
"
);
}
else
if
(
!
DOS_EmulateInterruptPM
)
init_winedos
();
if
(
DOS_EmulateInterruptPM
)
{
context
->
Eip
+=
prefixlen
+
2
;
D
osvm
.
EmulateInterruptPM
(
context
,
instr
[
1
]
);
D
OS_
EmulateInterruptPM
(
context
,
instr
[
1
]
);
return
ExceptionContinueExecution
;
}
break
;
/* Unable to emulate it */
...
...
@@ -786,4 +810,40 @@ DWORD INSTR_EmulateInstruction( EXCEPTION_RECORD *rec, CONTEXT86 *context )
return
ExceptionContinueSearch
;
/* Unable to emulate it */
}
#endif
/* __i386__ */
/***********************************************************************
* INSTR_CallBuiltinHandler
*/
void
INSTR_CallBuiltinHandler
(
CONTEXT86
*
context
,
BYTE
intnum
)
{
if
(
!
DOS_CallBuiltinHandler
)
init_winedos
();
if
(
DOS_CallBuiltinHandler
)
DOS_CallBuiltinHandler
(
context
,
intnum
);
}
/***********************************************************************
* DOS3Call (KERNEL.102)
*/
void
WINAPI
DOS3Call
(
CONTEXT86
*
context
)
{
INSTR_CallBuiltinHandler
(
context
,
0x21
);
}
/***********************************************************************
* NetBIOSCall (KERNEL.103)
*/
void
WINAPI
NetBIOSCall16
(
CONTEXT86
*
context
)
{
INSTR_CallBuiltinHandler
(
context
,
0x5c
);
}
/***********************************************************************
* GetSetKernelDOSProc (KERNEL.311)
*/
FARPROC16
WINAPI
GetSetKernelDOSProc16
(
FARPROC16
DosProc
)
{
FIXME
(
"(DosProc=0x%08x): stub
\n
"
,
(
UINT
)
DosProc
);
return
NULL
;
}
dlls/kernel/kernel_private.h
View file @
40443725
...
...
@@ -53,17 +53,8 @@ extern BOOL WOWTHUNK_Init(void);
extern
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
);
typedef
struct
{
void
(
WINAPI
*
EmulateInterruptPM
)(
CONTEXT86
*
context
,
BYTE
intnum
);
void
(
WINAPI
*
CallBuiltinHandler
)(
CONTEXT86
*
context
,
BYTE
intnum
);
/* I/O functions */
DWORD
(
WINAPI
*
inport
)(
int
port
,
int
size
);
void
(
WINAPI
*
outport
)(
int
port
,
int
size
,
DWORD
val
);
}
DOSVM_TABLE
;
extern
DOSVM_TABLE
Dosvm
;
extern
DWORD
INSTR_EmulateInstruction
(
EXCEPTION_RECORD
*
rec
,
CONTEXT86
*
context
);
extern
void
INSTR_CallBuiltinHandler
(
CONTEXT86
*
context
,
BYTE
intnum
);
/* this structure is always located at offset 0 of the DGROUP segment */
#include "pshpack1.h"
...
...
dlls/kernel/vxd.c
View file @
40443725
...
...
@@ -1087,8 +1087,7 @@ static DWORD VxDCall_VWin32( DWORD service, CONTEXT86 *context )
SET_AX
(
context
,
callnum
);
SET_CX
(
context
,
parm
);
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
context
,
0x31
);
INSTR_CallBuiltinHandler
(
context
,
0x31
);
return
LOWORD
(
context
->
Eax
);
}
...
...
include/miscemu.h
View file @
40443725
...
...
@@ -104,12 +104,6 @@ extern LPVOID DOSMEM_MapRealToLinear(DWORD); /* real-mode to linear */
extern
LPVOID
DOSMEM_MapDosToLinear
(
UINT
);
/* linear DOS to Wine */
extern
UINT
DOSMEM_MapLinearToDos
(
LPVOID
);
/* linear Wine to DOS */
/* memory/instr.c */
extern
DWORD
INSTR_EmulateInstruction
(
EXCEPTION_RECORD
*
rec
,
CONTEXT86
*
context
);
/* msdos/dpmi.c */
extern
BOOL
DPMI_LoadDosSystem
(
void
);
#define PTR_REAL_TO_LIN(seg,off) \
((void*)(((unsigned int)(seg) << 4) + LOWORD(off)))
...
...
msdos/dpmi.c
deleted
100644 → 0
View file @
3f1498fc
/*
* DPMI 0.9 emulation
*
* Copyright 1995 Alexandre Julliard
*
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "config.h"
#include "wine/port.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "kernel_private.h"
#include "wine/debug.h"
#include "wine/windef16.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
int31
);
DOSVM_TABLE
Dosvm
=
{
NULL
,
};
static
HMODULE
DosModule
;
/**********************************************************************
* DPMI_LoadDosSystem
*/
BOOL
DPMI_LoadDosSystem
(
void
)
{
if
(
DosModule
)
return
TRUE
;
DosModule
=
LoadLibraryA
(
"winedos.dll"
);
if
(
!
DosModule
)
{
ERR
(
"could not load winedos.dll, DOS subsystem unavailable
\n
"
);
return
FALSE
;
}
#define GET_ADDR(func) Dosvm.func = (void *)GetProcAddress(DosModule, #func);
GET_ADDR
(
inport
);
GET_ADDR
(
outport
);
GET_ADDR
(
EmulateInterruptPM
);
GET_ADDR
(
CallBuiltinHandler
);
#undef GET_ADDR
return
TRUE
;
}
/***********************************************************************
* NetBIOSCall (KERNEL.103)
*
*/
void
WINAPI
NetBIOSCall16
(
CONTEXT86
*
context
)
{
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
context
,
0x5c
);
}
/***********************************************************************
* DOS3Call (KERNEL.102)
*/
void
WINAPI
DOS3Call
(
CONTEXT86
*
context
)
{
if
(
Dosvm
.
CallBuiltinHandler
||
DPMI_LoadDosSystem
())
Dosvm
.
CallBuiltinHandler
(
context
,
0x21
);
}
/***********************************************************************
* GetSetKernelDOSProc (KERNEL.311)
*/
FARPROC16
WINAPI
GetSetKernelDOSProc16
(
FARPROC16
DosProc
)
{
FIXME
(
"(DosProc=0x%08x): stub
\n
"
,
(
UINT
)
DosProc
);
return
NULL
;
}
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