1 /*++
2 
3 Copyright (c) Microsoft Corporation.  All rights reserved.
4 
5 Module Name:
6 
7     wdffileobject_private.h
8 
9 Abstract:
10 
11     Defines private DDIs for WDF File Object
12 
13 Environment:
14 
15     User mode
16 
17 Revision History:
18 
19 --*/
20 
21 #ifndef _WDFFILEOBJECT_PRIVATE_H_
22 #define _WDFFILEOBJECT_PRIVATE_H_
23 
24 //
25 // Interface available through WdfObjectQuery
26 //
27 // a4870f73-7c63-4e8d-ab57-ab191b522aca
28 DEFINE_GUID(GUID_WDFP_FILEOBJECT_INTERFACE,
29     0xa4870f73, 0x7c63, 0x4e8d, 0xab, 0x57, 0xab, 0x19, 0x1b, 0x52, 0x2a, 0xca);
30 
31 typedef
32 NTSTATUS
33 (*PFN_WDFP_FILEOBJECT_INCREMENT_PROCESS_KEEP_ALIVE_COUNT)(
34     _In_ PWDF_DRIVER_GLOBALS WdfDriverGlobals,
35     _In_ WDFFILEOBJECT FileObject
36     );
37 
38 typedef
39 NTSTATUS
40 (*PFN_WDFP_FILEOBJECT_DECREMENT_PROCESS_KEEP_ALIVE_COUNT)(
41     _In_ PWDF_DRIVER_GLOBALS WdfDriverGlobals,
42     _In_ WDFFILEOBJECT FileObject
43     );
44 
45 //
46 // Structure passed in by the driver and populated by WdfObjectQuery
47 //
48 typedef struct _WDFP_FILEOBJECT_INTERFACE {
49 
50     //
51     // Size of this structure in bytes
52     //
53     ULONG Size;
54 
55     //
56     // Private DDIs exposed through WdfObjectQuery
57     //
58     PFN_WDFP_FILEOBJECT_INCREMENT_PROCESS_KEEP_ALIVE_COUNT
59         WdfpFileObjectIncrementProcessKeepAliveCount;
60 
61     PFN_WDFP_FILEOBJECT_DECREMENT_PROCESS_KEEP_ALIVE_COUNT
62         WdfpFileObjectDecrementProcessKeepAliveCount;
63 
64 } WDFP_FILEOBJECT_INTERFACE, *PWDFP_FILEOBJECT_INTERFACE;
65 
66 //
67 // Used by a driver to initialize this structure
68 //
69 VOID
70 __inline
71 WDFP_FILEOBJECT_INTERFACE_INIT(
72     _Out_ PWDFP_FILEOBJECT_INTERFACE FileObjectInterface
73     )
74 {
75     RtlZeroMemory(FileObjectInterface, sizeof(WDFP_FILEOBJECT_INTERFACE));
76 
77     FileObjectInterface->Size = sizeof(WDFP_FILEOBJECT_INTERFACE);
78 }
79 
80 #endif // _WDFFILEOBJECT_PRIVATE_H_
81