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
4f3b7f84
Commit
4f3b7f84
authored
Apr 14, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Implement _invalid_parameter and fix the handler definitions.
parent
a1e99f54
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
43 additions
and
19 deletions
+43
-19
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+2
-2
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+2
-2
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+2
-2
errno.c
dlls/msvcrt/errno.c
+25
-4
msvcrt.h
dlls/msvcrt/msvcrt.h
+3
-2
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/string.c
+2
-2
stdlib.h
include/msvcrt/stdlib.h
+6
-4
No files found.
dlls/msvcr80/msvcr80.spec
View file @
4f3b7f84
...
...
@@ -42,7 +42,7 @@
@ stub ?_ValidateWrite@@YAHPAXI@Z
@ cdecl __uncaught_exception() msvcrt.__uncaught_exception
@ stub ?_inconsistency@@YAXXZ
@
stub ?_invalid_parameter@@YAXPBG00II@Z
@
cdecl ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter
@ stub ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z
@ stub ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z
@ varargs ?_open@@YAHPBDHH@Z(str long) msvcrt._open
...
...
@@ -533,7 +533,7 @@
@ stub _inp
@ stub _inpd
@ stub _inpw
@
stub
_invalid_parameter
@
cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt.
_invalid_parameter
@ stub _invalid_parameter_noinfo
@ stub _invoke_watson
@ extern _iob msvcrt._iob
...
...
dlls/msvcr90/msvcr90.spec
View file @
4f3b7f84
...
...
@@ -42,7 +42,7 @@
@ stub ?_ValidateWrite@@YAHPAXI@Z
@ cdecl __uncaught_exception() msvcrt.__uncaught_exception
@ stub ?_inconsistency@@YAXXZ
@
stub ?_invalid_parameter@@YAXPBG00II@Z
@
cdecl ?_invalid_parameter@@YAXPBG00II@Z(wstr wstr wstr long long) msvcrt._invalid_parameter
@ stub ?_is_exception_typeof@@YAHABVtype_info@@PAU_EXCEPTION_POINTERS@@@Z
@ stub ?_name_internal_method@type_info@@QBEPBDPAU__type_info_node@@@Z
@ varargs ?_open@@YAHPBDHH@Z(str long) msvcrt._open
...
...
@@ -521,7 +521,7 @@
@ stub _inp
@ stub _inpd
@ stub _inpw
@
stub
_invalid_parameter
@
cdecl _invalid_parameter(wstr wstr wstr long long) msvcrt.
_invalid_parameter
@ stub _invalid_parameter_noinfo
@ stub _invoke_watson
@ extern _iob msvcrt._iob
...
...
dlls/msvcr90/tests/msvcr90.c
View file @
4f3b7f84
...
...
@@ -46,13 +46,13 @@ int cb_called[4];
void
__cdecl
test_invalid_parameter_handler
(
const
wchar_t
*
expression
,
const
wchar_t
*
function
,
const
wchar_t
*
file
,
unsigned
line
,
u
nsigned
*
res
)
unsigned
line
,
u
intptr_t
arg
)
{
ok
(
expression
==
NULL
,
"expression is not NULL
\n
"
);
ok
(
function
==
NULL
,
"function is not NULL
\n
"
);
ok
(
file
==
NULL
,
"file is not NULL
\n
"
);
ok
(
line
==
0
,
"line = %u
\n
"
,
line
);
ok
(
res
==
NULL
,
"res = %p
\n
"
,
res
);
ok
(
arg
==
0
,
"arg = %lx
\n
"
,
(
UINT_PTR
)
arg
);
}
static
int
__cdecl
initterm_cb0
(
void
)
...
...
dlls/msvcrt/errno.c
View file @
4f3b7f84
...
...
@@ -20,8 +20,14 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winternl.h"
#include "msvcrt.h"
#include "excpt.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcrt
);
...
...
@@ -117,7 +123,8 @@ char *MSVCRT__sys_errlist[] =
};
unsigned
int
MSVCRT__sys_nerr
=
sizeof
(
MSVCRT__sys_errlist
)
/
sizeof
(
MSVCRT__sys_errlist
[
0
])
-
1
;
MSVCRT_invalid_parameter_handler
MSVCRT_invalid_parameter
=
NULL
;
static
MSVCRT_invalid_parameter_handler
invalid_parameter_handler
=
NULL
;
/* INTERNAL: Set the crt and dos errno's from the OS error given. */
void
msvcrt_set_errno
(
int
err
)
...
...
@@ -287,21 +294,35 @@ void CDECL _seterrormode(int mode)
SetErrorMode
(
mode
);
}
/******************************************************************************
* _invalid_parameter (MSVCRT.@)
*/
void
__cdecl
MSVCRT__invalid_parameter
(
const
MSVCRT_wchar_t
*
expr
,
const
MSVCRT_wchar_t
*
func
,
const
MSVCRT_wchar_t
*
file
,
unsigned
int
line
,
MSVCRT_uintptr_t
arg
)
{
if
(
invalid_parameter_handler
)
invalid_parameter_handler
(
expr
,
func
,
file
,
line
,
arg
);
else
{
ERR
(
"%s:%u %s: %s %lx
\n
"
,
debugstr_w
(
file
),
line
,
debugstr_w
(
func
),
debugstr_w
(
expr
),
arg
);
RaiseException
(
STATUS_INVALID_CRUNTIME_PARAMETER
,
EXCEPTION_NONCONTINUABLE
,
0
,
NULL
);
}
}
/* _get_invalid_parameter_handler - not exported in native msvcrt, added in msvcr80 */
MSVCRT_invalid_parameter_handler
CDECL
_get_invalid_parameter_handler
(
void
)
{
TRACE
(
"
\n
"
);
return
MSVCRT_invalid_paramet
er
;
return
invalid_parameter_handl
er
;
}
/* _set_invalid_parameter_handler - not exproted in native msvcrt, added in msvcr80 */
MSVCRT_invalid_parameter_handler
CDECL
_set_invalid_parameter_handler
(
MSVCRT_invalid_parameter_handler
handler
)
{
MSVCRT_invalid_parameter_handler
old
=
MSVCRT_invalid_paramet
er
;
MSVCRT_invalid_parameter_handler
old
=
invalid_parameter_handl
er
;
TRACE
(
"(%p)
\n
"
,
handler
);
MSVCRT_invalid_paramet
er
=
handler
;
invalid_parameter_handl
er
=
handler
;
return
old
;
}
dlls/msvcrt/msvcrt.h
View file @
4f3b7f84
...
...
@@ -78,7 +78,7 @@ typedef void (*__cdecl MSVCRT__se_translator_function)(unsigned int code, struct
typedef
void
(
*
__cdecl
MSVCRT__beginthread_start_routine_t
)(
void
*
);
typedef
unsigned
int
(
__stdcall
*
MSVCRT__beginthreadex_start_routine_t
)(
void
*
);
typedef
int
(
*
__cdecl
MSVCRT__onexit_t
)(
void
);
typedef
void
(
__cdecl
*
MSVCRT_invalid_parameter_handler
)(
const
wchar_t
*
,
const
wchar_t
*
,
const
wchar_t
*
,
unsigned
,
unsigned
*
);
typedef
void
(
__cdecl
*
MSVCRT_invalid_parameter_handler
)(
const
MSVCRT_wchar_t
*
,
const
MSVCRT_wchar_t
*
,
const
MSVCRT_wchar_t
*
,
unsigned
,
MSVCRT_uintptr_t
);
typedef
struct
{
long
double
x
;}
MSVCRT__LDOUBLE
;
...
...
@@ -128,7 +128,6 @@ extern LCID MSVCRT_current_lc_all_lcid;
extern
WORD
MSVCRT__ctype
[
257
];
extern
WORD
MSVCRT_current_ctype
[
257
];
extern
WORD
*
MSVCRT__pctype
;
extern
MSVCRT_invalid_parameter_handler
MSVCRT_invalid_parameter
;
void
msvcrt_set_errno
(
int
);
...
...
@@ -825,6 +824,8 @@ int __cdecl MSVCRT__pipe(int *, unsigned int, int);
MSVCRT_wchar_t
*
__cdecl
_wgetenv
(
const
MSVCRT_wchar_t
*
);
void
__cdecl
_wsearchenv
(
const
MSVCRT_wchar_t
*
,
const
MSVCRT_wchar_t
*
,
MSVCRT_wchar_t
*
);
MSVCRT_intptr_t
__cdecl
MSVCRT__spawnvpe
(
int
,
const
char
*
,
const
char
*
const
*
,
const
char
*
const
*
);
void
__cdecl
MSVCRT__invalid_parameter
(
const
MSVCRT_wchar_t
*
expr
,
const
MSVCRT_wchar_t
*
func
,
const
MSVCRT_wchar_t
*
file
,
unsigned
int
line
,
MSVCRT_uintptr_t
arg
);
#endif
#endif
/* __WINE_MSVCRT_H */
dlls/msvcrt/msvcrt.spec
View file @
4f3b7f84
...
...
@@ -479,7 +479,7 @@
@ stub _inp #(long) -i386
@ stub _inpd #(long) -i386
@ stub _inpw #(long) -i386
@
stub
_invalid_parameter
@
cdecl _invalid_parameter(wstr wstr wstr long long) MSVCRT_
_invalid_parameter
@ extern _iob MSVCRT__iob
# stub _isalnum_l
# stub _isalpha_l
...
...
dlls/msvcrt/string.c
View file @
4f3b7f84
...
...
@@ -341,7 +341,7 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR
TRACE
(
"(%s %p %d %p)
\n
"
,
nptr
,
endptr
,
base
,
locale
);
if
(
!
nptr
||
base
<
0
||
base
>
36
||
base
==
1
)
{
MSVCRT_
invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
NULL
);
MSVCRT_
_invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
return
0
;
}
...
...
@@ -421,7 +421,7 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
TRACE
(
"(%s %p %d %p)
\n
"
,
nptr
,
endptr
,
base
,
locale
);
if
(
!
nptr
||
base
<
0
||
base
>
36
||
base
==
1
)
{
MSVCRT_
invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
NULL
);
MSVCRT_
_invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
return
0
;
}
...
...
include/msvcrt/stdlib.h
View file @
4f3b7f84
...
...
@@ -218,6 +218,12 @@ __msvcrt_ulong __cdecl wcstoul(const wchar_t*,wchar_t**,int);
int
__cdecl
wctomb
(
char
*
,
wchar_t
);
#endif
/* _WSTDLIB_DEFINED */
typedef
void
(
__cdecl
*
_invalid_parameter_handler
)(
const
wchar_t
*
,
const
wchar_t
*
,
const
wchar_t
*
,
unsigned
,
uintptr_t
);
_invalid_parameter_handler
__cdecl
_set_invalid_parameter_handler
(
_invalid_parameter_handler
);
_invalid_parameter_handler
__cdecl
_get_invalid_parameter_handler
(
void
);
void
__cdecl
_invalid_parameter
(
const
wchar_t
*
expr
,
const
wchar_t
*
func
,
const
wchar_t
*
file
,
unsigned
int
line
,
uintptr_t
arg
);
#ifdef __cplusplus
}
#endif
...
...
@@ -261,8 +267,4 @@ static inline ldiv_t __wine_msvcrt_ldiv(__msvcrt_long num, __msvcrt_long denom)
#include <poppack.h>
typedef
void
(
__cdecl
*
_invalid_parameter_handler
)(
const
wchar_t
*
,
const
wchar_t
*
,
const
wchar_t
*
,
unsigned
,
unsigned
*
);
_invalid_parameter_handler
__cdecl
_set_invalid_parameter_handler
(
_invalid_parameter_handler
);
_invalid_parameter_handler
__cdecl
_get_invalid_parameter_handler
(
void
);
#endif
/* __WINE_STDLIB_H */
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