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
2799c95d
Commit
2799c95d
authored
Mar 25, 2024
by
Paul Gofman
Committed by
Alexandre Julliard
Mar 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintypes: Report some API contracts as present in…
wintypes: Report some API contracts as present in api_information_statics_IsApiContractPresentByMajor().
parent
ce2ae79f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
2 deletions
+49
-2
main.c
dlls/wintypes/main.c
+23
-2
wintypes.c
dlls/wintypes/tests/wintypes.c
+26
-0
No files found.
dlls/wintypes/main.c
View file @
2799c95d
...
...
@@ -34,6 +34,27 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
wintypes
);
static
const
struct
{
const
WCHAR
*
name
;
unsigned
int
max_major
;
}
present_contracts
[]
=
{
{
L"Windows.Foundation.UniversalApiContract"
,
10
,
},
};
static
BOOLEAN
is_api_contract_present
(
const
HSTRING
hname
,
unsigned
int
version
)
{
const
WCHAR
*
name
=
WindowsGetStringRawBuffer
(
hname
,
NULL
);
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
present_contracts
);
++
i
)
if
(
!
wcsicmp
(
name
,
present_contracts
[
i
].
name
))
return
version
<=
present_contracts
[
i
].
max_major
;
return
FALSE
;
}
struct
wintypes
{
IActivationFactory
IActivationFactory_iface
;
...
...
@@ -280,13 +301,13 @@ static HRESULT STDMETHODCALLTYPE api_information_statics_IsEnumNamedValuePresent
static
HRESULT
STDMETHODCALLTYPE
api_information_statics_IsApiContractPresentByMajor
(
IApiInformationStatics
*
iface
,
HSTRING
contract_name
,
UINT16
major_version
,
BOOLEAN
*
value
)
{
FIXME
(
"iface %p, contract_name %s, major_version %u, value %p s
tub!
\n
"
,
iface
,
FIXME
(
"iface %p, contract_name %s, major_version %u, value %p s
emi-stub.
\n
"
,
iface
,
debugstr_hstring
(
contract_name
),
major_version
,
value
);
if
(
!
contract_name
)
return
E_INVALIDARG
;
*
value
=
FALSE
;
*
value
=
is_api_contract_present
(
contract_name
,
major_version
)
;
return
S_OK
;
}
...
...
dlls/wintypes/tests/wintypes.c
View file @
2799c95d
...
...
@@ -33,12 +33,23 @@
static
void
test_IApiInformationStatics
(
void
)
{
static
const
struct
{
const
WCHAR
*
name
;
unsigned
int
max_major
;
}
present_contracts
[]
=
{
{
L"Windows.Foundation.UniversalApiContract"
,
10
,
},
};
static
const
WCHAR
*
class_name
=
L"Windows.Foundation.Metadata.ApiInformation"
;
IAgileObject
*
agile_object
=
NULL
,
*
tmp_agile_object
=
NULL
;
IInspectable
*
inspectable
=
NULL
,
*
tmp_inspectable
=
NULL
;
IApiInformationStatics
*
statics
=
NULL
;
IActivationFactory
*
factory
=
NULL
;
HSTRING
str
,
str2
;
unsigned
int
i
,
j
;
BOOLEAN
ret
;
HRESULT
hr
;
...
...
@@ -424,6 +435,21 @@ static void test_IApiInformationStatics(void)
WindowsDeleteString
(
str
);
/* Test API contracts presence. */
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
present_contracts
);
++
i
)
{
hr
=
WindowsCreateString
(
present_contracts
[
i
].
name
,
wcslen
(
present_contracts
[
i
].
name
),
&
str
);
ok
(
hr
==
S_OK
,
"WindowsCreateString failed, hr %#lx.
\n
"
,
hr
);
for
(
j
=
0
;
j
<=
present_contracts
[
i
].
max_major
;
++
j
)
{
ret
=
FALSE
;
hr
=
IApiInformationStatics_IsApiContractPresentByMajor
(
statics
,
str
,
i
,
&
ret
);
ok
(
hr
==
S_OK
,
"IsApiContractPresentByMajor failed, hr %#lx, i %u, major %u.
\n
"
,
hr
,
i
,
j
);
ok
(
ret
==
TRUE
,
"IsApiContractPresentByMajor returned FALSE, i %u, major %u.
\n
"
,
i
,
j
);
}
WindowsDeleteString
(
str
);
}
IApiInformationStatics_Release
(
statics
);
IAgileObject_Release
(
agile_object
);
IInspectable_Release
(
inspectable
);
...
...
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