ReactOS  0.4.15-dev-3428-g0609db5
fxiotargetremoteum.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation. All rights reserved.
4 
5 Module Name:
6 
7  FxIoTargetRemoteUm.hpp
8 
9 Abstract:
10 
11  User-mode specific definitions of FxIoTargetRemote
12 
13 Author:
14 
15 
16 Environment:
17 
18  User mode only
19 
20 Revision History:
21 
22 --*/
23 
24 #pragma once
25 
27  public FxGlobalsStump,
28  public IWudfTargetCallbackDeviceChange
29 {
30 private:
31 
33 
35 
36 public:
37 
39  PFX_DRIVER_GLOBALS FxDriverGlobals,
41  ) :
42  FxGlobalsStump(FxDriverGlobals),
44  m_cRefs(1)
45  {
46  }
47 
49 
50  WUDF_TARGET_CONTEXT
52  VOID
53  )
54  {
56  }
57 
58  BOOL
59  __stdcall
61  _In_ WUDF_TARGET_CONTEXT RegistrationID
62  );
63 
64  VOID
65  __stdcall
67  _In_ WUDF_TARGET_CONTEXT RegistrationID
68  );
69 
70  VOID
71  __stdcall
73  _In_ WUDF_TARGET_CONTEXT RegistrationID
74  );
75 
76  VOID
77  __stdcall
79  _In_ WUDF_TARGET_CONTEXT RegistrationID,
83  _In_ DWORD NameBufferOffset
84  );
85 
86  HRESULT
87  __stdcall
89  __in const IID& iid,
90  __out void ** ppv
91  )
92  {
93  if (NULL == ppv) {
94  return E_INVALIDARG;
95  }
96 
97  *ppv = NULL;
98 
99  if ( iid == IID_IUnknown) {
100  *ppv = static_cast<IUnknown *> (this);
101  }
102  else if ( iid == IID_IWudfTargetCallbackDeviceChange) {
103  *ppv = static_cast<IWudfTargetCallbackDeviceChange *> (this);
104  }
105  else {
106  return E_INVALIDARG;
107  }
108 
109  this->AddRef();
110  return S_OK;
111  }
112 
113  ULONG
114  __stdcall
116  )
117  {
118  LONG cRefs = InterlockedIncrement( &m_cRefs );
119  return cRefs;
120  }
121 
122  ULONG
123  __stdcall
125  )
126  {
127  LONG cRefs = InterlockedDecrement( &m_cRefs );
128  if (0 == cRefs) {
129  //
130  // The lifetime of this object is controlled by FxIoTargetRemote
131  // object (the container object), and not by this ref count. This
132  // method is implemented just to satisfy the interface implemetation
133  // requirement.
134  //
135  DO_NOTHING();
136  }
137 
138  return cRefs;
139  }
140 };
141 
VOID __stdcall OnCustomEvent(_In_ WUDF_TARGET_CONTEXT RegistrationID, _In_ REFGUID Event, _In_reads_bytes_(DataSize) BYTE *Data, _In_ DWORD DataSize, _In_ DWORD NameBufferOffset)
Definition: scsiwmi.h:51
REFIID LPVOID * ppv
Definition: atlbase.h:39
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
VOID __stdcall OnRemoveComplete(_In_ WUDF_TARGET_CONTEXT RegistrationID)
#define __out
Definition: dbghelp.h:62
#define E_INVALIDARG
Definition: ddrawi.h:101
#define _In_
Definition: ms_sal.h:308
HRESULT __stdcall QueryInterface(__in const IID &iid, __out void **ppv)
LONG HRESULT
Definition: typedefs.h:79
const GUID IID_IUnknown
unsigned long DWORD
Definition: ntddk_ex.h:95
#define __stdcall
Definition: typedefs.h:25
#define InterlockedDecrement
Definition: armddk.h:52
unsigned char BYTE
Definition: xxhash.c:193
BOOL __stdcall OnQueryRemove(_In_ WUDF_TARGET_CONTEXT RegistrationID)
#define S_OK
Definition: intsafe.h:52
#define InterlockedIncrement
Definition: armddk.h:53
MdTargetNotifyHandle m_TargetNotifyHandle
VOID __stdcall OnRemoveCanceled(_In_ WUDF_TARGET_CONTEXT RegistrationID)
WUDF_TARGET_CONTEXT GetRegistrationId(VOID)
#define NULL
Definition: types.h:112
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
unsigned int ULONG
Definition: retypes.h:1
#define __in
Definition: dbghelp.h:35
FxIoTargetRemoteNotificationCallback(PFX_DRIVER_GLOBALS FxDriverGlobals, FxIoTargetRemote *Target)
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
#define _In_reads_bytes_(size)
Definition: ms_sal.h:321
#define DO_NOTHING()
Definition: mxgeneral.h:32