[BROWSEUI][BROWSEUI_APITEST] Add CLSID_ACLHistory stubs (#3582)

- Initial implement CLSID_ACLHistory as stub.
- Add IACLHistory testcase into browseui_apitest.
CORE-9281
This commit is contained in:
Katayama Hirofumi MZ 2021-04-05 04:20:18 +09:00 committed by GitHub
parent 6c4b4a107b
commit ab7d8f3616
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 163 additions and 1 deletions

View file

@ -8,6 +8,7 @@ spec2def(browseui.dll browseui.spec ADD_IMPORTLIB)
list(APPEND SOURCE
ACLCustomMRU.cpp
ACLCustomMRU.h
aclhistory.cpp
aclistisf.cpp
aclmulti.cpp
addressband.cpp

View file

@ -0,0 +1,51 @@
/*
* PROJECT: ReactOS Shell
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Implement CLSID_ACLHistory for auto-completion
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#include "precomp.h"
CACLHistory::CACLHistory()
{
TRACE("CACLHistory::CACLHistory(%p)\n", this);
}
CACLHistory::~CACLHistory()
{
TRACE("CACLHistory::~CACLHistory(%p)\n", this);
}
STDMETHODIMP CACLHistory::Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched)
{
FIXME("CACLHistory::Next(%p, %lu, %p, %p): stub\n", this, celt, rgelt, pceltFetched);
if (pceltFetched)
*pceltFetched = 0;
if (rgelt)
*rgelt = NULL;
if (celt != 1)
return E_NOTIMPL;
// FIXME: *rgelt, *pceltFetched, return value
return E_FAIL;
}
STDMETHODIMP CACLHistory::Reset()
{
FIXME("CACLHistory::Reset(%p): stub\n", this);
return S_OK;
}
STDMETHODIMP CACLHistory::Skip(ULONG celt)
{
TRACE("CACLHistory::Clone(%p, %lu)\n", this, celt);
return E_NOTIMPL;
}
STDMETHODIMP CACLHistory::Clone(IEnumString **ppenum)
{
FIXME("CACLHistory::Clone(%p, %p): stub\n", this, ppenum);
if (ppenum)
*ppenum = NULL;
return E_NOTIMPL;
}

View file

@ -0,0 +1,34 @@
/*
* PROJECT: ReactOS Shell
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Implement CLSID_ACLHistory for auto-completion
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#pragma once
class CACLHistory
: public CComCoClass<CACLHistory, &CLSID_ACLHistory>
, public CComObjectRootEx<CComMultiThreadModelNoCS>
, public IEnumString
{
public:
CACLHistory();
virtual ~CACLHistory();
// *** IEnumString methods ***
STDMETHODIMP Next(ULONG celt, LPOLESTR *rgelt, ULONG *pceltFetched) override;
STDMETHODIMP Skip(ULONG celt) override;
STDMETHODIMP Reset() override;
STDMETHODIMP Clone(IEnumString **ppenum) override;
public:
DECLARE_REGISTRY_RESOURCEID(IDR_ACLHISTORY)
DECLARE_NOT_AGGREGATABLE(CACLHistory)
DECLARE_PROTECT_FINAL_CONSTRUCT()
BEGIN_COM_MAP(CACLHistory)
COM_INTERFACE_ENTRY_IID(IID_IEnumString, IEnumString)
END_COM_MAP()
};

View file

@ -138,6 +138,7 @@ public:
BEGIN_OBJECT_MAP(ObjectMap)
OBJECT_ENTRY(CLSID_ACLCustomMRU, CACLCustomMRU)
OBJECT_ENTRY(CLSID_AutoComplete, CAutoComplete)
OBJECT_ENTRY(CLSID_ACLHistory, CACLHistory)
OBJECT_ENTRY(CLSID_ACLMulti, CACLMulti)
OBJECT_ENTRY(CLSID_ACListISF, CACListISF)
OBJECT_ENTRY(CLSID_SH_AddressBand, CAddressBand)

View file

@ -33,6 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDR_ADDRESSBAND REGISTRY "res/addressband.rgs"
IDR_ADDRESSEDITBOX REGISTRY "res/addresseditbox.rgs"
IDR_ACLMULTI REGISTRY "res/autocompletecontainer.rgs"
IDR_ACLHISTORY REGISTRY "res/autocompletehistory.rgs"
IDR_BANDPROXY REGISTRY "res/bandproxy.rgs"
IDR_BANDSITE REGISTRY "res/rebarbandsite.rgs"
IDR_BANDSITEMENU REGISTRY "res/bandsitemenu.rgs"

View file

@ -38,6 +38,7 @@
#include "resource.h"
#include "ACLCustomMRU.h"
#include "aclhistory.h"
#include "aclistisf.h"
#include "aclmulti.h"
#include "addressband.h"

View file

@ -0,0 +1,13 @@
HKCR
{
NoRemove CLSID
{
ForceRemove {00BB2764-6A77-11D0-A535-00C04FD7D062} = s 'ReactOS History AutoComplete List'
{
InprocServer32 = s '%MODULE%'
{
val ThreadingModel = s 'Apartment'
}
}
}
}

View file

@ -109,6 +109,7 @@
#define IDR_FINDFOLDER 147
#define IDR_USERASSIST 148
#define IDR_SHELLTASKSCHEDULER 149
#define IDR_ACLHISTORY 150
#define IDS_SMALLICONS 12301
#define IDS_LARGEICONS 12302

View file

@ -5,7 +5,8 @@ include_directories(
list(APPEND SOURCE
ACListISF.cpp
IACLCustomMRU.cpp
IAutoComplete.cpp
IACLHistory.cpp
IAutoComplete.cpp
SHEnumClassesOfCategories.cpp
SHExplorerParseCmdLine.c
testlist.c)

View file

@ -0,0 +1,56 @@
/*
* PROJECT: ReactOS api tests
* LICENSE: LGPL-2.0-or-later (https://spdx.org/licenses/LGPL-2.0-or-later)
* PURPOSE: Test for IACLHistory objects
* COPYRIGHT: Copyright 2021 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
*/
#define _UNICODE
#define UNICODE
#include <apitest.h>
#include <shlobj.h>
#include <atlbase.h>
#include <atlcom.h>
#include <stdio.h>
#include <shellutils.h>
struct CCoInit
{
CCoInit() { hres = CoInitialize(NULL); }
~CCoInit() { if (SUCCEEDED(hres)) { CoUninitialize(); } }
HRESULT hres;
};
START_TEST(IACLHistory)
{
CCoInit init;
ok_hex(init.hres, S_OK);
if (FAILED(init.hres))
{
skip("CoInitialize failed with 0x%08lX\n", init.hres);
return;
}
HRESULT hr;
CComPtr<IUnknown> pHistory;
hr = CoCreateInstance(CLSID_ACLHistory, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IUnknown, &pHistory));
ok_long(hr, S_OK);
ok_int(!!pHistory, TRUE);
CComPtr<IEnumString> pEnum;
hr = pHistory->QueryInterface(IID_PPV_ARG(IEnumString, &pEnum));
ok_long(hr, S_OK);
hr = pEnum->Reset();
ok_long(hr, S_OK);
hr = pEnum->Reset();
ok_long(hr, S_OK);
hr = pEnum->Skip(0);
ok_long(hr, E_NOTIMPL);
hr = pEnum->Skip(1);
ok_long(hr, E_NOTIMPL);
hr = pEnum->Skip(3);
ok_long(hr, E_NOTIMPL);
}

View file

@ -5,6 +5,7 @@
extern void func_ACListISF(void);
extern void func_IACLCustomMRU(void);
extern void func_IACLHistory(void);
extern void func_IAutoComplete(void);
extern void func_SHEnumClassesOfCategories(void);
extern void func_SHExplorerParseCmdLine(void);
@ -13,6 +14,7 @@ const struct test winetest_testlist[] =
{
{ "ACListISF", func_ACListISF },
{ "IACLCustomMRU", func_IACLCustomMRU },
{ "IACLHistory", func_IACLHistory },
{ "IAutoComplete", func_IAutoComplete },
{ "SHEnumClassesOfCategories", func_SHEnumClassesOfCategories },
{ "SHExplorerParseCmdLine", func_SHExplorerParseCmdLine },