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
796cf171
Commit
796cf171
authored
May 30, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
May 31, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added text/html filter.
parent
c73c3362
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
2 deletions
+39
-2
misc.c
dlls/urlmon/tests/misc.c
+17
-1
urlmon_main.c
dlls/urlmon/urlmon_main.c
+22
-1
No files found.
dlls/urlmon/tests/misc.c
View file @
796cf171
...
...
@@ -350,6 +350,14 @@ static BYTE data3[] = {0,0,0};
static
BYTE
data4
[]
=
{
't'
,
'e'
,
's'
,
0xfa
,
't'
,
' '
,
'd'
,
'a'
,
't'
,
'a'
,
'\n'
,
0
,
0
};
static
BYTE
data5
[]
=
{
0xa
,
0xa
,
0xa
,
'x'
,
32
,
'x'
,
0
};
static
BYTE
data6
[]
=
{
0xfa
,
0xfa
,
0xfa
,
0xfa
,
'\n'
,
'\r'
,
'\t'
,
'x'
,
'x'
,
'x'
,
1
};
static
BYTE
data7
[]
=
"<html>blahblah"
;
static
BYTE
data8
[]
=
{
't'
,
'e'
,
's'
,
0xfa
,
't'
,
' '
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'd'
,
'a'
,
't'
,
'a'
,
'\n'
,
0
,
0
};
static
BYTE
data9
[]
=
{
't'
,
'e'
,
0
,
's'
,
0xfa
,
't'
,
' '
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
'd'
,
'a'
,
't'
,
'a'
,
'\n'
,
0
,
0
};
static
BYTE
data10
[]
=
"<HtmL>blahblah"
;
static
BYTE
data11
[]
=
"blah<HTML>blahblah"
;
static
BYTE
data12
[]
=
"blah<HTMLblahblah"
;
static
BYTE
data13
[]
=
"blahHTML>blahblah"
;
static
BYTE
data14
[]
=
"blah<HTMblahblah"
;
static
const
struct
{
BYTE
*
data
;
...
...
@@ -361,7 +369,15 @@ static const struct {
{
data3
,
sizeof
(
data3
),
mimeAppOctetStream
},
{
data4
,
sizeof
(
data4
),
mimeAppOctetStream
},
{
data5
,
sizeof
(
data5
),
mimeTextPlain
},
{
data6
,
sizeof
(
data6
),
mimeTextPlain
}
{
data6
,
sizeof
(
data6
),
mimeTextPlain
},
{
data7
,
sizeof
(
data7
),
mimeTextHtml
},
{
data8
,
sizeof
(
data8
),
mimeTextHtml
},
{
data9
,
sizeof
(
data9
),
mimeTextHtml
},
{
data10
,
sizeof
(
data10
),
mimeTextHtml
},
{
data11
,
sizeof
(
data11
),
mimeTextHtml
},
{
data12
,
sizeof
(
data12
),
mimeTextHtml
},
{
data13
,
sizeof
(
data13
),
mimeTextPlain
},
{
data14
,
sizeof
(
data14
),
mimeTextPlain
}
};
static
void
test_FindMimeFromData
(
void
)
...
...
dlls/urlmon/urlmon_main.c
View file @
796cf171
...
...
@@ -28,7 +28,6 @@
#define NO_SHLWAPI_REG
#include "shlwapi.h"
#include "wine/debug.h"
#include "wine/unicode.h"
...
...
@@ -397,6 +396,26 @@ void WINAPI ReleaseBindInfo(BINDINFO* pbindinfo)
*
* Determines the Multipurpose Internet Mail Extensions (MIME) type from the data provided.
*/
static
BOOL
text_html_filter
(
LPVOID
buf
,
DWORD
size
)
{
const
char
*
b
=
buf
;
int
i
;
if
(
size
<
5
)
return
FALSE
;
for
(
i
=
0
;
i
<
size
-
5
;
i
++
)
{
if
(
b
[
i
]
==
'<'
&&
(
b
[
i
+
1
]
==
'h'
||
b
[
i
+
1
]
==
'H'
)
&&
(
b
[
i
+
2
]
==
't'
||
b
[
i
+
2
]
==
'T'
)
&&
(
b
[
i
+
3
]
==
'm'
||
b
[
i
+
3
]
==
'M'
)
&&
(
b
[
i
+
4
]
==
'l'
||
b
[
i
+
4
]
==
'L'
))
return
TRUE
;
}
return
FALSE
;
}
static
BOOL
text_plain_filter
(
LPVOID
buf
,
DWORD
size
)
{
UCHAR
*
ptr
;
...
...
@@ -448,6 +467,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
LPCWSTR
ret
=
NULL
;
int
i
=
0
;
static
const
WCHAR
wszTextHtml
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
wszTextPlain
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'p'
,
'l'
,
'a'
,
'i'
,
'n'
,
'\0'
};
static
const
WCHAR
wszAppOctetStream
[]
=
{
'a'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'/'
,
'o'
,
'c'
,
't'
,
'e'
,
't'
,
'-'
,
's'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
'\0'
};
...
...
@@ -456,6 +476,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
LPCWSTR
mime
;
BOOL
(
*
filter
)(
LPVOID
,
DWORD
);
}
mime_filters
[]
=
{
{
wszTextHtml
,
text_html_filter
},
{
wszTextPlain
,
text_plain_filter
},
{
wszAppOctetStream
,
application_octet_stream_filter
}
};
...
...
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