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
58e8b19d
Commit
58e8b19d
authored
Oct 23, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
urlmon: Added audio/wav MIME filter.
parent
ec565fbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
misc.c
dlls/urlmon/tests/misc.c
+18
-2
urlmon_main.c
dlls/urlmon/urlmon_main.c
+9
-0
No files found.
dlls/urlmon/tests/misc.c
View file @
58e8b19d
...
...
@@ -62,6 +62,13 @@ DEFINE_EXPECT(QI_IInternetProtocolInfo);
DEFINE_EXPECT
(
CreateInstance
);
DEFINE_EXPECT
(
unk_Release
);
static
const
char
*
debugstr_w
(
LPCWSTR
str
)
{
static
char
buf
[
1024
];
WideCharToMultiByte
(
CP_ACP
,
0
,
str
,
-
1
,
buf
,
sizeof
(
buf
),
NULL
,
NULL
);
return
buf
;
}
static
void
test_CreateFormatEnum
(
void
)
{
IEnumFORMATETC
*
fenum
=
NULL
,
*
fenum2
=
NULL
;
...
...
@@ -365,6 +372,7 @@ static const WCHAR mimeAppJava[] = {'a','p','p','l','i','c','a','t','i','o','n',
static
const
WCHAR
mimeAppPdf
[]
=
{
'a'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'/'
,
'p'
,
'd'
,
'f'
,
0
};
static
const
WCHAR
mimeAppXMSDownload
[]
=
{
'a'
,
'p'
,
'p'
,
'l'
,
'i'
,
'c'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'/'
,
'x'
,
'-'
,
'm'
,
's'
,
'd'
,
'o'
,
'w'
,
'n'
,
'l'
,
'o'
,
'a'
,
'd'
,
0
};
static
const
WCHAR
mimeAudioWav
[]
=
{
'a'
,
'u'
,
'd'
,
'i'
,
'o'
,
'/'
,
'w'
,
'a'
,
'v'
,
0
};
static
const
struct
{
LPCWSTR
url
;
...
...
@@ -454,6 +462,10 @@ static BYTE data71[] = {'{','\\','r','t','f',0};
static
BYTE
data72
[]
=
{
'{'
,
'\\'
,
'r'
,
't'
,
'f'
};
static
BYTE
data73
[]
=
{
' '
,
'{'
,
'\\'
,
'r'
,
't'
,
'f'
,
' '
};
static
BYTE
data74
[]
=
{
'{'
,
'\\'
,
'r'
,
't'
,
'f'
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
' '
};
static
BYTE
data75
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'W'
,
'A'
,
'V'
,
'E'
,
0xff
};
static
BYTE
data76
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'W'
,
'A'
,
'V'
,
'E'
};
static
BYTE
data77
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'W'
,
'A'
,
'V'
,
0xff
,
0xff
};
static
BYTE
data78
[]
=
{
'R'
,
'I'
,
'F'
,
'F'
,
0xff
,
0xff
,
0xff
,
0xff
,
'<'
,
'h'
,
't'
,
'm'
,
'l'
,
'>'
,
0xff
};
static
const
struct
{
BYTE
*
data
;
...
...
@@ -533,7 +545,11 @@ static const struct {
{
data71
,
sizeof
(
data71
),
mimeTextRichtext
},
{
data72
,
sizeof
(
data72
),
mimeTextPlain
},
{
data73
,
sizeof
(
data73
),
mimeTextPlain
},
{
data74
,
sizeof
(
data74
),
mimeTextHtml
}
{
data74
,
sizeof
(
data74
),
mimeTextHtml
},
{
data75
,
sizeof
(
data75
),
mimeAudioWav
},
{
data76
,
sizeof
(
data76
),
mimeTextPlain
},
{
data77
,
sizeof
(
data77
),
mimeTextPlain
},
{
data78
,
sizeof
(
data78
),
mimeTextHtml
}
};
static
void
test_FindMimeFromData
(
void
)
...
...
@@ -573,7 +589,7 @@ static void test_FindMimeFromData(void)
hres
=
FindMimeFromData
(
NULL
,
NULL
,
mime_tests2
[
i
].
data
,
mime_tests2
[
i
].
size
,
NULL
,
0
,
&
mime
,
0
);
ok
(
hres
==
S_OK
,
"[%d] FindMimeFromData failed: %08x
\n
"
,
i
,
hres
);
ok
(
!
lstrcmpW
(
mime
,
mime_tests2
[
i
].
mime
),
"[%d] wrong mime
\n
"
,
i
);
ok
(
!
lstrcmpW
(
mime
,
mime_tests2
[
i
].
mime
),
"[%d] wrong mime
: %s
\n
"
,
i
,
debugstr_w
(
mime
)
);
CoTaskMemFree
(
mime
);
hres
=
FindMimeFromData
(
NULL
,
NULL
,
mime_tests2
[
i
].
data
,
mime_tests2
[
i
].
size
,
...
...
dlls/urlmon/urlmon_main.c
View file @
58e8b19d
...
...
@@ -432,6 +432,13 @@ static BOOL text_html_filter(const BYTE *b, DWORD size)
return
FALSE
;
}
static
BOOL
audio_wav_filter
(
const
BYTE
*
b
,
DWORD
size
)
{
return
size
>
12
&&
b
[
0
]
==
'R'
&&
b
[
1
]
==
'I'
&&
b
[
2
]
==
'F'
&&
b
[
3
]
==
'F'
&&
b
[
8
]
==
'W'
&&
b
[
9
]
==
'A'
&&
b
[
10
]
==
'V'
&&
b
[
11
]
==
'E'
;
}
static
BOOL
image_gif_filter
(
const
BYTE
*
b
,
DWORD
size
)
{
return
size
>=
6
...
...
@@ -564,6 +571,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
static
const
WCHAR
wszTextHtml
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'h'
,
't'
,
'm'
,
'l'
,
0
};
static
const
WCHAR
wszTextRichtext
[]
=
{
't'
,
'e'
,
'x'
,
't'
,
'/'
,
'r'
,
'i'
,
'c'
,
'h'
,
't'
,
'e'
,
'x'
,
't'
,
0
};
static
const
WCHAR
wszAudioWav
[]
=
{
'a'
,
'u'
,
'd'
,
'i'
,
'o'
,
'/'
,
'w'
,
'a'
,
'v'
,
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
wszImageTiff
[]
=
{
'i'
,
'm'
,
'a'
,
'g'
,
'e'
,
'/'
,
't'
,
'i'
,
'f'
,
'f'
,
0
};
...
...
@@ -591,6 +599,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
}
mime_filters
[]
=
{
{
wszTextHtml
,
text_html_filter
},
{
wszTextRichtext
,
text_richtext_filter
},
{
wszAudioWav
,
audio_wav_filter
},
{
wszImageGif
,
image_gif_filter
},
{
wszImagePjpeg
,
image_pjpeg_filter
},
{
wszImageTiff
,
image_tiff_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