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
bff860c4
Commit
bff860c4
authored
Sep 18, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved synchronization and syslevel routines to dlls/kernel.
parent
8db8368e
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
174 additions
and
233 deletions
+174
-233
Makefile.in
dlls/kernel/Makefile.in
+1
-0
kernel_private.h
dlls/kernel/kernel_private.h
+2
-0
relay16.c
dlls/kernel/relay16.c
+1
-1
sync.c
dlls/kernel/sync.c
+160
-0
syslevel.c
dlls/kernel/syslevel.c
+5
-4
task.c
dlls/kernel/task.c
+1
-1
wowthunk.c
dlls/kernel/wowthunk.c
+1
-1
Makefile.in
dlls/ntdll/Makefile.in
+0
-2
signal_i386.c
dlls/ntdll/signal_i386.c
+3
-1
syslevel.h
include/syslevel.h
+0
-33
synchro.c
scheduler/synchro.c
+0
-190
No files found.
dlls/kernel/Makefile.in
View file @
bff860c4
...
...
@@ -52,6 +52,7 @@ C_SRCS = \
stress.c
\
string.c
\
sync.c
\
syslevel.c
\
system.c
\
tape.c
\
task.c
\
...
...
dlls/kernel/kernel_private.h
View file @
bff860c4
...
...
@@ -51,4 +51,6 @@ void FILE_ConvertOFMode( INT mode, DWORD *access, DWORD *sharing );
extern
BOOL
WOWTHUNK_Init
(
void
);
extern
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
);
#endif
dlls/kernel/relay16.c
View file @
bff860c4
...
...
@@ -33,7 +33,7 @@
#include "stackframe.h"
#include "selectors.h"
#include "builtin16.h"
#include "
syslevel
.h"
#include "
kernel_private
.h"
#include "wine/library.h"
#include "wine/debug.h"
...
...
dlls/kernel/sync.c
View file @
bff860c4
...
...
@@ -43,6 +43,7 @@
#include "wine/server.h"
#include "wine/unicode.h"
#include "kernel_private.h"
#include "file.h"
#include "wine/debug.h"
...
...
@@ -57,6 +58,165 @@ inline static int is_version_nt(void)
/***********************************************************************
* Sleep (KERNEL32.@)
*/
VOID
WINAPI
Sleep
(
DWORD
timeout
)
{
SleepEx
(
timeout
,
FALSE
);
}
/******************************************************************************
* SleepEx (KERNEL32.@)
*/
DWORD
WINAPI
SleepEx
(
DWORD
timeout
,
BOOL
alertable
)
{
NTSTATUS
status
;
if
(
timeout
==
INFINITE
)
status
=
NtDelayExecution
(
alertable
,
NULL
);
else
{
LARGE_INTEGER
time
;
time
.
QuadPart
=
timeout
*
(
ULONGLONG
)
10000
;
time
.
QuadPart
=
-
time
.
QuadPart
;
status
=
NtDelayExecution
(
alertable
,
&
time
);
}
if
(
status
!=
STATUS_USER_APC
)
status
=
STATUS_SUCCESS
;
return
status
;
}
/***********************************************************************
* WaitForSingleObject (KERNEL32.@)
*/
DWORD
WINAPI
WaitForSingleObject
(
HANDLE
handle
,
DWORD
timeout
)
{
return
WaitForMultipleObjectsEx
(
1
,
&
handle
,
FALSE
,
timeout
,
FALSE
);
}
/***********************************************************************
* WaitForSingleObjectEx (KERNEL32.@)
*/
DWORD
WINAPI
WaitForSingleObjectEx
(
HANDLE
handle
,
DWORD
timeout
,
BOOL
alertable
)
{
return
WaitForMultipleObjectsEx
(
1
,
&
handle
,
FALSE
,
timeout
,
alertable
);
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL32.@)
*/
DWORD
WINAPI
WaitForMultipleObjects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
)
{
return
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
FALSE
);
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL32.@)
*/
DWORD
WINAPI
WaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
,
BOOL
alertable
)
{
NTSTATUS
status
;
HANDLE
hloc
[
MAXIMUM_WAIT_OBJECTS
];
int
i
;
if
(
count
>=
MAXIMUM_WAIT_OBJECTS
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
WAIT_FAILED
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
((
handles
[
i
]
==
(
HANDLE
)
STD_INPUT_HANDLE
)
||
(
handles
[
i
]
==
(
HANDLE
)
STD_OUTPUT_HANDLE
)
||
(
handles
[
i
]
==
(
HANDLE
)
STD_ERROR_HANDLE
))
hloc
[
i
]
=
GetStdHandle
(
(
DWORD
)
handles
[
i
]
);
else
hloc
[
i
]
=
handles
[
i
];
/* yes, even screen buffer console handles are waitable, and are
* handled as a handle to the console itself !!
*/
if
(
is_console_handle
(
hloc
[
i
]))
{
if
(
!
VerifyConsoleIoHandle
(
hloc
[
i
]))
{
return
FALSE
;
}
hloc
[
i
]
=
GetConsoleInputWaitHandle
();
}
}
if
(
timeout
==
INFINITE
)
{
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
wait_all
,
alertable
,
NULL
);
}
else
{
LARGE_INTEGER
time
;
time
.
QuadPart
=
timeout
*
(
ULONGLONG
)
10000
;
time
.
QuadPart
=
-
time
.
QuadPart
;
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
wait_all
,
alertable
,
&
time
);
}
if
(
HIWORD
(
status
))
/* is it an error code? */
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
status
=
WAIT_FAILED
;
}
return
status
;
}
/***********************************************************************
* WaitForSingleObject (KERNEL.460)
*/
DWORD
WINAPI
WaitForSingleObject16
(
HANDLE
handle
,
DWORD
timeout
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForSingleObject
(
handle
,
timeout
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL.461)
*/
DWORD
WINAPI
WaitForMultipleObjects16
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
FALSE
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL.495)
*/
DWORD
WINAPI
WaitForMultipleObjectsEx16
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
,
BOOL
alertable
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
alertable
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
/***********************************************************************
* InitializeCriticalSection (KERNEL32.@)
*
* Initialise a critical section before use.
...
...
scheduler
/syslevel.c
→
dlls/kernel
/syslevel.c
View file @
bff860c4
...
...
@@ -30,8 +30,8 @@
#include "winreg.h"
#include "winternl.h"
#include "wine/winbase16.h"
#include "syslevel.h"
#include "thread.h"
#include "kernel_private.h"
#include "wine/library.h"
#include "wine/debug.h"
...
...
@@ -47,7 +47,7 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
static
SYSLEVEL
Win16Mutex
=
{
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
},
1
};
/* Global variable to save current TEB while in 16-bit code */
WORD
SYSLEVEL_Win16CurrentTeb
=
0
;
extern
WORD
SYSLEVEL_Win16CurrentTeb
;
/************************************************************************
...
...
@@ -113,8 +113,9 @@ VOID WINAPI _EnterSysLevel(SYSLEVEL *lock)
TRACE
(
"(%p, level %d): thread %lx count after %ld
\n
"
,
lock
,
lock
->
level
,
GetCurrentThreadId
(),
teb
->
sys_count
[
lock
->
level
]
);
if
(
lock
==
&
Win16Mutex
)
SYSLEVEL_Win16CurrentTeb
=
wine_get_fs
();
#ifdef __i386__
if
(
lock
==
&
Win16Mutex
)
SYSLEVEL_Win16CurrentTeb
=
wine_get_fs
();
#endif
}
/************************************************************************
...
...
dlls/kernel/task.c
View file @
bff860c4
...
...
@@ -45,11 +45,11 @@
#include "winternl.h"
#include "selectors.h"
#include "wine/server.h"
#include "syslevel.h"
#include "stackframe.h"
#include "task.h"
#include "thread.h"
#include "toolhelp.h"
#include "kernel_private.h"
#include "wine/debug.h"
...
...
dlls/kernel/wowthunk.c
View file @
bff860c4
...
...
@@ -32,11 +32,11 @@
#include "excpt.h"
#include "winreg.h"
#include "winternl.h"
#include "syslevel.h"
#include "file.h"
#include "task.h"
#include "miscemu.h"
#include "stackframe.h"
#include "kernel_private.h"
#include "wine/exception.h"
#include "wine/debug.h"
...
...
dlls/ntdll/Makefile.in
View file @
bff860c4
...
...
@@ -37,8 +37,6 @@ C_SRCS = \
$(TOPOBJDIR)
/scheduler/handle.c
\
$(TOPOBJDIR)
/scheduler/process.c
\
$(TOPOBJDIR)
/scheduler/pthread.c
\
$(TOPOBJDIR)
/scheduler/synchro.c
\
$(TOPOBJDIR)
/scheduler/syslevel.c
\
$(TOPOBJDIR)
/scheduler/thread.c
\
$(TOPOBJDIR)
/win32/device.c
\
$(TOPOBJDIR)
/win32/newfns.c
\
...
...
dlls/ntdll/signal_i386.c
View file @
bff860c4
...
...
@@ -407,7 +407,6 @@ typedef struct
#include "wine/exception.h"
#include "global.h"
#include "syslevel.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
seh
);
...
...
@@ -418,6 +417,9 @@ static wine_signal_handler handlers[256];
extern
void
WINAPI
EXC_RtlRaiseException
(
PEXCEPTION_RECORD
,
PCONTEXT
);
/* Global variable to save current TEB while in 16-bit code (FIXME) */
WORD
SYSLEVEL_Win16CurrentTeb
=
0
;
/***********************************************************************
* dispatch_signal
*/
...
...
include/syslevel.h
deleted
100644 → 0
View file @
8db8368e
/*
* Win32 'syslevel' routines
*
* Copyright 1998 Ulrich Weigand
*
* 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
*/
#ifndef __WINE_SYSLEVEL_H
#define __WINE_SYSLEVEL_H
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
extern
WORD
SYSLEVEL_Win16CurrentTeb
;
extern
WORD
SYSLEVEL_EmergencyTeb
;
VOID
SYSLEVEL_CheckNotLevel
(
INT
level
);
#endif
/* __WINE_SYSLEVEL_H */
scheduler/synchro.c
deleted
100644 → 0
View file @
8db8368e
/*
* Win32 process and thread synchronisation
*
* Copyright 1997 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 <stdarg.h>
#include "ntstatus.h"
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "winternl.h"
#include "../kernel/kernel_private.h"
/* FIXME: to be changed when moving file to dlls/kernel */
/***********************************************************************
* Sleep (KERNEL32.@)
*/
VOID
WINAPI
Sleep
(
DWORD
timeout
)
{
SleepEx
(
timeout
,
FALSE
);
}
/******************************************************************************
* SleepEx (KERNEL32.@)
*/
DWORD
WINAPI
SleepEx
(
DWORD
timeout
,
BOOL
alertable
)
{
NTSTATUS
status
;
if
(
timeout
==
INFINITE
)
status
=
NtDelayExecution
(
alertable
,
NULL
);
else
{
LARGE_INTEGER
time
;
time
.
QuadPart
=
timeout
*
(
ULONGLONG
)
10000
;
time
.
QuadPart
=
-
time
.
QuadPart
;
status
=
NtDelayExecution
(
alertable
,
&
time
);
}
if
(
status
!=
STATUS_USER_APC
)
status
=
STATUS_SUCCESS
;
return
status
;
}
/***********************************************************************
* WaitForSingleObject (KERNEL32.@)
*/
DWORD
WINAPI
WaitForSingleObject
(
HANDLE
handle
,
DWORD
timeout
)
{
return
WaitForMultipleObjectsEx
(
1
,
&
handle
,
FALSE
,
timeout
,
FALSE
);
}
/***********************************************************************
* WaitForSingleObjectEx (KERNEL32.@)
*/
DWORD
WINAPI
WaitForSingleObjectEx
(
HANDLE
handle
,
DWORD
timeout
,
BOOL
alertable
)
{
return
WaitForMultipleObjectsEx
(
1
,
&
handle
,
FALSE
,
timeout
,
alertable
);
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL32.@)
*/
DWORD
WINAPI
WaitForMultipleObjects
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
)
{
return
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
FALSE
);
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL32.@)
*/
DWORD
WINAPI
WaitForMultipleObjectsEx
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
,
BOOL
alertable
)
{
NTSTATUS
status
;
HANDLE
hloc
[
MAXIMUM_WAIT_OBJECTS
];
int
i
;
if
(
count
>=
MAXIMUM_WAIT_OBJECTS
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
WAIT_FAILED
;
}
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
((
handles
[
i
]
==
(
HANDLE
)
STD_INPUT_HANDLE
)
||
(
handles
[
i
]
==
(
HANDLE
)
STD_OUTPUT_HANDLE
)
||
(
handles
[
i
]
==
(
HANDLE
)
STD_ERROR_HANDLE
))
hloc
[
i
]
=
GetStdHandle
(
(
DWORD
)
handles
[
i
]
);
else
hloc
[
i
]
=
handles
[
i
];
/* yes, even screen buffer console handles are waitable, and are
* handled as a handle to the console itself !!
*/
if
(
is_console_handle
(
hloc
[
i
]))
{
if
(
!
VerifyConsoleIoHandle
(
hloc
[
i
]))
{
return
FALSE
;
}
hloc
[
i
]
=
GetConsoleInputWaitHandle
();
}
}
if
(
timeout
==
INFINITE
)
{
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
wait_all
,
alertable
,
NULL
);
}
else
{
LARGE_INTEGER
time
;
time
.
QuadPart
=
timeout
*
(
ULONGLONG
)
10000
;
time
.
QuadPart
=
-
time
.
QuadPart
;
status
=
NtWaitForMultipleObjects
(
count
,
hloc
,
wait_all
,
alertable
,
&
time
);
}
if
(
HIWORD
(
status
))
/* is it an error code? */
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
status
=
WAIT_FAILED
;
}
return
status
;
}
/***********************************************************************
* WaitForSingleObject (KERNEL.460)
*/
DWORD
WINAPI
WaitForSingleObject16
(
HANDLE
handle
,
DWORD
timeout
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForSingleObject
(
handle
,
timeout
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
/***********************************************************************
* WaitForMultipleObjects (KERNEL.461)
*/
DWORD
WINAPI
WaitForMultipleObjects16
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
FALSE
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
/***********************************************************************
* WaitForMultipleObjectsEx (KERNEL.495)
*/
DWORD
WINAPI
WaitForMultipleObjectsEx16
(
DWORD
count
,
const
HANDLE
*
handles
,
BOOL
wait_all
,
DWORD
timeout
,
BOOL
alertable
)
{
DWORD
retval
,
mutex_count
;
ReleaseThunkLock
(
&
mutex_count
);
retval
=
WaitForMultipleObjectsEx
(
count
,
handles
,
wait_all
,
timeout
,
alertable
);
RestoreThunkLock
(
mutex_count
);
return
retval
;
}
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