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
74138a02
Commit
74138a02
authored
Sep 03, 2005
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 03, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added RegisterFormatEnumerator and RevokeFormatEnumerator
implementation.
parent
3bf9c165
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
2 deletions
+107
-2
format.c
dlls/urlmon/format.c
+31
-0
misc.c
dlls/urlmon/tests/misc.c
+74
-0
urlmon.spec
dlls/urlmon/urlmon.spec
+2
-2
No files found.
dlls/urlmon/format.c
View file @
74138a02
...
...
@@ -31,6 +31,8 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
urlmon
);
static
WCHAR
wszEnumFORMATETC
[]
=
{
'_'
,
'E'
,
'n'
,
'u'
,
'm'
,
'F'
,
'O'
,
'R'
,
'M'
,
'A'
,
'T'
,
'E'
,
'T'
,
'C'
,
'_'
,
0
};
typedef
struct
{
const
IEnumFORMATETCVtbl
*
lpEnumFORMATETCVtbl
;
...
...
@@ -189,3 +191,32 @@ HRESULT WINAPI CreateFormatEnumerator(UINT cfmtetc, FORMATETC *rgfmtetc,
*
ppenumfmtetc
=
EnumFORMATETC_Create
(
cfmtetc
,
rgfmtetc
,
0
);
return
S_OK
;
}
/**********************************************************
* RegisterFormatEnumerator (urlmon.@)
*/
HRESULT
WINAPI
RegisterFormatEnumerator
(
LPBC
pBC
,
IEnumFORMATETC
*
pEFetc
,
DWORD
reserved
)
{
TRACE
(
"(%p %p %ld)
\n
"
,
pBC
,
pEFetc
,
reserved
);
if
(
reserved
)
WARN
(
"reserved != 0
\n
"
);
if
(
!
pBC
||
!
pEFetc
)
return
E_INVALIDARG
;
return
IBindCtx_RegisterObjectParam
(
pBC
,
wszEnumFORMATETC
,
(
IUnknown
*
)
pEFetc
);
}
/**********************************************************
* RevokeFormatEnumerator (urlmon.@)
*/
HRESULT
WINAPI
RevokeFormatEnumerator
(
LPBC
pbc
,
IEnumFORMATETC
*
pEFetc
)
{
TRACE
(
"(%p %p)
\n
"
,
pbc
,
pEFetc
);
if
(
!
pbc
)
return
E_INVALIDARG
;
return
IBindCtx_RevokeObjectParam
(
pbc
,
wszEnumFORMATETC
);
}
dlls/urlmon/tests/misc.c
View file @
74138a02
...
...
@@ -129,7 +129,81 @@ static void test_CreateFormatEnum(void)
IEnumFORMATETC_Release
(
fenum
);
}
static
void
test_RegisterFormatEnumerator
(
void
)
{
IBindCtx
*
bctx
=
NULL
;
IEnumFORMATETC
*
format
=
NULL
,
*
format2
=
NULL
;
IUnknown
*
unk
=
NULL
;
HRESULT
hres
;
static
FORMATETC
formatetc
=
{
0
,
NULL
,
0
,
0
,
0
};
static
WCHAR
wszEnumFORMATETC
[]
=
{
'_'
,
'E'
,
'n'
,
'u'
,
'm'
,
'F'
,
'O'
,
'R'
,
'M'
,
'A'
,
'T'
,
'E'
,
'T'
,
'C'
,
'_'
,
0
};
CreateBindCtx
(
0
,
&
bctx
);
hres
=
CreateFormatEnumerator
(
1
,
&
formatetc
,
&
format
);
ok
(
hres
==
S_OK
,
"CreateFormatEnumerator failed: %08lx
\n
"
,
hres
);
if
(
FAILED
(
hres
))
return
;
hres
=
RegisterFormatEnumerator
(
NULL
,
format
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"RegisterFormatEnumerator failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
RegisterFormatEnumerator
(
bctx
,
NULL
,
0
);
ok
(
hres
==
E_INVALIDARG
,
"RegisterFormatEnumerator failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
RegisterFormatEnumerator
(
bctx
,
format
,
0
);
ok
(
hres
==
S_OK
,
"RegisterFormatEnumerator failed: %08lx
\n
"
,
hres
);
hres
=
IBindCtx_GetObjectParam
(
bctx
,
wszEnumFORMATETC
,
&
unk
);
ok
(
hres
==
S_OK
,
"GetObjectParam failed: %08lx
\n
"
,
hres
);
ok
(
unk
==
(
IUnknown
*
)
format
,
"unk != format
\n
"
);
hres
=
RevokeFormatEnumerator
(
NULL
,
format
);
ok
(
hres
==
E_INVALIDARG
,
"RevokeFormatEnumerator failed: %08lx, expected E_INVALIDARG
\n
"
,
hres
);
hres
=
RevokeFormatEnumerator
(
bctx
,
format
);
ok
(
hres
==
S_OK
,
"RevokeFormatEnumerator failed: %08lx
\n
"
,
hres
);
hres
=
RevokeFormatEnumerator
(
bctx
,
format
);
ok
(
hres
==
E_FAIL
,
"RevokeFormatEnumerator failed: %08lx, expected E_FAIL
\n
"
,
hres
);
hres
=
IBindCtx_GetObjectParam
(
bctx
,
wszEnumFORMATETC
,
&
unk
);
ok
(
hres
==
E_FAIL
,
"GetObjectParam failed: %08lx, expected E_FAIL
\n
"
,
hres
);
hres
=
RegisterFormatEnumerator
(
bctx
,
format
,
0
);
ok
(
hres
==
S_OK
,
"RegisterFormatEnumerator failed: %08lx
\n
"
,
hres
);
hres
=
CreateFormatEnumerator
(
1
,
&
formatetc
,
&
format2
);
ok
(
hres
==
S_OK
,
"CreateFormatEnumerator failed: %08lx
\n
"
,
hres
);
if
(
SUCCEEDED
(
hres
))
{
hres
=
RevokeFormatEnumerator
(
bctx
,
format
);
ok
(
hres
==
S_OK
,
"RevokeFormatEnumerator failed: %08lx
\n
"
,
hres
);
IEnumFORMATETC_Release
(
format2
);
}
hres
=
IBindCtx_GetObjectParam
(
bctx
,
wszEnumFORMATETC
,
&
unk
);
ok
(
hres
==
E_FAIL
,
"GetObjectParam failed: %08lx, expected E_FAIL
\n
"
,
hres
);
IEnumFORMATETC_Release
(
format
);
hres
=
RegisterFormatEnumerator
(
bctx
,
format
,
0
);
ok
(
hres
==
S_OK
,
"RegisterFormatEnumerator failed: %08lx
\n
"
,
hres
);
hres
=
RevokeFormatEnumerator
(
bctx
,
NULL
);
ok
(
hres
==
S_OK
,
"RevokeFormatEnumerator failed: %08lx
\n
"
,
hres
);
hres
=
IBindCtx_GetObjectParam
(
bctx
,
wszEnumFORMATETC
,
&
unk
);
ok
(
hres
==
E_FAIL
,
"GetObjectParam failed: %08lx, expected E_FAIL
\n
"
,
hres
);
IBindCtx_Release
(
bctx
);
}
START_TEST
(
misc
)
{
test_CreateFormatEnum
();
test_RegisterFormatEnumerator
();
}
dlls/urlmon/urlmon.spec
View file @
74138a02
...
...
@@ -56,12 +56,12 @@
@ stdcall ObtainUserAgentString(long str ptr)
@ stub PrivateCoInstall
@ stdcall RegisterBindStatusCallback(ptr ptr ptr long)
@ st
ub RegisterFormatEnumerator
@ st
dcall RegisterFormatEnumerator(ptr ptr long)
@ stub RegisterMediaTypeClass
@ stub RegisterMediaTypes
@ stdcall ReleaseBindInfo(ptr)
@ stdcall RevokeBindStatusCallback(ptr ptr)
@ st
ub RevokeFormatEnumerator
@ st
dcall RevokeFormatEnumerator(ptr ptr)
@ stub SetSoftwareUpdateAdvertisementState
@ stub URLDownloadA
@ stub URLDownloadToCacheFileA
...
...
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