2017-09-08 11:59:42 +00:00
|
|
|
/* Copyright (c) Mark Harmstone 2016-17
|
|
|
|
*
|
2016-11-02 19:36:59 +00:00
|
|
|
* This file is part of WinBtrfs.
|
2017-09-08 11:59:42 +00:00
|
|
|
*
|
2016-11-02 19:36:59 +00:00
|
|
|
* WinBtrfs is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public Licence as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the Licence, or
|
|
|
|
* (at your option) any later version.
|
2017-09-08 11:59:42 +00:00
|
|
|
*
|
2016-11-02 19:36:59 +00:00
|
|
|
* WinBtrfs is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public Licence for more details.
|
2017-09-08 11:59:42 +00:00
|
|
|
*
|
2016-11-02 19:36:59 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public Licence
|
|
|
|
* along with WinBtrfs. If not, see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
2017-11-26 13:16:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
#include <shlobj.h>
|
|
|
|
|
|
|
|
extern LONG objs_loaded;
|
|
|
|
|
|
|
|
class BtrfsIconOverlay : public IShellIconOverlayIdentifier {
|
|
|
|
public:
|
|
|
|
BtrfsIconOverlay() {
|
|
|
|
refcount = 0;
|
|
|
|
InterlockedIncrement(&objs_loaded);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~BtrfsIconOverlay() {
|
|
|
|
InterlockedDecrement(&objs_loaded);
|
|
|
|
}
|
|
|
|
|
|
|
|
// IUnknown
|
2017-09-08 11:59:42 +00:00
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
HRESULT __stdcall QueryInterface(REFIID riid, void **ppObj);
|
2017-09-08 11:59:42 +00:00
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
ULONG __stdcall AddRef() {
|
|
|
|
return InterlockedIncrement(&refcount);
|
|
|
|
}
|
|
|
|
|
|
|
|
ULONG __stdcall Release() {
|
|
|
|
LONG rc = InterlockedDecrement(&refcount);
|
2017-09-08 11:59:42 +00:00
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
if (rc == 0)
|
|
|
|
delete this;
|
2017-09-08 11:59:42 +00:00
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
return rc;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IShellIconOverlayIdentifier
|
2017-09-08 11:59:42 +00:00
|
|
|
|
2016-11-02 19:36:59 +00:00
|
|
|
virtual HRESULT __stdcall GetOverlayInfo(PWSTR pwszIconFile, int cchMax, int* pIndex, DWORD* pdwFlags);
|
|
|
|
virtual HRESULT __stdcall GetPriority(int *pPriority);
|
|
|
|
virtual HRESULT __stdcall IsMemberOf(PCWSTR pwszPath, DWORD dwAttrib);
|
|
|
|
|
|
|
|
private:
|
|
|
|
LONG refcount;
|
|
|
|
};
|