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
805f7d79
Commit
805f7d79
authored
Feb 03, 2010
by
Peter Rosin
Committed by
Alexandre Julliard
Feb 04, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add SetThreadErrorMode and GetThreadErrorMode.
parent
e8a32ec2
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
1 deletion
+66
-1
kernel32.spec
dlls/kernel32/kernel32.spec
+2
-0
thread.c
dlls/kernel32/tests/thread.c
+1
-1
thread.c
dlls/kernel32/thread.c
+61
-0
winbase.h
include/winbase.h
+2
-0
No files found.
dlls/kernel32/kernel32.spec
View file @
805f7d79
...
...
@@ -643,6 +643,7 @@
@ stdcall GetTempPathA(long ptr)
@ stdcall GetTempPathW(long ptr)
@ stdcall GetThreadContext(long ptr)
@ stdcall GetThreadErrorMode()
@ stdcall GetThreadId(ptr)
# @ stub GetThreadIOPendingFlag
@ stdcall GetThreadLocale()
...
...
@@ -1056,6 +1057,7 @@
@ stdcall SetTermsrvAppInstallMode(long)
@ stdcall SetThreadAffinityMask(long long)
@ stdcall SetThreadContext(long ptr)
@ stdcall SetThreadErrorMode(long ptr)
@ stdcall SetThreadExecutionState(long)
@ stdcall SetThreadIdealProcessor(long long)
@ stdcall SetThreadLocale(long)
...
...
dlls/kernel32/tests/thread.c
View file @
805f7d79
...
...
@@ -1221,7 +1221,7 @@ static void test_ThreadErrorMode(void)
if
(
!
pSetThreadErrorMode
||
!
pGetThreadErrorMode
)
{
skip
(
"SetThreadErrorMode and/or GetThreadErrorMode unavailable (added in Windows 7)
\n
"
);
win_
skip
(
"SetThreadErrorMode and/or GetThreadErrorMode unavailable (added in Windows 7)
\n
"
);
return
;
}
...
...
dlls/kernel32/thread.c
View file @
805f7d79
...
...
@@ -651,3 +651,64 @@ DWORD WINAPI GetCurrentThreadId(void)
}
#endif
/* __i386__ */
/*************************************************************************
* rtlmode_to_win32mode
*/
static
DWORD
rtlmode_to_win32mode
(
DWORD
rtlmode
)
{
DWORD
win32mode
=
0
;
if
(
rtlmode
&
0x10
)
win32mode
|=
SEM_FAILCRITICALERRORS
;
if
(
rtlmode
&
0x20
)
win32mode
|=
SEM_NOGPFAULTERRORBOX
;
if
(
rtlmode
&
0x40
)
win32mode
|=
SEM_NOOPENFILEERRORBOX
;
return
win32mode
;
}
/***********************************************************************
* SetThreadErrorMode (KERNEL32.@)
*/
BOOL
WINAPI
SetThreadErrorMode
(
DWORD
mode
,
LPDWORD
oldmode
)
{
NTSTATUS
status
;
DWORD
tmp
=
0
;
if
(
mode
&
~
(
SEM_FAILCRITICALERRORS
|
SEM_NOGPFAULTERRORBOX
|
SEM_NOOPENFILEERRORBOX
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
mode
&
SEM_FAILCRITICALERRORS
)
tmp
|=
0x10
;
if
(
mode
&
SEM_NOGPFAULTERRORBOX
)
tmp
|=
0x20
;
if
(
mode
&
SEM_NOOPENFILEERRORBOX
)
tmp
|=
0x40
;
status
=
RtlSetThreadErrorMode
(
tmp
,
oldmode
);
if
(
status
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
if
(
oldmode
)
*
oldmode
=
rtlmode_to_win32mode
(
*
oldmode
);
return
TRUE
;
}
/***********************************************************************
* GetThreadErrorMode (KERNEL32.@)
*/
DWORD
WINAPI
GetThreadErrorMode
(
void
)
{
return
rtlmode_to_win32mode
(
RtlGetThreadErrorMode
()
);
}
include/winbase.h
View file @
805f7d79
...
...
@@ -1762,6 +1762,7 @@ WINBASEAPI DWORD WINAPI GetTickCount(void);
WINBASEAPI
ULONGLONG
WINAPI
GetTickCount64
(
void
);
WINBASEAPI
DWORD
WINAPI
GetTimeZoneInformation
(
LPTIME_ZONE_INFORMATION
);
WINBASEAPI
BOOL
WINAPI
GetThreadContext
(
HANDLE
,
CONTEXT
*
);
WINBASEAPI
DWORD
WINAPI
GetThreadErrorMode
(
void
);
WINBASEAPI
INT
WINAPI
GetThreadPriority
(
HANDLE
);
WINBASEAPI
BOOL
WINAPI
GetThreadPriorityBoost
(
HANDLE
,
PBOOL
);
WINBASEAPI
BOOL
WINAPI
GetThreadSelectorEntry
(
HANDLE
,
DWORD
,
LPLDT_ENTRY
);
...
...
@@ -2096,6 +2097,7 @@ WINBASEAPI DWORD WINAPI SetTapeParameters(HANDLE,DWORD,LPVOID);
WINBASEAPI
DWORD
WINAPI
SetTapePosition
(
HANDLE
,
DWORD
,
DWORD
,
DWORD
,
DWORD
,
BOOL
);
WINBASEAPI
DWORD_PTR
WINAPI
SetThreadAffinityMask
(
HANDLE
,
DWORD_PTR
);
WINBASEAPI
BOOL
WINAPI
SetThreadContext
(
HANDLE
,
const
CONTEXT
*
);
WINBASEAPI
BOOL
WINAPI
SetThreadErrorMode
(
DWORD
,
LPDWORD
);
WINBASEAPI
DWORD
WINAPI
SetThreadExecutionState
(
EXECUTION_STATE
);
WINBASEAPI
DWORD
WINAPI
SetThreadIdealProcessor
(
HANDLE
,
DWORD
);
WINBASEAPI
BOOL
WINAPI
SetThreadPriority
(
HANDLE
,
INT
);
...
...
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