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
709cce63
Commit
709cce63
authored
Jun 17, 2018
by
Zebediah Figura
Committed by
Alexandre Julliard
Jun 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hnetcfg/tests: Fix BSTR usage in test_NetFwAuthorizedApplication().
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1281a687
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
29 deletions
+23
-29
policy.c
dlls/hnetcfg/tests/policy.c
+23
-29
No files found.
dlls/hnetcfg/tests/policy.c
View file @
709cce63
...
...
@@ -105,48 +105,42 @@ static void test_interfaces(void)
static
void
test_NetFwAuthorizedApplication
(
void
)
{
INetFwAuthorizedApplication
*
app
;
static
WCHAR
empty
[]
=
{
0
};
WCHAR
image
[
MAX_PATH
];
HRESULT
hr
;
BSTR
bstr
;
hr
=
CoCreateInstance
(
&
CLSID_NetFwAuthorizedApplication
,
NULL
,
CLSCTX_INPROC_SERVER
|
CLSCTX_INPROC_HANDLER
,
&
IID_INetFwAuthorizedApplication
,
(
void
**
)
&
app
);
ok
(
hr
==
S_OK
,
"got: %08x
\n
"
,
hr
);
if
(
hr
==
S_OK
)
{
BSTR
image
=
SysAllocStringLen
(
NULL
,
MAX_PATH
);
static
WCHAR
empty
[]
=
{
0
};
BSTR
bstr
;
if
(
!
GetModuleFileNameW
(
NULL
,
image
,
MAX_PATH
))
{
ok
(
0
,
"Failed to get filename
\n
"
);
SysFreeString
(
image
);
return
;
}
hr
=
GetModuleFileNameW
(
NULL
,
image
,
sizeof
(
image
));
ok
(
hr
,
"GetModuleFileName failed: %u
\n
"
,
GetLastError
());
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
NULL
);
ok
(
hr
==
E_POINTER
,
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
&
bstr
);
ok
(
hr
==
S_OK
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_NOT_ENOUGH_MEMORY
),
"got: %08x
\n
"
,
hr
);
ok
(
!
bstr
,
"got: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
&
bstr
);
ok
(
hr
==
S_OK
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_NOT_ENOUGH_MEMORY
),
"got: %08x
\n
"
,
hr
);
ok
(
!
bstr
,
"got: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
NULL
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
NULL
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
empty
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
empty
);
ok
(
hr
==
E_INVALIDARG
||
hr
==
HRESULT_FROM_WIN32
(
ERROR_PATH_NOT_FOUND
),
"got: %08x
\n
"
,
hr
);
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
image
);
ok
(
hr
==
S_OK
,
"got: %08x
\n
"
,
hr
);
bstr
=
SysAllocString
(
image
);
hr
=
INetFwAuthorizedApplication_put_ProcessImageFileName
(
app
,
bstr
);
ok
(
hr
==
S_OK
,
"got: %08x
\n
"
,
hr
);
SysFreeString
(
bstr
);
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got: %08x
\n
"
,
hr
);
ok
(
!
lstrcmpiW
(
bstr
,
image
),
"got: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
hr
=
INetFwAuthorizedApplication_get_ProcessImageFileName
(
app
,
&
bstr
);
ok
(
hr
==
S_OK
,
"got: %08x
\n
"
,
hr
);
ok
(
!
lstrcmpiW
(
bstr
,
image
),
"got: %s
\n
"
,
wine_dbgstr_w
(
bstr
));
SysFreeString
(
bstr
);
SysFreeString
(
image
);
INetFwAuthorizedApplication_Release
(
app
);
}
INetFwAuthorizedApplication_Release
(
app
);
}
START_TEST
(
policy
)
...
...
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