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
6cabfcc1
Commit
6cabfcc1
authored
Mar 18, 2023
by
Jinoh Kang
Committed by
Alexandre Julliard
Mar 20, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Test for manifest file open share mode in CreateActCtxW.
parent
0065b244
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
67 additions
and
0 deletions
+67
-0
actctx.c
dlls/kernel32/tests/actctx.c
+67
-0
No files found.
dlls/kernel32/tests/actctx.c
View file @
6cabfcc1
...
@@ -617,6 +617,50 @@ static BOOL create_wide_manifest(const char *filename, const char *manifest, BOO
...
@@ -617,6 +617,50 @@ static BOOL create_wide_manifest(const char *filename, const char *manifest, BOO
return
ret
;
return
ret
;
}
}
static
HANDLE
create_temp_manifest_file
(
const
char
*
manifest
,
WCHAR
*
pathname
)
{
WCHAR
tmp_path
[
MAX_PATH
];
DWORD
size
,
tmp_path_len
;
HANDLE
file
,
file_w
;
UINT
unique
;
tmp_path_len
=
GetTempPathW
(
ARRAY_SIZE
(
tmp_path
),
tmp_path
);
ok
(
tmp_path_len
!=
0
,
"GetTempPathW returned error %lu
\n
"
,
GetLastError
());
ok
(
tmp_path_len
<
ARRAY_SIZE
(
tmp_path
),
"GetTempPathW return value %lu should be less than %Iu
\n
"
,
tmp_path_len
,
ARRAY_SIZE
(
tmp_path
));
memset
(
pathname
,
0
,
MAX_PATH
*
sizeof
(
WCHAR
));
unique
=
GetTempFileNameW
(
tmp_path
,
L"tst"
,
0
,
pathname
);
ok
(
unique
!=
0
,
"GetTempFileNameW returned error %lu
\n
"
,
GetLastError
());
/* Open file handle that will be deleted on close or process termination */
file
=
CreateFileW
(
pathname
,
GENERIC_READ
|
DELETE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
|
FILE_FLAG_DELETE_ON_CLOSE
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile returned error %lu
\n
"
,
GetLastError
());
/* Re-open file with write access */
file_w
=
CreateFileW
(
pathname
,
GENERIC_WRITE
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
|
FILE_SHARE_DELETE
,
NULL
,
TRUNCATE_EXISTING
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
ok
(
file_w
!=
INVALID_HANDLE_VALUE
,
"CreateFile returned error %lu
\n
"
,
GetLastError
());
WriteFile
(
file_w
,
manifest
,
strlen
(
manifest
),
&
size
,
NULL
);
/* Close file handle that was open for write to avoid sharing violation */
CloseHandle
(
file_w
);
return
file
;
}
typedef
struct
{
typedef
struct
{
ULONG
format_version
;
ULONG
format_version
;
ULONG
assembly_cnt_min
;
ULONG
assembly_cnt_min
;
...
@@ -2860,6 +2904,28 @@ todo_wine {
...
@@ -2860,6 +2904,28 @@ todo_wine {
}
}
}
}
static
void
test_CreateActCtx_share_mode
(
void
)
{
WCHAR
tmp_manifest_pathname
[
MAX_PATH
];
HANDLE
handle
,
manifest_file
;
ACTCTXW
actctx
;
manifest_file
=
create_temp_manifest_file
(
manifest1
,
tmp_manifest_pathname
);
memset
(
&
actctx
,
0
,
sizeof
(
ACTCTXW
));
actctx
.
cbSize
=
sizeof
(
ACTCTXW
);
actctx
.
lpSource
=
tmp_manifest_pathname
;
handle
=
CreateActCtxW
(
&
actctx
);
todo_wine
ok
(
handle
!=
INVALID_HANDLE_VALUE
,
"CreateActCtxW returned error %lu
\n
"
,
GetLastError
());
ok
(
handle
!=
NULL
,
"CreateActCtxW returned %p
\n
"
,
handle
);
ReleaseActCtx
(
handle
);
CloseHandle
(
manifest_file
);
}
static
BOOL
init_funcs
(
void
)
static
BOOL
init_funcs
(
void
)
{
{
HMODULE
hLibrary
=
GetModuleHandleA
(
"kernel32.dll"
);
HMODULE
hLibrary
=
GetModuleHandleA
(
"kernel32.dll"
);
...
@@ -3719,6 +3785,7 @@ START_TEST(actctx)
...
@@ -3719,6 +3785,7 @@ START_TEST(actctx)
test_actctx
();
test_actctx
();
test_create_fail
();
test_create_fail
();
test_CreateActCtx
();
test_CreateActCtx
();
test_CreateActCtx_share_mode
();
test_findsectionstring
();
test_findsectionstring
();
test_ZombifyActCtx
();
test_ZombifyActCtx
();
run_child_process
();
run_child_process
();
...
...
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