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
e596f404
Commit
e596f404
authored
Sep 29, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
Oct 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase: Move FlsSetValue() implementation to ntdll.RtlFlsSetValue().
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0627fa9d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
14 deletions
+35
-14
fiber.c
dlls/kernel32/tests/fiber.c
+14
-0
thread.c
dlls/kernelbase/thread.c
+1
-14
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
thread.c
dlls/ntdll/thread.c
+18
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/kernel32/tests/fiber.c
View file @
e596f404
...
...
@@ -39,6 +39,7 @@ static PVOID (WINAPI *pFlsGetValue)(DWORD);
static
BOOL
(
WINAPI
*
pFlsSetValue
)(
DWORD
,
PVOID
);
static
NTSTATUS
(
WINAPI
*
pRtlFlsAlloc
)(
PFLS_CALLBACK_FUNCTION
,
DWORD
*
);
static
NTSTATUS
(
WINAPI
*
pRtlFlsFree
)(
ULONG
);
static
NTSTATUS
(
WINAPI
*
pRtlFlsSetValue
)(
ULONG
,
void
*
);
static
void
*
fibers
[
3
];
static
BYTE
testparam
=
185
;
static
DWORD
fls_index_to_set
=
FLS_OUT_OF_INDEXES
;
...
...
@@ -70,6 +71,7 @@ static VOID init_funcs(void)
#define X(f) p##f = (void*)GetProcAddress(hntdll, #f);
X
(
RtlFlsAlloc
);
X
(
RtlFlsFree
);
X
(
RtlFlsSetValue
);
#undef X
}
...
...
@@ -213,6 +215,11 @@ static void test_FiberLocalStorage(void)
ok
(
fls_indices
[
i
]
==
0xdeadbeef
,
"Got unexpected index %#x.
\n
"
,
fls_indices
[
i
]);
break
;
}
if
(
pRtlFlsSetValue
)
{
status
=
pRtlFlsSetValue
(
fls_indices
[
i
],
(
void
*
)(
ULONG_PTR
)(
i
+
1
));
ok
(
!
status
,
"Got unexpected status %#x.
\n
"
,
status
);
}
}
count
=
i
;
/* FLS limits are increased since Win10 18312. */
...
...
@@ -280,6 +287,11 @@ static void test_FiberLocalStorage(void)
ret
=
pFlsSetValue
(
0
,
(
void
*
)
0xdeadbeef
);
ok
(
!
ret
,
"setting fls index 0 succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"setting fls index wrong error %u
\n
"
,
GetLastError
()
);
if
(
pRtlFlsSetValue
)
{
status
=
pRtlFlsSetValue
(
0
,
(
void
*
)
0xdeadbeef
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"Got unexpected status %#x.
\n
"
,
status
);
}
SetLastError
(
0xdeadbeef
);
val
=
pFlsGetValue
(
0
);
ok
(
!
val
,
"fls index 0 wrong value %p
\n
"
,
val
);
...
...
@@ -291,8 +303,10 @@ static void test_FiberLocalStorage(void)
ok
(
fls
!=
0
,
"fls index 0 allocated
\n
"
);
val
=
pFlsGetValue
(
fls
);
ok
(
!
val
,
"fls index %u wrong value %p
\n
"
,
fls
,
val
);
SetLastError
(
0xdeadbeef
);
ret
=
pFlsSetValue
(
fls
,
(
void
*
)
0xdeadbeef
);
ok
(
ret
,
"setting fls index %u failed
\n
"
,
fls
);
ok
(
GetLastError
()
==
0xdeadbeef
,
"setting fls index wrong error %u
\n
"
,
GetLastError
()
);
SetLastError
(
0xdeadbeef
);
val
=
pFlsGetValue
(
fls
);
ok
(
val
==
(
void
*
)
0xdeadbeef
,
"fls index %u wrong value %p
\n
"
,
fls
,
val
);
...
...
dlls/kernelbase/thread.c
View file @
e596f404
...
...
@@ -1101,20 +1101,7 @@ PVOID WINAPI DECLSPEC_HOTPATCH FlsGetValue( DWORD index )
*/
BOOL
WINAPI
DECLSPEC_HOTPATCH
FlsSetValue
(
DWORD
index
,
PVOID
data
)
{
if
(
!
index
||
index
>=
8
*
sizeof
(
NtCurrentTeb
()
->
Peb
->
FlsBitmapBits
))
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
FALSE
;
}
if
(
!
NtCurrentTeb
()
->
FlsSlots
&&
!
(
NtCurrentTeb
()
->
FlsSlots
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
8
*
sizeof
(
NtCurrentTeb
()
->
Peb
->
FlsBitmapBits
)
*
sizeof
(
void
*
)
)))
{
SetLastError
(
ERROR_NOT_ENOUGH_MEMORY
);
return
FALSE
;
}
NtCurrentTeb
()
->
FlsSlots
[
index
]
=
data
;
return
TRUE
;
return
set_ntstatus
(
RtlFlsSetValue
(
index
,
data
));
}
...
...
dlls/ntdll/ntdll.spec
View file @
e596f404
...
...
@@ -668,6 +668,7 @@
@ stdcall RtlFirstFreeAce(ptr ptr)
@ stdcall RtlFlsAlloc(ptr ptr)
@ stdcall RtlFlsFree(long)
@ stdcall RtlFlsSetValue(long ptr)
@ stub RtlFlushPropertySet
# @ stub RtlFlushSecureMemoryCache
@ stdcall RtlFormatCurrentUserKeyPath(ptr)
...
...
dlls/ntdll/thread.c
View file @
e596f404
...
...
@@ -311,3 +311,21 @@ NTSTATUS WINAPI DECLSPEC_HOTPATCH RtlFlsFree( ULONG index )
RtlReleasePebLock
();
return
status
;
}
/***********************************************************************
* RtlFlsSetValue (NTDLL.@)
*/
NTSTATUS
WINAPI
DECLSPEC_HOTPATCH
RtlFlsSetValue
(
ULONG
index
,
void
*
data
)
{
if
(
!
index
||
index
>=
8
*
sizeof
(
NtCurrentTeb
()
->
Peb
->
FlsBitmapBits
))
return
STATUS_INVALID_PARAMETER
;
if
(
!
NtCurrentTeb
()
->
FlsSlots
&&
!
(
NtCurrentTeb
()
->
FlsSlots
=
RtlAllocateHeap
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
8
*
sizeof
(
NtCurrentTeb
()
->
Peb
->
FlsBitmapBits
)
*
sizeof
(
void
*
)
)))
return
STATUS_NO_MEMORY
;
NtCurrentTeb
()
->
FlsSlots
[
index
]
=
data
;
return
STATUS_SUCCESS
;
}
include/winternl.h
View file @
e596f404
...
...
@@ -3373,6 +3373,7 @@ NTSYSAPI ULONG WINAPI RtlFindSetRuns(PCRTL_BITMAP,PRTL_BITMAP_RUN,ULONG,BOOL
NTSYSAPI
BOOLEAN
WINAPI
RtlFirstFreeAce
(
PACL
,
PACE_HEADER
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFlsAlloc
(
PFLS_CALLBACK_FUNCTION
,
ULONG
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFlsFree
(
ULONG
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFlsSetValue
(
ULONG
,
void
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFormatCurrentUserKeyPath
(
PUNICODE_STRING
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFormatMessage
(
LPCWSTR
,
ULONG
,
BOOLEAN
,
BOOLEAN
,
BOOLEAN
,
__ms_va_list
*
,
LPWSTR
,
ULONG
,
ULONG
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlFormatMessageEx
(
LPCWSTR
,
ULONG
,
BOOLEAN
,
BOOLEAN
,
BOOLEAN
,
__ms_va_list
*
,
LPWSTR
,
ULONG
,
ULONG
*
,
ULONG
);
...
...
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