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
e446351d
Commit
e446351d
authored
Dec 18, 2007
by
Huw Davies
Committed by
Alexandre Julliard
Dec 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Implement IMimeBody_GetParameters.
parent
1cb7df8a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
82 additions
and
2 deletions
+82
-2
mimeole.c
dlls/inetcomm/mimeole.c
+55
-2
mimeole.c
dlls/inetcomm/tests/mimeole.c
+27
-0
No files found.
dlls/inetcomm/mimeole.c
View file @
e446351d
...
...
@@ -444,6 +444,24 @@ static void release_data(REFIID riid, void *data)
FIXME
(
"Unhandled data format %s
\n
"
,
debugstr_guid
(
riid
));
}
static
HRESULT
find_prop
(
MimeBody
*
body
,
const
char
*
name
,
header_t
**
prop
)
{
header_t
*
header
;
*
prop
=
NULL
;
LIST_FOR_EACH_ENTRY
(
header
,
&
body
->
headers
,
header_t
,
entry
)
{
if
(
!
strcasecmp
(
name
,
header
->
prop
->
name
))
{
*
prop
=
header
;
return
S_OK
;
}
}
return
MIME_E_NOT_FOUND
;
}
static
HRESULT
WINAPI
MimeBody_QueryInterface
(
IMimeBody
*
iface
,
REFIID
riid
,
void
**
ppvObject
)
...
...
@@ -670,8 +688,43 @@ static HRESULT WINAPI MimeBody_GetParameters(
ULONG
*
pcParams
,
LPMIMEPARAMINFO
*
pprgParam
)
{
FIXME
(
"stub
\n
"
);
return
E_NOTIMPL
;
MimeBody
*
This
=
impl_from_IMimeBody
(
iface
);
HRESULT
hr
;
header_t
*
header
;
TRACE
(
"(%p)->(%s, %p, %p)
\n
"
,
iface
,
debugstr_a
(
pszName
),
pcParams
,
pprgParam
);
*
pprgParam
=
NULL
;
*
pcParams
=
0
;
hr
=
find_prop
(
This
,
pszName
,
&
header
);
if
(
hr
!=
S_OK
)
return
hr
;
*
pcParams
=
list_count
(
&
header
->
params
);
if
(
*
pcParams
)
{
IMimeAllocator
*
alloc
;
param_t
*
param
;
MIMEPARAMINFO
*
info
;
MimeOleGetAllocator
(
&
alloc
);
*
pprgParam
=
info
=
IMimeAllocator_Alloc
(
alloc
,
*
pcParams
*
sizeof
(
**
pprgParam
));
LIST_FOR_EACH_ENTRY
(
param
,
&
header
->
params
,
param_t
,
entry
)
{
int
len
;
len
=
strlen
(
param
->
name
)
+
1
;
info
->
pszName
=
IMimeAllocator_Alloc
(
alloc
,
len
);
memcpy
(
info
->
pszName
,
param
->
name
,
len
);
len
=
strlen
(
param
->
value
)
+
1
;
info
->
pszData
=
IMimeAllocator_Alloc
(
alloc
,
len
);
memcpy
(
info
->
pszData
,
param
->
value
,
len
);
info
++
;
}
IMimeAllocator_Release
(
alloc
);
}
return
S_OK
;
}
static
HRESULT
WINAPI
MimeBody_IsContentType
(
...
...
dlls/inetcomm/tests/mimeole.c
View file @
e446351d
...
...
@@ -90,6 +90,9 @@ static void test_CreateBody(void)
LARGE_INTEGER
off
;
ULARGE_INTEGER
pos
;
ENCODINGTYPE
enc
;
ULONG
count
;
MIMEPARAMINFO
*
param_info
;
IMimeAllocator
*
alloc
;
hr
=
CoCreateInstance
(
&
CLSID_IMimeBody
,
NULL
,
CLSCTX_INPROC_SERVER
,
&
IID_IMimeBody
,
(
void
**
)
&
body
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
...
...
@@ -134,6 +137,30 @@ static void test_CreateBody(void)
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
enc
==
IET_8BIT
,
"encoding %d
\n
"
,
enc
);
hr
=
MimeOleGetAllocator
(
&
alloc
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeBody_GetParameters
(
body
,
"nothere"
,
&
count
,
&
param_info
);
ok
(
hr
==
MIME_E_NOT_FOUND
,
"ret %08x
\n
"
,
hr
);
ok
(
count
==
0
,
"got %d
\n
"
,
count
);
ok
(
!
param_info
,
"got %p
\n
"
,
param_info
);
hr
=
IMimeBody_GetParameters
(
body
,
"bar"
,
&
count
,
&
param_info
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
count
==
0
,
"got %d
\n
"
,
count
);
ok
(
!
param_info
,
"got %p
\n
"
,
param_info
);
hr
=
IMimeBody_GetParameters
(
body
,
"Content-Type"
,
&
count
,
&
param_info
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
todo_wine
/* native adds a charset parameter */
ok
(
count
==
3
,
"got %d
\n
"
,
count
);
ok
(
param_info
!=
NULL
,
"got %p
\n
"
,
param_info
);
hr
=
IMimeAllocator_FreeParamInfoArray
(
alloc
,
count
,
param_info
,
TRUE
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
IMimeAllocator_Release
(
alloc
);
IStream_Release
(
in
);
IMimeBody_Release
(
body
);
}
...
...
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