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
2d05a633
Commit
2d05a633
authored
Dec 26, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Dec 30, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Test generic access mapping for a file.
parent
683a1dc9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
0 deletions
+45
-0
security.c
dlls/advapi32/tests/security.c
+45
-0
No files found.
dlls/advapi32/tests/security.c
View file @
2d05a633
...
...
@@ -4756,6 +4756,50 @@ todo_wine
CloseHandle
(
file
);
}
static
void
test_file_security
(
HANDLE
token
)
{
DWORD
ret
,
i
,
access
;
HANDLE
file
,
dup
;
static
const
struct
{
int
generic
,
mapped
;
}
map
[]
=
{
{
GENERIC_READ
,
FILE_GENERIC_READ
},
{
GENERIC_WRITE
,
FILE_GENERIC_WRITE
},
{
GENERIC_EXECUTE
,
FILE_GENERIC_EXECUTE
},
{
GENERIC_ALL
,
STANDARD_RIGHTS_ALL
|
FILE_ALL_ACCESS
}
};
char
temp_path
[
MAX_PATH
];
char
file_name
[
MAX_PATH
];
GetTempPathA
(
MAX_PATH
,
temp_path
);
GetTempFileNameA
(
temp_path
,
"tmp"
,
0
,
file_name
);
SetLastError
(
0xdeadbeef
);
file
=
CreateFileA
(
file_name
,
GENERIC_ALL
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"CreateFile error %d
\n
"
,
GetLastError
());
access
=
get_obj_access
(
file
);
ok
(
access
==
FILE_ALL_ACCESS
,
"expected FILE_ALL_ACCESS, got %#x
\n
"
,
access
);
for
(
i
=
0
;
i
<
sizeof
(
map
)
/
sizeof
(
map
[
0
]);
i
++
)
{
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
file
,
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
(
file
);
DeleteFileA
(
file_name
);
}
static
BOOL
validate_impersonation_token
(
HANDLE
token
,
DWORD
*
token_type
)
{
DWORD
ret
,
needed
;
...
...
@@ -4830,6 +4874,7 @@ static void test_kernel_objects_security(void)
test_event_security
(
token
);
test_named_pipe_security
(
token
);
test_semaphore_security
(
token
);
test_file_security
(
token
);
/* 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