ReactOS 0.4.15-dev-5666-gc548b97
fxdevicebasekm.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxDeviceBaseKm.cpp
8
9Abstract:
10
11 This is the class implementation for the base device class.
12
13Author:
14
15
16
17Environment:
18
19 Kernel mode only
20
21Revision History:
22
23--*/
24
25#include "coreprivshared.hpp"
26
27extern "C" {
28// #include "FxDeviceBaseKm.tmh"
29}
30
34 __in const GUID* InterfaceType,
40 )
41/*++
42
43Routine Description:
44 Send an IRP_MJPNP/IRP_MN_QUERY_INTERFACE irp to a device object and its
45 attached stack.
46
47Arguments:
48 InterfaceType - The type of interface to query for
49
50 Interface - The interface to fill out
51
52 Size - Size of Interface in bytes
53
54 Version - Version of the interface to be queried
55
56 InterfaceSpecificData - Addtional interface data to be queried
57
58 TargetDevice - device in the stack to send the query to. If NULL, the top
59 of the stack will receive the query.
60
61Return Value:
62 NTSTATUS as indicated by the handler of the QI with in the device stack,
63 STATUS_NOT_SUPPORTED if the QI is not handled.
64
65 --*/
66{
69
70 //
71 // PnP rules dictate you send the QI through the entire stack and not just
72 // the stack below you...but we let the caller override this. There are
73 // some stacks which are not PnP reentrant, so sending a QI from a lower
74 // filter might cause the stack to stop responding if the FDO is synchronously
75 // sending a PnP irp down the stack already.
76 //
77 if (TargetDevice == NULL) {
79 }
80 else {
81 //
82 // To make the exit logic simpler below, just add our own reference.
83 //
86 }
87
92 Size,
93 Version,
95 );
96
98
99 return status;
100}
101
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ NTSTATUS QueryForInterface(__in const GUID *InterfaceType, __out PINTERFACE Interface, __in USHORT Size, __in USHORT Version, __in PVOID InterfaceSpecificData, __in_opt MdDeviceObject TargetDevice=NULL)
__inline MdDeviceObject GetAttachedDeviceReference(VOID)
Definition: fxdevice.hpp:429
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define NULL
Definition: types.h:112
PDEVICE_OBJECT pTopOfStack
#define _Must_inspect_result_
Definition: ms_sal.h:558
unsigned short USHORT
Definition: pedump.c:61
static _Must_inspect_result_ NTSTATUS _QueryForInterface(__in PDEVICE_OBJECT TopOfStack, __in const GUID *InterfaceType, __out PINTERFACE Interface, __in USHORT Size, __in USHORT Version, __in_opt PVOID InterfaceSpecificData)
Definition: ps.c:97
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:472
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:691