mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[ATL] CImage: Hack fix for getting filter string (#5528)
- Fix the crash on opening/saving file. - To get the filename extension info from CODECs, we have to keep gdiplus.dll loaded. - The perfect fix will take time. CORE-19093, CORE-19094
This commit is contained in:
parent
b4bc6f0a6a
commit
36a35ee203
1 changed files with 4 additions and 4 deletions
|
@ -811,6 +811,7 @@ public:
|
|||
DWORD dwExclude = excludeDefaultLoad,
|
||||
TCHAR chSeparator = TEXT('|'))
|
||||
{
|
||||
CImage dummy; // HACK: Initialize common
|
||||
UINT cDecoders = 0;
|
||||
Gdiplus::ImageCodecInfo* pDecoders = _getAllDecoders(cDecoders);
|
||||
HRESULT hr = BuildCodecFilterString(pDecoders,
|
||||
|
@ -831,6 +832,7 @@ public:
|
|||
DWORD dwExclude = excludeDefaultSave,
|
||||
TCHAR chSeparator = TEXT('|'))
|
||||
{
|
||||
CImage dummy; // HACK: Initialize common
|
||||
UINT cEncoders = 0;
|
||||
Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders);
|
||||
HRESULT hr = BuildCodecFilterString(pEncoders,
|
||||
|
@ -1057,6 +1059,7 @@ protected:
|
|||
// Deprecated. Don't use this
|
||||
static const GUID *FileTypeFromExtension(LPCTSTR dotext)
|
||||
{
|
||||
CImage dummy; // HACK: Initialize common
|
||||
UINT cEncoders = 0;
|
||||
Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders);
|
||||
|
||||
|
@ -1111,6 +1114,7 @@ protected:
|
|||
// Deprecated. Don't use this
|
||||
static bool GetClsidFromFileType(CLSID *clsid, const GUID *guid)
|
||||
{
|
||||
CImage dummy; // HACK: Initialize common
|
||||
UINT cEncoders = 0;
|
||||
Gdiplus::ImageCodecInfo* pEncoders = _getAllEncoders(cEncoders);
|
||||
*clsid = FindCodecForFileType(*guid, pEncoders, cEncoders);
|
||||
|
@ -1120,8 +1124,6 @@ protected:
|
|||
|
||||
static Gdiplus::ImageCodecInfo* _getAllEncoders(UINT& cEncoders)
|
||||
{
|
||||
CImage image; // Initialize common
|
||||
|
||||
UINT total_size = 0;
|
||||
GetCommon().GetImageEncodersSize(&cEncoders, &total_size);
|
||||
if (total_size == 0)
|
||||
|
@ -1141,8 +1143,6 @@ protected:
|
|||
|
||||
static Gdiplus::ImageCodecInfo* _getAllDecoders(UINT& cDecoders)
|
||||
{
|
||||
CImage image; // Initialize common
|
||||
|
||||
UINT total_size = 0;
|
||||
GetCommon().GetImageDecodersSize(&cDecoders, &total_size);
|
||||
if (total_size == 0)
|
||||
|
|
Loading…
Reference in a new issue