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
4229da7c
Commit
4229da7c
authored
Jan 10, 2014
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Jan 10, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add access tests for a file mapping.
parent
fa0b745d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
security.c
dlls/advapi32/tests/security.c
+53
-0
No files found.
dlls/advapi32/tests/security.c
View file @
4229da7c
...
...
@@ -4898,6 +4898,58 @@ todo_wine
CloseHandle
(
file
);
}
static
void
test_filemap_security
(
void
)
{
DWORD
ret
,
i
,
access
;
HANDLE
mapping
,
dup
;
static
const
struct
{
int
generic
,
mapped
;
}
map
[]
=
{
{
0
,
0
},
{
GENERIC_READ
,
STANDARD_RIGHTS_READ
|
SECTION_QUERY
|
SECTION_MAP_READ
},
{
GENERIC_WRITE
,
STANDARD_RIGHTS_WRITE
|
SECTION_MAP_WRITE
},
{
GENERIC_EXECUTE
,
STANDARD_RIGHTS_EXECUTE
|
SECTION_MAP_EXECUTE
},
{
GENERIC_ALL
,
STANDARD_RIGHTS_REQUIRED
|
SECTION_ALL_ACCESS
}
};
SetLastError
(
0xdeadbeef
);
mapping
=
CreateFileMappingW
(
INVALID_HANDLE_VALUE
,
NULL
,
PAGE_EXECUTE_READWRITE
,
0
,
4096
,
NULL
);
if
(
mapping
)
{
access
=
get_obj_access
(
mapping
);
todo_wine
ok
(
access
==
(
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
SECTION_MAP_READ
|
SECTION_MAP_WRITE
|
SECTION_MAP_EXECUTE
),
"expected STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE | SECTION_MAP_EXECUTE, got %#x
\n
"
,
access
);
}
else
/* win2k fails to create EXECUTE mapping using system page file */
{
SetLastError
(
0xdeadbeef
);
mapping
=
CreateFileMappingW
(
INVALID_HANDLE_VALUE
,
NULL
,
PAGE_READWRITE
,
0
,
4096
,
NULL
);
ok
(
mapping
!=
0
,
"CreateFileMapping error %d
\n
"
,
GetLastError
());
access
=
get_obj_access
(
mapping
);
ok
(
access
==
(
STANDARD_RIGHTS_REQUIRED
|
SECTION_QUERY
|
SECTION_MAP_READ
|
SECTION_MAP_WRITE
),
"expected STANDARD_RIGHTS_REQUIRED | SECTION_QUERY | SECTION_MAP_READ | SECTION_MAP_WRITE, got %#x
\n
"
,
access
);
}
for
(
i
=
0
;
i
<
sizeof
(
map
)
/
sizeof
(
map
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
mapping
,
GetCurrentProcess
(),
&
dup
,
map
[
i
].
generic
,
FALSE
,
0
);
ok
(
ret
,
"DuplicateHandle error %d
\n
"
,
GetLastError
());
access
=
get_obj_access
(
dup
);
ok
(
access
==
map
[
i
].
mapped
,
"%d: expected %#x, got %#x
\n
"
,
i
,
map
[
i
].
mapped
,
access
);
CloseHandle
(
dup
);
}
CloseHandle
(
mapping
);
}
static
BOOL
validate_impersonation_token
(
HANDLE
token
,
DWORD
*
token_type
)
{
DWORD
ret
,
needed
;
...
...
@@ -4973,6 +5025,7 @@ static void test_kernel_objects_security(void)
test_named_pipe_security
(
token
);
test_semaphore_security
(
token
);
test_file_security
(
token
);
test_filemap_security
();
/* FIXME: test other kernel object types */
CloseHandle
(
process_token
);
...
...
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