summaryrefslogtreecommitdiff
path: root/powerlimit/plpolicy/powerlimitpolicy_drvinterface.h
blob: cd630ef66d32ff5df0fec6308f389be3db6f7be9 (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
/*++

Copyright (c) Microsoft Corporation

Module Name:

    powerlimitpolicy_drvinterface.h

Abstract:

    This module contains the interfaces used to communicate with the simulate
    power limit policy driver stack.

--*/

//--------------------------------------------------------------------- Pragmas

#pragma once

//--------------------------------------------------------------------- Defines

//
// Simulated power limit policy interface
//

// {dbdc0da1-563c-4e20-8408-d4e3c1069ea3}
DEFINE_GUID(GUID_DEVINTERFACE_POWERLIMIT_POLICY,
0xdbdc0da1, 0x563c, 0x4e20, 0x84, 0x08, 0xd4, 0xe3, 0xc1, 0x06, 0x9e, 0xa3);

//
// IOCTLs to control the policy driver
//

#define POWERLIMIT_POLICY_IOCTL(_index_) \
    CTL_CODE(FILE_DEVICE_UNKNOWN, _index_, METHOD_BUFFERED, FILE_WRITE_DATA)

//
// IOCTL_POWERLIMIT_POLICY_REGISTER
// - Input: WCHAR[], contains interface name of the target device
// - Output: ULONG, Id of the created power limit
//

#define IOCTL_POWERLIMIT_POLICY_REGISTER             POWERLIMIT_POLICY_IOCTL(0x800)

//
// IOCTL_POWERLIMIT_POLICY_UNREGISTER
// - Input: ULONG, Id of the power limit to unregister
//

#define IOCTL_POWERLIMIT_POLICY_UNREGISTER           POWERLIMIT_POLICY_IOCTL(0x801)

//
// IOCTL_POWERLIMIT_POLICY_QUERY_ATTRIBUTES
// - Input: POWERLIMIT_POLICY_ATTRIBUTES
// - Output: POWERLIMIT_POLICY_ATTRIBUTES
//

#define IOCTL_POWERLIMIT_POLICY_QUERY_ATTRIBUTES     POWERLIMIT_POLICY_IOCTL(0x802)

//
// IOCTL_POWERLIMIT_POLICY_QUERY_VALUES
// - Input: POWERLIMIT_POLICY_VALUES
// - Output: POWERLIMIT_POLICY_VALUES
//

#define IOCTL_POWERLIMIT_POLICY_QUERY_VALUES         POWERLIMIT_POLICY_IOCTL(0x803)

//
// IOCTL_POWERLIMIT_POLICY_SET_VALUES
// - Input: POWERLIMIT_POLICY_VALUES, values to be updated for target power limit request
//

#define IOCTL_POWERLIMIT_POLICY_SET_VALUES           POWERLIMIT_POLICY_IOCTL(0x804)

typedef struct _POWERLIMIT_POLICY_ATTRIBUTES {
    ULONG RequestId;
    ULONG BufferCount;
    POWER_LIMIT_ATTRIBUTES Buffer[ANYSIZE_ARRAY];
} POWERLIMIT_POLICY_ATTRIBUTES, *PPOWERLIMIT_POLICY_ATTRIBUTES;

typedef struct _POWERLIMIT_POLICY_VALUES {
    ULONG RequestId;
    ULONG BufferCount;
    POWER_LIMIT_VALUE Buffer[ANYSIZE_ARRAY];
} POWERLIMIT_POLICY_VALUES, *PPOWERLIMIT_POLICY_VALUES;