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
c775e1ec
Commit
c775e1ec
authored
Apr 16, 2000
by
Richard Cohen
Committed by
Alexandre Julliard
Apr 16, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap an exception handler around FindResource.
parent
72e1be10
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
7 deletions
+35
-7
resource.c
loader/resource.c
+35
-7
No files found.
loader/resource.c
View file @
c775e1ec
...
...
@@ -18,6 +18,7 @@
#include "winuser.h"
#include "wine/winbase16.h"
#include "wine/winuser16.h"
#include "wine/exception.h"
#include "ldt.h"
#include "global.h"
#include "heap.h"
...
...
@@ -124,15 +125,19 @@ static WORD MapHRsrc16ToType( NE_MODULE *pModule, HRSRC16 hRsrc16 )
}
/**********************************************************************
* RES_FindResource
*/
static
HRSRC
RES_FindResource
(
HMODULE
hModule
,
LPCSTR
type
,
/* filter for page-fault exceptions */
static
WINE_EXCEPTION_FILTER
(
page_fault
)
{
if
(
GetExceptionCode
()
==
EXCEPTION_ACCESS_VIOLATION
)
return
EXCEPTION_EXECUTE_HANDLER
;
return
EXCEPTION_CONTINUE_SEARCH
;
}
static
HRSRC
RES_FindResource2
(
HMODULE
hModule
,
LPCSTR
type
,
LPCSTR
name
,
WORD
lang
,
BOOL
bUnicode
,
BOOL
bRet16
)
{
HRSRC
hRsrc
=
0
;
HMODULE16
hMod16
=
MapHModuleLS
(
hModule
);
NE_MODULE
*
pModule
=
NE_GetPtr
(
hMod16
);
WINE_MODREF
*
wm
=
pModule
&&
pModule
->
module32
?
...
...
@@ -147,8 +152,8 @@ static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type,
bUnicode
?
"W"
:
"A"
,
bRet16
?
"NE"
:
"PE"
);
if
(
!
pModule
)
return
0
;
if
(
pModule
)
{
if
(
wm
)
{
/* 32-bit PE module */
...
...
@@ -201,7 +206,30 @@ static HRSRC RES_FindResource( HMODULE hModule, LPCSTR type,
/* If we need to return 32-bit HRSRC, no conversion is necessary,
we simply use the 16-bit HRSRC as 32-bit HRSRC */
}
}
return
hRsrc
;
}
/**********************************************************************
* RES_FindResource
*/
static
HRSRC
RES_FindResource
(
HMODULE
hModule
,
LPCSTR
type
,
LPCSTR
name
,
WORD
lang
,
BOOL
bUnicode
,
BOOL
bRet16
)
{
HRSRC
hRsrc
;
__TRY
{
hRsrc
=
RES_FindResource2
(
hModule
,
type
,
name
,
lang
,
bUnicode
,
bRet16
);
}
__EXCEPT
(
page_fault
)
{
WARN
(
"page fault
\n
"
);
SetLastError
(
ERROR_INVALID_PARAMETER
);
return
0
;
}
__ENDTRY
return
hRsrc
;
}
...
...
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