Sample Code

Windows Driver Samples/ Print Pipeline Simple Filter/ C++/ main.hxx/

//+--------------------------------------------------------------------------
//
//  Copyright (c) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
//  WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//
//  Abstract:
//     WDK print filter sample.
//  The filters need to derive from DllLockManager. Thus the filter constructor and
//  destructor call the DllLockManager constructor and destructor, respectively.
//
//----------------------------------------------------------------------------

#ifndef _FILTER_MAIN_HXX_
#define _FILTER_MAIN_HXX_

class DllLockManager
{
public:

    DllLockManager()
    {
        InterlockedIncrement(&m_cGlobalRef);
    }

    ~DllLockManager()
    {
        InterlockedDecrement(&m_cGlobalRef);
    }

    static
    LONG
    GetGlobalRef()
    {
        return InterlockedCompareExchange(&m_cGlobalRef, 0, 0);
    }

private:

    static LONG m_cGlobalRef;
};

#endif


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