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
577db37b
Commit
577db37b
authored
Nov 08, 1998
by
James Sutherland
Committed by
Alexandre Julliard
Nov 08, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More complete implementation of the SetCtrlHandler() function (and the
related console functions).
parent
471b5dff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
6 deletions
+110
-6
kernel32.spec
relay32/kernel32.spec
+2
-2
process.c
scheduler/process.c
+32
-2
console.c
win32/console.c
+76
-2
No files found.
relay32/kernel32.spec
View file @
577db37b
...
@@ -290,7 +290,7 @@ init MAIN_KernelInit
...
@@ -290,7 +290,7 @@ init MAIN_KernelInit
271 stdcall FreeLibrary(long) FreeLibrary32
271 stdcall FreeLibrary(long) FreeLibrary32
273 stdcall FreeResource(long) FreeResource32
273 stdcall FreeResource(long) FreeResource32
274 stdcall FreeSLCallback(long) FreeSLCallback
274 stdcall FreeSLCallback(long) FreeSLCallback
275 st
ub
GenerateConsoleCtrlEvent
275 st
dcall GenerateConsoleCtrlEvent(long long)
GenerateConsoleCtrlEvent
276 stdcall GetACP() GetACP
276 stdcall GetACP() GetACP
277 stdcall GetAtomNameA(long ptr long) GetAtomName32A
277 stdcall GetAtomNameA(long ptr long) GetAtomName32A
278 stdcall GetAtomNameW(long ptr long) GetAtomName32W
278 stdcall GetAtomNameW(long ptr long) GetAtomName32W
...
@@ -392,7 +392,7 @@ init MAIN_KernelInit
...
@@ -392,7 +392,7 @@ init MAIN_KernelInit
374 stdcall GetProcessFlags(long) GetProcessFlags
374 stdcall GetProcessFlags(long) GetProcessFlags
375 stdcall GetProcessHeap() GetProcessHeap
375 stdcall GetProcessHeap() GetProcessHeap
376 stdcall GetProcessHeaps(long ptr) GetProcessHeaps
376 stdcall GetProcessHeaps(long ptr) GetProcessHeaps
377 st
ub
GetProcessShutdownParameters
377 st
dcall GetProcessShutdownParameters(ptr ptr)
GetProcessShutdownParameters
378 stdcall GetProcessTimes(long ptr ptr ptr ptr) GetProcessTimes
378 stdcall GetProcessTimes(long ptr ptr ptr ptr) GetProcessTimes
379 stdcall GetProcessVersion(long) GetProcessVersion
379 stdcall GetProcessVersion(long) GetProcessVersion
380 stdcall GetProcessWorkingSetSize(long ptr ptr) GetProcessWorkingSetSize
380 stdcall GetProcessWorkingSetSize(long ptr ptr) GetProcessWorkingSetSize
...
...
scheduler/process.c
View file @
577db37b
...
@@ -717,13 +717,43 @@ BOOL32 WINAPI GetProcessWorkingSetSize(HANDLE32 hProcess,LPDWORD minset,
...
@@ -717,13 +717,43 @@ BOOL32 WINAPI GetProcessWorkingSetSize(HANDLE32 hProcess,LPDWORD minset,
/***********************************************************************
/***********************************************************************
* SetProcessShutdownParameters (KERNEL32)
* SetProcessShutdownParameters (KERNEL32)
*/
*
* CHANGED - James Sutherland (JamesSutherland@gmx.de)
* Now tracks changes made (but does not act on these changes)
* NOTE: the definition for SHUTDOWN_NORETRY was done on guesswork.
* It really shouldn't be here, but I'll move it when it's been checked!
*/
#define SHUTDOWN_NORETRY 1
extern
unsigned
int
shutdown_noretry
=
0
;
extern
unsigned
int
shutdown_priority
=
0x280L
;
BOOL32
WINAPI
SetProcessShutdownParameters
(
DWORD
level
,
DWORD
flags
)
BOOL32
WINAPI
SetProcessShutdownParameters
(
DWORD
level
,
DWORD
flags
)
{
{
FIXME
(
process
,
"(%ld,0x%08lx): stub
\n
"
,
level
,
flags
);
if
(
flags
&
SHUTDOWN_NORETRY
)
shutdown_noretry
=
1
;
else
shutdown_noretry
=
0
;
if
(
level
>
0x100L
&&
level
<
0x3FFL
)
shutdown_priority
=
level
;
else
{
ERR
(
process
,
"invalid priority level 0x%08lx
\n
"
,
level
);
return
FALSE
;
}
return
TRUE
;
return
TRUE
;
}
}
/***********************************************************************
* GetProcessShutdownParameters (KERNEL32)
*
*/
BOOL32
WINAPI
GetProcessShutdownParameters
(
LPDWORD
lpdwLevel
,
LPDWORD
lpdwFlags
)
{
(
*
lpdwLevel
)
=
shutdown_priority
;
(
*
lpdwFlags
)
=
(
shutdown_noretry
*
SHUTDOWN_NORETRY
);
return
TRUE
;
}
/***********************************************************************
/***********************************************************************
* SetProcessPriorityBoost (KERNEL32)
* SetProcessPriorityBoost (KERNEL32)
*/
*/
...
...
win32/console.c
View file @
577db37b
...
@@ -177,11 +177,85 @@ static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer,
...
@@ -177,11 +177,85 @@ static BOOL32 CONSOLE_Write(K32OBJ *ptr, LPCVOID lpBuffer,
* RETURNS
* RETURNS
* Success: TRUE
* Success: TRUE
* Failure: FALSE
* Failure: FALSE
*
* CHANGED
* James Sutherland (JamesSutherland@gmx.de)
* Added global variables console_ignore_ctrl_c and handlers[]
* Does not yet do any error checking, or set LastError if failed.
* This doesn't yet matter, since these handlers are not yet called...!
*/
*/
static
unsigned
int
console_ignore_ctrl_c
=
0
;
static
HANDLER_ROUTINE
*
handlers
[]
=
{
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
};
BOOL32
WINAPI
SetConsoleCtrlHandler
(
HANDLER_ROUTINE
*
func
,
BOOL32
add
)
BOOL32
WINAPI
SetConsoleCtrlHandler
(
HANDLER_ROUTINE
*
func
,
BOOL32
add
)
{
{
FIXME
(
console
,
"(%p,%i): stub
\n
"
,
func
,
add
);
unsigned
int
alloc_loop
=
sizeof
(
handlers
)
/
sizeof
(
HANDLER_ROUTINE
*
);
return
TRUE
;
unsigned
int
done
=
0
;
FIXME
(
console
,
"(%p,%i) - no error checking or testing yet
\n
"
,
func
,
add
);
if
(
!
func
)
{
console_ignore_ctrl_c
=
add
;
return
TRUE
;
}
if
(
add
)
{
for
(;
alloc_loop
--
;)
if
(
!
handlers
[
alloc_loop
]
&&
!
done
)
{
handlers
[
alloc_loop
]
=
func
;
done
++
;
}
if
(
!
done
)
FIXME
(
console
,
"Out of space on CtrlHandler table
\n
"
);
return
(
done
);
}
else
{
for
(;
alloc_loop
--
;)
if
(
handlers
[
alloc_loop
]
==
func
&&
!
done
)
{
handlers
[
alloc_loop
]
=
0
;
done
++
;
}
if
(
!
done
)
WARN
(
console
,
"Attempt to remove non-installed CtrlHandler %p
\n
"
);
return
(
done
);
}
return
(
done
);
}
/******************************************************************************
* GenerateConsoleCtrlEvent [KERNEL32.275] Simulate a CTRL-C or CTRL-BREAK
*
* PARAMS
* dwCtrlEvent [I] Type of event
* dwProcessGroupID [I] Process group ID to send event to
*
* NOTES
* Doesn't yet work...!
*
* RETURNS
* Success: True
* Failure: False (and *should* [but doesn't] set LastError)
*/
BOOL32
WINAPI
GenerateConsoleCtrlEvent
(
DWORD
dwCtrlEvent
,
DWORD
dwProcessGroupID
)
{
if
(
dwCtrlEvent
!=
CTRL_C_EVENT
&&
dwCtrlEvent
!=
CTRL_BREAK_EVENT
)
{
ERR
(
console
,
"invalid event %d for PGID %d
\n
"
,
(
unsigned
short
)
dwCtrlEvent
,
dwProcessGroupID
);
return
FALSE
;
}
if
(
dwProcessGroupID
==
GetCurrentProcessId
()
)
{
FIXME
(
console
,
"Attempt to send event %d to self - stub
\n
"
,
(
unsigned
short
)
dwCtrlEvent
);
return
FALSE
;
}
FIXME
(
console
,
"event %d to external PGID %d - not implemented yet
\n
"
,
(
unsigned
short
)
dwCtrlEvent
,
dwProcessGroupID
);
return
FALSE
;
}
}
...
...
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