urlmon: Added image/pjpeg mime filter.

This commit is contained in:
Jacek Caban 2006-07-06 20:02:24 +02:00 committed by Alexandre Julliard
parent 973371c01d
commit b5fa092756
1 changed files with 7 additions and 0 deletions

View File

@ -416,6 +416,11 @@ static BOOL text_html_filter(LPVOID buf, DWORD size)
return FALSE;
}
static BOOL image_pjpeg_filter(LPVOID buf, DWORD size)
{
return size > 2 && *(BYTE*)buf == 0xff && *((BYTE*)buf+1) == 0xd8;
}
static BOOL text_plain_filter(LPVOID buf, DWORD size)
{
UCHAR *ptr;
@ -468,6 +473,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
int i = 0;
static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',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','/',
'o','c','t','e','t','-','s','t','r','e','a','m','\0'};
@ -477,6 +483,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
BOOL (*filter)(LPVOID,DWORD);
} mime_filters[] = {
{wszTextHtml, text_html_filter},
{wszImagePjpeg, image_pjpeg_filter},
{wszTextPlain, text_plain_filter},
{wszAppOctetStream, application_octet_stream_filter}
};