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
44540a66
Commit
44540a66
authored
Nov 09, 2008
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 10, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Fix broken GetLastError tests.
parent
21a70825
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
22 deletions
+13
-22
security.c
dlls/advapi32/tests/security.c
+13
-22
No files found.
dlls/advapi32/tests/security.c
View file @
44540a66
...
...
@@ -728,13 +728,13 @@ static void test_FileSecurity(void)
/* Create a temporary directory and in it a temporary file */
strcat
(
strcpy
(
path
,
wintmpdir
),
"rary"
);
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
CreateDirectoryA
(
path
,
NULL
);
ok
(
rc
||
GetLastError
()
==
ERROR_ALREADY_EXISTS
,
"CreateDirectoryA "
"failed for '%s' with %d
\n
"
,
path
,
GetLastError
());
strcat
(
strcpy
(
file
,
path
),
"
\\
ess"
);
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
fh
=
CreateFileA
(
file
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
fh
!=
INVALID_HANDLE_VALUE
,
"CreateFileA "
"failed for '%s' with %d
\n
"
,
file
,
GetLastError
());
...
...
@@ -744,7 +744,7 @@ static void test_FileSecurity(void)
/* Get size needed */
retSize
=
0
;
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pGetFileSecurityA
(
file
,
request
,
NULL
,
0
,
&
retSize
);
if
(
!
rc
&&
(
GetLastError
()
==
ERROR_CALL_NOT_IMPLEMENTED
))
{
win_skip
(
"GetFileSecurityA is not implemented
\n
"
);
...
...
@@ -761,22 +761,18 @@ static void test_FileSecurity(void)
/* Get security descriptor for real */
retSize
=
0
;
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pGetFileSecurityA
(
file
,
request
,
sd
,
sdSize
,
&
retSize
);
ok
(
rc
,
"GetFileSecurityA "
"was not expected to fail '%s'
\n
"
,
file
);
ok
(
GetLastError
()
==
NO_ERROR
,
"GetFileSecurityA "
"returned %d; expected NO_ERROR
\n
"
,
GetLastError
());
"was not expected to fail '%s': %d
\n
"
,
file
,
GetLastError
());
ok
(
retSize
==
sdSize
,
"GetFileSecurityA "
"returned size %d; expected %d
\n
"
,
retSize
,
sdSize
);
/* Use it to set security descriptor */
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pSetFileSecurityA
(
file
,
request
,
sd
);
ok
(
rc
,
"SetFileSecurityA "
"was not expected to fail '%s'
\n
"
,
file
);
ok
(
GetLastError
()
==
NO_ERROR
,
"SetFileSecurityA "
"returned %d; expected NO_ERROR
\n
"
,
GetLastError
());
"was not expected to fail '%s': %d
\n
"
,
file
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
sd
);
...
...
@@ -784,7 +780,7 @@ static void test_FileSecurity(void)
/* Get size needed */
retSize
=
0
;
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pGetFileSecurityA
(
path
,
request
,
NULL
,
0
,
&
retSize
);
ok
(
!
rc
,
"GetFileSecurityA "
"was expected to fail for '%s'
\n
"
,
path
);
...
...
@@ -797,28 +793,23 @@ static void test_FileSecurity(void)
/* Get security descriptor for real */
retSize
=
0
;
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pGetFileSecurityA
(
path
,
request
,
sd
,
sdSize
,
&
retSize
);
ok
(
rc
,
"GetFileSecurityA "
"was not expected to fail '%s'
\n
"
,
path
);
ok
(
GetLastError
()
==
NO_ERROR
,
"GetFileSecurityA "
"returned %d; expected NO_ERROR
\n
"
,
GetLastError
());
"was not expected to fail '%s': %d
\n
"
,
path
,
GetLastError
());
ok
(
retSize
==
sdSize
,
"GetFileSecurityA "
"returned size %d; expected %d
\n
"
,
retSize
,
sdSize
);
/* Use it to set security descriptor */
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pSetFileSecurityA
(
path
,
request
,
sd
);
ok
(
rc
,
"SetFileSecurityA "
"was not expected to fail '%s'
\n
"
,
path
);
ok
(
GetLastError
()
==
NO_ERROR
,
"SetFileSecurityA "
"returned %d; expected NO_ERROR
\n
"
,
GetLastError
());
"was not expected to fail '%s': %d
\n
"
,
path
,
GetLastError
());
HeapFree
(
GetProcessHeap
(),
0
,
sd
);
/* Old test */
strcpy
(
wintmpdir
,
"
\\
Should not exist"
);
SetLastError
(
NO_ERROR
);
SetLastError
(
0xdeadbeef
);
rc
=
pGetFileSecurityA
(
wintmpdir
,
OWNER_SECURITY_INFORMATION
,
NULL
,
0
,
&
sdSize
);
ok
(
!
rc
,
"GetFileSecurityA should fail for not existing directories/files
\n
"
);
ok
(
GetLastError
()
==
ERROR_FILE_NOT_FOUND
,
...
...
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