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
1da37e6a
Commit
1da37e6a
authored
Dec 12, 2003
by
Eric Pouech
Committed by
Alexandre Julliard
Dec 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved all remaining console related code to dlls/kernel directory.
parent
15be9062
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
118 deletions
+117
-118
console.c
dlls/kernel/console.c
+117
-0
file.c
files/file.c
+0
-118
No files found.
dlls/kernel/console.c
View file @
1da37e6a
...
...
@@ -181,6 +181,123 @@ BOOL WINAPI Beep( DWORD dwFreq, DWORD dwDur )
}
/******************************************************************
* OpenConsoleW (KERNEL32.@)
*
* Undocumented
* Open a handle to the current process console.
* Returns INVALID_HANDLE_VALUE on failure.
*/
HANDLE
WINAPI
OpenConsoleW
(
LPCWSTR
name
,
DWORD
access
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
)
{
static
const
WCHAR
coninW
[]
=
{
'C'
,
'O'
,
'N'
,
'I'
,
'N'
,
'$'
,
0
};
static
const
WCHAR
conoutW
[]
=
{
'C'
,
'O'
,
'N'
,
'O'
,
'U'
,
'T'
,
'$'
,
0
};
BOOL
output
;
HANDLE
ret
;
if
(
strcmpW
(
coninW
,
name
)
==
0
)
output
=
FALSE
;
else
if
(
strcmpW
(
conoutW
,
name
)
==
0
)
output
=
TRUE
;
else
{
SetLastError
(
ERROR_INVALID_NAME
);
return
INVALID_HANDLE_VALUE
;
}
if
(
creation
!=
OPEN_EXISTING
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
SERVER_START_REQ
(
open_console
)
{
req
->
from
=
output
;
req
->
access
=
access
;
req
->
share
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
req
->
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
SetLastError
(
0
);
wine_server_call_err
(
req
);
ret
=
reply
->
handle
;
}
SERVER_END_REQ
;
return
ret
?
console_handle_map
(
ret
)
:
INVALID_HANDLE_VALUE
;
}
/******************************************************************
* VerifyConsoleIoHandle (KERNEL32.@)
*
* Undocumented
*/
BOOL
WINAPI
VerifyConsoleIoHandle
(
HANDLE
handle
)
{
BOOL
ret
;
if
(
!
is_console_handle
(
handle
))
return
FALSE
;
SERVER_START_REQ
(
get_console_mode
)
{
req
->
handle
=
console_handle_unmap
(
handle
);
ret
=
!
wine_server_call_err
(
req
);
}
SERVER_END_REQ
;
return
ret
;
}
/******************************************************************
* DuplicateConsoleHandle (KERNEL32.@)
*
* Undocumented
*/
HANDLE
WINAPI
DuplicateConsoleHandle
(
HANDLE
handle
,
DWORD
access
,
BOOL
inherit
,
DWORD
options
)
{
HANDLE
ret
;
if
(
!
is_console_handle
(
handle
)
||
!
DuplicateHandle
(
GetCurrentProcess
(),
console_handle_unmap
(
handle
),
GetCurrentProcess
(),
&
ret
,
access
,
inherit
,
options
))
return
INVALID_HANDLE_VALUE
;
return
console_handle_map
(
ret
);
}
/******************************************************************
* CloseConsoleHandle (KERNEL32.@)
*
* Undocumented
*/
BOOL
WINAPI
CloseConsoleHandle
(
HANDLE
handle
)
{
if
(
!
is_console_handle
(
handle
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
CloseHandle
(
console_handle_unmap
(
handle
));
}
/******************************************************************
* GetConsoleInputWaitHandle (KERNEL32.@)
*
* Undocumented
*/
HANDLE
WINAPI
GetConsoleInputWaitHandle
(
void
)
{
static
HANDLE
console_wait_event
;
/* FIXME: this is not thread safe */
if
(
!
console_wait_event
)
{
SERVER_START_REQ
(
get_console_wait_event
)
{
if
(
!
wine_server_call_err
(
req
))
console_wait_event
=
reply
->
handle
;
}
SERVER_END_REQ
;
}
return
console_wait_event
;
}
/******************************************************************************
* WriteConsoleInputA [KERNEL32.@]
*/
...
...
files/file.c
View file @
1da37e6a
...
...
@@ -202,124 +202,6 @@ void FILE_SetDosError(void)
}
/******************************************************************
* OpenConsoleW (KERNEL32.@)
*
* Undocumented
* Open a handle to the current process console.
* Returns INVALID_HANDLE_VALUE on failure.
*/
HANDLE
WINAPI
OpenConsoleW
(
LPCWSTR
name
,
DWORD
access
,
LPSECURITY_ATTRIBUTES
sa
,
DWORD
creation
)
{
static
const
WCHAR
coninW
[]
=
{
'C'
,
'O'
,
'N'
,
'I'
,
'N'
,
'$'
,
0
};
static
const
WCHAR
conoutW
[]
=
{
'C'
,
'O'
,
'N'
,
'O'
,
'U'
,
'T'
,
'$'
,
0
};
BOOL
output
;
HANDLE
ret
;
if
(
strcmpW
(
coninW
,
name
)
==
0
)
output
=
FALSE
;
else
if
(
strcmpW
(
conoutW
,
name
)
==
0
)
output
=
TRUE
;
else
{
SetLastError
(
ERROR_INVALID_NAME
);
return
INVALID_HANDLE_VALUE
;
}
if
(
creation
!=
OPEN_EXISTING
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
SERVER_START_REQ
(
open_console
)
{
req
->
from
=
output
;
req
->
access
=
access
;
req
->
share
=
FILE_SHARE_READ
|
FILE_SHARE_WRITE
;
req
->
inherit
=
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
);
SetLastError
(
0
);
wine_server_call_err
(
req
);
ret
=
reply
->
handle
;
}
SERVER_END_REQ
;
return
ret
?
console_handle_map
(
ret
)
:
INVALID_HANDLE_VALUE
;
}
/******************************************************************
* VerifyConsoleIoHandle (KERNEL32.@)
*
* Undocumented
*/
BOOL
WINAPI
VerifyConsoleIoHandle
(
HANDLE
handle
)
{
BOOL
ret
;
if
(
!
is_console_handle
(
handle
))
return
FALSE
;
SERVER_START_REQ
(
get_console_mode
)
{
req
->
handle
=
console_handle_unmap
(
handle
);
ret
=
!
wine_server_call_err
(
req
);
}
SERVER_END_REQ
;
return
ret
;
}
/******************************************************************
* DuplicateConsoleHandle (KERNEL32.@)
*
* Undocumented
*/
HANDLE
WINAPI
DuplicateConsoleHandle
(
HANDLE
handle
,
DWORD
access
,
BOOL
inherit
,
DWORD
options
)
{
HANDLE
ret
;
if
(
!
is_console_handle
(
handle
)
||
!
DuplicateHandle
(
GetCurrentProcess
(),
console_handle_unmap
(
handle
),
GetCurrentProcess
(),
&
ret
,
access
,
inherit
,
options
))
return
INVALID_HANDLE_VALUE
;
return
console_handle_map
(
ret
);
}
/******************************************************************
* CloseConsoleHandle (KERNEL32.@)
*
* Undocumented
*/
BOOL
WINAPI
CloseConsoleHandle
(
HANDLE
handle
)
{
if
(
!
is_console_handle
(
handle
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
return
CloseHandle
(
console_handle_unmap
(
handle
));
}
/******************************************************************
* GetConsoleInputWaitHandle (KERNEL32.@)
*
* Undocumented
*/
HANDLE
WINAPI
GetConsoleInputWaitHandle
(
void
)
{
static
HANDLE
console_wait_event
;
/* FIXME: this is not thread safe */
if
(
!
console_wait_event
)
{
SERVER_START_REQ
(
get_console_wait_event
)
{
if
(
!
wine_server_call_err
(
req
))
console_wait_event
=
reply
->
handle
;
}
SERVER_END_REQ
;
}
return
console_wait_event
;
}
/* end of FIXME */
/***********************************************************************
* FILE_CreateFile
*
...
...
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