diff options
| author | David Spruill <[email protected]> | 2026-01-08 17:51:47 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-08 17:51:47 -0500 |
| commit | c5fc3ca1fd0e00a7e085ef48abfeff9c0c39817e (patch) | |
| tree | 0e650a0fee8027816bbea82ca1fd9b8e3e6ee24a /wpd/WpdWudfSampleDriver/WpdBaseDriver.h | |
| parent | f88e4fbbd4d2671e5cd77e4f60be7a235326797e (diff) | |
| parent | ed3dbe56378117a15105099870f2397671ad99ab (diff) | |
Merge branch 'develop' into user/daspr/kmodsamplefix
Diffstat (limited to 'wpd/WpdWudfSampleDriver/WpdBaseDriver.h')
| -rw-r--r-- | wpd/WpdWudfSampleDriver/WpdBaseDriver.h | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/wpd/WpdWudfSampleDriver/WpdBaseDriver.h b/wpd/WpdWudfSampleDriver/WpdBaseDriver.h deleted file mode 100644 index ee092fd6..00000000 --- a/wpd/WpdWudfSampleDriver/WpdBaseDriver.h +++ /dev/null @@ -1,113 +0,0 @@ -#pragma once - -// This class is used to store the connected client information. -// This is for demonstration purposes only - this driver does not -// make use of the information. -class ClientContext : public IUnknown -{ -public: - ClientContext() : - MajorVersion(0), - MinorVersion(0), - Revision(0), - m_cRef(1) - { - } - - ~ClientContext() - { - } - -public: // IUnknown - ULONG __stdcall AddRef() - { - InterlockedIncrement((long*) &m_cRef); - return m_cRef; - } - - _At_(this, __drv_freesMem(Mem)) - ULONG __stdcall Release() - { - ULONG ulRefCount = m_cRef - 1; - - if (InterlockedDecrement((long*) &m_cRef) == 0) - { - delete this; - return 0; - } - return ulRefCount; - } - - HRESULT __stdcall QueryInterface( - REFIID riid, - void** ppv) - { - HRESULT hr = S_OK; - - if(riid == IID_IUnknown) - { - *ppv = static_cast<IUnknown*>(this); - AddRef(); - } - else - { - *ppv = NULL; - hr = E_NOINTERFACE; - } - - return hr; - } - -private: - DWORD m_cRef; - -public: - CAtlStringW ClientName; - CAtlStringW EventCookie; - DWORD MajorVersion; - DWORD MinorVersion; - DWORD Revision; -}; - -class WpdBaseDriver : - public IUnknown -{ -public: - WpdBaseDriver(); - virtual ~WpdBaseDriver(); - - HRESULT Initialize(_In_ LPCWSTR pszPortName, _In_ IPortableDeviceClassExtension* pPortableDeviceClassExtension); - VOID Uninitialize(); - - HRESULT DispatchWpdMessage(_In_ IPortableDeviceValues* pParams, - _In_ IPortableDeviceValues* pResults); - -private: - HRESULT OnSaveClientInfo(_In_ IPortableDeviceValues* pParams, - _In_ IPortableDeviceValues* pResults); - - HRESULT OnGetObjectIDsFromPersistentUniqueIDs(_In_ IPortableDeviceValues* pParams, - _In_ IPortableDeviceValues* pResults); - -public: // IUnknown - ULONG __stdcall AddRef(); - - _At_(this, __drv_freesMem(Mem)) - ULONG __stdcall Release(); - - HRESULT __stdcall QueryInterface(REFIID riid, void** ppv); - -private: - WpdObjectEnumerator m_ObjectEnum; - WpdObjectProperties m_ObjectProperties; - WpdObjectPropertiesBulk m_ObjectPropertiesBulk; - WpdObjectResources m_ObjectResources; - WpdObjectManagement m_ObjectManagement; - WpdCapabilities m_Capabilities; - WpdStorage m_Storage; - WpdNetworkConfig m_NetworkConfig; - FakeDevice m_FakeDevice; - CComPtr<IPortableDeviceClassExtension> m_pPortableDeviceClassExtension; - ULONG m_cRef; -}; - |
