| 59 | } |
| 60 | |
| 61 | static IStream *GetResourceStream(HINSTANCE hInstance, LPCWSTR name, LPCWSTR type) { |
| 62 | IStream *stream = NULL; |
| 63 | HGLOBAL resource = GetRawResource(hInstance, name, type); |
| 64 | if (!resource) { |
| 65 | HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); |
| 66 | CHECK_HR(L"GetRawResource failed"); |
| 67 | return NULL; |
| 68 | } |
| 69 | |
| 70 | if (SUCCEEDED(CreateStreamOnHGlobal(resource, TRUE, &stream))) { |
| 71 | return stream; |
| 72 | } |
| 73 | |
| 74 | GlobalFree(resource); |
| 75 | return NULL; |
| 76 | } |
| 77 | |
| 78 | static IWICBitmapSource *GetWICBitmap(IStream *imageStream, REFCLSID rclsid) { |
| 79 | IWICBitmapSource *bitmap = NULL; |
no test coverage detected