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
fe386938
Commit
fe386938
authored
May 07, 2007
by
Eric Pouech
Committed by
Alexandre Julliard
May 09, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Set the new definition for an activation context, and implement…
kernel32: Set the new definition for an activation context, and implement adding/releasing references to it.
parent
80f41b49
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
9 deletions
+62
-9
actctx.c
dlls/kernel32/actctx.c
+62
-9
No files found.
dlls/kernel32/actctx.c
View file @
fe386938
...
...
@@ -46,6 +46,14 @@ WINE_DEFAULT_DEBUG_CHANNEL(actctx);
#define ACTCTX_FAKE_HANDLE ((HANDLE) 0xf00baa)
#define ACTCTX_FAKE_COOKIE ((ULONG_PTR) 0xf00bad)
#define ACTCTX_MAGIC 0xC07E3E11
struct
actctx
{
ULONG
magic
;
LONG
ref_count
;
};
/***********************************************************************
* CreateActCtxA (KERNEL32.@)
*
...
...
@@ -130,15 +138,44 @@ done:
*/
HANDLE
WINAPI
CreateActCtxW
(
PCACTCTXW
pActCtx
)
{
FIXME
(
"%p %08x
\n
"
,
pActCtx
,
pActCtx
?
pActCtx
->
dwFlags
:
0
);
struct
actctx
*
actctx
;
DWORD
ret
=
ERROR_SUCCESS
;
if
(
!
pActCtx
)
return
INVALID_HANDLE_VALUE
;
if
(
pActCtx
->
cbSize
!=
sizeof
*
pActCtx
)
return
INVALID_HANDLE_VALUE
;
if
(
pActCtx
->
dwFlags
&
~
ACTCTX_FLAGS_ALL
)
TRACE
(
"%p %08x
\n
"
,
pActCtx
,
pActCtx
?
pActCtx
->
dwFlags
:
0
);
if
(
!
pActCtx
||
pActCtx
->
cbSize
!=
sizeof
(
*
pActCtx
)
||
(
pActCtx
->
dwFlags
&
~
ACTCTX_FLAGS_ALL
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
INVALID_HANDLE_VALUE
;
}
actctx
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
actctx
));
if
(
!
actctx
)
return
INVALID_HANDLE_VALUE
;
actctx
->
magic
=
ACTCTX_MAGIC
;
actctx
->
ref_count
=
1
;
if
(
ret
==
ERROR_SUCCESS
)
{
return
(
HANDLE
)
actctx
;
}
ReleaseActCtx
((
HANDLE
)
actctx
);
SetLastError
(
ret
);
return
INVALID_HANDLE_VALUE
;
return
ACTCTX_FAKE_HANDLE
;
}
static
struct
actctx
*
check_actctx
(
HANDLE
h
)
{
struct
actctx
*
actctx
=
(
struct
actctx
*
)
h
;
switch
(
actctx
->
magic
)
{
case
ACTCTX_MAGIC
:
return
actctx
;
default:
SetLastError
(
ERROR_INVALID_HANDLE
);
return
NULL
;
}
}
/***********************************************************************
...
...
@@ -204,7 +241,12 @@ BOOL WINAPI GetCurrentActCtx(HANDLE* phActCtx)
*/
void
WINAPI
AddRefActCtx
(
HANDLE
hActCtx
)
{
FIXME
(
"%p
\n
"
,
hActCtx
);
struct
actctx
*
actctx
;
TRACE
(
"%p
\n
"
,
hActCtx
);
if
((
actctx
=
check_actctx
(
hActCtx
)))
InterlockedIncrement
(
&
actctx
->
ref_count
);
}
/***********************************************************************
...
...
@@ -214,7 +256,18 @@ void WINAPI AddRefActCtx(HANDLE hActCtx)
*/
void
WINAPI
ReleaseActCtx
(
HANDLE
hActCtx
)
{
FIXME
(
"%p
\n
"
,
hActCtx
);
struct
actctx
*
actctx
;
TRACE
(
"%p
\n
"
,
hActCtx
);
if
((
actctx
=
check_actctx
(
hActCtx
)))
{
if
(
!
InterlockedDecrement
(
&
actctx
->
ref_count
))
{
actctx
->
magic
=
0
;
HeapFree
(
GetProcessHeap
(),
0
,
actctx
);
}
}
}
/***********************************************************************
...
...
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