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
84253b01
Commit
84253b01
authored
Oct 23, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 24, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added video/avi mime filter implementation.
parent
83b836b3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
misc.c
dlls/urlmon/tests/misc.c
+14
-1
urlmon_main.c
dlls/urlmon/urlmon_main.c
+12
-1
No files found.
dlls/urlmon/tests/misc.c
View file @
84253b01
...
...
@@ -336,6 +336,7 @@ static const WCHAR mimeImageGif[] = {'i','m','a','g','e','/','g','i','f',0};
static
const
WCHAR
mimeImageBmp
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'b'
,
'm'
,
'p'
,
0
};
static
const
WCHAR
mimeImageXPng
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'x'
,
'-'
,
'p'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
mimeImageTiff
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
't'
,
'i'
,
'f'
,
'f'
,
0
};
static
const
WCHAR
mimeVideoAvi
[]
=
{
'v'
,
'i'
,
'd'
,
'e'
,
'o'
,
'/'
,
'a'
,
'v'
,
'i'
,
0
};
static
const
struct
{
LPCWSTR
url
;
...
...
@@ -393,6 +394,12 @@ static BYTE data40[] = {0x4d,0x4d,0x00,0x2a,'<','h','t','m','l','>',0};
static
BYTE
data41
[]
=
{
0x4d
,
0x4d
,
0xff
};
static
BYTE
data42
[]
=
{
0x4d
,
0x4d
};
static
BYTE
data43
[]
=
{
0x00
,
0x4d
,
0x4d
,
0x00
};
static
BYTE
data44
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'A'
,
'V'
,
'I'
,
0x20
,
0xff
};
static
BYTE
data45
[]
=
{
'R'
,
'I'
,
'F'
,
'f'
,
0xff
,
0xff
,
0xff
,
0xff
,
'A'
,
'V'
,
'I'
,
0x20
,
0xff
};
static
BYTE
data46
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'A'
,
'V'
,
'I'
,
0x20
};
static
BYTE
data47
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'A'
,
'V'
,
'I'
,
0x21
,
0xff
};
static
BYTE
data48
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'A'
,
'V'
,
'I'
,
0x20
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
};
static
BYTE
data49
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0x0f
,
0x0f
,
0xf0
,
0xf0
,
'A'
,
'V'
,
'I'
,
0x20
,
0xf0
,
0x00
};
static
const
struct
{
BYTE
*
data
;
...
...
@@ -441,7 +448,13 @@ static const struct {
{
data40
,
sizeof
(
data40
),
mimeTextHtml
},
{
data41
,
sizeof
(
data41
),
mimeImageTiff
},
{
data42
,
sizeof
(
data42
),
mimeTextPlain
},
{
data43
,
sizeof
(
data43
),
mimeAppOctetStream
}
{
data43
,
sizeof
(
data43
),
mimeAppOctetStream
},
{
data44
,
sizeof
(
data44
),
mimeVideoAvi
},
{
data45
,
sizeof
(
data45
),
mimeTextPlain
},
{
data46
,
sizeof
(
data46
),
mimeTextPlain
},
{
data47
,
sizeof
(
data47
),
mimeTextPlain
},
{
data48
,
sizeof
(
data48
),
mimeTextHtml
},
{
data49
,
sizeof
(
data49
),
mimeVideoAvi
}
};
static
void
test_FindMimeFromData
(
void
)
...
...
dlls/urlmon/urlmon_main.c
View file @
84253b01
...
...
@@ -459,6 +459,15 @@ static BOOL image_bmp_filter(LPVOID buf, DWORD size)
&&
*
(
DWORD
*
)((
BYTE
*
)
buf
+
6
)
==
0
;
}
static
BOOL
video_avi_filter
(
LPVOID
buf
,
DWORD
size
)
{
const
BYTE
const
*
b
=
buf
;
return
size
>
12
&&
b
[
0
]
==
'R'
&&
b
[
1
]
==
'I'
&&
b
[
2
]
==
'F'
&&
b
[
3
]
==
'F'
&&
b
[
8
]
==
'A'
&&
b
[
9
]
==
'V'
&&
b
[
10
]
==
'I'
&&
b
[
11
]
==
0x20
;
}
static
BOOL
text_plain_filter
(
LPVOID
buf
,
DWORD
size
)
{
UCHAR
*
ptr
;
...
...
@@ -516,6 +525,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
static
const
WCHAR
wszImageTiff
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
't'
,
'i'
,
'f'
,
'f'
,
0
};
static
const
WCHAR
wszImageXPng
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'x'
,
'-'
,
'p'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
wszImageBmp
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
'b'
,
'm'
,
'p'
,
0
};
static
const
WCHAR
wszVideoAvi
[]
=
{
'v'
,
'i'
,
'd'
,
'e'
,
'o'
,
'/'
,
'a'
,
'v'
,
'i'
,
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'
};
...
...
@@ -530,6 +540,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
{
wszImageTiff
,
image_tiff_filter
},
{
wszImageXPng
,
image_xpng_filter
},
{
wszImageBmp
,
image_bmp_filter
},
{
wszVideoAvi
,
video_avi_filter
},
{
wszTextPlain
,
text_plain_filter
},
{
wszAppOctetStream
,
application_octet_stream_filter
}
};
...
...
@@ -564,7 +575,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
ret
=
pwzMimeProposed
;
/* text/html is a special case */
if
(
!
strcmpW
(
pwzMimeProposed
,
wszTextHtml
)
&&
!
strcmpW
(
ret
,
wszTextPlain
))
if
(
!
strcmpW
(
pwzMimeProposed
,
wszTextHtml
)
&&
!
strcmpW
(
ret
,
wszTextPlain
))
ret
=
wszTextHtml
;
}
...
...
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