ReactOS 0.4.17-dev-784-g3812a95
CSnapinCacheEntry.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Management Console
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Snapin cache entry class
5 * COPYRIGHT: Copyright 2026 Eric Kohl (eric.kohl@reactos.org)
6 */
7
8#include "precomp.h"
9
10#define NDEBUG
11#include <debug.h>
12
13#define IID_PPV_ARG(Itype, ppType) IID_##Itype, reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
14
15CSnapinCacheEntry::CSnapinCacheEntry(const CAtlString& guidString, const CAtlString& aboutGuidString, const CAtlString& name, HIMAGELIST hImageList)
16 :m_GuidString(guidString), m_AboutGuidString(aboutGuidString), m_Name(name), m_Loaded(FALSE)
17{
20
21 CComPtr<ISnapinAbout> pSnapinAbout;
22 HRESULT hr = CoCreateInstance(m_AboutGuid, NULL, CLSCTX_INPROC, IID_PPV_ARG(ISnapinAbout, &pSnapinAbout));
23 DPRINT("CoCreateInstance %lx\n", hr);
24 if (SUCCEEDED(hr))
25 {
26 LPOLESTR Str;
27
28 hr = pSnapinAbout->GetProvider(&Str);
29 DPRINT("GetProvider %lx\n", hr);
30 if (SUCCEEDED(hr))
31 {
34 }
35
36 hr = pSnapinAbout->GetSnapinDescription(&Str);
37 DPRINT("GetDescription %lx\n", hr);
38 if (SUCCEEDED(hr))
39 {
42 }
43
44 hr = pSnapinAbout->GetSnapinVersion(&Str);
45 DPRINT("GetVersion %lx\n", hr);
46 if (SUCCEEDED(hr))
47 {
48 m_Version = Str;
50 }
51
52 HBITMAP hSmallImage, hSmallImageOpen, hLargeImage;
53 COLORREF colorMask;
54
55 hr = pSnapinAbout->GetStaticFolderImage(&hSmallImage,
56 &hSmallImageOpen,
57 &hLargeImage,
58 &colorMask);
59 if (SUCCEEDED(hr))
60 {
62 hSmallImage,
63 colorMask);
64
66 hSmallImageOpen,
67 colorMask);
68
69 DeleteObject(hSmallImage);
70 DeleteObject(hSmallImageOpen);
71 DeleteObject(hLargeImage);
72 }
73 }
74}
75
77{
78}
#define IID_PPV_ARG(Itype, ppType)
CSnapinCacheEntry(const CAtlString &guidString, const CAtlString &aboutGuidString, const CAtlString &name, HIMAGELIST hImageList)
CAtlString m_AboutGuidString
CAtlString m_Description
HRESULT hr
Definition: delayimp.cpp:582
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
HRESULT WINAPI CLSIDFromString(LPCOLESTR str, LPCLSID clsid)
Definition: combase.c:1470
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, IUnknown *outer, DWORD cls_context, REFIID riid, void **obj)
Definition: combase.c:1685
void WINAPI CoTaskMemFree(void *ptr)
Definition: malloc.c:389
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:573
pKey DeleteObject()
#define SUCCEEDED(hr)
Definition: intsafe.h:50
static HBITMAP
Definition: button.c:44
#define DPRINT
Definition: sndvol32.h:73
Definition: name.c:39
DWORD COLORREF
Definition: windef.h:100