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
7e0932d6
Commit
7e0932d6
authored
Oct 13, 2008
by
Paul Bryan Roberts
Committed by
Alexandre Julliard
Oct 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: ConvertStringSecurityDescriptorToSecurityDescriptor - more tests (pass).
parent
bba54cd4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
security.c
dlls/advapi32/security.c
+6
-2
security.c
dlls/advapi32/tests/security.c
+46
-1
No files found.
dlls/advapi32/security.c
View file @
7e0932d6
...
...
@@ -3833,6 +3833,7 @@ static BOOL ParseStringAclToAcl(LPCWSTR StringAcl, LPDWORD lpdwFlags,
return
TRUE
;
lerr:
SetLastError
(
ERROR_INVALID_ACL
);
WARN
(
"Invalid ACE string format
\n
"
);
return
FALSE
;
}
...
...
@@ -4025,6 +4026,11 @@ BOOL WINAPI ConvertStringSecurityDescriptorToSecurityDescriptorW(
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
goto
lend
;
}
else
if
(
!
StringSecurityDescriptor
||
!
SecurityDescriptor
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
goto
lend
;
}
else
if
(
StringSDRevision
!=
SID_REVISION
)
{
SetLastError
(
ERROR_UNKNOWN_REVISION
);
...
...
@@ -4476,7 +4482,6 @@ BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID* Sid)
if
(
!
bret
)
LocalFree
(
*
Sid
);
}
TRACE
(
"returning %s
\n
"
,
bret
?
"TRUE"
:
"FALSE"
);
return
bret
;
}
...
...
@@ -4502,7 +4507,6 @@ BOOL WINAPI ConvertStringSidToSidA(LPCSTR StringSid, PSID* Sid)
bret
=
ConvertStringSidToSidW
(
wStringSid
,
Sid
);
HeapFree
(
GetProcessHeap
(),
0
,
wStringSid
);
}
TRACE
(
"returning %s
\n
"
,
bret
?
"TRUE"
:
"FALSE"
);
return
bret
;
}
...
...
dlls/advapi32/tests/security.c
View file @
7e0932d6
...
...
@@ -81,6 +81,8 @@ typedef BOOL (WINAPI *fnConvertSidToStringSidA)( PSID pSid, LPSTR *str );
typedef
BOOL
(
WINAPI
*
fnConvertStringSidToSidA
)(
LPCSTR
str
,
PSID
pSid
);
static
BOOL
(
WINAPI
*
pConvertStringSecurityDescriptorToSecurityDescriptorA
)(
LPCSTR
,
DWORD
,
PSECURITY_DESCRIPTOR
*
,
PULONG
);
static
BOOL
(
WINAPI
*
pConvertStringSecurityDescriptorToSecurityDescriptorW
)(
LPCWSTR
,
DWORD
,
PSECURITY_DESCRIPTOR
*
,
PULONG
);
static
BOOL
(
WINAPI
*
pConvertSecurityDescriptorToStringSecurityDescriptorA
)(
PSECURITY_DESCRIPTOR
,
DWORD
,
SECURITY_INFORMATION
,
LPSTR
*
,
PULONG
);
typedef
BOOL
(
WINAPI
*
fnGetFileSecurityA
)(
LPCSTR
,
SECURITY_INFORMATION
,
...
...
@@ -144,6 +146,8 @@ static void init(void)
pAddAuditAccessAceEx
=
(
void
*
)
GetProcAddress
(
hmod
,
"AddAuditAccessAceEx"
);
pConvertStringSecurityDescriptorToSecurityDescriptorA
=
(
void
*
)
GetProcAddress
(
hmod
,
"ConvertStringSecurityDescriptorToSecurityDescriptorA"
);
pConvertStringSecurityDescriptorToSecurityDescriptorW
=
(
void
*
)
GetProcAddress
(
hmod
,
"ConvertStringSecurityDescriptorToSecurityDescriptorW"
);
pConvertSecurityDescriptorToStringSecurityDescriptorA
=
(
void
*
)
GetProcAddress
(
hmod
,
"ConvertSecurityDescriptorToStringSecurityDescriptorA"
);
pCreateWellKnownSid
=
(
fnCreateWellKnownSid
)
GetProcAddress
(
hmod
,
"CreateWellKnownSid"
);
...
...
@@ -2175,6 +2179,7 @@ static void test_ConvertStringSecurityDescriptor(void)
{
BOOL
ret
;
PSECURITY_DESCRIPTOR
pSD
;
static
const
WCHAR
Blank
[]
=
{
0
};
if
(
!
pConvertStringSecurityDescriptorToSecurityDescriptorA
)
{
...
...
@@ -2255,11 +2260,51 @@ static void test_ConvertStringSecurityDescriptor(void)
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_ACL
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_ACL instead of %d
\n
"
,
GetLastError
());
/* test behaviour with NULL parameters */
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
NULL
,
0xdeadbeef
,
&
pSD
,
NULL
);
todo_wine
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorW
(
NULL
,
0xdeadbeef
,
&
pSD
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;ROB;;;WD)"
,
0xdeadbeef
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
"D:(A;;ROB;;;WD)"
,
SDDL_REVISION_1
,
NULL
,
NULL
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"ConvertStringSecurityDescriptorToSecurityDescriptor should have failed with ERROR_INVALID_PARAMETER instead of %d
\n
"
,
GetLastError
());
/* test behaviour with empty strings */
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
""
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorW
(
Blank
,
SDDL_REVISION_1
,
&
pSD
,
NULL
);
ok
(
ret
,
"ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %d
\n
"
,
GetLastError
());
/* test ACE string SID */
SetLastError
(
0xdeadbeef
);
ret
=
pConvertStringSecurityDescriptorToSecurityDescriptorA
(
...
...
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