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
ab687979
Commit
ab687979
authored
Nov 15, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved standard syslevel APIs declaration to winbase.h.
Use exported syslevel function wherever possible. Moved SEGPTR declaration to windef16.h.
parent
3606dc55
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
106 additions
and
181 deletions
+106
-181
kernel.spec
dlls/kernel/kernel.spec
+2
-2
sync.c
dlls/kernel/sync.c
+4
-3
thunk.c
dlls/kernel/thunk.c
+4
-3
wowthunk.c
dlls/kernel/wowthunk.c
+9
-10
signal_i386.c
dlls/ntdll/signal_i386.c
+0
-6
user_main.c
dlls/user/user_main.c
+0
-3
w32skernel.c
dlls/win32s/w32skernel.c
+1
-0
win32s16.c
dlls/win32s/win32s16.c
+1
-0
mmsystem.c
dlls/winmm/mmsystem.c
+0
-1
time.c
dlls/winmm/time.c
+4
-7
dos_fs.c
files/dos_fs.c
+2
-3
heap.h
include/heap.h
+1
-0
syslevel.h
include/syslevel.h
+0
-23
win.h
include/win.h
+0
-1
winbase.h
include/winbase.h
+19
-3
windef.h
include/windef.h
+0
-8
winbase16.h
include/wine/winbase16.h
+4
-0
windef16.h
include/wine/windef16.h
+1
-0
winsock.h
include/winsock.h
+1
-1
module.c
loader/module.c
+6
-6
module.c
loader/ne/module.c
+2
-3
task.c
loader/task.c
+9
-9
gdiobj.c
objects/gdiobj.c
+1
-4
process.c
scheduler/process.c
+3
-9
synchro.c
scheduler/synchro.c
+10
-15
syslevel.c
scheduler/syslevel.c
+13
-42
relay.c
tools/winebuild/relay.c
+4
-4
queue.c
windows/queue.c
+0
-1
win.c
windows/win.c
+1
-11
winhelp.c
windows/winhelp.c
+4
-3
No files found.
dlls/kernel/kernel.spec
View file @
ab687979
...
...
@@ -389,8 +389,8 @@ owner kernel32
477 stub WOAFullScreen
478 stub WOATerminateProcess
479 pascal KERNEL_479(long) VWin32_EventSet # ???
480 pascal16 _EnterWin16Lock()
SYSLEVEL
_EnterWin16Lock
481 pascal16 _LeaveWin16Lock()
SYSLEVEL
_LeaveWin16Lock
480 pascal16 _EnterWin16Lock() _EnterWin16Lock
481 pascal16 _LeaveWin16Lock() _LeaveWin16Lock
482 pascal LoadSystemLibrary32(str) LoadLibrary32_16 # FIXME!
483 pascal MapProcessHandle(long) MapProcessHandle
484 pascal SetProcessDWORD(long s_word long) SetProcessDword
...
...
dlls/kernel/sync.c
View file @
ab687979
...
...
@@ -8,7 +8,6 @@
#include "winerror.h"
#include "winnls.h"
#include "wine/unicode.h"
#include "syslevel.h"
#include "server.h"
#include "debugtools.h"
...
...
@@ -222,9 +221,11 @@ VOID WINAPI VWin32_EventDestroy(HANDLE event)
*/
VOID
WINAPI
VWin32_EventWait
(
HANDLE
event
)
{
SYSLEVEL_ReleaseWin16Lock
();
DWORD
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
WaitForSingleObject
(
event
,
INFINITE
);
SYSLEVEL_RestoreWin16Lock
(
);
RestoreThunkLock
(
mutex_count
);
}
/***********************************************************************
...
...
dlls/kernel/thunk.c
View file @
ab687979
...
...
@@ -24,7 +24,6 @@
#include "module.h"
#include "selectors.h"
#include "stackframe.h"
#include "syslevel.h"
#include "task.h"
DEFAULT_DEBUG_CHANNEL
(
thunk
);
...
...
@@ -1134,7 +1133,9 @@ void WINAPI K32Thk1632Prolog( CONTEXT86 *context )
context
->
Ebp
,
context
->
Esp
,
NtCurrentTeb
()
->
cur_stack
);
}
SYSLEVEL_ReleaseWin16Lock
();
/* entry_point is never used again once the entry point has
been called. Thus we re-use it to hold the Win16Lock count */
ReleaseThunkLock
(
&
CURRENT_STACK16
->
entry_point
);
}
/***********************************************************************
...
...
@@ -1144,7 +1145,7 @@ void WINAPI K32Thk1632Epilog( CONTEXT86 *context )
{
LPBYTE
code
=
(
LPBYTE
)
context
->
Eip
-
13
;
SYSLEVEL_RestoreWin16Lock
(
);
RestoreThunkLock
(
CURRENT_STACK16
->
entry_point
);
/* We undo the SYSTHUNK hack if necessary. See K32Thk1632Prolog. */
...
...
dlls/kernel/wowthunk.c
View file @
ab687979
...
...
@@ -10,7 +10,6 @@
#include "file.h"
#include "heap.h"
#include "miscemu.h"
#include "syslevel.h"
#include "stackframe.h"
#include "builtin16.h"
#include "debugtools.h"
...
...
@@ -315,6 +314,7 @@ DWORD WINAPI LoadLibraryEx32W16( LPCSTR lpszLibFile, DWORD hFile, DWORD dwFlags
{
HMODULE
hModule
;
DOS_FULL_NAME
full_name
;
DWORD
mutex_count
;
/* if the file can not be found, call LoadLibraryExA anyway, since it might be
a buildin module. This case is handled in MODULE_LoadLibraryExA */
...
...
@@ -323,10 +323,9 @@ DWORD WINAPI LoadLibraryEx32W16( LPCSTR lpszLibFile, DWORD hFile, DWORD dwFlags
strcpy
(
full_name
.
short_name
,
lpszLibFile
);
}
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
hModule
=
LoadLibraryExA
(
full_name
.
short_name
,
(
HANDLE
)
hFile
,
dwFlags
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
mutex_count
);
return
(
DWORD
)
hModule
;
}
...
...
@@ -344,11 +343,11 @@ DWORD WINAPI GetProcAddress32W16( DWORD hModule, LPCSTR lpszProc )
DWORD
WINAPI
FreeLibrary32W16
(
DWORD
hLibModule
)
{
BOOL
retv
;
DWORD
mutex_count
;
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
retv
=
FreeLibrary
(
(
HMODULE
)
hLibModule
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
mutex_count
);
return
(
DWORD
)
retv
;
}
...
...
@@ -361,11 +360,12 @@ static DWORD WOW_CallProc32W16( BOOL Ex )
DWORD
nrofargs
,
argconvmask
;
FARPROC
proc32
;
DWORD
*
args
,
ret
;
DWORD
mutex_count
;
VA_LIST16
valist
;
int
i
;
int
aix
;
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
VA_START16
(
valist
);
nrofargs
=
VA_ARG16
(
valist
,
DWORD
);
...
...
@@ -446,8 +446,7 @@ static DWORD WOW_CallProc32W16( BOOL Ex )
TRACE
(
"returns %08lx
\n
"
,
ret
);
HeapFree
(
GetProcessHeap
(),
0
,
args
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
mutex_count
);
return
ret
;
}
...
...
dlls/ntdll/signal_i386.c
View file @
ab687979
...
...
@@ -432,12 +432,6 @@ static void save_context( CONTEXT *context, const SIGCONTEXT *sigcontext )
}
#endif
/* linux */
if
(
!
fs
)
{
fs
=
SYSLEVEL_EmergencyTeb
;
__set_fs
(
fs
);
ERR
(
"fallback to emergency TEB
\n
"
);
}
__set_fs
(
fs
);
context
->
Eax
=
EAX_sig
(
sigcontext
);
...
...
dlls/user/user_main.c
View file @
ab687979
...
...
@@ -135,9 +135,6 @@ BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
/* Load the graphics driver */
if
(
!
load_driver
())
return
FALSE
;
/* Initialize window handling (critical section) */
WIN_Init
();
/* Initialize system colors and metrics*/
SYSMETRICS_Init
();
SYSCOLOR_Init
();
...
...
dlls/win32s/w32skernel.c
View file @
ab687979
...
...
@@ -8,6 +8,7 @@
#include <string.h>
#include "winbase.h"
#include "wine/windef16.h"
/***********************************************************************
* GetWin32sDirectory
...
...
dlls/win32s/win32s16.c
View file @
ab687979
...
...
@@ -8,6 +8,7 @@
#include <string.h>
#include <stdlib.h>
#include "windef.h"
#include "wine/windef16.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
dll
);
...
...
dlls/winmm/mmsystem.c
View file @
ab687979
...
...
@@ -27,7 +27,6 @@
#include "wine/winestring.h"
#include "heap.h"
#include "winemm.h"
#include "syslevel.h"
#include "selectors.h"
#include "module.h"
#include "debugtools.h"
...
...
dlls/winmm/time.c
View file @
ab687979
...
...
@@ -13,10 +13,9 @@
#include "winuser.h"
#include "winemm.h"
#include "services.h"
#include "syslevel.h"
#include "debugtools.h"
DEFAULT_DEBUG_CHANNEL
(
mmtime
)
DEFAULT_DEBUG_CHANNEL
(
mmtime
)
;
/*
* FIXME
...
...
@@ -383,10 +382,8 @@ DWORD WINAPI timeGetTime(void)
/* FIXME: releasing the win16 lock here is a temporary hack (I hope)
* that lets mciavi.drv run correctly
*/
if
(
_ConfirmWin16Lock
()
)
{
SYSLEVEL_ReleaseWin16Lock
();
SYSLEVEL_RestoreWin16Lock
();
}
DWORD
count
;
ReleaseThunkLock
(
&
count
);
RestoreThunkLock
(
count
);
return
MULTIMEDIA_MMTimeStart
()
->
mmSysTimeMS
;
}
files/dos_fs.c
View file @
ab687979
...
...
@@ -31,7 +31,6 @@
#include "file.h"
#include "heap.h"
#include "msdos.h"
#include "syslevel.h"
#include "server.h"
#include "options.h"
#include "debugtools.h"
...
...
@@ -1501,7 +1500,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
LPCSTR
short_name
,
long_name
;
int
count
;
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
/* Check the cached directory */
if
(
!
(
info
.
dir
&&
info
.
path
==
path
&&
info
.
short_mask
==
short_mask
...
...
@@ -1538,7 +1537,7 @@ int DOSFS_FindNext( const char *path, const char *short_mask,
memset
(
&
info
,
'\0'
,
sizeof
(
info
)
);
}
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
return
count
;
}
...
...
include/heap.h
View file @
ab687979
...
...
@@ -10,6 +10,7 @@
#include "config.h"
#include "winbase.h"
#include "wine/windef16.h"
/* for SEGPTR */
extern
HANDLE
SystemHeap
;
extern
HANDLE
SegptrHeap
;
...
...
include/syslevel.h
View file @
ab687979
...
...
@@ -10,32 +10,9 @@
#include "windef.h"
#include "winbase.h"
typedef
struct
tagSYSLEVEL
{
CRITICAL_SECTION
crst
;
INT
level
;
}
SYSLEVEL
;
extern
WORD
SYSLEVEL_Win16CurrentTeb
;
extern
WORD
SYSLEVEL_EmergencyTeb
;
void
SYSLEVEL_Init
(
void
);
VOID
WINAPI
SYSLEVEL_EnterWin16Lock
(
void
);
VOID
WINAPI
SYSLEVEL_LeaveWin16Lock
(
void
);
VOID
SYSLEVEL_ReleaseWin16Lock
(
void
);
VOID
SYSLEVEL_RestoreWin16Lock
(
void
);
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
);
VOID
WINAPI
GetpWin16Lock
(
SYSLEVEL
**
lock
);
SEGPTR
WINAPI
GetpWin16Lock16
(
void
);
DWORD
WINAPI
_ConfirmWin16Lock
(
void
);
VOID
WINAPI
_CreateSysLevel
(
SYSLEVEL
*
lock
,
INT
level
);
VOID
WINAPI
_EnterSysLevel
(
SYSLEVEL
*
lock
);
VOID
WINAPI
_LeaveSysLevel
(
SYSLEVEL
*
lock
);
DWORD
WINAPI
_ConfirmSysLevel
(
SYSLEVEL
*
lock
);
VOID
WINAPI
ReleaseThunkLock
(
DWORD
*
mutex_count
);
VOID
WINAPI
RestoreThunkLock
(
DWORD
mutex_count
);
#endif
/* __WINE_SYSLEVEL_H */
include/win.h
View file @
ab687979
...
...
@@ -174,7 +174,6 @@ typedef struct
#define UNC_IN_BEGINPAINT 0x0020
/* Window functions */
extern
void
WIN_Init
(
void
);
extern
void
WIN_LockWnds
(
void
);
extern
void
WIN_UnlockWnds
(
void
);
extern
int
WIN_SuspendWndsLock
(
void
);
...
...
include/winbase.h
View file @
ab687979
...
...
@@ -1476,8 +1476,6 @@ BOOL WINAPI LookupPrivilegeValueW(LPCWSTR,LPCWSTR,LPVOID);
BOOL
WINAPI
MakeSelfRelativeSD
(
PSECURITY_DESCRIPTOR
,
PSECURITY_DESCRIPTOR
,
LPDWORD
);
HMODULE
WINAPI
MapHModuleSL
(
WORD
);
WORD
WINAPI
MapHModuleLS
(
HMODULE
);
SEGPTR
WINAPI
MapLS
(
LPVOID
);
LPVOID
WINAPI
MapSL
(
SEGPTR
);
LPVOID
WINAPI
MapViewOfFile
(
HANDLE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
LPVOID
WINAPI
MapViewOfFileEx
(
HANDLE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
LPVOID
);
BOOL
WINAPI
MoveFileA
(
LPCSTR
,
LPCSTR
);
...
...
@@ -1599,7 +1597,6 @@ BOOL WINAPI TlsFree(DWORD);
LPVOID
WINAPI
TlsGetValue
(
DWORD
);
BOOL
WINAPI
TlsSetValue
(
DWORD
,
LPVOID
);
BOOL
WINAPI
TransmitCommChar
(
HANDLE
,
CHAR
);
VOID
WINAPI
UnMapLS
(
SEGPTR
);
BOOL
WINAPI
UnlockFile
(
HANDLE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
BOOL
WINAPI
UnmapViewOfFile
(
LPVOID
);
LPVOID
WINAPI
VirtualAlloc
(
LPVOID
,
DWORD
,
DWORD
,
DWORD
);
...
...
@@ -1875,6 +1872,25 @@ INT WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
#define ZeroMemory RtlZeroMemory
#define CopyMemory RtlCopyMemory
/* undocumented functions */
typedef
struct
tagSYSLEVEL
{
CRITICAL_SECTION
crst
;
INT
level
;
}
SYSLEVEL
;
VOID
WINAPI
GetpWin16Lock
(
SYSLEVEL
**
);
DWORD
WINAPI
MapLS
(
LPVOID
);
LPVOID
WINAPI
MapSL
(
DWORD
);
VOID
WINAPI
ReleaseThunkLock
(
DWORD
*
);
VOID
WINAPI
RestoreThunkLock
(
DWORD
);
VOID
WINAPI
UnMapLS
(
DWORD
);
DWORD
WINAPI
_ConfirmWin16Lock
(
void
);
DWORD
WINAPI
_ConfirmSysLevel
(
SYSLEVEL
*
);
VOID
WINAPI
_EnterSysLevel
(
SYSLEVEL
*
);
VOID
WINAPI
_LeaveSysLevel
(
SYSLEVEL
*
);
/* a few optimizations for i386/gcc */
#if defined(__i386__) && defined(__GNUC__)
...
...
include/windef.h
View file @
ab687979
...
...
@@ -234,14 +234,6 @@ typedef FLOAT *LPFLOAT;
typedef
BOOL
*
PBOOL
;
typedef
BOOL
*
LPBOOL
;
/* Special case: a segmented pointer is just a pointer in the user's code. */
#ifdef __WINE__
typedef
DWORD
SEGPTR
;
#else
typedef
void
*
SEGPTR
;
#endif
/* __WINE__ */
/* Handle types that exist both in Win16 and Win32. */
#ifdef STRICT
...
...
include/wine/winbase16.h
View file @
ab687979
...
...
@@ -78,6 +78,7 @@ INT16 WINAPI GetInstanceData16(HINSTANCE16,WORD,INT16);
BOOL16
WINAPI
GetModuleName16
(
HINSTANCE16
,
LPSTR
,
INT16
);
INT16
WINAPI
GetModuleUsage16
(
HINSTANCE16
);
UINT16
WINAPI
GetNumTasks16
(
void
);
SEGPTR
WINAPI
GetpWin16Lock16
(
void
);
DWORD
WINAPI
GetSelectorLimit16
(
WORD
);
FARPROC16
WINAPI
GetSetKernelDOSProc16
(
FARPROC16
DosProc
);
HINSTANCE16
WINAPI
GetTaskDS16
(
void
);
...
...
@@ -117,6 +118,9 @@ VOID WINAPI SwitchStackTo16(WORD,WORD,WORD);
BOOL16
WINAPI
WaitEvent16
(
HTASK16
);
VOID
WINAPI
WriteOutProfiles16
(
void
);
VOID
WINAPI
hmemcpy16
(
LPVOID
,
LPCVOID
,
LONG
);
VOID
WINAPI
_CreateSysLevel
(
SYSLEVEL
*
,
INT
);
VOID
WINAPI
_EnterWin16Lock
(
void
);
VOID
WINAPI
_LeaveWin16Lock
(
void
);
INT16
WINAPI
AccessResource16
(
HINSTANCE16
,
HRSRC16
);
...
...
include/wine/windef16.h
View file @
ab687979
...
...
@@ -14,6 +14,7 @@
typedef
short
INT16
;
typedef
unsigned
short
UINT16
;
typedef
unsigned
short
BOOL16
;
typedef
DWORD
SEGPTR
;
typedef
UINT16
HANDLE16
;
typedef
HANDLE16
*
LPHANDLE16
;
...
...
include/winsock.h
View file @
ab687979
...
...
@@ -153,7 +153,7 @@ typedef struct WSAData {
char
szSystemStatus
[
WSASYS_STATUS_LEN
+
1
];
WORD
iMaxSockets
;
WORD
iMaxUdpDg
;
SEGPTR
lpVendorInfo
;
char
*
lpVendorInfo
;
}
WSADATA
,
*
LPWSADATA
;
#include "poppack.h"
...
...
loader/module.c
View file @
ab687979
...
...
@@ -17,7 +17,6 @@
#include "heap.h"
#include "neexe.h"
#include "process.h"
#include "syslevel.h"
#include "selectors.h"
#include "debugtools.h"
#include "callback.h"
...
...
@@ -798,9 +797,10 @@ HINSTANCE16 WINAPI WinExec16( LPCSTR lpCmdLine, UINT16 nCmdShow )
if
(
ret
==
21
)
/* 32-bit module */
{
SYSLEVEL_ReleaseWin16Lock
();
DWORD
count
;
ReleaseThunkLock
(
&
count
);
ret
=
WinExec
(
lpCmdLine
,
nCmdShow
);
SYSLEVEL_RestoreWin16Lock
(
);
RestoreThunkLock
(
count
);
}
return
ret
;
}
...
...
@@ -1452,11 +1452,11 @@ HMODULE WINAPI LoadLibraryW(LPCWSTR libnameW)
HMODULE
WINAPI
LoadLibrary32_16
(
LPCSTR
libname
)
{
HMODULE
hModule
;
DWORD
count
;
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
count
);
hModule
=
LoadLibraryA
(
libname
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
count
);
return
hModule
;
}
...
...
loader/ne/module.c
View file @
ab687979
...
...
@@ -22,7 +22,6 @@
#include "global.h"
#include "process.h"
#include "snoop.h"
#include "syslevel.h"
#include "builtin16.h"
#include "stackframe.h"
#include "debugtools.h"
...
...
@@ -1120,7 +1119,7 @@ static void NE_InitProcess(void)
SEGTABLEENTRY
*
pSegTable
=
NE_SEG_TABLE
(
pModule
);
WORD
sp
;
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
if
(
pModule
->
count
>
0
)
{
...
...
@@ -1197,7 +1196,7 @@ static void NE_InitProcess(void)
ExitThread
(
LOWORD
(
context
.
Eax
)
);
}
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
ExitThread
(
hInstance
);
}
...
...
loader/task.c
View file @
ab687979
...
...
@@ -27,8 +27,8 @@
#include "thread.h"
#include "toolhelp.h"
#include "winnt.h"
#include "winsock.h"
#include "syslevel.h"
#include "winsock.h"
#include "debugtools.h"
#include "services.h"
#include "server.h"
...
...
@@ -336,9 +336,9 @@ BOOL TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cmdline,
/* Add the task to the linked list */
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
TASK_LinkTask
(
hTask
);
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
return
TRUE
;
}
...
...
@@ -384,12 +384,12 @@ void TASK_ExitTask(void)
DWORD
lockCount
;
/* Enter the Win16Lock to protect global data structures */
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
pTask
=
(
TDB
*
)
GlobalLock16
(
GetCurrentTask
()
);
if
(
!
pTask
)
{
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
return
;
}
...
...
@@ -486,7 +486,7 @@ void TASK_Reschedule(void)
enum
{
MODE_YIELD
,
MODE_SLEEP
,
MODE_WAKEUP
}
mode
;
DWORD
lockCount
;
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
/* Check what we need to do */
hOldTask
=
GetCurrentTask
();
...
...
@@ -521,7 +521,7 @@ void TASK_Reschedule(void)
else
{
/* nothing to do */
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
return
;
}
}
...
...
@@ -555,7 +555,7 @@ void TASK_Reschedule(void)
if
(
mode
==
MODE_YIELD
&&
hNewTask
&&
hNewTask
==
hCurrentTask
)
{
TRACE
(
"returning to the current task (%04x)
\n
"
,
hCurrentTask
);
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
/* Allow Win32 threads to thunk down even while a Win16 task is
in a tight PeekMessage() or Yield() loop ... */
...
...
@@ -600,7 +600,7 @@ void TASK_Reschedule(void)
RestoreThunkLock
(
lockCount
);
}
SYSLEVEL
_LeaveWin16Lock
();
_LeaveWin16Lock
();
}
/***********************************************************************
...
...
objects/gdiobj.c
View file @
ab687979
...
...
@@ -26,7 +26,6 @@
#include "debugtools.h"
#include "gdi.h"
#include "tweak.h"
#include "syslevel.h"
DEFAULT_DEBUG_CHANNEL
(
gdi
);
...
...
@@ -178,7 +177,7 @@ static GDIOBJHDR * StockObjects[NB_STOCK_OBJECTS] =
HBITMAP
hPseudoStockBitmap
;
/* 1x1 bitmap for memory DCs */
static
SYSLEVEL
GDI_level
;
static
SYSLEVEL
GDI_level
=
{
CRITICAL_SECTION_INIT
,
3
}
;
static
WORD
GDI_HeapSel
;
...
...
@@ -327,8 +326,6 @@ BOOL GDI_Init(void)
HPALETTE16
hpalette
;
HINSTANCE16
instance
;
_CreateSysLevel
(
&
GDI_level
,
3
);
/* create GDI heap */
if
((
instance
=
LoadLibrary16
(
"GDI.EXE"
))
<
32
)
return
FALSE
;
GDI_HeapSel
=
GlobalHandleToSel16
(
instance
);
...
...
scheduler/process.c
View file @
ab687979
...
...
@@ -25,7 +25,6 @@
#include "heap.h"
#include "task.h"
#include "ldt.h"
#include "syslevel.h"
#include "thread.h"
#include "winerror.h"
#include "server.h"
...
...
@@ -211,9 +210,6 @@ static BOOL process_init( char *argv[] )
SERVER_END_REQ
;
if
(
!
ret
)
return
FALSE
;
/* Remember TEB selector of initial process for emergency use */
SYSLEVEL_EmergencyTeb
=
NtCurrentTeb
()
->
teb_sel
;
/* Create the system and process heaps */
if
(
!
HEAP_CreateSystemHeap
())
return
FALSE
;
current_process
.
heap
=
HeapCreate
(
HEAP_GROWABLE
,
0
,
0
);
...
...
@@ -227,9 +223,6 @@ static BOOL process_init( char *argv[] )
/* Initialize the critical sections */
InitializeCriticalSection
(
&
current_process
.
crit_section
);
/* Initialize syslevel handling */
SYSLEVEL_Init
();
/* Parse command line arguments */
OPTIONS_ParseOptions
(
argv
);
...
...
@@ -456,7 +449,7 @@ void PROCESS_InitWine( int argc, char *argv[] )
main_exe_name
[
0
]
=
0
;
CloseHandle
(
main_exe_file
);
main_exe_file
=
INVALID_HANDLE_VALUE
;
SYSLEVEL
_EnterWin16Lock
();
_EnterWin16Lock
();
found:
/* allocate main thread stack */
...
...
@@ -846,7 +839,8 @@ void WINAPI ExitProcess( DWORD status )
*/
void
WINAPI
ExitProcess16
(
WORD
status
)
{
SYSLEVEL_ReleaseWin16Lock
();
DWORD
count
;
ReleaseThunkLock
(
&
count
);
ExitProcess
(
status
);
}
...
...
scheduler/synchro.c
View file @
ab687979
...
...
@@ -12,7 +12,6 @@
#include "file.h"
/* for DOSFS_UnixTimeToFileTime */
#include "thread.h"
#include "winerror.h"
#include "syslevel.h"
#include "server.h"
...
...
@@ -154,12 +153,11 @@ DWORD WINAPI WaitForMultipleObjectsEx( DWORD count, const HANDLE *handles,
*/
DWORD
WINAPI
WIN16_WaitForSingleObject
(
HANDLE
handle
,
DWORD
timeout
)
{
DWORD
retval
;
DWORD
retval
,
mutex_count
;
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForSingleObject
(
handle
,
timeout
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
...
...
@@ -169,12 +167,11 @@ DWORD WINAPI WIN16_WaitForSingleObject( HANDLE handle, DWORD timeout )
DWORD
WINAPI
WIN16_WaitForMultipleObjects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
)
{
DWORD
retval
;
DWORD
retval
,
mutex_count
;
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjects
(
count
,
handles
,
wait_all
,
timeout
);
SYSLEVEL_RestoreWin16Lock
();
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
...
...
@@ -186,13 +183,11 @@ DWORD WINAPI WIN16_WaitForMultipleObjectsEx( DWORD count,
BOOL
wait_all
,
DWORD
timeout
,
BOOL
alertable
)
{
DWORD
retval
;
SYSLEVEL_ReleaseWin16Lock
();
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
alertable
);
SYSLEVEL_RestoreWin16Lock
();
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
alertable
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
scheduler/syslevel.c
View file @
ab687979
...
...
@@ -15,28 +15,11 @@
DEFAULT_DEBUG_CHANNEL
(
win32
);
static
SYSLEVEL
Win16Mutex
;
static
SEGPTR
segpWin16Mutex
;
static
SYSLEVEL
Win16Mutex
=
{
CRITICAL_SECTION_INIT
,
1
};
/* Global variable to save current TEB while in 16-bit code */
WORD
SYSLEVEL_Win16CurrentTeb
=
0
;
/* TEB of initial process for emergency use */
WORD
SYSLEVEL_EmergencyTeb
=
0
;
/************************************************************************
* SYSLEVEL_Init
*/
void
SYSLEVEL_Init
(
void
)
{
SYSLEVEL
**
w16Mutex
=
SEGPTR_ALLOC
(
sizeof
(
SYSLEVEL
*
));
*
w16Mutex
=
&
Win16Mutex
;
segpWin16Mutex
=
SEGPTR_GET
(
w16Mutex
);
_CreateSysLevel
(
&
Win16Mutex
,
1
);
}
/************************************************************************
* GetpWin16Lock (KERNEL32.93)
...
...
@@ -51,6 +34,13 @@ VOID WINAPI GetpWin16Lock(SYSLEVEL **lock)
*/
SEGPTR
WINAPI
GetpWin16Lock16
(
void
)
{
static
SEGPTR
segpWin16Mutex
;
if
(
!
segpWin16Mutex
)
{
SYSLEVEL
**
w16Mutex
=
SEGPTR_ALLOC
(
sizeof
(
SYSLEVEL
*
));
*
w16Mutex
=
&
Win16Mutex
;
segpWin16Mutex
=
SEGPTR_GET
(
w16Mutex
);
}
return
segpWin16Mutex
;
}
...
...
@@ -157,20 +147,21 @@ VOID WINAPI _CheckNotSysLevel(SYSLEVEL *lock)
/************************************************************************
*
SYSLEVEL
_EnterWin16Lock [KERNEL.480]
* _EnterWin16Lock [KERNEL.480]
*/
VOID
WINAPI
SYSLEVEL_EnterWin16Lock
(
VOID
)
VOID
WINAPI
_EnterWin16Lock
(
void
)
{
_EnterSysLevel
(
&
Win16Mutex
);
}
/************************************************************************
*
SYSLEVEL
_LeaveWin16Lock [KERNEL.481]
* _LeaveWin16Lock [KERNEL.481]
*/
VOID
WINAPI
SYSLEVEL_LeaveWin16Lock
(
VOID
)
VOID
WINAPI
_LeaveWin16Lock
(
void
)
{
_LeaveSysLevel
(
&
Win16Mutex
);
}
/************************************************************************
* _ConfirmWin16Lock (KERNEL32.96)
*/
...
...
@@ -201,25 +192,6 @@ VOID WINAPI RestoreThunkLock(DWORD mutex_count)
}
/************************************************************************
* SYSLEVEL_ReleaseWin16Lock
*/
VOID
SYSLEVEL_ReleaseWin16Lock
(
VOID
)
{
/* entry_point is never used again once the entry point has
been called. Thus we re-use it to hold the Win16Lock count */
ReleaseThunkLock
(
&
CURRENT_STACK16
->
entry_point
);
}
/************************************************************************
* SYSLEVEL_RestoreWin16Lock
*/
VOID
SYSLEVEL_RestoreWin16Lock
(
VOID
)
{
RestoreThunkLock
(
CURRENT_STACK16
->
entry_point
);
}
/************************************************************************
* SYSLEVEL_CheckNotLevel
*/
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
)
...
...
@@ -235,4 +207,3 @@ VOID SYSLEVEL_CheckNotLevel( INT level )
break
;
}
}
tools/winebuild/relay.c
View file @
ab687979
...
...
@@ -478,9 +478,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Enter Win16 Mutex */
if
(
UsePIC
)
fprintf
(
outfile
,
"
\t
call "
PREFIX
"
SYSLEVEL
_EnterWin16Lock@PLT
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"_EnterWin16Lock@PLT
\n
"
);
else
fprintf
(
outfile
,
"
\t
call "
PREFIX
"
SYSLEVEL
_EnterWin16Lock
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"_EnterWin16Lock
\n
"
);
/* Print debugging info */
if
(
debugging
)
...
...
@@ -574,9 +574,9 @@ static void BuildCallTo16Core( FILE *outfile, int short_ret, int reg_func )
/* Leave Win16 Mutex */
if
(
UsePIC
)
fprintf
(
outfile
,
"
\t
call "
PREFIX
"
SYSLEVEL
_LeaveWin16Lock@PLT
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"_LeaveWin16Lock@PLT
\n
"
);
else
fprintf
(
outfile
,
"
\t
call "
PREFIX
"
SYSLEVEL
_LeaveWin16Lock
\n
"
);
fprintf
(
outfile
,
"
\t
call "
PREFIX
"_LeaveWin16Lock
\n
"
);
/* Get return value */
fprintf
(
outfile
,
"
\t
popl %%eax
\n
"
);
...
...
windows/queue.c
View file @
ab687979
...
...
@@ -11,7 +11,6 @@
#include "winerror.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "syslevel.h"
#include "module.h"
#include "queue.h"
#include "task.h"
...
...
windows/win.c
View file @
ab687979
...
...
@@ -31,7 +31,6 @@
#include "winerror.h"
#include "mdi.h"
#include "local.h"
#include "syslevel.h"
#include "stackframe.h"
#include "debugtools.h"
...
...
@@ -51,16 +50,7 @@ static WORD wDragWidth = 4;
static
WORD
wDragHeight
=
3
;
/* thread safeness */
static
SYSLEVEL
WIN_SysLevel
;
/***********************************************************************
* WIN_Init
*/
void
WIN_Init
(
void
)
{
/* Initialisation of the critical section for thread safeness */
_CreateSysLevel
(
&
WIN_SysLevel
,
2
);
}
static
SYSLEVEL
WIN_SysLevel
=
{
CRITICAL_SECTION_INIT
,
2
};
/***********************************************************************
* WIN_LockWnds
...
...
windows/winhelp.c
View file @
ab687979
...
...
@@ -13,7 +13,6 @@
#include "wine/winbase16.h"
#include "heap.h"
#include "ldt.h"
#include "syslevel.h"
DEFAULT_DEBUG_CHANNEL
(
win
);
...
...
@@ -36,8 +35,10 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
DWORD
dwData
)
{
BOOL
ret
;
DWORD
mutex_count
;
/* We might call WinExec() */
SYSLEVEL_ReleaseWin16Lock
(
);
ReleaseThunkLock
(
&
mutex_count
);
if
(
!
(
ret
=
WinHelpA
(
hWnd
,
lpHelpFile
,
wCommand
,
(
DWORD
)
PTR_SEG_TO_LIN
(
dwData
)
)))
{
...
...
@@ -49,7 +50,7 @@ BOOL16 WINAPI WinHelp16( HWND16 hWnd, LPCSTR lpHelpFile, UINT16 wCommand,
}
}
SYSLEVEL_RestoreWin16Lock
(
);
RestoreThunkLock
(
mutex_count
);
return
ret
;
}
...
...
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