urlmon: Added image/x-png mime filter.
This commit is contained in:
parent
682944ad2d
commit
6ce4833479
|
@ -333,6 +333,7 @@ static const WCHAR mimeAppOctetStream[] = {'a','p','p','l','i','c','a','t','i','
|
|||
static const WCHAR mimeImagePjpeg[] = {'i','m','a','g','e','/','p','j','p','e','g',0};
|
||||
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 struct {
|
||||
LPCWSTR url;
|
||||
|
@ -380,6 +381,11 @@ static BYTE data30[] = {0x42,0x4d,'x','x','x','x',0x00,0x01,0x00,0x00,'x','x','x
|
|||
static BYTE data31[] = {0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'<','h','t','m','l','>'};
|
||||
static BYTE data32[] = {0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'x','x','x'};
|
||||
static BYTE data33[] = {0x00,0x42,0x4d,'x','x','x','x',0x00,0x00,0x00,0x00,'x','x','x'};
|
||||
static BYTE data34[] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x'};
|
||||
static BYTE data35[] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x','x','x','x',0};
|
||||
static BYTE data36[] = {0x89,'P','N','G',0x0d,0x0a,0x1a,'x','x'};
|
||||
static BYTE data37[] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'<','h','t','m','l','>'};
|
||||
static BYTE data38[] = {0x00,0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a,'x'};
|
||||
|
||||
static const struct {
|
||||
BYTE *data;
|
||||
|
@ -418,7 +424,12 @@ static const struct {
|
|||
{data30, sizeof(data30), mimeAppOctetStream},
|
||||
{data31, sizeof(data31), mimeTextHtml},
|
||||
{data32, sizeof(data32), mimeAppOctetStream},
|
||||
{data33, sizeof(data32), mimeAppOctetStream}
|
||||
{data33, sizeof(data33), mimeAppOctetStream},
|
||||
{data34, sizeof(data34), mimeImageXPng},
|
||||
{data35, sizeof(data35), mimeImageXPng},
|
||||
{data36, sizeof(data36), mimeAppOctetStream},
|
||||
{data37, sizeof(data37), mimeTextHtml},
|
||||
{data38, sizeof(data38), mimeAppOctetStream}
|
||||
};
|
||||
|
||||
static void test_FindMimeFromData(void)
|
||||
|
|
|
@ -434,6 +434,12 @@ static BOOL image_pjpeg_filter(LPVOID buf, DWORD size)
|
|||
return size > 2 && *(BYTE*)buf == 0xff && *((BYTE*)buf+1) == 0xd8;
|
||||
}
|
||||
|
||||
static BOOL image_xpng_filter(LPVOID buf, DWORD size)
|
||||
{
|
||||
static const BYTE xpng_header[] = {0x89,'P','N','G',0x0d,0x0a,0x1a,0x0a};
|
||||
return size > sizeof(xpng_header) && !memcmp(buf, xpng_header, sizeof(xpng_header));
|
||||
}
|
||||
|
||||
static BOOL image_bmp_filter(LPVOID buf, DWORD size)
|
||||
{
|
||||
return size >= 14
|
||||
|
@ -496,6 +502,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 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 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 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','/',
|
||||
|
@ -508,6 +515,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
|||
{wszTextHtml, text_html_filter},
|
||||
{wszImageGif, image_gif_filter},
|
||||
{wszImagePjpeg, image_pjpeg_filter},
|
||||
{wszImageXPng, image_xpng_filter},
|
||||
{wszImageBmp, image_bmp_filter},
|
||||
{wszTextPlain, text_plain_filter},
|
||||
{wszAppOctetStream, application_octet_stream_filter}
|
||||
|
|
Loading…
Reference in New Issue