Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e15ff2ef
Commit
e15ff2ef
authored
Feb 12, 2008
by
Huw Davies
Committed by
Alexandre Julliard
Feb 13, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inetcomm: Implement IMimeMessage_GetBody.
parent
db4881cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
2 deletions
+103
-2
mimeole.c
dlls/inetcomm/mimeole.c
+76
-2
mimeole.c
dlls/inetcomm/tests/mimeole.c
+27
-0
No files found.
dlls/inetcomm/mimeole.c
View file @
e15ff2ef
...
...
@@ -1777,6 +1777,71 @@ static HRESULT WINAPI MimeMessage_SaveBody(
return
E_NOTIMPL
;
}
static
HRESULT
get_body
(
MimeMessage
*
msg
,
BODYLOCATION
location
,
HBODY
pivot
,
body_t
**
out
)
{
body_t
*
root
=
LIST_ENTRY
(
list_head
(
&
msg
->
body_tree
),
body_t
,
entry
);
body_t
*
body
;
HRESULT
hr
;
struct
list
*
list
;
if
(
location
==
IBL_ROOT
)
{
*
out
=
root
;
return
S_OK
;
}
hr
=
find_body
(
&
msg
->
body_tree
,
pivot
,
&
body
);
if
(
hr
==
S_OK
)
{
switch
(
location
)
{
case
IBL_PARENT
:
*
out
=
body
->
parent
;
break
;
case
IBL_FIRST
:
list
=
list_head
(
&
body
->
children
);
if
(
list
)
*
out
=
LIST_ENTRY
(
list
,
body_t
,
entry
);
else
hr
=
MIME_E_NOT_FOUND
;
break
;
case
IBL_LAST
:
list
=
list_tail
(
&
body
->
children
);
if
(
list
)
*
out
=
LIST_ENTRY
(
list
,
body_t
,
entry
);
else
hr
=
MIME_E_NOT_FOUND
;
break
;
case
IBL_NEXT
:
list
=
list_next
(
&
body
->
parent
->
children
,
&
body
->
entry
);
if
(
list
)
*
out
=
LIST_ENTRY
(
list
,
body_t
,
entry
);
else
hr
=
MIME_E_NOT_FOUND
;
break
;
case
IBL_PREVIOUS
:
list
=
list_prev
(
&
body
->
parent
->
children
,
&
body
->
entry
);
if
(
list
)
*
out
=
LIST_ENTRY
(
list
,
body_t
,
entry
);
else
hr
=
MIME_E_NOT_FOUND
;
break
;
default:
hr
=
E_FAIL
;
break
;
}
}
return
hr
;
}
static
HRESULT
WINAPI
MimeMessage_InsertBody
(
IMimeMessage
*
iface
,
BODYLOCATION
location
,
...
...
@@ -1793,8 +1858,17 @@ static HRESULT WINAPI MimeMessage_GetBody(
HBODY
hPivot
,
LPHBODY
phBody
)
{
FIXME
(
"(%p)->(%d, %p, %p)
\n
"
,
iface
,
location
,
hPivot
,
phBody
);
return
E_NOTIMPL
;
MimeMessage
*
This
=
(
MimeMessage
*
)
iface
;
body_t
*
body
;
HRESULT
hr
;
TRACE
(
"(%p)->(%d, %p, %p)
\n
"
,
iface
,
location
,
hPivot
,
phBody
);
hr
=
get_body
(
This
,
location
,
hPivot
,
&
body
);
if
(
hr
==
S_OK
)
*
phBody
=
body
->
hbody
;
return
hr
;
}
static
HRESULT
WINAPI
MimeMessage_DeleteBody
(
...
...
dlls/inetcomm/tests/mimeole.c
View file @
e15ff2ef
...
...
@@ -209,6 +209,7 @@ static void test_CreateMessage(void)
IStream
*
stream
;
LARGE_INTEGER
pos
;
LONG
ref
;
HBODY
hbody
;
IMimeBody
*
body
;
BODYOFFSETS
offsets
;
...
...
@@ -233,6 +234,32 @@ static void test_CreateMessage(void)
ok
(
offsets
.
cbBodyEnd
==
666
,
"got %d
\n
"
,
offsets
.
cbBodyEnd
);
IMimeBody_Release
(
body
);
hr
=
IMimeMessage_GetBody
(
msg
,
IBL_ROOT
,
NULL
,
&
hbody
);
hr
=
IMimeMessage_GetBody
(
msg
,
IBL_FIRST
,
hbody
,
&
hbody
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeMessage_BindToObject
(
msg
,
hbody
,
&
IID_IMimeBody
,
(
void
**
)
&
body
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeBody_GetOffsets
(
body
,
&
offsets
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
offsets
.
cbBoundaryStart
==
405
,
"got %d
\n
"
,
offsets
.
cbBoundaryStart
);
ok
(
offsets
.
cbHeaderStart
==
428
,
"got %d
\n
"
,
offsets
.
cbHeaderStart
);
ok
(
offsets
.
cbBodyStart
==
518
,
"got %d
\n
"
,
offsets
.
cbBodyStart
);
ok
(
offsets
.
cbBodyEnd
==
523
,
"got %d
\n
"
,
offsets
.
cbBodyEnd
);
IMimeBody_Release
(
body
);
hr
=
IMimeMessage_GetBody
(
msg
,
IBL_NEXT
,
hbody
,
&
hbody
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeMessage_BindToObject
(
msg
,
hbody
,
&
IID_IMimeBody
,
(
void
**
)
&
body
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
hr
=
IMimeBody_GetOffsets
(
body
,
&
offsets
);
ok
(
hr
==
S_OK
,
"ret %08x
\n
"
,
hr
);
ok
(
offsets
.
cbBoundaryStart
==
525
,
"got %d
\n
"
,
offsets
.
cbBoundaryStart
);
ok
(
offsets
.
cbHeaderStart
==
548
,
"got %d
\n
"
,
offsets
.
cbHeaderStart
);
ok
(
offsets
.
cbBodyStart
==
629
,
"got %d
\n
"
,
offsets
.
cbBodyStart
);
ok
(
offsets
.
cbBodyEnd
==
639
,
"got %d
\n
"
,
offsets
.
cbBodyEnd
);
IMimeBody_Release
(
body
);
IMimeMessage_Release
(
msg
);
ref
=
IStream_AddRef
(
stream
);
...
...
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