//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this sample source code is subject to the terms of the Microsoft
// license agreement under which you licensed this sample source code. If
// you did not accept the terms of the license agreement, you are not
// authorized to use this sample source code. For the terms of the license,
// please see the license agreement between you and Microsoft or, if applicable,
// see the LICENSE.RTF on your install media or the root of your tools installation.
// THE SAMPLE SOURCE CODE IS PROVIDED "AS IS", WITH NO WARRANTIES.
//
/*++
THIS CODE AND INFORMATION IS 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.

Module Name:  

Abstract:

    Platform dependent PCMCIA initialization functions

Notes: 
--*/
#ifndef __PCMBUS_H_
#define __PCMBUS_H_
#include <CRefCon.h>
#include <CRegEdit.h>
#define PCMCIA_FUNCTION_ID_VALNAME TEXT("FUNCTION_ID")
#define PCMCIA_INTERRUPT_MASK TEXT("INTERRUPT_MASK")
#define PCMCIA_CONFIGURATION_INDEX TEXT("CONFIGURATION_INDEX")
#define PCMCIA_VCC_NORM_VOLTAGE TEXT("VCC_NORM_VOLTAGE")
#define PCMCIA_VPP1_NORM_VOLTAGE TEXT("VPP1_NORM_VOLTAGE")
#define PCMCIA_VPP2_NORM_VOLTAGE TEXT("VPP2_NORM_VOLTAGE")

#define PCMCIA_IO_ADDR_HIGHEST_BIT_SET TEXT("IOADDR_HIGHESTBIT_SET")
class CPcmciaEnum {
public:
    CPcmciaEnum(LPTSTR lpPnpString, UCHAR uFuncId,PPARSED_PCMCFTABLE pPcmciaConfigure);
    ~CPcmciaEnum();
    BOOL Init();

    // Property.
    LPCTSTR GetMatchedRegistry() { return (m_RegPath[0]!=0?m_RegPath:NULL); };
    BOOL IsNoConfig();
    BOOL IsIoHighestBitSet();
    LPCTSTR GetInstances() { return (m_InstancePath[0]!=0?m_InstancePath:NULL); };
    DWORD   GetNumOfMatch() { return m_dwNumOfMatch; };
    DWORD   GetDevLoadFlag();

private:
    LPTSTR m_lpPnpString;
    BYTE   const m_uFuncId;
    DWORD  m_dwNumOfMatch;
    PARSED_PCMCFTABLE m_CurPcmciaConfig;
    TCHAR m_RegPath [ DEVKEY_LEN ];
    TCHAR m_DevName[DEVKEY_LEN];
    TCHAR m_InstancePath[DEVKEY_LEN];
    //internal function
    BOOL PcmciaCfgFindMatch();
    BOOL InitInstances();
    BOOL RegCopyKey( CRegistryEdit& TKey,CRegistryEdit& IKey    )    ;
    DWORD RegMatchOne(HKEY hKey,LPCWSTR DevName);
};

#endif
