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
254eab38
Commit
254eab38
authored
Mar 24, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Mar 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcr90: Added _get/set_invalid_parameter_handler implementation.
parent
d91b71e0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
71 additions
and
7 deletions
+71
-7
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+3
-3
msvcr90.c
dlls/msvcr90/msvcr90.c
+25
-0
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+3
-3
msvcr90.c
dlls/msvcr90/tests/msvcr90.c
+17
-0
errno.c
dlls/msvcrt/errno.c
+1
-0
msvcrt.h
dlls/msvcrt/msvcrt.h
+2
-0
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+1
-1
string.c
dlls/msvcrt/tests/string.c
+15
-0
stdlib.h
include/msvcrt/stdlib.h
+4
-0
No files found.
dlls/msvcr80/msvcr80.spec
View file @
254eab38
...
...
@@ -470,7 +470,7 @@
@ stub _get_errno
@ stub _get_fmode
@ stub _get_heap_handle
@
stub
_get_invalid_parameter_handler
@
cdecl _get_invalid_parameter_handler() msvcr90.
_get_invalid_parameter_handler
@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle
@ stub _get_osplatform
@ stub _get_osver
...
...
@@ -533,7 +533,7 @@
@ stub _inp
@ stub _inpd
@ stub _inpw
@
stub
_invalid_parameter
@
extern _invalid_parameter msvcrt.
_invalid_parameter
@ stub _invalid_parameter_noinfo
@ stub _invoke_watson
@ extern _iob msvcrt._iob
...
...
@@ -873,7 +873,7 @@
@ stub _set_errno
@ cdecl _set_error_mode(long) msvcrt._set_error_mode
@ stub _set_fmode
@
stub
_set_invalid_parameter_handler
@
cdecl _set_invalid_parameter_handler(ptr) msvcr90.
_set_invalid_parameter_handler
@ stub _set_malloc_crt_max_wait
@ stub _set_output_format
@ stub _set_printf_count_output
...
...
dlls/msvcr90/msvcr90.c
View file @
254eab38
...
...
@@ -27,6 +27,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
msvcr90
);
typedef
int
(
CDECL
*
_INITTERM_E_FN
)(
void
);
typedef
void
(
__cdecl
*
_invalid_parameter_handler
)(
const
wchar_t
*
,
const
wchar_t
*
,
const
wchar_t
*
,
unsigned
,
unsigned
*
);
/*********************************************************************
* DllMain (MSVCR90.@)
...
...
@@ -77,6 +78,30 @@ void * CDECL _encoded_null(void)
}
/*********************************************************************
* _get_invalid_parameter_handler (MSVCR90.@)
*/
_invalid_parameter_handler
CDECL
_get_invalid_parameter_handler
(
void
)
{
TRACE
(
"
\n
"
);
return
*
((
_invalid_parameter_handler
*
)
GetProcAddress
(
GetModuleHandleA
(
"msvcrt.dll"
),
"_invalid_parameter"
));
}
/*********************************************************************
* _set_invalid_parameter_handler (MSVCR90.@)
*/
_invalid_parameter_handler
CDECL
_set_invalid_parameter_handler
(
_invalid_parameter_handler
handler
)
{
_invalid_parameter_handler
*
ptr
=
(
_invalid_parameter_handler
*
)
GetProcAddress
(
GetModuleHandleA
(
"msvcrt.dll"
),
"_invalid_parameter"
);
_invalid_parameter_handler
old
=
*
ptr
;
TRACE
(
"(%p)
\n
"
,
handler
);
*
ptr
=
handler
;
return
old
;
}
/*********************************************************************
* _initterm_e (MSVCR90.@)
*
* call an array of application initialization functions and report the return value
...
...
dlls/msvcr90/msvcr90.spec
View file @
254eab38
...
...
@@ -462,7 +462,7 @@
@ stub _get_errno
@ stub _get_fmode
@ stub _get_heap_handle
@
stub _get_invalid_parameter_handler
@
cdecl _get_invalid_parameter_handler()
@ cdecl _get_osfhandle(long) msvcrt._get_osfhandle
@ stub _get_output_format
@ stub _get_pgmptr
...
...
@@ -521,7 +521,7 @@
@ stub _inp
@ stub _inpd
@ stub _inpw
@
stub
_invalid_parameter
@
extern _invalid_parameter msvcrt.
_invalid_parameter
@ stub _invalid_parameter_noinfo
@ stub _invoke_watson
@ extern _iob msvcrt._iob
...
...
@@ -859,7 +859,7 @@
@ stub _set_errno
@ cdecl _set_error_mode(long) msvcrt._set_error_mode
@ stub _set_fmode
@
stub _set_invalid_parameter_handler
@
cdecl _set_invalid_parameter_handler(ptr)
@ stub _set_malloc_crt_max_wait
@ stub _set_output_format
@ stub _set_printf_count_output
...
...
dlls/msvcr90/tests/msvcr90.c
View file @
254eab38
...
...
@@ -25,6 +25,7 @@
#include <errno.h>
#include "wine/test.h"
static
_invalid_parameter_handler
(
__cdecl
*
p_set_invalid_parameter_handler
)(
_invalid_parameter_handler
);
typedef
int
(
__cdecl
*
_INITTERM_E_FN
)(
void
);
static
int
(
__cdecl
*
p_initterm_e
)(
_INITTERM_E_FN
*
table
,
_INITTERM_E_FN
*
end
);
static
void
*
(
__cdecl
*
p_encode_pointer
)(
void
*
);
...
...
@@ -35,6 +36,17 @@ int cb_called[4];
/* ########## */
void
__cdecl
test_invalid_parameter_handler
(
const
wchar_t
*
expression
,
const
wchar_t
*
function
,
const
wchar_t
*
file
,
unsigned
line
,
unsigned
*
res
)
{
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
);
}
static
int
initterm_cb0
(
void
)
{
cb_called
[
0
]
++
;
...
...
@@ -169,6 +181,11 @@ START_TEST(msvcr90)
return
;
}
p_set_invalid_parameter_handler
=
(
void
*
)
GetProcAddress
(
hcrt
,
"_set_invalid_parameter_handler"
);
if
(
p_set_invalid_parameter_handler
)
ok
(
p_set_invalid_parameter_handler
(
test_invalid_parameter_handler
)
==
NULL
,
"Invalid parameter handler was already set
\n
"
);
p_initterm_e
=
(
void
*
)
GetProcAddress
(
hcrt
,
"_initterm_e"
);
p_encode_pointer
=
(
void
*
)
GetProcAddress
(
hcrt
,
"_encode_pointer"
);
p_decode_pointer
=
(
void
*
)
GetProcAddress
(
hcrt
,
"_decode_pointer"
);
...
...
dlls/msvcrt/errno.c
View file @
254eab38
...
...
@@ -117,6 +117,7 @@ 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
;
/* INTERNAL: Set the crt and dos errno's from the OS error given. */
void
msvcrt_set_errno
(
int
err
)
...
...
dlls/msvcrt/msvcrt.h
View file @
254eab38
...
...
@@ -75,6 +75,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
struct
{
long
double
x
;}
MSVCRT__LDOUBLE
;
...
...
@@ -124,6 +125,7 @@ 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
);
...
...
dlls/msvcrt/msvcrt.spec
View file @
254eab38
...
...
@@ -479,7 +479,7 @@
@ stub _inp #(long) -i386
@ stub _inpd #(long) -i386
@ stub _inpw #(long) -i386
# stub
_invalid_parameter
@ extern _invalid_parameter MSVCRT
_invalid_parameter
@ extern _iob MSVCRT__iob
# stub _isalnum_l
# stub _isalpha_l
...
...
dlls/msvcrt/tests/string.c
View file @
254eab38
...
...
@@ -53,6 +53,7 @@ static int (__cdecl *p_mbsnbcpy_s)(unsigned char * dst, size_t size, const unsig
static
int
(
__cdecl
*
p_wcscpy_s
)(
wchar_t
*
wcDest
,
size_t
size
,
const
wchar_t
*
wcSrc
);
static
int
(
__cdecl
*
p_wcsupr_s
)(
wchar_t
*
str
,
size_t
size
);
static
size_t
(
__cdecl
*
p_strnlen
)(
const
char
*
,
size_t
);
static
_invalid_parameter_handler
*
p_invalid_parameter
;
static
int
*
p__mb_cur_max
;
static
unsigned
char
*
p_mbctype
;
...
...
@@ -61,6 +62,17 @@ static unsigned char *p_mbctype;
HMODULE
hMsvcrt
;
void
__cdecl
test_invalid_parameter_handler
(
const
wchar_t
*
expression
,
const
wchar_t
*
function
,
const
wchar_t
*
file
,
unsigned
line
,
unsigned
*
res
)
{
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
);
}
static
void
test_swab
(
void
)
{
char
original
[]
=
"BADCFEHGJILKNMPORQTSVUXWZY@#"
;
char
expected1
[]
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ@#"
;
...
...
@@ -946,6 +958,9 @@ START_TEST(string)
SET
(
pmemcmp
,
"memcmp"
);
SET
(
p_mbctype
,
"_mbctype"
);
SET
(
p__mb_cur_max
,
"__mb_cur_max"
);
p_invalid_parameter
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_invalid_parameter"
);
if
(
p_invalid_parameter
)
*
p_invalid_parameter
=
test_invalid_parameter_handler
;
pstrcpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"strcpy_s"
);
pstrcat_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"strcat_s"
);
p_mbsnbcpy_s
=
(
void
*
)
GetProcAddress
(
hMsvcrt
,
"_mbsnbcpy_s"
);
...
...
include/msvcrt/stdlib.h
View file @
254eab38
...
...
@@ -261,4 +261,8 @@ 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