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
32405d63
Commit
32405d63
authored
Jul 06, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added image/gif filter.
parent
1fd9f3ed
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
misc.c
dlls/urlmon/tests/misc.c
+21
-1
urlmon_main.c
dlls/urlmon/urlmon_main.c
+15
-0
No files found.
dlls/urlmon/tests/misc.c
View file @
32405d63
...
...
@@ -331,6 +331,7 @@ static const WCHAR mimeTextPlain[] = {'t','e','x','t','/','p','l','a','i','n',0}
static
const
WCHAR
mimeAppOctetStream
[]
=
{
'a'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'/'
,
'o'
,
'c'
,
't'
,
'e'
,
't'
,
'-'
,
's'
,
't'
,
'r'
,
'e'
,
'a'
,
'm'
,
0
};
static
const
WCHAR
mimeImagePjpeg
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'p'
,
'j'
,
'p'
,
'e'
,
'g'
,
0
};
static
const
WCHAR
mimeImageGif
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'g'
,
'i'
,
'f'
,
0
};
static
const
struct
{
LPCWSTR
url
;
...
...
@@ -363,6 +364,16 @@ static BYTE data15[] = {0xff,0xd8};
static
BYTE
data16
[]
=
{
0xff
,
0xd8
,
'h'
};
static
BYTE
data17
[]
=
{
0
,
0xff
,
0xd8
};
static
BYTE
data18
[]
=
{
0xff
,
0xd8
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
};
static
BYTE
data19
[]
=
{
'G'
,
'I'
,
'F'
,
'8'
,
'7'
,
'a'
};
static
BYTE
data20
[]
=
{
'G'
,
'I'
,
'F'
,
'8'
,
'9'
,
'a'
};
static
BYTE
data21
[]
=
{
'G'
,
'I'
,
'F'
,
'8'
,
'7'
};
static
BYTE
data22
[]
=
{
'G'
,
'i'
,
'F'
,
'8'
,
'7'
,
'a'
};
static
BYTE
data23
[]
=
{
'G'
,
'i'
,
'F'
,
'8'
,
'8'
,
'a'
};
static
BYTE
data24
[]
=
{
'g'
,
'i'
,
'f'
,
'8'
,
'7'
,
'a'
};
static
BYTE
data25
[]
=
{
'G'
,
'i'
,
'F'
,
'8'
,
'7'
,
'A'
};
static
BYTE
data26
[]
=
{
'G'
,
'i'
,
'F'
,
'8'
,
'7'
,
'a'
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
};
static
BYTE
data27
[]
=
{
0x30
,
'G'
,
'i'
,
'F'
,
'8'
,
'7'
,
'A'
};
static
const
struct
{
BYTE
*
data
;
...
...
@@ -386,7 +397,16 @@ static const struct {
{
data15
,
sizeof
(
data15
),
mimeTextPlain
},
{
data16
,
sizeof
(
data16
),
mimeImagePjpeg
},
{
data17
,
sizeof
(
data17
),
mimeAppOctetStream
},
{
data18
,
sizeof
(
data18
),
mimeTextHtml
}
{
data18
,
sizeof
(
data18
),
mimeTextHtml
},
{
data19
,
sizeof
(
data19
),
mimeImageGif
},
{
data20
,
sizeof
(
data20
),
mimeImageGif
},
{
data21
,
sizeof
(
data21
),
mimeTextPlain
},
{
data22
,
sizeof
(
data22
),
mimeImageGif
},
{
data23
,
sizeof
(
data23
),
mimeTextPlain
},
{
data24
,
sizeof
(
data24
),
mimeImageGif
},
{
data25
,
sizeof
(
data25
),
mimeImageGif
},
{
data26
,
sizeof
(
data26
),
mimeTextHtml
},
{
data27
,
sizeof
(
data27
),
mimeTextPlain
}
};
static
void
test_FindMimeFromData
(
void
)
...
...
dlls/urlmon/urlmon_main.c
View file @
32405d63
...
...
@@ -416,6 +416,19 @@ static BOOL text_html_filter(LPVOID buf, DWORD size)
return
FALSE
;
}
static
BOOL
image_gif_filter
(
LPVOID
buf
,
DWORD
size
)
{
const
BYTE
const
*
b
=
buf
;
return
size
>=
6
&&
(
b
[
0
]
==
'G'
||
b
[
0
]
==
'g'
)
&&
(
b
[
1
]
==
'I'
||
b
[
1
]
==
'i'
)
&&
(
b
[
2
]
==
'F'
||
b
[
2
]
==
'f'
)
&&
b
[
3
]
==
'8'
&&
(
b
[
4
]
==
'7'
||
b
[
4
]
==
'9'
)
&&
(
b
[
5
]
==
'A'
||
b
[
5
]
==
'a'
);
}
static
BOOL
image_pjpeg_filter
(
LPVOID
buf
,
DWORD
size
)
{
return
size
>
2
&&
*
(
BYTE
*
)
buf
==
0xff
&&
*
((
BYTE
*
)
buf
+
1
)
==
0xd8
;
...
...
@@ -473,6 +486,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
int
i
;
static
const
WCHAR
wszTextHtml
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
wszImageGif
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'g'
,
'i'
,
'f'
,
0
};
static
const
WCHAR
wszImagePjpeg
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'p'
,
'j'
,
'p'
,
'e'
,
'g'
,
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'
,
'/'
,
...
...
@@ -483,6 +497,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
BOOL
(
*
filter
)(
LPVOID
,
DWORD
);
}
mime_filters
[]
=
{
{
wszTextHtml
,
text_html_filter
},
{
wszImageGif
,
image_gif_filter
},
{
wszImagePjpeg
,
image_pjpeg_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