Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jason Beetham
wine
Commits
e91d976e
Commit
e91d976e
authored
25 years ago
by
Ulrich Czekalla
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix integer based resource id assumption.
Add support for string based type ids.
parent
a39ad1af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
loader/libres.c
+23
-23
23 additions, 23 deletions
loader/libres.c
with
23 additions
and
23 deletions
loader/libres.c
+
23
−
23
View file @
e91d976e
...
...
@@ -37,56 +37,56 @@ void LIBRES_RegisterResources(const wrc_resource32_t * const * Res)
/**********************************************************************
* LIBRES_FindResource
*/
typedef
int
(
*
CmpFunc_t
)(
LPCWSTR
a
,
LPCWSTR
b
,
int
c
);
int
CompareOrdinal
(
LPCWSTR
ordinal
,
LPCWSTR
resstr
,
int
resid
)
{
return
!
resstr
&&
(
resid
==
LOWORD
(
ordinal
));
}
int
CompareName
(
LPCWSTR
name
,
LPCWSTR
resstr
,
int
resid
)
{
return
resstr
&&
!
CRTDLL__wcsnicmp
(
resstr
+
1
,
name
,
*
(
resstr
));
}
HRSRC
LIBRES_FindResource
(
HINSTANCE
hModule
,
LPCWSTR
name
,
LPCWSTR
type
)
{
int
nameid
=
0
,
typeid
;
LPCWSTR
nameid
=
name
,
typeid
=
type
;
ResListE
*
ResBlock
;
const
wrc_resource32_t
*
const
*
Res
;
CmpFunc_t
EqualNames
=
CompareOrdinal
;
CmpFunc_t
EqualTypes
=
CompareOrdinal
;
if
(
HIWORD
(
name
))
{
if
(
*
name
==
'#'
)
{
LPSTR
nameA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
name
);
nameid
=
atoi
(
nameA
+
1
);
nameid
=
(
LPCWSTR
)
atoi
(
nameA
+
1
);
HeapFree
(
GetProcessHeap
(),
0
,
nameA
);
name
=
NULL
;
}
}
else
{
nameid
=
LOWORD
(
name
);
name
=
NULL
;
EqualNames
=
CompareName
;
}
if
(
HIWORD
(
type
))
{
if
(
*
type
==
'#'
)
{
LPSTR
typeA
=
HEAP_strdupWtoA
(
GetProcessHeap
(),
0
,
type
);
typeid
=
atoi
(
typeA
+
1
);
typeid
=
(
LPCWSTR
)
atoi
(
typeA
+
1
);
HeapFree
(
GetProcessHeap
(),
0
,
typeA
);
}
else
{
TRACE
(
"(*,*,type=string): Returning 0
\n
"
);
return
0
;
}
EqualTypes
=
CompareName
;
}
else
typeid
=
LOWORD
(
type
);
/* FIXME: types can be strings */
for
(
ResBlock
=
ResourceList
;
ResBlock
;
ResBlock
=
ResBlock
->
next
)
for
(
Res
=
ResBlock
->
Resources
;
*
Res
;
Res
++
)
if
(
name
)
{
if
((
*
Res
)
->
restype
==
typeid
&&
!
CRTDLL__wcsnicmp
((
LPCWSTR
)((
*
Res
)
->
resname
+
1
),
name
,
*
((
*
Res
)
->
resname
)))
return
(
HRSRC
)
*
Res
;
}
else
if
((
*
Res
)
->
restype
==
typeid
&&
(
*
Res
)
->
resid
==
nameid
)
if
(
EqualNames
(
nameid
,
(
*
Res
)
->
resname
,
(
*
Res
)
->
resid
)
&&
EqualTypes
(
typeid
,
(
*
Res
)
->
restypename
,
(
*
Res
)
->
restype
))
return
(
HRSRC
)
*
Res
;
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment