Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
797dd942
Commit
797dd942
authored
Jul 19, 2007
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implemented handling of the per-thread activation context stack.
parent
64f6fdc5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
137 additions
and
35 deletions
+137
-35
actctx.c
dlls/kernel32/actctx.c
+17
-29
thread.c
dlls/kernel32/thread.c
+5
-1
actctx.c
dlls/ntdll/actctx.c
+105
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+5
-5
winternl.h
include/winternl.h
+5
-0
No files found.
dlls/kernel32/actctx.c
View file @
797dd942
...
@@ -35,7 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(actctx);
...
@@ -35,7 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(actctx);
#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
#define ACTCTX_FAKE_COOKIE ((ULONG_PTR) 0xf00bad)
/***********************************************************************
/***********************************************************************
* CreateActCtxA (KERNEL32.@)
* CreateActCtxA (KERNEL32.@)
...
@@ -140,19 +139,14 @@ HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
...
@@ -140,19 +139,14 @@ HANDLE WINAPI CreateActCtxW(PCACTCTXW pActCtx)
*/
*/
BOOL
WINAPI
ActivateActCtx
(
HANDLE
hActCtx
,
ULONG_PTR
*
ulCookie
)
BOOL
WINAPI
ActivateActCtx
(
HANDLE
hActCtx
,
ULONG_PTR
*
ulCookie
)
{
{
static
BOOL
reported
=
FALSE
;
NTSTATUS
status
;
if
(
reported
)
if
((
status
=
RtlActivateActivationContext
(
0
,
hActCtx
,
ulCookie
)))
TRACE
(
"%p %p
\n
"
,
hActCtx
,
ulCookie
);
{
else
SetLastError
(
RtlNtStatusToDosError
(
status
));
{
return
FALSE
;
FIXME
(
"%p %p
\n
"
,
hActCtx
,
ulCookie
);
}
reported
=
TRUE
;
return
TRUE
;
}
if
(
ulCookie
)
*
ulCookie
=
ACTCTX_FAKE_COOKIE
;
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -162,19 +156,8 @@ BOOL WINAPI ActivateActCtx(HANDLE hActCtx, ULONG_PTR *ulCookie)
...
@@ -162,19 +156,8 @@ BOOL WINAPI ActivateActCtx(HANDLE hActCtx, ULONG_PTR *ulCookie)
*/
*/
BOOL
WINAPI
DeactivateActCtx
(
DWORD
dwFlags
,
ULONG_PTR
ulCookie
)
BOOL
WINAPI
DeactivateActCtx
(
DWORD
dwFlags
,
ULONG_PTR
ulCookie
)
{
{
static
BOOL
reported
=
FALSE
;
RtlDeactivateActivationContext
(
dwFlags
,
ulCookie
);
return
TRUE
;
if
(
reported
)
TRACE
(
"%08x %08lx
\n
"
,
dwFlags
,
ulCookie
);
else
{
FIXME
(
"%08x %08lx
\n
"
,
dwFlags
,
ulCookie
);
reported
=
TRUE
;
}
if
(
ulCookie
!=
ACTCTX_FAKE_COOKIE
)
return
FALSE
;
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
...
@@ -184,9 +167,14 @@ BOOL WINAPI DeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
...
@@ -184,9 +167,14 @@ BOOL WINAPI DeactivateActCtx(DWORD dwFlags, ULONG_PTR ulCookie)
*/
*/
BOOL
WINAPI
GetCurrentActCtx
(
HANDLE
*
phActCtx
)
BOOL
WINAPI
GetCurrentActCtx
(
HANDLE
*
phActCtx
)
{
{
FIXME
(
"%p
\n
"
,
phActCtx
);
NTSTATUS
status
;
*
phActCtx
=
ACTCTX_FAKE_HANDLE
;
return
TRUE
;
if
((
status
=
RtlGetActiveActivationContext
(
phActCtx
)))
{
SetLastError
(
RtlNtStatusToDosError
(
status
));
return
FALSE
;
}
return
TRUE
;
}
}
/***********************************************************************
/***********************************************************************
...
...
dlls/kernel32/thread.c
View file @
797dd942
...
@@ -168,7 +168,11 @@ void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
...
@@ -168,7 +168,11 @@ void WINAPI ExitThread( DWORD code ) /* [in] Exit code for this thread */
LdrShutdownProcess
();
LdrShutdownProcess
();
exit
(
code
);
exit
(
code
);
}
}
else
RtlExitUserThread
(
code
);
else
{
RtlFreeThreadActivationContextStack
();
RtlExitUserThread
(
code
);
}
}
}
...
...
dlls/ntdll/actctx.c
View file @
797dd942
...
@@ -135,3 +135,108 @@ void WINAPI RtlReleaseActivationContext( HANDLE handle )
...
@@ -135,3 +135,108 @@ void WINAPI RtlReleaseActivationContext( HANDLE handle )
if
((
actctx
=
check_actctx
(
handle
)))
actctx_release
(
actctx
);
if
((
actctx
=
check_actctx
(
handle
)))
actctx_release
(
actctx
);
}
}
/******************************************************************
* RtlActivateActivationContext (NTDLL.@)
*/
NTSTATUS
WINAPI
RtlActivateActivationContext
(
ULONG
unknown
,
HANDLE
handle
,
ULONG_PTR
*
cookie
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
frame
;
TRACE
(
"%p %p
\n
"
,
handle
,
cookie
);
if
(
!
(
frame
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
frame
)
)))
return
STATUS_NO_MEMORY
;
frame
->
Previous
=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
;
frame
->
ActivationContext
=
handle
;
frame
->
Flags
=
0
;
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
=
frame
;
RtlAddRefActivationContext
(
handle
);
*
cookie
=
(
ULONG_PTR
)
frame
;
return
STATUS_SUCCESS
;
}
/***********************************************************************
* RtlDeactivateActivationContext (NTDLL.@)
*/
void
WINAPI
RtlDeactivateActivationContext
(
ULONG
flags
,
ULONG_PTR
cookie
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
frame
,
*
top
;
TRACE
(
"%x %lx
\n
"
,
flags
,
cookie
);
/* find the right frame */
top
=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
;
for
(
frame
=
top
;
frame
;
frame
=
frame
->
Previous
)
if
((
ULONG_PTR
)
frame
==
cookie
)
break
;
if
(
!
frame
)
RtlRaiseStatus
(
STATUS_SXS_INVALID_DEACTIVATION
);
if
(
frame
!=
top
&&
!
(
flags
&
DEACTIVATE_ACTCTX_FLAG_FORCE_EARLY_DEACTIVATION
))
RtlRaiseStatus
(
STATUS_SXS_EARLY_DEACTIVATION
);
/* pop everything up to and including frame */
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
=
frame
->
Previous
;
while
(
top
!=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
)
{
frame
=
top
->
Previous
;
RtlReleaseActivationContext
(
top
->
ActivationContext
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
top
);
top
=
frame
;
}
}
/******************************************************************
* RtlFreeThreadActivationContextStack (NTDLL.@)
*/
void
WINAPI
RtlFreeThreadActivationContextStack
(
void
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
frame
;
frame
=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
;
while
(
frame
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
prev
=
frame
->
Previous
;
RtlReleaseActivationContext
(
frame
->
ActivationContext
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
frame
);
frame
=
prev
;
}
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
=
NULL
;
}
/******************************************************************
* RtlGetActiveActivationContext (NTDLL.@)
*/
NTSTATUS
WINAPI
RtlGetActiveActivationContext
(
HANDLE
*
handle
)
{
if
(
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
)
{
*
handle
=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
->
ActivationContext
;
RtlAddRefActivationContext
(
*
handle
);
}
else
*
handle
=
0
;
return
STATUS_SUCCESS
;
}
/******************************************************************
* RtlIsActivationContextActive (NTDLL.@)
*/
BOOLEAN
WINAPI
RtlIsActivationContextActive
(
HANDLE
handle
)
{
RTL_ACTIVATION_CONTEXT_STACK_FRAME
*
frame
;
for
(
frame
=
NtCurrentTeb
()
->
ActivationContextStack
.
ActiveFrame
;
frame
;
frame
=
frame
->
Previous
)
if
(
frame
->
ActivationContext
==
handle
)
return
TRUE
;
return
FALSE
;
}
dlls/ntdll/ntdll.spec
View file @
797dd942
...
@@ -389,7 +389,7 @@
...
@@ -389,7 +389,7 @@
@ stdcall RtlAcquirePebLock()
@ stdcall RtlAcquirePebLock()
@ stdcall RtlAcquireResourceExclusive(ptr long)
@ stdcall RtlAcquireResourceExclusive(ptr long)
@ stdcall RtlAcquireResourceShared(ptr long)
@ stdcall RtlAcquireResourceShared(ptr long)
@ st
ub RtlActivateActivationContext
@ st
dcall RtlActivateActivationContext(long ptr ptr)
@ stub RtlActivateActivationContextEx
@ stub RtlActivateActivationContextEx
@ stub RtlActivateActivationContextUnsafeFast
@ stub RtlActivateActivationContextUnsafeFast
@ stdcall RtlAddAccessAllowedAce(ptr long long ptr)
@ stdcall RtlAddAccessAllowedAce(ptr long long ptr)
...
@@ -498,7 +498,7 @@
...
@@ -498,7 +498,7 @@
@ stub RtlCustomCPToUnicodeN
@ stub RtlCustomCPToUnicodeN
@ stub RtlCutoverTimeToSystemTime
@ stub RtlCutoverTimeToSystemTime
@ stdcall RtlDeNormalizeProcessParams(ptr)
@ stdcall RtlDeNormalizeProcessParams(ptr)
@ st
ub RtlDeactivateActivationContext
@ st
dcall RtlDeactivateActivationContext(long long)
@ stub RtlDeactivateActivationContextUnsafeFast
@ stub RtlDeactivateActivationContextUnsafeFast
@ stub RtlDebugPrintTimes
@ stub RtlDebugPrintTimes
@ stdcall RtlDecodePointer(ptr)
@ stdcall RtlDecodePointer(ptr)
...
@@ -604,13 +604,13 @@
...
@@ -604,13 +604,13 @@
@ stdcall RtlFreeOemString(ptr)
@ stdcall RtlFreeOemString(ptr)
# @ stub RtlFreeRangeList
# @ stub RtlFreeRangeList
@ stdcall RtlFreeSid (long)
@ stdcall RtlFreeSid (long)
# @ stub RtlFreeThreadActivationContextStack
@ stdcall RtlFreeThreadActivationContextStack()
@ stdcall RtlFreeUnicodeString(ptr)
@ stdcall RtlFreeUnicodeString(ptr)
@ stub RtlFreeUserThreadStack
@ stub RtlFreeUserThreadStack
@ stdcall RtlGUIDFromString(ptr ptr)
@ stdcall RtlGUIDFromString(ptr ptr)
@ stub RtlGenerate8dot3Name
@ stub RtlGenerate8dot3Name
@ stdcall RtlGetAce(ptr long ptr)
@ stdcall RtlGetAce(ptr long ptr)
# @ stub RtlGetActiveActivationContext
@ stdcall RtlGetActiveActivationContext(ptr)
@ stub RtlGetCallersAddress
@ stub RtlGetCallersAddress
@ stub RtlGetCompressionWorkSpaceSize
@ stub RtlGetCompressionWorkSpaceSize
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
@ stdcall RtlGetControlSecurityDescriptor(ptr ptr ptr)
...
@@ -699,7 +699,7 @@
...
@@ -699,7 +699,7 @@
# @ stub RtlIpv6StringToAddressExA
# @ stub RtlIpv6StringToAddressExA
# @ stub RtlIpv6StringToAddressExW
# @ stub RtlIpv6StringToAddressExW
# @ stub RtlIpv6StringToAddressW
# @ stub RtlIpv6StringToAddressW
# @ stub RtlIsActivationContextActive
@ stdcall RtlIsActivationContextActive(ptr)
@ stdcall RtlIsDosDeviceName_U(wstr)
@ stdcall RtlIsDosDeviceName_U(wstr)
@ stub RtlIsGenericTableEmpty
@ stub RtlIsGenericTableEmpty
# @ stub RtlIsGenericTableEmptyAvl
# @ stub RtlIsGenericTableEmptyAvl
...
...
include/winternl.h
View file @
797dd942
...
@@ -1979,6 +1979,7 @@ NTSTATUS WINAPI NtYieldExecution(void);
...
@@ -1979,6 +1979,7 @@ NTSTATUS WINAPI NtYieldExecution(void);
void
WINAPI
RtlAcquirePebLock
(
void
);
void
WINAPI
RtlAcquirePebLock
(
void
);
BYTE
WINAPI
RtlAcquireResourceExclusive
(
LPRTL_RWLOCK
,
BYTE
);
BYTE
WINAPI
RtlAcquireResourceExclusive
(
LPRTL_RWLOCK
,
BYTE
);
BYTE
WINAPI
RtlAcquireResourceShared
(
LPRTL_RWLOCK
,
BYTE
);
BYTE
WINAPI
RtlAcquireResourceShared
(
LPRTL_RWLOCK
,
BYTE
);
NTSTATUS
WINAPI
RtlActivateActivationContext
(
DWORD
,
HANDLE
,
ULONG_PTR
*
);
NTSTATUS
WINAPI
RtlAddAce
(
PACL
,
DWORD
,
DWORD
,
PACE_HEADER
,
DWORD
);
NTSTATUS
WINAPI
RtlAddAce
(
PACL
,
DWORD
,
DWORD
,
PACE_HEADER
,
DWORD
);
NTSTATUS
WINAPI
RtlAddAccessAllowedAce
(
PACL
,
DWORD
,
DWORD
,
PSID
);
NTSTATUS
WINAPI
RtlAddAccessAllowedAce
(
PACL
,
DWORD
,
DWORD
,
PSID
);
NTSTATUS
WINAPI
RtlAddAccessAllowedAceEx
(
PACL
,
DWORD
,
DWORD
,
DWORD
,
PSID
);
NTSTATUS
WINAPI
RtlAddAccessAllowedAceEx
(
PACL
,
DWORD
,
DWORD
,
DWORD
,
PSID
);
...
@@ -2037,6 +2038,7 @@ BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
...
@@ -2037,6 +2038,7 @@ BOOLEAN WINAPI RtlCreateUnicodeString(PUNICODE_STRING,LPCWSTR);
BOOLEAN
WINAPI
RtlCreateUnicodeStringFromAsciiz
(
PUNICODE_STRING
,
LPCSTR
);
BOOLEAN
WINAPI
RtlCreateUnicodeStringFromAsciiz
(
PUNICODE_STRING
,
LPCSTR
);
NTSTATUS
WINAPI
RtlCreateUserThread
(
HANDLE
,
const
SECURITY_DESCRIPTOR
*
,
BOOLEAN
,
PVOID
,
SIZE_T
,
SIZE_T
,
PRTL_THREAD_START_ROUTINE
,
void
*
,
HANDLE
*
,
CLIENT_ID
*
);
NTSTATUS
WINAPI
RtlCreateUserThread
(
HANDLE
,
const
SECURITY_DESCRIPTOR
*
,
BOOLEAN
,
PVOID
,
SIZE_T
,
SIZE_T
,
PRTL_THREAD_START_ROUTINE
,
void
*
,
HANDLE
*
,
CLIENT_ID
*
);
void
WINAPI
RtlDeactivateActivationContext
(
DWORD
,
ULONG_PTR
);
NTSTATUS
WINAPI
RtlDeleteAce
(
PACL
,
DWORD
);
NTSTATUS
WINAPI
RtlDeleteAce
(
PACL
,
DWORD
);
NTSTATUS
WINAPI
RtlDeleteAtomFromAtomTable
(
RTL_ATOM_TABLE
,
RTL_ATOM
);
NTSTATUS
WINAPI
RtlDeleteAtomFromAtomTable
(
RTL_ATOM_TABLE
,
RTL_ATOM
);
NTSTATUS
WINAPI
RtlDeleteCriticalSection
(
RTL_CRITICAL_SECTION
*
);
NTSTATUS
WINAPI
RtlDeleteCriticalSection
(
RTL_CRITICAL_SECTION
*
);
...
@@ -2103,9 +2105,11 @@ BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
...
@@ -2103,9 +2105,11 @@ BOOLEAN WINAPI RtlFreeHandle(RTL_HANDLE_TABLE *,RTL_HANDLE *);
BOOLEAN
WINAPI
RtlFreeHeap
(
HANDLE
,
ULONG
,
PVOID
);
BOOLEAN
WINAPI
RtlFreeHeap
(
HANDLE
,
ULONG
,
PVOID
);
void
WINAPI
RtlFreeOemString
(
POEM_STRING
);
void
WINAPI
RtlFreeOemString
(
POEM_STRING
);
DWORD
WINAPI
RtlFreeSid
(
PSID
);
DWORD
WINAPI
RtlFreeSid
(
PSID
);
void
WINAPI
RtlFreeThreadActivationContextStack
(
void
);
void
WINAPI
RtlFreeUnicodeString
(
PUNICODE_STRING
);
void
WINAPI
RtlFreeUnicodeString
(
PUNICODE_STRING
);
NTSTATUS
WINAPI
RtlGetAce
(
PACL
,
DWORD
,
LPVOID
*
);
NTSTATUS
WINAPI
RtlGetAce
(
PACL
,
DWORD
,
LPVOID
*
);
NTSTATUS
WINAPI
RtlGetActiveActivationContext
(
HANDLE
*
);
NTSTATUS
WINAPI
RtlGetControlSecurityDescriptor
(
PSECURITY_DESCRIPTOR
,
PSECURITY_DESCRIPTOR_CONTROL
,
LPDWORD
);
NTSTATUS
WINAPI
RtlGetControlSecurityDescriptor
(
PSECURITY_DESCRIPTOR
,
PSECURITY_DESCRIPTOR_CONTROL
,
LPDWORD
);
NTSTATUS
WINAPI
RtlGetCurrentDirectory_U
(
ULONG
,
LPWSTR
);
NTSTATUS
WINAPI
RtlGetCurrentDirectory_U
(
ULONG
,
LPWSTR
);
PEB
*
WINAPI
RtlGetCurrentPeb
(
void
);
PEB
*
WINAPI
RtlGetCurrentPeb
(
void
);
...
@@ -2143,6 +2147,7 @@ BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
...
@@ -2143,6 +2147,7 @@ BOOL WINAPI RtlInitializeSid(PSID,PSID_IDENTIFIER_AUTHORITY,BYTE);
NTSTATUS
WINAPI
RtlInt64ToUnicodeString
(
ULONGLONG
,
ULONG
,
UNICODE_STRING
*
);
NTSTATUS
WINAPI
RtlInt64ToUnicodeString
(
ULONGLONG
,
ULONG
,
UNICODE_STRING
*
);
NTSTATUS
WINAPI
RtlIntegerToChar
(
ULONG
,
ULONG
,
ULONG
,
PCHAR
);
NTSTATUS
WINAPI
RtlIntegerToChar
(
ULONG
,
ULONG
,
ULONG
,
PCHAR
);
NTSTATUS
WINAPI
RtlIntegerToUnicodeString
(
ULONG
,
ULONG
,
UNICODE_STRING
*
);
NTSTATUS
WINAPI
RtlIntegerToUnicodeString
(
ULONG
,
ULONG
,
UNICODE_STRING
*
);
BOOLEAN
WINAPI
RtlIsActivationContextActive
(
HANDLE
);
ULONG
WINAPI
RtlIsDosDeviceName_U
(
PCWSTR
);
ULONG
WINAPI
RtlIsDosDeviceName_U
(
PCWSTR
);
BOOLEAN
WINAPI
RtlIsNameLegalDOS8Dot3
(
const
UNICODE_STRING
*
,
POEM_STRING
,
PBOOLEAN
);
BOOLEAN
WINAPI
RtlIsNameLegalDOS8Dot3
(
const
UNICODE_STRING
*
,
POEM_STRING
,
PBOOLEAN
);
BOOLEAN
WINAPI
RtlIsTextUnicode
(
LPCVOID
,
INT
,
INT
*
);
BOOLEAN
WINAPI
RtlIsTextUnicode
(
LPCVOID
,
INT
,
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