Commit ec565fbf authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added text/richtext MIME filter.

parent 7ce4194c
......@@ -345,6 +345,7 @@ static void test_CoInternetCompareUrl(void)
static const WCHAR mimeTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
static const WCHAR mimeTextPlain[] = {'t','e','x','t','/','p','l','a','i','n',0};
static const WCHAR mimeTextRichtext[] = {'t','e','x','t','/','r','i','c','h','t','e','x','t',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};
......@@ -449,6 +450,10 @@ static BYTE data67[] = {0x25,0x50,0x44,0x46,'x','<','h','t','m','l','>'};
static BYTE data68[] = {'M','Z','x'};
static BYTE data69[] = {'M','Z'};
static BYTE data70[] = {'M','Z','<','h','t','m','l','>',0xff};
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 const struct {
BYTE *data;
......@@ -524,7 +529,11 @@ static const struct {
{data67, sizeof(data67), mimeTextHtml},
{data68, sizeof(data68), mimeAppXMSDownload},
{data69, sizeof(data69), mimeTextPlain},
{data70, sizeof(data70), mimeTextHtml}
{data70, sizeof(data70), mimeTextHtml},
{data71, sizeof(data71), mimeTextRichtext},
{data72, sizeof(data72), mimeTextPlain},
{data73, sizeof(data73), mimeTextPlain},
{data74, sizeof(data74), mimeTextHtml}
};
static void test_FindMimeFromData(void)
......
......@@ -408,6 +408,10 @@ void WINAPI ReleaseBindInfo(BINDINFO* pbindinfo)
pbindinfo->cbSize = size;
}
static BOOL text_richtext_filter(const BYTE *b, DWORD size)
{
return size > 5 && !memcmp(b, "{\\rtf", 5);
}
static BOOL text_html_filter(const BYTE *b, DWORD size)
{
......@@ -559,6 +563,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 wszTextRichtext[] = {'t','e','x','t','/','r','i','c','h','t','e','x','t',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};
......@@ -585,6 +590,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
BOOL (*filter)(const BYTE *,DWORD);
} mime_filters[] = {
{wszTextHtml, text_html_filter},
{wszTextRichtext, text_richtext_filter},
{wszImageGif, image_gif_filter},
{wszImagePjpeg, image_pjpeg_filter},
{wszImageTiff, image_tiff_filter},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment