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
fdc51fc2
Commit
fdc51fc2
authored
Nov 24, 2017
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix size returned from RtlMakeSelfRelativeSD on 64-bit.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
290aec59
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
sec.c
dlls/ntdll/sec.c
+1
-0
rtl.c
dlls/ntdll/tests/rtl.c
+51
-0
No files found.
dlls/ntdll/sec.c
View file @
fdc51fc2
...
...
@@ -860,6 +860,7 @@ NTSTATUS WINAPI RtlMakeSelfRelativeSD(
return
STATUS_INVALID_PARAMETER
;
length
=
RtlLengthSecurityDescriptor
(
pAbs
);
if
(
!
(
pAbs
->
Control
&
SE_SELF_RELATIVE
))
length
-=
(
sizeof
(
*
pAbs
)
-
sizeof
(
*
pRel
));
if
(
*
lpdwBufferLength
<
length
)
{
*
lpdwBufferLength
=
length
;
...
...
dlls/ntdll/tests/rtl.c
View file @
fdc51fc2
...
...
@@ -99,6 +99,8 @@ static BOOL (WINAPI *pRtlIsCriticalSectionLocked)(CRITICAL_SECTION *);
static
BOOL
(
WINAPI
*
pRtlIsCriticalSectionLockedByThread
)(
CRITICAL_SECTION
*
);
static
NTSTATUS
(
WINAPI
*
pRtlInitializeCriticalSectionEx
)(
CRITICAL_SECTION
*
,
ULONG
,
ULONG
);
static
NTSTATUS
(
WINAPI
*
pLdrEnumerateLoadedModules
)(
void
*
,
void
*
,
void
*
);
static
NTSTATUS
(
WINAPI
*
pRtlMakeSelfRelativeSD
)(
PSECURITY_DESCRIPTOR
,
PSECURITY_DESCRIPTOR
,
LPDWORD
);
static
NTSTATUS
(
WINAPI
*
pRtlAbsoluteToSelfRelativeSD
)(
PSECURITY_DESCRIPTOR
,
PSECURITY_DESCRIPTOR
,
PULONG
);
static
HMODULE
hkernel32
=
0
;
static
BOOL
(
WINAPI
*
pIsWow64Process
)(
HANDLE
,
PBOOL
);
...
...
@@ -153,6 +155,8 @@ static void InitFunctionPtrs(void)
pRtlIsCriticalSectionLockedByThread
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlIsCriticalSectionLockedByThread"
);
pRtlInitializeCriticalSectionEx
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlInitializeCriticalSectionEx"
);
pLdrEnumerateLoadedModules
=
(
void
*
)
GetProcAddress
(
hntdll
,
"LdrEnumerateLoadedModules"
);
pRtlMakeSelfRelativeSD
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlMakeSelfRelativeSD"
);
pRtlAbsoluteToSelfRelativeSD
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlAbsoluteToSelfRelativeSD"
);
}
hkernel32
=
LoadLibraryA
(
"kernel32.dll"
);
ok
(
hkernel32
!=
0
,
"LoadLibrary failed
\n
"
);
...
...
@@ -2209,6 +2213,52 @@ static void test_LdrEnumerateLoadedModules(void)
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"expected STATUS_INVALID_PARAMETER, got 0x%08x
\n
"
,
status
);
}
static
void
test_RtlMakeSelfRelativeSD
(
void
)
{
char
buf
[
sizeof
(
SECURITY_DESCRIPTOR_RELATIVE
)
+
4
];
SECURITY_DESCRIPTOR_RELATIVE
*
sd_rel
=
(
SECURITY_DESCRIPTOR_RELATIVE
*
)
buf
;
SECURITY_DESCRIPTOR
sd
;
NTSTATUS
status
;
DWORD
len
;
if
(
!
pRtlMakeSelfRelativeSD
||
!
pRtlAbsoluteToSelfRelativeSD
)
{
win_skip
(
"RtlMakeSelfRelativeSD/RtlAbsoluteToSelfRelativeSD not available
\n
"
);
return
;
}
memset
(
&
sd
,
0
,
sizeof
(
sd
)
);
sd
.
Revision
=
SECURITY_DESCRIPTOR_REVISION
;
len
=
0
;
status
=
pRtlMakeSelfRelativeSD
(
&
sd
,
NULL
,
&
len
);
ok
(
status
==
STATUS_BUFFER_TOO_SMALL
,
"got %08x
\n
"
,
status
);
ok
(
len
==
sizeof
(
*
sd_rel
),
"got %u
\n
"
,
len
);
len
+=
4
;
status
=
pRtlMakeSelfRelativeSD
(
&
sd
,
sd_rel
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
status
);
ok
(
len
==
sizeof
(
*
sd_rel
)
+
4
,
"got %u
\n
"
,
len
);
len
=
0
;
status
=
pRtlAbsoluteToSelfRelativeSD
(
&
sd
,
NULL
,
&
len
);
ok
(
status
==
STATUS_BUFFER_TOO_SMALL
,
"got %08x
\n
"
,
status
);
ok
(
len
==
sizeof
(
*
sd_rel
),
"got %u
\n
"
,
len
);
len
+=
4
;
status
=
pRtlAbsoluteToSelfRelativeSD
(
&
sd
,
sd_rel
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
status
);
ok
(
len
==
sizeof
(
*
sd_rel
)
+
4
,
"got %u
\n
"
,
len
);
sd
.
Control
=
SE_SELF_RELATIVE
;
status
=
pRtlMakeSelfRelativeSD
(
&
sd
,
sd_rel
,
&
len
);
ok
(
status
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
status
);
ok
(
len
==
sizeof
(
*
sd_rel
)
+
4
,
"got %u
\n
"
,
len
);
status
=
pRtlAbsoluteToSelfRelativeSD
(
&
sd
,
sd_rel
,
&
len
);
ok
(
status
==
STATUS_BAD_DESCRIPTOR_FORMAT
,
"got %08x
\n
"
,
status
);
}
START_TEST
(
rtl
)
{
InitFunctionPtrs
();
...
...
@@ -2242,4 +2292,5 @@ START_TEST(rtl)
test_RtlInitializeCriticalSectionEx
();
test_RtlLeaveCriticalSection
();
test_LdrEnumerateLoadedModules
();
test_RtlMakeSelfRelativeSD
();
}
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