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
bcd6e9f3
Commit
bcd6e9f3
authored
May 25, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
May 25, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Fix implementation of ReleaseBindInfo.
parent
27b5c54f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
2 deletions
+59
-2
misc.c
dlls/urlmon/tests/misc.c
+46
-0
urlmon_main.c
dlls/urlmon/urlmon_main.c
+13
-2
No files found.
dlls/urlmon/tests/misc.c
View file @
bcd6e9f3
...
...
@@ -58,6 +58,7 @@ DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xA
DEFINE_EXPECT
(
ParseUrl
);
DEFINE_EXPECT
(
QI_IInternetProtocolInfo
);
DEFINE_EXPECT
(
CreateInstance
);
DEFINE_EXPECT
(
unk_Release
);
static
void
test_CreateFormatEnum
(
void
)
{
...
...
@@ -829,6 +830,50 @@ static void test_NameSpace(void)
IInternetSession_Release
(
session
);
}
static
ULONG
WINAPI
unk_Release
(
IUnknown
*
iface
)
{
CHECK_EXPECT
(
unk_Release
);
return
0
;
}
static
const
IUnknownVtbl
unk_vtbl
=
{
(
void
*
)
0xdeadbeef
,
(
void
*
)
0xdeadbeef
,
unk_Release
};
static
void
test_ReleaseBindInfo
(
void
)
{
BINDINFO
bi
;
IUnknown
unk
=
{
&
unk_vtbl
};
ReleaseBindInfo
(
NULL
);
/* shouldn't crash */
memset
(
&
bi
,
0
,
sizeof
(
bi
));
bi
.
cbSize
=
sizeof
(
BINDINFO
);
bi
.
pUnk
=
&
unk
;
SET_EXPECT
(
unk_Release
);
ReleaseBindInfo
(
&
bi
);
ok
(
bi
.
cbSize
==
sizeof
(
BINDINFO
),
"bi.cbSize=%ld, expected %d
\n
"
,
bi
.
cbSize
,
sizeof
(
bi
));
ok
(
bi
.
pUnk
==
NULL
,
"bi.pUnk=%p, expected NULL
\n
"
,
bi
.
pUnk
);
CHECK_CALLED
(
unk_Release
);
memset
(
&
bi
,
0
,
sizeof
(
bi
));
bi
.
cbSize
=
offsetof
(
BINDINFO
,
pUnk
);
bi
.
pUnk
=
&
unk
;
ReleaseBindInfo
(
&
bi
);
ok
(
bi
.
cbSize
==
offsetof
(
BINDINFO
,
pUnk
),
"bi.cbSize=%ld, expected %d
\n
"
,
bi
.
cbSize
,
sizeof
(
bi
));
ok
(
bi
.
pUnk
==
&
unk
,
"bi.pUnk=%p, expected %p
\n
"
,
bi
.
pUnk
,
&
unk
);
memset
(
&
bi
,
0
,
sizeof
(
bi
));
bi
.
pUnk
=
&
unk
;
ReleaseBindInfo
(
&
bi
);
ok
(
!
bi
.
cbSize
,
"bi.cbSize=%ld, expected 0
\n
"
,
bi
.
cbSize
);
ok
(
bi
.
pUnk
==
&
unk
,
"bi.pUnk=%p, expected %p
\n
"
,
bi
.
pUnk
,
&
unk
);
}
START_TEST
(
misc
)
{
OleInitialize
(
NULL
);
...
...
@@ -842,6 +887,7 @@ START_TEST(misc)
test_SecurityManager
();
test_ZoneManager
();
test_NameSpace
();
test_ReleaseBindInfo
();
OleUninitialize
();
}
dlls/urlmon/urlmon_main.c
View file @
bcd6e9f3
...
...
@@ -35,6 +35,7 @@
#include "winuser.h"
#include "urlmon.h"
#include "urlmon_main.h"
#include "ole2.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
...
...
@@ -370,15 +371,25 @@ HRESULT WINAPI CoGetClassObjectFromURL( REFCLSID rclsid, LPCWSTR szCodeURL, DWOR
*/
void
WINAPI
ReleaseBindInfo
(
BINDINFO
*
pbindinfo
)
{
DWORD
size
;
TRACE
(
"(%p)
\n
"
,
pbindinfo
);
if
(
!
pbindinfo
)
if
(
!
pbindinfo
||
!
(
size
=
pbindinfo
->
cbSize
)
)
return
;
CoTaskMemFree
(
pbindinfo
->
szExtraInfo
);
ReleaseStgMedium
(
&
pbindinfo
->
stgmedData
);
if
(
offsetof
(
BINDINFO
,
szExtraInfo
)
<
size
)
CoTaskMemFree
(
pbindinfo
->
szCustomVerb
);
if
(
pbindinfo
->
pUnk
)
if
(
pbindinfo
->
pUnk
&&
offsetof
(
BINDINFO
,
pUnk
)
<
size
)
IUnknown_Release
(
pbindinfo
->
pUnk
);
memset
(
pbindinfo
,
0
,
size
);
pbindinfo
->
cbSize
=
size
;
}
/***********************************************************************
...
...
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