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
6ebbe3c9
Commit
6ebbe3c9
authored
Jan 01, 1999
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up and removed some no longer used code.
parent
881708cc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
95 additions
and
268 deletions
+95
-268
change.c
files/change.c
+1
-9
dos_fs.c
files/dos_fs.c
+1
-4
file.c
files/file.c
+33
-95
file.h
include/file.h
+2
-5
client.c
scheduler/client.c
+26
-45
event.c
scheduler/event.c
+2
-25
k32obj.c
scheduler/k32obj.c
+24
-10
mutex.c
scheduler/mutex.c
+2
-23
pipe.c
scheduler/pipe.c
+0
-20
semaphore.c
scheduler/semaphore.c
+3
-27
console.c
win32/console.c
+1
-5
No files found.
files/change.c
View file @
6ebbe3c9
...
@@ -29,14 +29,10 @@ const K32OBJ_OPS CHANGE_Ops =
...
@@ -29,14 +29,10 @@ const K32OBJ_OPS CHANGE_Ops =
typedef
struct
typedef
struct
{
{
K32OBJ
header
;
K32OBJ
header
;
LPSTR
lpPathName
;
LPSTR
lpPathName
;
BOOL32
bWatchSubtree
;
BOOL32
bWatchSubtree
;
DWORD
dwNotifyFilter
;
DWORD
dwNotifyFilter
;
THREAD_QUEUE
wait_queue
;
BOOL32
notify
;
BOOL32
notify
;
}
CHANGE_OBJECT
;
}
CHANGE_OBJECT
;
/****************************************************************************
/****************************************************************************
...
@@ -67,13 +63,11 @@ HANDLE32 WINAPI FindFirstChangeNotification32A( LPCSTR lpPathName,
...
@@ -67,13 +63,11 @@ HANDLE32 WINAPI FindFirstChangeNotification32A( LPCSTR lpPathName,
CHANGE_OBJECT
*
change
;
CHANGE_OBJECT
*
change
;
struct
create_change_notification_request
req
;
struct
create_change_notification_request
req
;
struct
create_change_notification_reply
reply
;
struct
create_change_notification_reply
reply
;
int
len
;
req
.
subtree
=
bWatchSubtree
;
req
.
subtree
=
bWatchSubtree
;
req
.
filter
=
dwNotifyFilter
;
req
.
filter
=
dwNotifyFilter
;
CLIENT_SendRequest
(
REQ_CREATE_CHANGE_NOTIFICATION
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_CREATE_CHANGE_NOTIFICATION
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
==
-
1
)
return
INVALID_HANDLE_VALUE32
;
if
(
reply
.
handle
==
-
1
)
return
INVALID_HANDLE_VALUE32
;
change
=
HeapAlloc
(
SystemHeap
,
0
,
sizeof
(
CHANGE_OBJECT
)
);
change
=
HeapAlloc
(
SystemHeap
,
0
,
sizeof
(
CHANGE_OBJECT
)
);
...
@@ -89,8 +83,6 @@ HANDLE32 WINAPI FindFirstChangeNotification32A( LPCSTR lpPathName,
...
@@ -89,8 +83,6 @@ HANDLE32 WINAPI FindFirstChangeNotification32A( LPCSTR lpPathName,
change
->
lpPathName
=
HEAP_strdupA
(
SystemHeap
,
0
,
lpPathName
);
change
->
lpPathName
=
HEAP_strdupA
(
SystemHeap
,
0
,
lpPathName
);
change
->
bWatchSubtree
=
bWatchSubtree
;
change
->
bWatchSubtree
=
bWatchSubtree
;
change
->
dwNotifyFilter
=
dwNotifyFilter
;
change
->
dwNotifyFilter
=
dwNotifyFilter
;
change
->
wait_queue
=
NULL
;
change
->
notify
=
FALSE
;
change
->
notify
=
FALSE
;
return
HANDLE_Alloc
(
PROCESS_Current
(),
&
change
->
header
,
return
HANDLE_Alloc
(
PROCESS_Current
(),
&
change
->
header
,
...
...
files/dos_fs.c
View file @
6ebbe3c9
...
@@ -652,10 +652,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
...
@@ -652,10 +652,7 @@ HFILE32 DOSFS_OpenDevice( const char *name, int unixmode )
!
strcmp
(
DOSFS_Devices
[
i
].
name
,
"HPSCAN"
))
!
strcmp
(
DOSFS_Devices
[
i
].
name
,
"HPSCAN"
))
{
{
int
fd
=
open
(
"/dev/null"
,
unixmode
);
int
fd
=
open
(
"/dev/null"
,
unixmode
);
if
((
handle
=
FILE_Alloc
(
&
file
,
fd
))
==
INVALID_HANDLE_VALUE32
)
return
FILE_Alloc
(
&
file
,
fd
,
DOSFS_Devices
[
i
].
name
);
return
HFILE_ERROR32
;
file
->
unix_name
=
HEAP_strdupA
(
SystemHeap
,
0
,
name
);
return
handle
;
}
}
FIXME
(
dosfs
,
"device open %s not supported (yet)
\n
"
,
DOSFS_Devices
[
i
].
name
);
FIXME
(
dosfs
,
"device open %s not supported (yet)
\n
"
,
DOSFS_Devices
[
i
].
name
);
return
HFILE_ERROR32
;
return
HFILE_ERROR32
;
...
...
files/file.c
View file @
6ebbe3c9
This diff is collapsed.
Click to expand it.
include/file.h
View file @
6ebbe3c9
...
@@ -10,7 +10,6 @@
...
@@ -10,7 +10,6 @@
#include <time.h>
#include <time.h>
#include "windows.h"
#include "windows.h"
#include "k32obj.h"
#include "k32obj.h"
#include "thread.h"
#define MAX_PATHNAME_LEN 1024
#define MAX_PATHNAME_LEN 1024
...
@@ -21,7 +20,6 @@ typedef struct
...
@@ -21,7 +20,6 @@ typedef struct
int
mode
;
int
mode
;
char
*
unix_name
;
char
*
unix_name
;
DWORD
type
;
/* Type for win32 apps */
DWORD
type
;
/* Type for win32 apps */
THREAD_QUEUE
wait_queue
;
}
FILE_OBJECT
;
}
FILE_OBJECT
;
/* Definition of a full DOS file name */
/* Definition of a full DOS file name */
...
@@ -62,9 +60,8 @@ typedef struct
...
@@ -62,9 +60,8 @@ typedef struct
extern
FILE_OBJECT
*
FILE_GetFile
(
HFILE32
handle
,
DWORD
access
,
extern
FILE_OBJECT
*
FILE_GetFile
(
HFILE32
handle
,
DWORD
access
,
int
*
server_handle
);
int
*
server_handle
);
extern
void
FILE_ReleaseFile
(
FILE_OBJECT
*
file
);
extern
void
FILE_ReleaseFile
(
FILE_OBJECT
*
file
);
extern
HFILE32
FILE_Alloc
(
FILE_OBJECT
**
file
,
int
unix_handle
);
extern
HFILE32
FILE_Alloc
(
FILE_OBJECT
**
file
,
int
unix_handle
,
const
char
*
unix_name
);
extern
void
FILE_SetDosError
(
void
);
extern
void
FILE_SetDosError
(
void
);
extern
int
FILE_GetUnixHandle
(
HFILE32
hFile
,
DWORD
access
);
extern
HFILE32
FILE_DupUnixHandle
(
int
fd
);
extern
HFILE32
FILE_DupUnixHandle
(
int
fd
);
extern
BOOL32
FILE_Stat
(
LPCSTR
unixName
,
BY_HANDLE_FILE_INFORMATION
*
info
);
extern
BOOL32
FILE_Stat
(
LPCSTR
unixName
,
BY_HANDLE_FILE_INFORMATION
*
info
);
extern
HFILE32
FILE_Dup
(
HFILE32
hFile
);
extern
HFILE32
FILE_Dup
(
HFILE32
hFile
);
...
@@ -72,7 +69,7 @@ extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 );
...
@@ -72,7 +69,7 @@ extern HFILE32 FILE_Dup2( HFILE32 hFile1, HFILE32 hFile2 );
extern
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
,
INT32
sharemode
);
extern
HFILE32
FILE_Open
(
LPCSTR
path
,
INT32
mode
,
INT32
sharemode
);
extern
HFILE32
FILE_OpenUnixFile
(
LPCSTR
path
,
INT32
mode
);
extern
HFILE32
FILE_OpenUnixFile
(
LPCSTR
path
,
INT32
mode
);
extern
BOOL32
FILE_SetFileType
(
HFILE32
hFile
,
DWORD
type
);
extern
BOOL32
FILE_SetFileType
(
HFILE32
hFile
,
DWORD
type
);
extern
LPVOID
FILE_dommap
(
FILE_OBJECT
*
file
,
int
unix_handle
,
LPVOID
start
,
extern
LPVOID
FILE_dommap
(
int
unix_handle
,
LPVOID
start
,
DWORD
size_high
,
DWORD
size_low
,
DWORD
size_high
,
DWORD
size_low
,
DWORD
offset_high
,
DWORD
offset_low
,
DWORD
offset_high
,
DWORD
offset_low
,
int
prot
,
int
flags
);
int
prot
,
int
flags
);
...
...
scheduler/client.c
View file @
6ebbe3c9
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
/***********************************************************************
/***********************************************************************
* CLIENT_ProtocolError
* CLIENT_ProtocolError
*/
*/
void
CLIENT_ProtocolError
(
const
char
*
err
,
...
)
static
void
CLIENT_ProtocolError
(
const
char
*
err
,
...
)
{
{
THDB
*
thdb
=
THREAD_Current
();
THDB
*
thdb
=
THREAD_Current
();
va_list
args
;
va_list
args
;
...
@@ -216,6 +216,26 @@ unsigned int CLIENT_WaitReply( int *len, int *passed_fd,
...
@@ -216,6 +216,26 @@ unsigned int CLIENT_WaitReply( int *len, int *passed_fd,
/***********************************************************************
/***********************************************************************
* CLIENT_WaitSimpleReply
*
* Wait for a simple fixed-length reply from the server.
*/
unsigned
int
CLIENT_WaitSimpleReply
(
void
*
reply
,
int
len
,
int
*
passed_fd
)
{
struct
iovec
vec
[
2
];
unsigned
int
ret
;
int
got
;
vec
[
1
].
iov_base
=
reply
;
vec
[
1
].
iov_len
=
len
;
ret
=
CLIENT_WaitReply_v
(
&
got
,
passed_fd
,
vec
,
2
);
if
(
got
!=
len
)
CLIENT_ProtocolError
(
"WaitSimpleReply: len %d != %d
\n
"
,
len
,
got
);
return
ret
;
}
/***********************************************************************
* CLIENT_NewThread
* CLIENT_NewThread
*
*
* Send a new thread request.
* Send a new thread request.
...
@@ -224,7 +244,7 @@ int CLIENT_NewThread( THDB *thdb, int *thandle, int *phandle )
...
@@ -224,7 +244,7 @@ int CLIENT_NewThread( THDB *thdb, int *thandle, int *phandle )
{
{
struct
new_thread_request
request
;
struct
new_thread_request
request
;
struct
new_thread_reply
reply
;
struct
new_thread_reply
reply
;
int
len
,
fd
[
2
];
int
fd
[
2
];
extern
BOOL32
THREAD_InitDone
;
extern
BOOL32
THREAD_InitDone
;
extern
void
server_init
(
int
fd
);
extern
void
server_init
(
int
fd
);
extern
void
select_loop
(
void
);
extern
void
select_loop
(
void
);
...
@@ -273,16 +293,13 @@ int CLIENT_NewThread( THDB *thdb, int *thandle, int *phandle )
...
@@ -273,16 +293,13 @@ int CLIENT_NewThread( THDB *thdb, int *thandle, int *phandle )
request
.
pid
=
thdb
->
process
->
server_pid
;
request
.
pid
=
thdb
->
process
->
server_pid
;
CLIENT_SendRequest
(
REQ_NEW_THREAD
,
fd
[
1
],
1
,
&
request
,
sizeof
(
request
)
);
CLIENT_SendRequest
(
REQ_NEW_THREAD
,
fd
[
1
],
1
,
&
request
,
sizeof
(
request
)
);
if
(
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
))
goto
error
;
if
(
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
))
goto
error
;
if
(
len
<
sizeof
(
reply
))
goto
error
;
thdb
->
server_tid
=
reply
.
tid
;
thdb
->
server_tid
=
reply
.
tid
;
thdb
->
process
->
server_pid
=
reply
.
pid
;
thdb
->
process
->
server_pid
=
reply
.
pid
;
if
(
thdb
->
socket
!=
-
1
)
close
(
thdb
->
socket
);
if
(
thdb
->
socket
!=
-
1
)
close
(
thdb
->
socket
);
thdb
->
socket
=
fd
[
0
];
thdb
->
socket
=
fd
[
0
];
thdb
->
seq
=
0
;
/* reset the sequence number for the new fd */
thdb
->
seq
=
0
;
/* reset the sequence number for the new fd */
/* we don't need the handles for now */
if
(
thandle
)
*
thandle
=
reply
.
thandle
;
if
(
thandle
)
*
thandle
=
reply
.
thandle
;
else
if
(
reply
.
thandle
!=
-
1
)
CLIENT_CloseHandle
(
reply
.
thandle
);
else
if
(
reply
.
thandle
!=
-
1
)
CLIENT_CloseHandle
(
reply
.
thandle
);
if
(
phandle
)
*
phandle
=
reply
.
phandle
;
if
(
phandle
)
*
phandle
=
reply
.
phandle
;
...
@@ -359,45 +376,12 @@ int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process, in
...
@@ -359,45 +376,12 @@ int CLIENT_DuplicateHandle( int src_process, int src_handle, int dst_process, in
req
.
options
=
options
;
req
.
options
=
options
;
CLIENT_SendRequest
(
REQ_DUP_HANDLE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_DUP_HANDLE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
return
reply
.
handle
;
return
reply
.
handle
;
}
}
/***********************************************************************
/***********************************************************************
* CLIENT_GetProcessInfo
*
* Send a get process info request. Return 0 if OK.
*/
int
CLIENT_GetProcessInfo
(
int
handle
,
struct
get_process_info_reply
*
reply
)
{
int
len
,
err
;
CLIENT_SendRequest
(
REQ_GET_PROCESS_INFO
,
-
1
,
1
,
&
handle
,
sizeof
(
handle
)
);
err
=
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
reply
,
sizeof
(
*
reply
)
);
CHECK_LEN
(
len
,
sizeof
(
*
reply
)
);
return
err
;
}
/***********************************************************************
* CLIENT_GetThreadInfo
*
* Send a get thread info request. Return 0 if OK.
*/
int
CLIENT_GetThreadInfo
(
int
handle
,
struct
get_thread_info_reply
*
reply
)
{
int
len
,
err
;
CLIENT_SendRequest
(
REQ_GET_THREAD_INFO
,
-
1
,
1
,
&
handle
,
sizeof
(
handle
)
);
err
=
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
reply
,
sizeof
(
*
reply
)
);
CHECK_LEN
(
len
,
sizeof
(
*
reply
)
);
return
err
;
}
/***********************************************************************
* CLIENT_OpenProcess
* CLIENT_OpenProcess
*
*
* Open a handle to a process.
* Open a handle to a process.
...
@@ -406,15 +390,13 @@ int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit )
...
@@ -406,15 +390,13 @@ int CLIENT_OpenProcess( void *pid, DWORD access, BOOL32 inherit )
{
{
struct
open_process_request
req
;
struct
open_process_request
req
;
struct
open_process_reply
reply
;
struct
open_process_reply
reply
;
int
len
;
req
.
pid
=
pid
;
req
.
pid
=
pid
;
req
.
access
=
access
;
req
.
access
=
access
;
req
.
inherit
=
inherit
;
req
.
inherit
=
inherit
;
CLIENT_SendRequest
(
REQ_OPEN_PROCESS
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_OPEN_PROCESS
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
return
reply
.
handle
;
return
reply
.
handle
;
}
}
...
@@ -435,7 +417,6 @@ int CLIENT_Select( int count, int *handles, int flags, int timeout )
...
@@ -435,7 +417,6 @@ int CLIENT_Select( int count, int *handles, int flags, int timeout )
CLIENT_SendRequest
(
REQ_SELECT
,
-
1
,
2
,
CLIENT_SendRequest
(
REQ_SELECT
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
&
req
,
sizeof
(
req
),
handles
,
count
*
sizeof
(
int
)
);
handles
,
count
*
sizeof
(
int
)
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
return
reply
.
signaled
;
return
reply
.
signaled
;
}
}
scheduler/event.c
View file @
6ebbe3c9
...
@@ -20,13 +20,6 @@ typedef struct
...
@@ -20,13 +20,6 @@ typedef struct
K32OBJ
header
;
K32OBJ
header
;
}
EVENT
;
}
EVENT
;
static
void
EVENT_Destroy
(
K32OBJ
*
obj
);
const
K32OBJ_OPS
EVENT_Ops
=
{
EVENT_Destroy
/* destroy */
};
/***********************************************************************
/***********************************************************************
* CreateEvent32A (KERNEL32.156)
* CreateEvent32A (KERNEL32.156)
...
@@ -45,8 +38,7 @@ HANDLE32 WINAPI CreateEvent32A( SECURITY_ATTRIBUTES *sa, BOOL32 manual_reset,
...
@@ -45,8 +38,7 @@ HANDLE32 WINAPI CreateEvent32A( SECURITY_ATTRIBUTES *sa, BOOL32 manual_reset,
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
CLIENT_SendRequest
(
REQ_CREATE_EVENT
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_CREATE_EVENT
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
==
-
1
)
return
0
;
if
(
reply
.
handle
==
-
1
)
return
0
;
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -96,8 +88,7 @@ HANDLE32 WINAPI OpenEvent32A( DWORD access, BOOL32 inherit, LPCSTR name )
...
@@ -96,8 +88,7 @@ HANDLE32 WINAPI OpenEvent32A( DWORD access, BOOL32 inherit, LPCSTR name )
req
.
access
=
access
;
req
.
access
=
access
;
req
.
inherit
=
inherit
;
req
.
inherit
=
inherit
;
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
!=
-
1
)
if
(
reply
.
handle
!=
-
1
)
{
{
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -173,20 +164,6 @@ BOOL32 WINAPI ResetEvent( HANDLE32 handle )
...
@@ -173,20 +164,6 @@ BOOL32 WINAPI ResetEvent( HANDLE32 handle )
/***********************************************************************
/***********************************************************************
* EVENT_Destroy
*/
static
void
EVENT_Destroy
(
K32OBJ
*
obj
)
{
EVENT
*
event
=
(
EVENT
*
)
obj
;
assert
(
obj
->
type
==
K32OBJ_EVENT
);
obj
->
type
=
K32OBJ_UNKNOWN
;
HeapFree
(
SystemHeap
,
0
,
event
);
}
/***********************************************************************
* NOTE: The Win95 VWin32_Event routines given below are really low-level
* NOTE: The Win95 VWin32_Event routines given below are really low-level
* routines implemented directly by VWin32. The user-mode libraries
* routines implemented directly by VWin32. The user-mode libraries
* implement Win32 synchronisation routines on top of these low-level
* implement Win32 synchronisation routines on top of these low-level
...
...
scheduler/k32obj.c
View file @
6ebbe3c9
...
@@ -21,23 +21,25 @@ extern const K32OBJ_OPS DEVICE_Ops;
...
@@ -21,23 +21,25 @@ extern const K32OBJ_OPS DEVICE_Ops;
extern
const
K32OBJ_OPS
CONSOLE_Ops
;
extern
const
K32OBJ_OPS
CONSOLE_Ops
;
extern
const
K32OBJ_OPS
SNAPSHOT_Ops
;
extern
const
K32OBJ_OPS
SNAPSHOT_Ops
;
/* The following are fully implemented in the server and could be removed */
extern
const
K32OBJ_OPS
SEMAPHORE_Ops
;
extern
const
K32OBJ_OPS
EVENT_Ops
;
extern
const
K32OBJ_OPS
MUTEX_Ops
;
extern
const
K32OBJ_OPS
PIPE_Ops
;
static
const
K32OBJ_OPS
K32OBJ_NullOps
=
static
const
K32OBJ_OPS
K32OBJ_NullOps
=
{
{
NULL
/* destroy */
NULL
/* destroy */
};
};
static
void
K32OBJ_Destroy
(
K32OBJ
*
obj
);
static
const
K32OBJ_OPS
K32OBJ_DefaultOps
=
{
K32OBJ_Destroy
/* destroy */
};
const
K32OBJ_OPS
*
const
K32OBJ_Ops
[
K32OBJ_NBOBJECTS
]
=
const
K32OBJ_OPS
*
const
K32OBJ_Ops
[
K32OBJ_NBOBJECTS
]
=
{
{
NULL
,
NULL
,
&
SEMAPHORE_Ops
,
/* K32OBJ_SEMAPHORE */
&
K32OBJ_DefaultOps
,
/* K32OBJ_SEMAPHORE */
&
EVENT_Ops
,
/* K32OBJ_EVENT */
&
K32OBJ_DefaultOps
,
/* K32OBJ_EVENT */
&
MUTEX_Ops
,
/* K32OBJ_MUTEX */
&
K32OBJ_DefaultOps
,
/* K32OBJ_MUTEX */
&
K32OBJ_NullOps
,
/* K32OBJ_CRITICAL_SECTION */
&
K32OBJ_NullOps
,
/* K32OBJ_CRITICAL_SECTION */
&
PROCESS_Ops
,
/* K32OBJ_PROCESS */
&
PROCESS_Ops
,
/* K32OBJ_PROCESS */
&
THREAD_Ops
,
/* K32OBJ_THREAD */
&
THREAD_Ops
,
/* K32OBJ_THREAD */
...
@@ -48,7 +50,7 @@ const K32OBJ_OPS * const K32OBJ_Ops[K32OBJ_NBOBJECTS] =
...
@@ -48,7 +50,7 @@ const K32OBJ_OPS * const K32OBJ_Ops[K32OBJ_NBOBJECTS] =
&
MEM_MAPPED_FILE_Ops
,
/* K32OBJ_MEM_MAPPED_FILE */
&
MEM_MAPPED_FILE_Ops
,
/* K32OBJ_MEM_MAPPED_FILE */
&
K32OBJ_NullOps
,
/* K32OBJ_SERIAL */
&
K32OBJ_NullOps
,
/* K32OBJ_SERIAL */
&
DEVICE_Ops
,
/* K32OBJ_DEVICE_IOCTL */
&
DEVICE_Ops
,
/* K32OBJ_DEVICE_IOCTL */
&
PIPE_Ops
,
/* K32OBJ_PIPE */
&
K32OBJ_DefaultOps
,
/* K32OBJ_PIPE */
&
K32OBJ_NullOps
,
/* K32OBJ_MAILSLOT */
&
K32OBJ_NullOps
,
/* K32OBJ_MAILSLOT */
&
K32OBJ_NullOps
,
/* K32OBJ_TOOLHELP_SNAPSHOT */
&
K32OBJ_NullOps
,
/* K32OBJ_TOOLHELP_SNAPSHOT */
&
K32OBJ_NullOps
/* K32OBJ_SOCKET */
&
K32OBJ_NullOps
/* K32OBJ_SOCKET */
...
@@ -113,6 +115,18 @@ void K32OBJ_DecCount( K32OBJ *ptr )
...
@@ -113,6 +115,18 @@ void K32OBJ_DecCount( K32OBJ *ptr )
/***********************************************************************
/***********************************************************************
* K32OBJ_Destroy
*
* Generic destroy functions for objects that don't need any special treatment.
*/
static
void
K32OBJ_Destroy
(
K32OBJ
*
obj
)
{
obj
->
type
=
K32OBJ_UNKNOWN
;
HeapFree
(
SystemHeap
,
0
,
obj
);
}
/***********************************************************************
* K32OBJ_IsValid
* K32OBJ_IsValid
*
*
* Check if a pointer is a valid kernel object
* Check if a pointer is a valid kernel object
...
...
scheduler/mutex.c
View file @
6ebbe3c9
...
@@ -19,13 +19,6 @@ typedef struct _MUTEX
...
@@ -19,13 +19,6 @@ typedef struct _MUTEX
K32OBJ
header
;
K32OBJ
header
;
}
MUTEX
;
}
MUTEX
;
static
void
MUTEX_Destroy
(
K32OBJ
*
obj
);
const
K32OBJ_OPS
MUTEX_Ops
=
{
MUTEX_Destroy
/* destroy */
};
/***********************************************************************
/***********************************************************************
* CreateMutex32A (KERNEL32.166)
* CreateMutex32A (KERNEL32.166)
...
@@ -43,8 +36,7 @@ HANDLE32 WINAPI CreateMutex32A( SECURITY_ATTRIBUTES *sa, BOOL32 owner,
...
@@ -43,8 +36,7 @@ HANDLE32 WINAPI CreateMutex32A( SECURITY_ATTRIBUTES *sa, BOOL32 owner,
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
CLIENT_SendRequest
(
REQ_CREATE_MUTEX
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_CREATE_MUTEX
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
==
-
1
)
return
0
;
if
(
reply
.
handle
==
-
1
)
return
0
;
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -86,8 +78,7 @@ HANDLE32 WINAPI OpenMutex32A( DWORD access, BOOL32 inherit, LPCSTR name )
...
@@ -86,8 +78,7 @@ HANDLE32 WINAPI OpenMutex32A( DWORD access, BOOL32 inherit, LPCSTR name )
req
.
access
=
access
;
req
.
access
=
access
;
req
.
inherit
=
inherit
;
req
.
inherit
=
inherit
;
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
!=
-
1
)
if
(
reply
.
handle
!=
-
1
)
{
{
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -130,15 +121,3 @@ BOOL32 WINAPI ReleaseMutex( HANDLE32 handle )
...
@@ -130,15 +121,3 @@ BOOL32 WINAPI ReleaseMutex( HANDLE32 handle )
CLIENT_SendRequest
(
REQ_RELEASE_MUTEX
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_RELEASE_MUTEX
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
return
!
CLIENT_WaitReply
(
NULL
,
NULL
,
0
);
return
!
CLIENT_WaitReply
(
NULL
,
NULL
,
0
);
}
}
/***********************************************************************
* MUTEX_Destroy
*/
static
void
MUTEX_Destroy
(
K32OBJ
*
obj
)
{
MUTEX
*
mutex
=
(
MUTEX
*
)
obj
;
assert
(
obj
->
type
==
K32OBJ_MUTEX
);
obj
->
type
=
K32OBJ_UNKNOWN
;
HeapFree
(
SystemHeap
,
0
,
mutex
);
}
scheduler/pipe.c
View file @
6ebbe3c9
...
@@ -19,13 +19,6 @@ typedef struct _PIPE
...
@@ -19,13 +19,6 @@ typedef struct _PIPE
K32OBJ
header
;
K32OBJ
header
;
}
PIPE
;
}
PIPE
;
static
void
PIPE_Destroy
(
K32OBJ
*
obj
);
const
K32OBJ_OPS
PIPE_Ops
=
{
PIPE_Destroy
/* destroy */
};
/***********************************************************************
/***********************************************************************
* CreatePipe (KERNEL32.170)
* CreatePipe (KERNEL32.170)
...
@@ -71,16 +64,3 @@ BOOL32 WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
...
@@ -71,16 +64,3 @@ BOOL32 WINAPI CreatePipe( PHANDLE hReadPipe, PHANDLE hWritePipe,
SYSTEM_UNLOCK
();
SYSTEM_UNLOCK
();
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
* PIPE_Destroy
*/
static
void
PIPE_Destroy
(
K32OBJ
*
obj
)
{
PIPE
*
pipe
=
(
PIPE
*
)
obj
;
assert
(
obj
->
type
==
K32OBJ_PIPE
);
obj
->
type
=
K32OBJ_UNKNOWN
;
HeapFree
(
SystemHeap
,
0
,
pipe
);
}
scheduler/semaphore.c
View file @
6ebbe3c9
...
@@ -19,13 +19,6 @@ typedef struct
...
@@ -19,13 +19,6 @@ typedef struct
K32OBJ
header
;
K32OBJ
header
;
}
SEMAPHORE
;
}
SEMAPHORE
;
static
void
SEMAPHORE_Destroy
(
K32OBJ
*
obj
);
const
K32OBJ_OPS
SEMAPHORE_Ops
=
{
SEMAPHORE_Destroy
/* destroy */
};
/***********************************************************************
/***********************************************************************
* CreateSemaphore32A (KERNEL32.174)
* CreateSemaphore32A (KERNEL32.174)
...
@@ -52,8 +45,7 @@ HANDLE32 WINAPI CreateSemaphore32A( SECURITY_ATTRIBUTES *sa, LONG initial,
...
@@ -52,8 +45,7 @@ HANDLE32 WINAPI CreateSemaphore32A( SECURITY_ATTRIBUTES *sa, LONG initial,
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
req
.
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
CLIENT_SendRequest
(
REQ_CREATE_SEMAPHORE
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_CREATE_SEMAPHORE
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
==
-
1
)
return
0
;
if
(
reply
.
handle
==
-
1
)
return
0
;
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -95,8 +87,7 @@ HANDLE32 WINAPI OpenSemaphore32A( DWORD access, BOOL32 inherit, LPCSTR name )
...
@@ -95,8 +87,7 @@ HANDLE32 WINAPI OpenSemaphore32A( DWORD access, BOOL32 inherit, LPCSTR name )
req
.
access
=
access
;
req
.
access
=
access
;
req
.
inherit
=
inherit
;
req
.
inherit
=
inherit
;
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_SendRequest
(
REQ_OPEN_NAMED_OBJ
,
-
1
,
2
,
&
req
,
sizeof
(
req
),
name
,
len
);
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
);
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
);
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
reply
.
handle
!=
-
1
)
if
(
reply
.
handle
!=
-
1
)
{
{
SYSTEM_LOCK
();
SYSTEM_LOCK
();
...
@@ -133,7 +124,6 @@ BOOL32 WINAPI ReleaseSemaphore( HANDLE32 handle, LONG count, LONG *previous )
...
@@ -133,7 +124,6 @@ BOOL32 WINAPI ReleaseSemaphore( HANDLE32 handle, LONG count, LONG *previous )
{
{
struct
release_semaphore_request
req
;
struct
release_semaphore_request
req
;
struct
release_semaphore_reply
reply
;
struct
release_semaphore_reply
reply
;
int
len
;
if
(
count
<
0
)
if
(
count
<
0
)
{
{
...
@@ -145,21 +135,7 @@ BOOL32 WINAPI ReleaseSemaphore( HANDLE32 handle, LONG count, LONG *previous )
...
@@ -145,21 +135,7 @@ BOOL32 WINAPI ReleaseSemaphore( HANDLE32 handle, LONG count, LONG *previous )
if
(
req
.
handle
==
-
1
)
return
FALSE
;
if
(
req
.
handle
==
-
1
)
return
FALSE
;
req
.
count
=
(
unsigned
int
)
count
;
req
.
count
=
(
unsigned
int
)
count
;
CLIENT_SendRequest
(
REQ_RELEASE_SEMAPHORE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_RELEASE_SEMAPHORE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
if
(
CLIENT_WaitReply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
))
return
FALSE
;
if
(
CLIENT_WaitSimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
))
return
FALSE
;
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
if
(
previous
)
*
previous
=
reply
.
prev_count
;
if
(
previous
)
*
previous
=
reply
.
prev_count
;
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
* SEMAPHORE_Destroy
*/
static
void
SEMAPHORE_Destroy
(
K32OBJ
*
obj
)
{
SEMAPHORE
*
sem
=
(
SEMAPHORE
*
)
obj
;
assert
(
obj
->
type
==
K32OBJ_SEMAPHORE
);
/* There cannot be any thread on the list since the ref count is 0 */
obj
->
type
=
K32OBJ_UNKNOWN
;
HeapFree
(
SystemHeap
,
0
,
sem
);
}
win32/console.c
View file @
6ebbe3c9
...
@@ -60,7 +60,6 @@ typedef struct _CONSOLE {
...
@@ -60,7 +60,6 @@ typedef struct _CONSOLE {
LPSTR
title
;
/* title of console */
LPSTR
title
;
/* title of console */
INPUT_RECORD
*
irs
;
/* buffered input records */
INPUT_RECORD
*
irs
;
/* buffered input records */
int
nrofirs
;
/* nr of buffered input records */
int
nrofirs
;
/* nr of buffered input records */
THREAD_QUEUE
wait_queue
;
}
CONSOLE
;
}
CONSOLE
;
static
void
CONSOLE_Destroy
(
K32OBJ
*
obj
);
static
void
CONSOLE_Destroy
(
K32OBJ
*
obj
);
...
@@ -644,7 +643,6 @@ BOOL32 WINAPI AllocConsole(VOID)
...
@@ -644,7 +643,6 @@ BOOL32 WINAPI AllocConsole(VOID)
{
{
struct
create_console_request
req
;
struct
create_console_request
req
;
struct
create_console_reply
reply
;
struct
create_console_reply
reply
;
int
len
;
PDB32
*
pdb
=
PROCESS_Current
();
PDB32
*
pdb
=
PROCESS_Current
();
CONSOLE
*
console
;
CONSOLE
*
console
;
HANDLE32
hIn
,
hOut
,
hErr
;
HANDLE32
hIn
,
hOut
,
hErr
;
...
@@ -674,7 +672,6 @@ BOOL32 WINAPI AllocConsole(VOID)
...
@@ -674,7 +672,6 @@ BOOL32 WINAPI AllocConsole(VOID)
console
->
pid
=
-
1
;
console
->
pid
=
-
1
;
console
->
title
=
NULL
;
console
->
title
=
NULL
;
console
->
nrofirs
=
0
;
console
->
nrofirs
=
0
;
console
->
wait_queue
=
NULL
;
console
->
irs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);;
console
->
irs
=
HeapAlloc
(
GetProcessHeap
(),
0
,
1
);;
console
->
mode
=
ENABLE_PROCESSED_INPUT
console
->
mode
=
ENABLE_PROCESSED_INPUT
|
ENABLE_LINE_INPUT
|
ENABLE_LINE_INPUT
...
@@ -685,13 +682,12 @@ BOOL32 WINAPI AllocConsole(VOID)
...
@@ -685,13 +682,12 @@ BOOL32 WINAPI AllocConsole(VOID)
console
->
hread
=
console
->
hwrite
=
-
1
;
console
->
hread
=
console
->
hwrite
=
-
1
;
CLIENT_SendRequest
(
REQ_CREATE_CONSOLE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
CLIENT_SendRequest
(
REQ_CREATE_CONSOLE
,
-
1
,
1
,
&
req
,
sizeof
(
req
)
);
if
(
CLIENT_Wait
Reply
(
&
len
,
NULL
,
1
,
&
reply
,
sizeof
(
reply
)
)
!=
ERROR_SUCCESS
)
if
(
CLIENT_Wait
SimpleReply
(
&
reply
,
sizeof
(
reply
),
NULL
)
!=
ERROR_SUCCESS
)
{
{
K32OBJ_DecCount
(
&
console
->
header
);
K32OBJ_DecCount
(
&
console
->
header
);
SYSTEM_UNLOCK
();
SYSTEM_UNLOCK
();
return
FALSE
;
return
FALSE
;
}
}
CHECK_LEN
(
len
,
sizeof
(
reply
)
);
console
->
hread
=
reply
.
handle_read
;
console
->
hread
=
reply
.
handle_read
;
console
->
hwrite
=
reply
.
handle_write
;
console
->
hwrite
=
reply
.
handle_write
;
...
...
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