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
3548b87f
Commit
3548b87f
authored
Mar 28, 2005
by
Stefan Leichter
Committed by
Alexandre Julliard
Mar 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for GetFileSecurityA.
parent
89feaca2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
security.c
dlls/advapi32/tests/security.c
+30
-0
No files found.
dlls/advapi32/tests/security.c
View file @
3548b87f
...
...
@@ -31,6 +31,8 @@ typedef BOOL (WINAPI *fnBuildTrusteeWithSidA)( TRUSTEE *trustee, PSID psid );
typedef
BOOL
(
WINAPI
*
fnBuildTrusteeWithNameA
)(
TRUSTEE
*
trustee
,
LPSTR
str
);
typedef
BOOL
(
WINAPI
*
fnConvertSidToStringSidA
)(
PSID
pSid
,
LPSTR
*
str
);
typedef
BOOL
(
WINAPI
*
fnConvertStringSidToSidA
)(
LPCSTR
str
,
PSID
pSid
);
typedef
BOOL
(
WINAPI
*
fnGetFileSecurityA
)(
LPCSTR
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
,
DWORD
,
LPDWORD
);
static
HMODULE
hmod
;
...
...
@@ -38,6 +40,7 @@ fnBuildTrusteeWithSidA pBuildTrusteeWithSidA;
fnBuildTrusteeWithNameA
pBuildTrusteeWithNameA
;
fnConvertSidToStringSidA
pConvertSidToStringSidA
;
fnConvertStringSidToSidA
pConvertStringSidToSidA
;
fnGetFileSecurityA
pGetFileSecurityA
;
struct
sidRef
{
...
...
@@ -400,6 +403,32 @@ static void test_luid(void)
test_lookupPrivilegeValue
();
}
static
void
test_FileSecurity
(
void
)
{
char
directory
[
MAX_PATH
];
DWORD
retval
,
outSize
;
BOOL
result
;
BYTE
buffer
[
0x40
];
pGetFileSecurityA
=
(
fnGetFileSecurityA
)
GetProcAddress
(
hmod
,
"GetFileSecurityA"
);
if
(
!
pGetFileSecurityA
)
return
;
retval
=
GetTempPathA
(
sizeof
(
directory
),
directory
);
if
(
!
retval
)
{
trace
(
"GetTempPathA failed
\n
"
);
return
;
}
strcpy
(
directory
,
"
\\
Should not exist"
);
SetLastError
(
NO_ERROR
);
result
=
pGetFileSecurityA
(
directory
,
OWNER_SECURITY_INFORMATION
,
buffer
,
0x40
,
&
outSize
);
todo_wine
ok
(
!
result
,
"GetFileSecurityA should fail for not existing directories
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
"ERROR_FILE_NOT_FOUND expected
\n
"
);
}
START_TEST
(
security
)
{
init
();
...
...
@@ -407,4 +436,5 @@ START_TEST(security)
test_sid
();
test_trustee
();
test_luid
();
test_FileSecurity
();
}
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