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
bc799e40
Commit
bc799e40
authored
Oct 12, 2001
by
Marcus Meissner
Committed by
Alexandre Julliard
Oct 12, 2001
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle bad pointer arguments to LoadImageA() (and functions
callingLoadImageA) with an exception handler.
parent
9d777f90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
cursoricon.c
windows/cursoricon.c
+18
-2
No files found.
windows/cursoricon.c
View file @
bc799e40
...
...
@@ -36,6 +36,7 @@
#include "wingdi.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/exception.h"
#include "heap.h"
#include "palette.h"
#include "bitmap.h"
...
...
@@ -2174,14 +2175,29 @@ HANDLE16 WINAPI LoadImage16( HINSTANCE16 hinst, LPCSTR name, UINT16 type,
* FIXME: implementation lacks some features, see LR_ defines in winuser.h
*/
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
HANDLE
WINAPI
LoadImageA
(
HINSTANCE
hinst
,
LPCSTR
name
,
UINT
type
,
INT
desiredx
,
INT
desiredy
,
UINT
loadflags
)
{
HANDLE
res
;
LPWSTR
u_name
;
if
(
HIWORD
(
name
))
u_name
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
name
);
else
u_name
=
(
LPWSTR
)
name
;
__TRY
{
if
(
HIWORD
(
name
))
u_name
=
HEAP_strdupAtoW
(
GetProcessHeap
(),
0
,
name
);
else
u_name
=
(
LPWSTR
)
name
;
}
__EXCEPT
(
page_fault
)
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
__ENDTRY
res
=
LoadImageW
(
hinst
,
u_name
,
type
,
desiredx
,
desiredy
,
loadflags
);
if
(
HIWORD
(
name
))
HeapFree
(
GetProcessHeap
(),
0
,
u_name
);
return
res
;
...
...
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