summaryrefslogtreecommitdiff
path: root/pofx/WDF/inc/AppInterface.h
blob: 6017336972aad45c917c9d71690aaf6766c405bd (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
/*++

Copyright (c) Microsoft Corporation, All Rights Reserved

Module Name:

    AppInterface.h

Abstract:

    This module contains the common declarations shared by the driver and the 
    user application for the PowerFx sample.

Environment:

    user and kernel

--*/

#if !defined(_APPINTERFACE_H_)
#define _APPINTERFACE_H_

#include <initguid.h>

//
// Component count for multi-component device
//
#define COMPONENT_COUNT         4

//
// Interface GUID for the PowerFx driver
// {D21FD4DB-5FB6-4df2-B73B-5E7F8632B390}
//
DEFINE_GUID(
    GUID_DEVINTERFACE_POWERFX,
    0xd21fd4db, 0x5fb6, 0x4df2, 0xb7, 0x3b, 0x5e, 0x7f, 0x86, 0x32, 0xb3, 0x90
    );

//
// IOCTLs that the application sends to the PowerFx driver
//
#define IOCTL_INDEX_POWERFX     0x900
#define FILE_DEVICE_POWERFX     0x9000

//
// This IOCTL is used to read a data from a component. The app initializes the 
// input buffer with the component number to read. The driver writes the data
// from that component to the output buffer.
// In this sample, the "data" for a given component is just the bit-wise 
// complement of the component number. In other words, the data for component 
// number 'X' is simply '~X'.
//
#define IOCTL_POWERFX_READ_COMPONENT    CTL_CODE(FILE_DEVICE_POWERFX,  \
                                                 IOCTL_INDEX_POWERFX,  \
                                                 METHOD_BUFFERED,      \
                                                 FILE_READ_ACCESS)

//
// Input and output buffers for IOCTL_POWERFX_READ_COMPONENT
//
typedef struct _POWERFX_READ_COMPONENT_INPUT {
    ULONG ComponentNumber;
} POWERFX_READ_COMPONENT_INPUT, *PPOWERFX_READ_COMPONENT_INPUT;

typedef struct _POWERFX_READ_COMPONENT_OUTPUT {
    ULONG ComponentData;
} POWERFX_READ_COMPONENT_OUTPUT, *PPOWERFX_READ_COMPONENT_OUTPUT;

#endif // _APPINTERFACE_H_