summaryrefslogtreecommitdiff
path: root/wpd/WpdServiceSampleDriver/FakeContactsService.h
blob: 23522c072ae0aefa36ea9712be7851995b495afe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#pragma once

/**
 * This class represents an abstraction of a contacts service that implements 
 * the full enumeration sync model.
 * Driver implementors should replace this with their own
 * device I/O classes/libraries.
 */

class FakeContactsService
{
public:
    FakeContactsService() : RequestFilename(CONTACTS_SERVICE_OBJECT_ID)
    {
    }

    ~FakeContactsService()
    {
    }

    // Capabilities
    HRESULT GetSupportedCommands(
        _In_    IPortableDeviceKeyCollection*         pCommands);
    
    HRESULT GetCommandOptions(
        _In_    REFPROPERTYKEY                        Command,
        _In_    IPortableDeviceValues*                pOptions);

    HRESULT GetSupportedMethods(
        _In_    IPortableDevicePropVariantCollection* pMethods);

    BOOL IsMethodSupported(
        _In_    REFGUID Method);

    HRESULT GetSupportedMethodsByFormat(
        _In_    REFGUID                               Format, 
        _In_    IPortableDevicePropVariantCollection* pMethods);

    HRESULT GetMethodAttributes(
        _In_    REFGUID                               Method, 
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetMethodParameterAttributes(
        _In_    REFPROPERTYKEY                        Parameter, 
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetSupportedFormats(
        _In_    IPortableDevicePropVariantCollection* pFormats);

    HRESULT GetFormatAttributes(
        _In_    REFGUID                               Format, 
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetSupportedFormatProperties(
        _In_    REFGUID                               Format, 
        _In_    IPortableDeviceKeyCollection*         pKeys);

    HRESULT GetPropertyAttributes(
        _In_    REFGUID                               Format,
        _In_    REFPROPERTYKEY                        Property,
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetSupportedEvents(
        _In_    IPortableDevicePropVariantCollection* pEvents);

    HRESULT GetEventAttributes(
        _In_    REFGUID                               Event, 
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetEventParameterAttributes(
        _In_    REFPROPERTYKEY                        Parameter, 
        _In_    IPortableDeviceValues*                pAttributes);

    HRESULT GetInheritedServices(
                const DWORD                           dwInheritanceType, 
        _In_    IPortableDevicePropVariantCollection* pServices);

    // Methods
    HRESULT OnBeginSync(
        _In_    IPortableDeviceValues*                pParams, 
        _In_    IPortableDeviceValues*                pResults);

    HRESULT OnEndSync(
        _In_    IPortableDeviceValues*                pParams, 
        _In_    IPortableDeviceValues*                pResults);

    HRESULT OnMyCustomMethod(
        _In_    IPortableDeviceValues*                pParams, 
        _In_    IPortableDeviceValues*                pResults,
        _In_    IPortableDeviceValues*                pEventParameters);

    LPCWSTR GetRequestFilename()
    {
        return RequestFilename.GetString();
    }

private:
    CAtlStringW RequestFilename;
};