Sample Code

Windows Driver Samples/ Near-Field Proximity Sample Driver (UMDF Version 1)/ C++/ driver/ device.h/

/*++

Copyright (C) Microsoft Corporation, All Rights Reserved

Module Name:

    Device.h

Abstract:

    This module contains the type definitions for the sample
    driver's device callback class.

Environment:

    Windows User-Mode Driver Framework (WUDF)

--*/
#pragma once

class CMyQueue;

class ATL_NO_VTABLE CMyDevice : 
    public CComObjectRootEx<CComMultiThreadModel>,
    public IFileCallbackCleanup,
    public IFileCallbackClose,
    public IObjectCleanup
{
public:

DECLARE_NOT_AGGREGATABLE(CMyDevice)

BEGIN_COM_MAP(CMyDevice)
    COM_INTERFACE_ENTRY(IFileCallbackCleanup)
    COM_INTERFACE_ENTRY(IFileCallbackClose)
    COM_INTERFACE_ENTRY(IObjectCleanup)
END_COM_MAP()

public:
    
    //IFileCallbackCleanup
    STDMETHOD_(void,OnCleanupFile)(_In_ IWDFFile* pWdfFileObject);
    //IFileCallbackClose
    STDMETHOD_(void,OnCloseFile)(_In_ IWDFFile* pWdfFileObject);
    //IObjectCleanup
    STDMETHOD_(void,OnCleanup)(_In_ IWDFObject* pWdfObject);

public:

    STDMETHOD(Initialize)(_In_ IWDFDriver* pWdfDriver, _In_ IWDFDeviceInitialize* pWdfDeviceInit);
    
    HRESULT
    Configure(
        VOID
        );

    IWDFDevice *
    GetFxDevice(
        VOID
        )
    {
        return m_FxDevice;
    }

private:
    CComPtr<IWDFDevice> m_FxDevice;

    CMyQueue* m_MyQueue;
    
    HRESULT  ReadAndAssignPropertyStoreValue();
    HRESULT GetAnsiValFromPropVariant(_In_ PROPVARIANT val, _Inout_ LPSTR *PropertyValueA);
    
};

Our Services

  • What our customers say about us?

© 2011-2024 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS