urlmon: Added application/pdf mime filter.
This commit is contained in:
parent
edf73245fe
commit
8afd947f15
|
@ -346,6 +346,7 @@ static const WCHAR mimeAppXZip[] = {'a','p','p','l','i','c','a','t','i','o','n',
|
||||||
static const WCHAR mimeAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
static const WCHAR mimeAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||||
'x','-','g','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
'x','-','g','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
||||||
static const WCHAR mimeAppJava[] = {'a','p','p','l','i','c','a','t','i','o','n','/','j','a','v','a',0};
|
static const WCHAR mimeAppJava[] = {'a','p','p','l','i','c','a','t','i','o','n','/','j','a','v','a',0};
|
||||||
|
static const WCHAR mimeAppPdf[] = {'a','p','p','l','i','c','a','t','i','o','n','/','p','d','f',0};
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
LPCWSTR url;
|
LPCWSTR url;
|
||||||
|
@ -424,6 +425,9 @@ static BYTE data61[] = {0x50,0x4b,'<','h','t','m','l','>',0};
|
||||||
static BYTE data62[] = {0xca,0xfe,0xba,0xbe,'x'};
|
static BYTE data62[] = {0xca,0xfe,0xba,0xbe,'x'};
|
||||||
static BYTE data63[] = {0xca,0xfe,0xba,0xbe};
|
static BYTE data63[] = {0xca,0xfe,0xba,0xbe};
|
||||||
static BYTE data64[] = {0xca,0xfe,0xba,0xbe,'<','h','t','m','l','>',0};
|
static BYTE data64[] = {0xca,0xfe,0xba,0xbe,'<','h','t','m','l','>',0};
|
||||||
|
static BYTE data65[] = {0x25,0x50,0x44,0x46,'x'};
|
||||||
|
static BYTE data66[] = {0x25,0x50,0x44,0x46};
|
||||||
|
static BYTE data67[] = {0x25,0x50,0x44,0x46,'x','<','h','t','m','l','>'};
|
||||||
|
|
||||||
static const struct {
|
static const struct {
|
||||||
BYTE *data;
|
BYTE *data;
|
||||||
|
@ -493,7 +497,10 @@ static const struct {
|
||||||
{data61, sizeof(data61), mimeTextHtml},
|
{data61, sizeof(data61), mimeTextHtml},
|
||||||
{data62, sizeof(data62), mimeAppJava},
|
{data62, sizeof(data62), mimeAppJava},
|
||||||
{data63, sizeof(data63), mimeTextPlain},
|
{data63, sizeof(data63), mimeTextPlain},
|
||||||
{data64, sizeof(data64), mimeTextHtml}
|
{data64, sizeof(data64), mimeTextHtml},
|
||||||
|
{data65, sizeof(data65), mimeAppPdf},
|
||||||
|
{data66, sizeof(data66), mimeTextPlain},
|
||||||
|
{data67, sizeof(data67), mimeTextHtml}
|
||||||
};
|
};
|
||||||
|
|
||||||
static void test_FindMimeFromData(void)
|
static void test_FindMimeFromData(void)
|
||||||
|
|
|
@ -469,6 +469,11 @@ static BOOL video_mpeg_filter(const BYTE const *b, DWORD size)
|
||||||
&& (b[3] == 0xb3 || b[3] == 0xba);
|
&& (b[3] == 0xb3 || b[3] == 0xba);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL application_pdf_filter(const BYTE const *b, DWORD size)
|
||||||
|
{
|
||||||
|
return size > 4 && b[0] == 0x25 && b[1] == 0x50 && b[2] == 0x44 && b[3] == 0x46;
|
||||||
|
}
|
||||||
|
|
||||||
static BOOL application_xzip_filter(const BYTE const *b, DWORD size)
|
static BOOL application_xzip_filter(const BYTE const *b, DWORD size)
|
||||||
{
|
{
|
||||||
return size > 2 && b[0] == 0x50 && b[1] == 0x4b;
|
return size > 2 && b[0] == 0x50 && b[1] == 0x4b;
|
||||||
|
@ -544,6 +549,8 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
||||||
static const WCHAR wszImageBmp[] = {'i','m','a','g','e','/','b','m','p',0};
|
static const WCHAR wszImageBmp[] = {'i','m','a','g','e','/','b','m','p',0};
|
||||||
static const WCHAR wszVideoAvi[] = {'v','i','d','e','o','/','a','v','i',0};
|
static const WCHAR wszVideoAvi[] = {'v','i','d','e','o','/','a','v','i',0};
|
||||||
static const WCHAR wszVideoMpeg[] = {'v','i','d','e','o','/','m','p','e','g',0};
|
static const WCHAR wszVideoMpeg[] = {'v','i','d','e','o','/','m','p','e','g',0};
|
||||||
|
static const WCHAR wszAppPdf[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||||
|
'p','d','f',0};
|
||||||
static const WCHAR wszAppXZip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
static const WCHAR wszAppXZip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||||
'x','-','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
'x','-','z','i','p','-','c','o','m','p','r','e','s','s','e','d',0};
|
||||||
static const WCHAR wszAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
static const WCHAR wszAppXGzip[] = {'a','p','p','l','i','c','a','t','i','o','n','/',
|
||||||
|
@ -566,6 +573,7 @@ HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer,
|
||||||
{wszImageBmp, image_bmp_filter},
|
{wszImageBmp, image_bmp_filter},
|
||||||
{wszVideoAvi, video_avi_filter},
|
{wszVideoAvi, video_avi_filter},
|
||||||
{wszVideoMpeg, video_mpeg_filter},
|
{wszVideoMpeg, video_mpeg_filter},
|
||||||
|
{wszAppPdf, application_pdf_filter},
|
||||||
{wszAppXZip, application_xzip_filter},
|
{wszAppXZip, application_xzip_filter},
|
||||||
{wszAppXGzip, application_xgzip_filter},
|
{wszAppXGzip, application_xgzip_filter},
|
||||||
{wszAppJava, application_java_filter},
|
{wszAppJava, application_java_filter},
|
||||||
|
|
Loading…
Reference in New Issue