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
1d917529
Commit
1d917529
authored
Jan 20, 2024
by
Piotr Caban
Committed by
Alexandre Julliard
Jan 22, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcp140: Add _XGetLastError implementation.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46904
parent
b6199254
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
16 deletions
+50
-16
exception.c
dlls/msvcp90/exception.c
+13
-1
misc.c
dlls/msvcp90/misc.c
+34
-15
msvcp90.h
dlls/msvcp90/msvcp90.h
+3
-0
No files found.
dlls/msvcp90/exception.c
View file @
1d917529
...
...
@@ -1001,7 +1001,19 @@ bool __cdecl MSVCP__uncaught_exception(void)
/* ?_XGetLastError@std@@YAXXZ */
void
__cdecl
_XGetLastError
(
void
)
{
FIXME
(
"stub
\n
"
);
int
err
=
GetLastError
();
system_error
se
;
const
char
*
msg
;
TRACE
(
"() GetLastError()=%d
\n
"
,
err
);
msg
=
_Winerror_map_str
(
err
);
MSVCP_runtime_error_ctor
(
&
se
.
base
,
&
msg
);
se
.
code
.
code
=
err
;
se
.
code
.
category
=
std_system_category
();
se
.
base
.
e
.
vtable
=
&
system_error_vtable
;
_CxxThrowException
(
&
se
,
&
system_error_cxx_type
);
}
#endif
...
...
dlls/msvcp90/misc.c
View file @
1d917529
...
...
@@ -1063,6 +1063,13 @@ bool __thiscall custom_category_equivalent_code(custom_category *this,
return
FALSE
;
}
DEFINE_THISCALL_WRAPPER
(
custom_category_message
,
12
)
basic_string_char
*
__thiscall
custom_category_message
(
const
custom_category
*
this
,
basic_string_char
*
ret
,
int
err
)
{
return
MSVCP_basic_string_char_ctor_cstr
(
ret
,
strerror
(
err
));
}
DEFINE_THISCALL_WRAPPER
(
iostream_category_name
,
4
)
const
char
*
__thiscall
iostream_category_name
(
const
custom_category
*
this
)
{
...
...
@@ -1090,7 +1097,7 @@ const error_category* __cdecl std_iostream_category(void)
}
#endif
#if _MSVCP_VER == 100
#if _MSVCP_VER == 100
|| _MSVCP_VER >= 140
static
custom_category
system_category
;
DEFINE_RTTI_DATA1
(
system_category
,
0
,
&
error_category_rtti_base_descriptor
,
".?AV_System_error_category@std@@"
)
...
...
@@ -1099,13 +1106,32 @@ extern const vtable_ptr system_category_vtable;
static
void
system_category_ctor
(
custom_category
*
this
)
{
this
->
base
.
vtable
=
&
system_category_vtable
;
#if _MSVCP_VER == 100
this
->
type
=
"system"
;
#endif
}
DEFINE_THISCALL_WRAPPER
(
custo
m_category_name
,
4
)
const
char
*
__thiscall
custo
m_category_name
(
const
custom_category
*
this
)
DEFINE_THISCALL_WRAPPER
(
syste
m_category_name
,
4
)
const
char
*
__thiscall
syste
m_category_name
(
const
custom_category
*
this
)
{
#if _MSVCP_VER == 100
return
this
->
type
;
#else
return
"system"
;
#endif
}
DEFINE_THISCALL_WRAPPER
(
system_category_message
,
12
)
basic_string_char
*
__thiscall
system_category_message
(
const
custom_category
*
this
,
basic_string_char
*
ret
,
int
err
)
{
#if _MSVCP_VER > 100
const
char
*
msg
=
_Winerror_map_str
(
err
);
if
(
!
msg
)
return
MSVCP_basic_string_char_ctor_cstr
(
ret
,
"unknown error"
);
return
MSVCP_basic_string_char_ctor_cstr
(
ret
,
msg
);
#else
return
custom_category_message
(
this
,
ret
,
err
);
#endif
}
/* ?system_category@std@@YAABVerror_category@1@XZ */
...
...
@@ -1140,13 +1166,6 @@ const char* __thiscall generic_category_name(const custom_category *this)
#endif
}
DEFINE_THISCALL_WRAPPER
(
custom_category_message
,
12
)
basic_string_char
*
__thiscall
custom_category_message
(
const
custom_category
*
this
,
basic_string_char
*
ret
,
int
err
)
{
return
MSVCP_basic_string_char_ctor_cstr
(
ret
,
strerror
(
err
));
}
/* ?generic_category@std@@YAABVerror_category@1@XZ */
/* ?generic_category@std@@YAAEBVerror_category@1@XZ */
const
error_category
*
__cdecl
std_generic_category
(
void
)
...
...
@@ -1729,11 +1748,11 @@ __ASM_BLOCK_BEGIN(misc_vtables)
VTABLE_ADD_FUNC
(
custom_category_default_error_condition
)
VTABLE_ADD_FUNC
(
custom_category_equivalent
)
VTABLE_ADD_FUNC
(
custom_category_equivalent_code
));
#if _MSVCP_VER == 100
#if _MSVCP_VER == 100
|| _MSVCP_VER >= 140
__ASM_VTABLE
(
system_category
,
VTABLE_ADD_FUNC
(
custom_category_vector_dtor
)
VTABLE_ADD_FUNC
(
custo
m_category_name
)
VTABLE_ADD_FUNC
(
custo
m_category_message
)
VTABLE_ADD_FUNC
(
syste
m_category_name
)
VTABLE_ADD_FUNC
(
syste
m_category_message
)
VTABLE_ADD_FUNC
(
custom_category_default_error_condition
)
VTABLE_ADD_FUNC
(
custom_category_equivalent
)
VTABLE_ADD_FUNC
(
custom_category_equivalent_code
));
...
...
@@ -1759,7 +1778,7 @@ void init_misc(void *base)
init_generic_category_rtti
(
base
);
init_iostream_category_rtti
(
base
);
#endif
#if _MSVCP_VER == 100
#if _MSVCP_VER == 100
|| _MSVCP_VER >= 140
init_system_category_rtti
(
base
);
#endif
#if _MSVCP_VER >= 110
...
...
@@ -1772,7 +1791,7 @@ void init_misc(void *base)
generic_category_ctor
(
&
generic_category
);
#endif
#if _MSVCP_VER == 100
#if _MSVCP_VER == 100
|| _MSVCP_VER >= 140
system_category_ctor
(
&
system_category
);
#endif
}
...
...
dlls/msvcp90/msvcp90.h
View file @
1d917529
...
...
@@ -694,12 +694,15 @@ typedef struct {
const
error_category
*
__cdecl
std_iostream_category
(
void
);
const
error_category
*
__cdecl
std_generic_category
(
void
);
const
error_category
*
__cdecl
std_system_category
(
void
);
typedef
struct
{
int
code
;
const
error_category
*
category
;
}
error_code
;
const
char
*
_Winerror_map_str
(
int
err
);
#endif
#if _MSVCP_VER < 80
...
...
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