Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
031c0272
Commit
031c0272
authored
Dec 30, 2013
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Open source file only when needed during context creation.
parent
0c4b3514
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
actctx.c
dlls/kernel32/tests/actctx.c
+30
-3
actctx.c
dlls/ntdll/actctx.c
+4
-2
No files found.
dlls/kernel32/tests/actctx.c
View file @
031c0272
...
...
@@ -2113,14 +2113,41 @@ static void test_CreateActCtx(void)
actctx
.
lpAssemblyDirectory
=
dir
;
actctx
.
lpSource
=
path
;
SetLastError
(
0xdeadbeef
);
handle
=
pCreateActCtxA
(
&
actctx
);
todo_wine
ok
(
handle
==
INVALID_HANDLE_VALUE
&&
GetLastError
()
==
ERROR_SXS_CANT_GEN_ACTCTX
,
"got handle %p, supposed to fail
\n
"
,
handle
);
todo_wine
{
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"got handle %p
\n
"
,
handle
);
ok
(
GetLastError
()
==
ERROR_SXS_CANT_GEN_ACTCTX
,
"got error %d
\n
"
,
GetLastError
());
}
if
(
handle
!=
INVALID_HANDLE_VALUE
)
pReleaseActCtx
(
handle
);
delete_manifest_file
(
"main.manifest"
);
delete_manifest_file
(
"testdep1.manifest"
);
/* ACTCTX_FLAG_HMODULE_VALID but hModule is not set */
memset
(
&
actctx
,
0
,
sizeof
(
ACTCTXA
));
actctx
.
cbSize
=
sizeof
(
ACTCTXA
);
actctx
.
dwFlags
=
ACTCTX_FLAG_HMODULE_VALID
;
SetLastError
(
0xdeadbeef
);
handle
=
pCreateActCtxA
(
&
actctx
);
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"got handle %p
\n
"
,
handle
);
todo_wine
ok
(
GetLastError
()
==
ERROR_SXS_CANT_GEN_ACTCTX
||
broken
(
GetLastError
()
==
ERROR_NOT_ENOUGH_MEMORY
)
/* XP, win2k3 */
,
"got error %d
\n
"
,
GetLastError
());
/* create from HMODULE - resource doesn't exist, lpSource is set */
memset
(
&
actctx
,
0
,
sizeof
(
ACTCTXA
));
actctx
.
cbSize
=
sizeof
(
ACTCTXA
);
actctx
.
dwFlags
=
ACTCTX_FLAG_RESOURCE_NAME_VALID
|
ACTCTX_FLAG_HMODULE_VALID
;
actctx
.
lpSource
=
"dummyfile.dll"
;
actctx
.
lpResourceName
=
MAKEINTRESOURCEA
(
20
);
actctx
.
hModule
=
GetModuleHandleA
(
NULL
);
SetLastError
(
0xdeadbeef
);
handle
=
pCreateActCtxA
(
&
actctx
);
ok
(
handle
==
INVALID_HANDLE_VALUE
,
"got handle %p
\n
"
,
handle
);
todo_wine
ok
(
GetLastError
()
==
ERROR_RESOURCE_TYPE_NOT_FOUND
,
"got error %d
\n
"
,
GetLastError
());
}
static
BOOL
init_funcs
(
void
)
...
...
dlls/ntdll/actctx.c
View file @
031c0272
...
...
@@ -4519,7 +4519,10 @@ NTSTATUS WINAPI RtlCreateActivationContext( HANDLE *handle, const void *ptr )
}
nameW
.
Buffer
=
NULL
;
if
(
pActCtx
->
lpSource
)
/* open file only if it's going to be used */
if
(
pActCtx
->
lpSource
&&
!
((
pActCtx
->
dwFlags
&
ACTCTX_FLAG_RESOURCE_NAME_VALID
)
&&
(
pActCtx
->
dwFlags
&
ACTCTX_FLAG_HMODULE_VALID
)))
{
if
(
!
RtlDosPathNameToNtPathName_U
(
pActCtx
->
lpSource
,
&
nameW
,
NULL
,
NULL
))
{
...
...
@@ -4550,7 +4553,6 @@ NTSTATUS WINAPI RtlCreateActivationContext( HANDLE *handle, const void *ptr )
status
=
get_manifest_in_module
(
&
acl
,
NULL
,
NULL
,
directory
,
FALSE
,
pActCtx
->
hModule
,
pActCtx
->
lpResourceName
,
lang
);
if
(
status
&&
status
!=
STATUS_SXS_CANT_GEN_ACTCTX
)
/* FIXME: what to do if pActCtx->lpSource is set */
status
=
get_manifest_in_associated_manifest
(
&
acl
,
NULL
,
NULL
,
directory
,
pActCtx
->
hModule
,
pActCtx
->
lpResourceName
);
}
...
...
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