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
80f41b49
Commit
80f41b49
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: Implemented CreateActCtxA on top of CreateActCtxW.
parent
ca52d341
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
8 deletions
+70
-8
actctx.c
dlls/kernel32/actctx.c
+70
-8
No files found.
dlls/kernel32/actctx.c
View file @
80f41b49
...
...
@@ -2,6 +2,8 @@
* Activation contexts
*
* Copyright 2004 Jon Griffiths
* Copyright 2007 Eric Pouech
* Copyright 2007 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
...
...
@@ -25,6 +27,7 @@
#include "windef.h"
#include "winbase.h"
#include "winerror.h"
#include "winnls.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
actctx
);
...
...
@@ -50,15 +53,74 @@ WINE_DEFAULT_DEBUG_CHANNEL(actctx);
*/
HANDLE
WINAPI
CreateActCtxA
(
PCACTCTXA
pActCtx
)
{
FIXME
(
"%p %08x
\n
"
,
pActCtx
,
pActCtx
?
pActCtx
->
dwFlags
:
0
);
ACTCTXW
actw
;
SIZE_T
len
;
HANDLE
ret
=
INVALID_HANDLE_VALUE
;
LPWSTR
src
=
NULL
,
assdir
=
NULL
,
resname
=
NULL
,
appname
=
NULL
;
if
(
!
pActCtx
)
return
INVALID_HANDLE_VALUE
;
if
(
pActCtx
->
cbSize
!=
sizeof
*
pActCtx
)
return
INVALID_HANDLE_VALUE
;
if
(
pActCtx
->
dwFlags
&
~
ACTCTX_FLAGS_ALL
)
return
INVALID_HANDLE_VALUE
;
return
ACTCTX_FAKE_HANDLE
;
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
;
}
actw
.
cbSize
=
sizeof
(
actw
);
actw
.
dwFlags
=
pActCtx
->
dwFlags
;
if
(
pActCtx
->
lpSource
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpSource
,
-
1
,
NULL
,
0
);
src
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
src
)
return
INVALID_HANDLE_VALUE
;
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpSource
,
-
1
,
src
,
len
);
}
actw
.
lpSource
=
src
;
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_PROCESSOR_ARCHITECTURE_VALID
)
actw
.
wProcessorArchitecture
=
pActCtx
->
wProcessorArchitecture
;
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_LANGID_VALID
)
actw
.
wLangId
=
pActCtx
->
wLangId
;
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_ASSEMBLY_DIRECTORY_VALID
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpAssemblyDirectory
,
-
1
,
NULL
,
0
);
assdir
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
assdir
)
goto
done
;
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpAssemblyDirectory
,
-
1
,
assdir
,
len
);
actw
.
lpAssemblyDirectory
=
assdir
;
}
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_RESOURCE_NAME_VALID
)
{
if
(
!
((
ULONG_PTR
)
pActCtx
->
lpResourceName
>>
16
))
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpResourceName
,
-
1
,
NULL
,
0
);
resname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
resname
)
goto
done
;
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpResourceName
,
-
1
,
resname
,
len
);
actw
.
lpResourceName
=
resname
;
}
else
actw
.
lpResourceName
=
(
LPWSTR
)
pActCtx
->
lpResourceName
;
}
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_APPLICATION_NAME_VALID
)
{
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpApplicationName
,
-
1
,
NULL
,
0
);
appname
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
if
(
!
appname
)
goto
done
;
MultiByteToWideChar
(
CP_ACP
,
0
,
pActCtx
->
lpApplicationName
,
-
1
,
appname
,
len
);
actw
.
lpApplicationName
=
appname
;
}
if
(
actw
.
dwFlags
&
ACTCTX_FLAG_HMODULE_VALID
)
actw
.
hModule
=
pActCtx
->
hModule
;
ret
=
CreateActCtxW
(
&
actw
);
done:
HeapFree
(
GetProcessHeap
(),
0
,
src
);
HeapFree
(
GetProcessHeap
(),
0
,
assdir
);
HeapFree
(
GetProcessHeap
(),
0
,
resname
);
HeapFree
(
GetProcessHeap
(),
0
,
appname
);
return
ret
;
}
/***********************************************************************
...
...
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