ReactOS  0.4.15-dev-2701-g34593d9
fxdevicebasekm.cpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxDeviceBaseKm.cpp
8 
9 Abstract:
10 
11  This is the class implementation for the base device class.
12 
13 Author:
14 
15 
16 
17 Environment:
18 
19  Kernel mode only
20 
21 Revision History:
22 
23 --*/
24 
25 #include "coreprivshared.hpp"
26 
27 extern "C" {
28 // #include "FxDeviceBaseKm.tmh"
29 }
30 
34  __in const GUID* InterfaceType,
40  )
41 /*++
42 
43 Routine Description:
44  Send an IRP_MJPNP/IRP_MN_QUERY_INTERFACE irp to a device object and its
45  attached stack.
46 
47 Arguments:
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 
61 Return 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 
91  Interface,
92  Size,
93  Version,
95  );
96 
98 
99  return status;
100 }
101 
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:461
#define _Must_inspect_result_
Definition: no_sal2.h:62
_Must_inspect_result_ __drv_aliasesMem PDEVICE_OBJECT _In_ PDEVICE_OBJECT TargetDevice
Definition: iofuncs.h:690
_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)
#define __in_opt
Definition: dbghelp.h:38
LONG NTSTATUS
Definition: precomp.h:26
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
__inline MdDeviceObject GetAttachedDeviceReference(VOID)
Definition: fxdevice.hpp:429
PDEVICE_OBJECT pTopOfStack
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
#define __out
Definition: dbghelp.h:62
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
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)
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
#define __in
Definition: dbghelp.h:35
static SERVICE_STATUS status
Definition: service.c:31
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:461
Definition: ps.c:97