diff --git a/plap/openvpn-plap-res.rc b/plap/openvpn-plap-res.rc index 5afd056..6d78ec5 100644 --- a/plap/openvpn-plap-res.rc +++ b/plap/openvpn-plap-res.rc @@ -26,6 +26,7 @@ #include #include #include "../openvpn-gui-res.h" +#include "resource.h" /* Language resource files are UTF-8 encoded */ #pragma code_page(65001) @@ -39,6 +40,8 @@ ID_ICO_CONNECTED ICON DISCARDABLE "../res/connected.ico" ID_ICO_CONNECTING ICON DISCARDABLE "../res/connecting.ico" ID_ICO_DISCONNECTED ICON DISCARDABLE "../res/disconnected.ico" +IDB_TILE_IMAGE BITMAP DISCARDABLE "../res/tileimage.bmp" + #ifdef ENABLE_OVPN3 #define ADVANCED_DIALOG_HEIGHT 320 #else diff --git a/plap/plap_connection.c b/plap/plap_connection.c index f176ce3..48d44f9 100644 --- a/plap/plap_connection.c +++ b/plap/plap_connection.c @@ -27,6 +27,7 @@ #include "plap_connection.h" #include "plap_dll.h" #include +#include "resource.h" /* A "class" that implements IConnectableCredentialProviderCredential */ @@ -343,9 +344,30 @@ GetStringValue(ICCPC *this, DWORD index, WCHAR **ws) static HRESULT WINAPI GetBitmapValue(UNUSED ICCPC *this, DWORD field, HBITMAP *bmp) { + HRESULT hr = S_OK; + dmsg(L"field = %lu ", field); - return E_NOTIMPL; + if (field_desc[field].cpft == CPFT_TILE_IMAGE && bmp) + { + HBITMAP tmp = LoadBitmapW(hinst_global, MAKEINTRESOURCE(IDB_TILE_IMAGE)); + if (tmp) + { + *bmp = tmp; /* The caller takes ownership of this memory */ + dmsg(L"Returning a bitmap for PLAP tile %lu", field); + } + else + { + hr = HRESULT_FROM_WIN32(GetLastError()); + dmsg(L"LoadBitmap failed with error = 0x%08x", hr); + } + } + else + { + hr = E_INVALIDARG; + } + + return hr; } /* diff --git a/plap/resource.h b/plap/resource.h new file mode 100644 index 0000000..ef811a1 --- /dev/null +++ b/plap/resource.h @@ -0,0 +1 @@ +#define IDB_TILE_IMAGE 101 diff --git a/res/tileimage.bmp b/res/tileimage.bmp new file mode 100644 index 0000000..4377653 Binary files /dev/null and b/res/tileimage.bmp differ