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
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
Gabriel Ivăncescu
wine
Commits
62bd7578
Commit
62bd7578
authored
2 years ago
by
Mohamad Al-Jaf
Committed by
Alexandre Julliard
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cryptowinrt/tests: Add ICryptographicBufferStatics interface test.
parent
80dc6df8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure
+1
-0
1 addition, 0 deletions
configure
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
dlls/cryptowinrt/tests/Makefile.in
+5
-0
5 additions, 0 deletions
dlls/cryptowinrt/tests/Makefile.in
dlls/cryptowinrt/tests/crypto.c
+94
-0
94 additions, 0 deletions
dlls/cryptowinrt/tests/crypto.c
with
101 additions
and
0 deletions
configure
+
1
−
0
View file @
62bd7578
...
...
@@ -21110,6 +21110,7 @@ wine_fn_config_makefile dlls/cryptext enable_cryptext
wine_fn_config_makefile dlls/cryptnet enable_cryptnet
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
wine_fn_config_makefile dlls/cryptowinrt enable_cryptowinrt
wine_fn_config_makefile dlls/cryptowinrt/tests enable_tests
wine_fn_config_makefile dlls/cryptsp enable_cryptsp
wine_fn_config_makefile dlls/cryptui enable_cryptui
wine_fn_config_makefile dlls/cryptui/tests enable_tests
...
...
This diff is collapsed.
Click to expand it.
configure.ac
+
1
−
0
View file @
62bd7578
...
...
@@ -2423,6 +2423,7 @@ WINE_CONFIG_MAKEFILE(dlls/cryptext)
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt)
WINE_CONFIG_MAKEFILE(dlls/cryptowinrt/tests)
WINE_CONFIG_MAKEFILE(dlls/cryptsp)
WINE_CONFIG_MAKEFILE(dlls/cryptui)
WINE_CONFIG_MAKEFILE(dlls/cryptui/tests)
...
...
This diff is collapsed.
Click to expand it.
dlls/cryptowinrt/tests/Makefile.in
0 → 100644
+
5
−
0
View file @
62bd7578
TESTDLL
=
cryptowinrt.dll
IMPORTS
=
combase
C_SRCS
=
\
crypto.c
This diff is collapsed.
Click to expand it.
dlls/cryptowinrt/tests/crypto.c
0 → 100644
+
94
−
0
View file @
62bd7578
/*
* Copyright (C) 2022 Mohamad Al-Jaf
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include
"initguid.h"
#include
<stdarg.h>
#include
"windef.h"
#include
"winbase.h"
#include
"winstring.h"
#include
"roapi.h"
#define WIDL_using_Windows_Foundation
#define WIDL_using_Windows_Foundation_Collections
#include
"windows.foundation.h"
#define WIDL_using_Windows_Storage_Streams
#include
"windows.storage.streams.h"
#define WIDL_using_Windows_Security_Cryptography
#include
"windows.security.cryptography.h"
#include
"wine/test.h"
#define check_interface( obj, iid ) check_interface_( __LINE__, obj, iid )
static
void
check_interface_
(
unsigned
int
line
,
void
*
obj
,
const
IID
*
iid
)
{
IUnknown
*
iface
=
obj
;
IUnknown
*
unk
;
HRESULT
hr
;
hr
=
IUnknown_QueryInterface
(
iface
,
iid
,
(
void
**
)
&
unk
);
ok_
(
__FILE__
,
line
)(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
IUnknown_Release
(
unk
);
}
static
void
test_CryptobufferStatics
(
void
)
{
static
const
WCHAR
*
cryptobuffer_statics_name
=
L"Windows.Security.Cryptography.CryptographicBuffer"
;
ICryptographicBufferStatics
*
cryptobuffer_statics
;
IActivationFactory
*
factory
;
HSTRING
str
;
HRESULT
hr
;
LONG
ref
;
hr
=
WindowsCreateString
(
cryptobuffer_statics_name
,
wcslen
(
cryptobuffer_statics_name
),
&
str
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
hr
=
RoGetActivationFactory
(
str
,
&
IID_IActivationFactory
,
(
void
**
)
&
factory
);
WindowsDeleteString
(
str
);
ok
(
hr
==
S_OK
||
broken
(
hr
==
REGDB_E_CLASSNOTREG
),
"got hr %#lx.
\n
"
,
hr
);
if
(
hr
==
REGDB_E_CLASSNOTREG
)
{
win_skip
(
"%s runtimeclass not registered, skipping tests.
\n
"
,
wine_dbgstr_w
(
cryptobuffer_statics_name
)
);
return
;
}
check_interface
(
factory
,
&
IID_IUnknown
);
check_interface
(
factory
,
&
IID_IInspectable
);
check_interface
(
factory
,
&
IID_IAgileObject
);
hr
=
IActivationFactory_QueryInterface
(
factory
,
&
IID_ICryptographicBufferStatics
,
(
void
**
)
&
cryptobuffer_statics
);
ok
(
hr
==
S_OK
,
"got hr %#lx.
\n
"
,
hr
);
ref
=
ICryptographicBufferStatics_Release
(
cryptobuffer_statics
);
ok
(
ref
==
2
,
"got ref %ld.
\n
"
,
ref
);
ref
=
IActivationFactory_Release
(
factory
);
ok
(
ref
==
1
,
"got ref %ld.
\n
"
,
ref
);
}
START_TEST
(
crypto
)
{
HRESULT
hr
;
hr
=
RoInitialize
(
RO_INIT_MULTITHREADED
);
ok
(
hr
==
S_OK
,
"RoInitialize failed, hr %#lx
\n
"
,
hr
);
test_CryptobufferStatics
();
RoUninitialize
();
}
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