urlmon: Added audio/basic MIME filter.

This commit is contained in:
Jacek Caban 2008-02-18 01:05:14 +01:00 committed by Alexandre Julliard
parent 374007985a
commit 5321c7154a
2 changed files with 18 additions and 2 deletions

View File

@ -421,6 +421,7 @@ static const WCHAR mimeAppPdf[] = {'a','p','p','l','i','c','a','t','i','o','n','
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 WCHAR mimeAudioBasic[] = {'a','u','d','i','o','/','b','a','s','i','c',0};
static const struct {
LPCWSTR url;
@ -517,6 +518,10 @@ static BYTE data78[] = {'R','I','F','F',0xff,0xff,0xff,0xff,'<','h','t','m','l',
static BYTE data79[] = {'%','!',0xff};
static BYTE data80[] = {'%','!'};
static BYTE data81[] = {'%','!','P','S','<','h','t','m','l','>'};
static BYTE data82[] = {'.','s','n','d',0};
static BYTE data83[] = {'.','s','n','d'};
static BYTE data84[] = {'.','s','n','d',0,'<','h','t','m','l','>',1,1};
static BYTE data85[] = {'.','S','N','D',0};
static const struct {
BYTE *data;
@ -603,7 +608,11 @@ static const struct {
{data78, sizeof(data78), mimeTextHtml},
{data79, sizeof(data79), mimeAppPostscript},
{data80, sizeof(data80), mimeTextPlain},
{data81, sizeof(data81), mimeTextHtml}
{data81, sizeof(data81), mimeTextHtml},
{data82, sizeof(data82), mimeAudioBasic},
{data83, sizeof(data83), mimeTextPlain},
{data84, sizeof(data84), mimeTextHtml},
{data85, sizeof(data85), mimeTextPlain}
};
static void test_FindMimeFromData(void)

View File

@ -469,6 +469,12 @@ static BOOL text_html_filter(const BYTE *b, DWORD size)
return FALSE;
}
static BOOL audio_basic_filter(const BYTE *b, DWORD size)
{
return size > 4
&& b[0] == '.' && b[1] == 's' && b[2] == 'n' && b[3] == 'd';
}
static BOOL audio_wav_filter(const BYTE *b, DWORD size)
{
return size > 12
@ -613,6 +619,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 wszAudioBasic[] = {'a','u','d','i','o','/','b','a','s','i','c',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};
@ -644,7 +651,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
{wszTextHtml, text_html_filter},
{wszTextRichtext, text_richtext_filter},
/* {wszAudioXAiff, audio_xaiff_filter}, */
/* {wszAudioBasic, audio_basic_filter}, */
{wszAudioBasic, audio_basic_filter},
{wszAudioWav, audio_wav_filter},
{wszImageGif, image_gif_filter},
{wszImagePjpeg, image_pjpeg_filter},