Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
10b36e39
Commit
10b36e39
authored
Mar 01, 2017
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp140: Add task_continuation_context constructor implementation.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
aedd6e95
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
92 additions
and
3 deletions
+92
-3
msvcp140.spec
dlls/msvcp140/msvcp140.spec
+3
-3
msvcp140.c
dlls/msvcp140/tests/msvcp140.c
+72
-0
misc.c
dlls/msvcp90/misc.c
+17
-0
No files found.
dlls/msvcp140/msvcp140.spec
View file @
10b36e39
...
...
@@ -358,9 +358,9 @@
@ cdecl -arch=arm ??0ios_base@std@@IAA@XZ(ptr) ios_base_ctor
@ thiscall -arch=i386 ??0ios_base@std@@IAE@XZ(ptr) ios_base_ctor
@ cdecl -arch=win64 ??0ios_base@std@@IEAA@XZ(ptr) ios_base_ctor
@
stub -arch=arm ??0task_continuation_context@Concurrency@@AAA@XZ
@
stub -arch=i386 ??0task_continuation_context@Concurrency@@AAE@XZ
@
stub -arch=win64 ??0task_continuation_context@Concurrency@@AEAA@XZ
@
cdecl -arch=arm ??0task_continuation_context@Concurrency@@AAA@XZ(ptr) task_continuation_context_ctor
@
thiscall -arch=i386 ??0task_continuation_context@Concurrency@@AAE@XZ(ptr) task_continuation_context_ctor
@
cdecl -arch=win64 ??0task_continuation_context@Concurrency@@AEAA@XZ(ptr) task_continuation_context_ctor
@ stub -arch=arm ??0time_base@std@@QAA@I@Z
@ stub -arch=i386 ??0time_base@std@@QAE@I@Z
@ stub -arch=win64 ??0time_base@std@@QEAA@_K@Z
...
...
dlls/msvcp140/tests/msvcp140.c
View file @
10b36e39
...
...
@@ -21,7 +21,57 @@
#include "wine/test.h"
#include "winbase.h"
#undef __thiscall
#ifdef __i386__
#define __thiscall __stdcall
#else
#define __thiscall __cdecl
#endif
/* Emulate a __thiscall */
#ifdef __i386__
#include "pshpack1.h"
struct
thiscall_thunk
{
BYTE
pop_eax
;
/* popl %eax (ret addr) */
BYTE
pop_edx
;
/* popl %edx (func) */
BYTE
pop_ecx
;
/* popl %ecx (this) */
BYTE
push_eax
;
/* pushl %eax */
WORD
jmp_edx
;
/* jmp *%edx */
};
#include "poppack.h"
static
void
*
(
WINAPI
*
call_thiscall_func1
)(
void
*
func
,
void
*
this
);
static
void
init_thiscall_thunk
(
void
)
{
struct
thiscall_thunk
*
thunk
=
VirtualAlloc
(
NULL
,
sizeof
(
*
thunk
),
MEM_COMMIT
,
PAGE_EXECUTE_READWRITE
);
thunk
->
pop_eax
=
0x58
;
/* popl %eax */
thunk
->
pop_edx
=
0x5a
;
/* popl %edx */
thunk
->
pop_ecx
=
0x59
;
/* popl %ecx */
thunk
->
push_eax
=
0x50
;
/* pushl %eax */
thunk
->
jmp_edx
=
0xe2ff
;
/* jmp *%edx */
call_thiscall_func1
=
(
void
*
)
thunk
;
}
#define call_func1(func,_this) call_thiscall_func1(func,_this)
#else
#define init_thiscall_thunk()
#define call_func1(func,_this) func(_this)
#endif
/* __i386__ */
typedef
struct
{
void
*
unk0
;
BYTE
unk1
;
}
task_continuation_context
;
static
unsigned
int
(
__cdecl
*
p__Thrd_id
)(
void
);
static
task_continuation_context
*
(
__thiscall
*
p_task_continuation_context_ctor
)(
task_continuation_context
*
);
static
HMODULE
msvcp
;
#define SETNOFAIL(x,y) x = (void*)GetProcAddress(msvcp,y)
...
...
@@ -37,6 +87,17 @@ static BOOL init(void)
SET
(
p__Thrd_id
,
"_Thrd_id"
);
if
(
sizeof
(
void
*
)
==
8
)
{
/* 64-bit initialization */
SET
(
p_task_continuation_context_ctor
,
"??0task_continuation_context@Concurrency@@AEAA@XZ"
);
}
else
{
#ifdef __arm__
SET
(
p_task_continuation_context_ctor
,
"??0task_continuation_context@Concurrency@@AAA@XZ"
);
#else
SET
(
p_task_continuation_context_ctor
,
"??0task_continuation_context@Concurrency@@AAE@XZ"
);
#endif
}
init_thiscall_thunk
();
return
TRUE
;
}
...
...
@@ -82,10 +143,21 @@ static void test_vbtable_size_exports(void)
}
}
static
void
test_task_continuation_context
(
void
)
{
task_continuation_context
tcc
;
memset
(
&
tcc
,
0xdead
,
sizeof
(
tcc
));
call_func1
(
p_task_continuation_context_ctor
,
&
tcc
);
ok
(
!
tcc
.
unk0
,
"tcc.unk0 != NULL (%p)
\n
"
,
tcc
.
unk0
);
ok
(
!
tcc
.
unk1
,
"tcc.unk1 != 0 (%x)
\n
"
,
tcc
.
unk1
);
}
START_TEST
(
msvcp140
)
{
if
(
!
init
())
return
;
test_thrd
();
test_vbtable_size_exports
();
test_task_continuation_context
();
FreeLibrary
(
msvcp
);
}
dlls/msvcp90/misc.c
View file @
10b36e39
...
...
@@ -1360,3 +1360,20 @@ void __cdecl _Unlock_shared_ptr_spin_lock(void)
shared_ptr_lock
=
0
;
}
#endif
#if _MSVCP_VER >= 140
typedef
struct
{
void
*
unk0
;
BYTE
unk1
;
}
task_continuation_context
;
/* ??0task_continuation_context@Concurrency@@AAE@XZ */
/* ??0task_continuation_context@Concurrency@@AEAA@XZ */
DEFINE_THISCALL_WRAPPER
(
task_continuation_context_ctor
,
4
)
task_continuation_context
*
__thiscall
task_continuation_context_ctor
(
task_continuation_context
*
this
)
{
TRACE
(
"(%p)
\n
"
,
this
);
memset
(
this
,
0
,
sizeof
(
*
this
));
return
this
;
}
#endif
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